老师:图表交易,如何当根k线只保留一个信号?(有开仓就不去平仓,有平仓信号 就不去开仓)
if 开仓条件 and exitbars>0 or exitbars=-1 then buy();
if 平仓条件 and enterbars>0 or enterbars=-1 then sell();
再写个:当根k线开仓后可以平仓,但是有平仓信号的k线不再开仓
那我当根k线 先出了平仓信号,当根不再开仓;
先出了开仓信号,当根可以平仓; enterbars>0 or enterbars=-1 这两个应该怎么赋值啊?有些头晕
if 开仓条件 and exitbars>0 or exitbars=-1 then buy(); if 平仓条件 and enterbars>0 or enterbars=-1 then sell(); |
这两个不是赋值,你先看下函数说明,这个是软件提供的函数