收盘前平仓吗?还是要一定等到满足直营止损条件?
第一根K线收盘为阳线做多,收盘为阴线做空。
止损:最新价小于等于-5个点平多,大于等于5个点平空。
止盈:最新价大于等于10个点平多,小于等于-10个点平空。
sj:=time>=130000 and time<=185000;
if barslast(time=closetime(1))=1 and isup then buy(holding=0,1,marketr);
if barslast(time=closetime(1))=1 and isdown then buyshort(holding=0,1,marketr);
if enterprice-c>=5 and sj then sell(1,0,marketr);
if c-enterprice>=10 and sj then sell(1,0,marketr);
if c-enterprice>=5 and sj then sellshort(1,0,marketr);
if enterprice-c>=10 and sj then sellshort(1,0,marketr);
if time>185000 then begin
sell(1,0,marketr);
sellshort(1,0,marketr);
end