大家好!
最近寫了一個策略,想每天執行一次停利或停損後,就停止下單。
當停止下單後,隔天早上都能自動執行,每天都能自動執行不知道這樣的寫法可不可以:
Var : record(0)
If time=084500 then
record=0
End;
If time>=084500 and time<=134500 and record=0 and position=0 and filled=0 and condition1 then
Setposition(1,market) 進場
End;
If time>=084500 and time<=134500 and record=0 and position=1 and filled=1 and condition2 then begin
Setposition(0,market) 停利
Record=1
End;
If time>=084500 and time<=134500 and record=0 and position=1 and filled=1 and condition3 then begin
Setposition(0,market) 停損
Record=1
End;
2 評論