
小幫手你好
自動交易下單後會馬上平倉
想請問是哪邊有問題
程式碼如下
if position<0 then begin
barsinceentry=barsinceentry+1;
if c>1.03*filledAvgPrice then nonprofitbar=nonprofitbar+1;
if kbar>90 and nonprofitbar>0.5*barsinceentry and c>filledAvgPrice then setposition(0,market);
if c>filledAvgPrice*1.05 then setposition(0,market);
if highd(0)>1.07*closed(1) then setposition(0,market);
//漲停跌停出場
if c>=GetField("收盤價","d")[1]*1.09 then begin
setposition(0,market);
end;
if c<GetField("收盤價","d")[1]*0.905 then begin
setposition(0,market);
end;
1 評論