|
小弟最近剛使用MTC
幾個較淺的問題想請教各位前輩
希望不要見怪>"<
我想設定兩筆單子不同的停損金額
譬如:
在10:00進1口 之後設定此單停損金額600
10:02進1口 之後設定此單停損金額1000
到13:29如果都沒出 則全部平倉
所以我這樣子寫
if time=1000 then begin
buy 1 contract next bar at market;
setstoploss(600);
end;
if time=1002 then begin
buy 1 contract next bar at market;
setstoploss(1000);
end;
if time=1329 and marketposition<>0 then begin
sell all share next bar at market;
end;
結果跑出來發現
10:02的單子 停損依然是10:00設定的600
請問應該要怎麼寫才對呢? |
|