COCO研究院

 找回密碼
 註冊
搜索
查看: 1899|回復: 0

[教學] [請教]有關進場策略重複的問題....

[複製鏈接]
發表於 13-5-3 14:57 | 顯示全部樓層 |閱讀模式
各位好 小弟有些問題想請教..

如果我的進場策略是用kd交叉來做判斷,例如:死亡交叉後,紀錄當根k棒高點,接下來有k棒close突破高點則做多..

問題來了,不管這筆交易是獲利或停損,系統又會馬上以上一筆交叉為基礎去判斷而進場,但我希望能讓系統等到下一次交叉出現在去做判斷...

不知這種控制語法該怎麼寫比較好...

思考很久沒頭緒..

value8=D值

value7=K值

謝謝

If value8 crosses above value7 then
value12=low;
If value8 crosses below value7 then
value13=high;

if DailyLosers(date)<=2 then begin
If marketposition=0 and close<value12 and value11<value11[1] then begin
sellshort 1 share this bar on close;
end;

If marketposition=0 and close>value13 and value11>value1[1] then begin
buy 1 share this bar on close;
end;
end;

If marketposition>0 and lowest(low,10)>entryprice then begin
sell 1 share next bar lowest(low,5) stop;
end;

If marketposition<0 and highest(high,10)<entryprice then begin
buytocover 1 share next bar highest(high,5) stop;
end;

If marketposition>0 and entryprice-close>=20 then begin
sell 1 share this bar on close;
end;

If marketposition<0 and close-entryprice>=20 then begin
buytocover 1 share this bar on close;
end;

If time=1344 then begin
sell all share this bar on close;
buytocover all share this bar on close;
end;
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

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

GMT+8, 24-4-29 13:48

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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