if cross(c,ma(c,5)) then begin
sellshort(holding<0,0,thisclose),orderqueue;
buy(holding=0,1,thisclose),orderqueue;
end
一楼代码加在模型后面可以吗?加了在反手主令出信号是否会先平后开呢?
if cross(c,ma(c,5)) then begin //满足收盘价上穿5周期均线后开始做下列动作
sellshort(holding<0,0,thisclose),orderqueue;//平空,顺序下单
buy(holding=0,1,thisclose),orderqueue;//开多,顺序下单
end//结束