請選擇 進入手機版 | 繼續訪問電腦版

COCO研究院

 找回密碼
 註冊
搜索
查看: 3485|回復: 5

[教學] 求教學 , 移動停利

[複製鏈接]
發表於 22-7-7 22:56 | 顯示全部樓層 |閱讀模式
本帖最後由 samnghk 於 22-7-7 23:00 編輯

這個是我自己寫的移動停利的語句, 意思是
1.多空進場後,當下跌20至39點, 就會止盈在開倉價-10點的位置
2.當下跌40至59點, 就會止盈在開倉價-30點的位置
理念是只要能下跌到20點以下,就必定不會虧錢

但問題出現了, 就是有時成功, 有時不成功, 求高手指教語句問題的位置?


vars:
profit200(False),
profit400(False),
profitn200(False),
profitn400(False);

[IntrabarOrderGeneration = True];

if marketposition =1 and close - postradeentryprice(0,currententries-1) >= 20 and close - postradeentryprice(0,currententries-1) < 40 then profit200=true;
if profit200 = true then begin
if close <= postradeentryprice(0,currententries-1) + 10 then sell("100LE") next bar at market;
end;
if marketposition =1 and close - postradeentryprice(0,currententries-1) >= 40 and close - postradeentryprice(0,currententries-1) < 60 then profit400=true;
if profit400 = true then begin
if close <= postradeentryprice(0,currententries-1) + 30 then sell("300LE") next bar at market;
end;
               
if marketposition =-1 and postradeentryprice(0,currententries-1) -close >= 20 and postradeentryprice(0,currententries-1) - close< 40 then profitn200=true;
if profitn200 = true then begin
if close >= postradeentryprice(0,currententries-1) -10 then buytocover("100SE") next bar at market;
end;
if marketposition =-1 and postradeentryprice(0,currententries-1) -close >= 40 and postradeentryprice(0,currententries-1) - close< 60 then profitn400=true;
if profitn400 = true then begin
if close >= postradeentryprice(0,currententries-1) -30 then buytocover("300SE") next bar at market;
end;
1是成功的例
2這個淡倉(22058), 第二條K線最低為22018 , 已經超過40, 止盈應為30, 但最後只有10
3這個淡倉(21414), 4K線最低為21388 , 已經大過20, 但最後沒有止盈,只有止



圖3

圖3

圖2

圖2

圖1

圖1
發表於 22-7-8 09:44 | 顯示全部樓層
請問為何不以每支K棒的開市價為標準, 下跌20點就直接平倉。
 樓主| 發表於 22-7-8 10:01 | 顯示全部樓層
zegawong 發表於 22-7-8 09:44
請問為何不以每支K棒的開市價為標準, 下跌20點就直接平倉。

這樣的話,整個理念已經完成不同了
發表於 22-7-11 00:07 | 顯示全部樓層
本帖最後由 平靜的海 於 22-7-11 00:09 編輯

就必定不會虧錢<==交易..沒有一定.絕對...(應該沒錯吧..因為盤是活的..一直都在變)
這句話.."就".....已經把自己的想法卡死了吧
如果只是用那句話
可以參考 stop 跟 limit的用法
發表於 22-7-11 13:09 | 顯示全部樓層
(但問題出現了, 就是有時成功, 有時不成功,)

策略只偏趨勢盤
 樓主| 發表於 22-7-13 08:05 | 顯示全部樓層
抱歉, 我表達得不好,其實還有其他想法的,只是想把想法一個一個弄明白

@平靜的海  stop 跟limit 我都試過, 還是不可以

@santien 策略只偏趨勢盤 --> 是的
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

手機版|Archiver|站長信箱|廣告洽詢|COCO研究院

GMT+8, 24-3-29 22:42

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回復 返回頂部 返回列表
理財討論網站 | AI繪圖AI超擬真美女AI beauty AI Stable DiffusionAI正妹AI Lookbook