要循环多少次?
止盈10个点指的是开仓1个周期的时候按照10个点的盈利下单?
止盈10个点指的是开仓1个周期的时候按照10个点的盈利下单?
可能是我的标题没取好,造成了误解。就是一笔开仓之后,第一个K线如果盈利达到10跳止盈,没有达到就不平仓,持仓到第二根K线,如果第二根K线盈利达到15点就止盈,如果没有达到就继续持仓到第三根K先,第三根K先止盈为20个点,以此类推
if holding>0 and h>enterprice+(enterbars+1)*5 and enterbars>0 then sell(1,0,market);
if holding<0 and l<enterprice-(enterbars+1)*5 and enterbars>0 then sellshort(1,0,market);
if holding>0 and h>enterprice+(enterbars+1)*5 and enterbars>0 then sell(1,0,market);
if holding<0 and l<enterprice-(enterbars+1)*5 and enterbars>0 then sellshort(1,0,market);
非常感谢老师