if enterbars=1 and openprofit<0 then sell......;
if enterbars>1 and pd1 then sell........;
if enterbars=1 and openprofit<0 then sell(1,0,limitr,c);
if enterbars>1 and pd1 then sell(1,0,market);
第一句就是表示开仓后亏损了就平仓
第二句表示其他情况下的按照PD1平仓
这个是走完k线写的
如果是固定轮询模式的,把enterbars=1和enterbars>1改成enterbar=0 和enterbars>0