买:日线开盘价格大于昨天收盘价
卖:日线开盘价格小于昨天收盘价
平仓条件
1min 1atr止损,如果不被止损就持仓到收盘前平仓
引用公式,不做实际交易,但是不可省略
公式1:
atr:ref(ma(tr,20)),1);
交易公式,使用固定轮询模式平仓
公式2:
aa:=stkindi('','公式1.atr',0,1);
if o>ref(c,1) then buy(holding=0,1,market);
if o<ref(c,1) then buyshort(holding=0,1,market);
if holding>0 and l<enterprice-atr then sell(1,0,market);
if holding<0 and h>enterprice+atr then sellshort(1,0,market);
if timetot0(closetime(0))-timetot0(dynainfo(207))<=5*60 then begin
sellshort(1,0,market);
sell(1,0,market);
end
跨周期引用也能回测的