老师你好,请你帮忙修改加空头仓位问题,是在图表上交易的。 多头加仓 if holding=1 and close>=enterprice+20 then begin Buy(1,1,market); end. 空头加仓 if holding=1 and close<=enterprise-20 then begin Buyshort(1,1,market); end 但是空头这样加仓方式就不行了,没有信号。谢谢各位老师前辈帮忙修改编写。
if
holding=-1 and close<=enterprise-20 then begin Buyshort(1,1,market); end
holding在空头持仓时候返回值是负值,所以如果想表达空头持有一手,那应该是holding=-1