请问一下,下面的代码如何实现
手中没有仓位时
价格等于20均线,就做多。(不论是上穿,还是下穿)
价格等于70均线 就做空。(不论是向上穿越,还是向下穿越。)
if holding=0 and c=ma(c,20) then buy(1,1,market);
if holding=0 and c=ma(c,70) then buyshort(1,1,market);
不过图表上开多前需要平空,反正也是一样的操作。
if holding<0 and HIGH=dd then SELLSHORT(1,1,LIMITR);//平空
if holding>0 and LOW=kk then sell(1,1,LIMITR);//平多
if holding=0 and HIGH=dd then buy(1,1,LIMITR);//开多
if holding=0 and LOW=kk then buyshort(1,1,LIMITR);//开空
我写成这样,没有开仓信号。
比较菜,检查不出来哪 里有问题。