a1:=开仓周期的收盘价
b1:=紧接着a1那个周期的下一根K线的开盘价
c1:=平仓K线的收盘价
d1:=b1周期到c1周期的最高价
e1:=b1周期到c1周期的最低价
f:=if(有盈利,1,0);
a1:=valeuwhen(enterbars>0,ref(close,enterbars));
b1:=valuewhen(enterbars>0,ref(open,enterbars-1));
c1:=valuewhen(exitbars>0,ref(close,exitbars));
d1:=valuewhen(exitbars>0,hhv(h,enterbars+1));
e1:=valuewhen(exitbars>0,llv(l,enterbars+1));
f:=if(numprofit(1)>0,1,0);
谢谢,接着如果想这样判断,怎么编
df:=if(刚才单是多单,且盈利 and e1-a1>0,1,0);
kf:=if(刚才单是空单,且盈利 and a1-d1>0,1,0);
df:=if(numprofit(1)>0 and type(1)=2 and e1-a1>0,1,0);
kf:=if(numprofit(1)>0 and type(1)=4 and a1-d1>0,1,0);