请问,加仓策略怎么编写思路:
一:之前已有开多单并持有,如果盈利不加仓,如果亏损加仓(亏损20点)加仓
二:之前已有开空单并持有,如果盈利不加仓,如果亏损加仓(亏损20点)加仓
if holding>0 and openprofit/multiplier<=-20 then buy(1,1,market);
if holding<0 and openprofit/multiplier<=-20 then buyshort(1,1,market);
if holding>0 and openprofit/multiplier<=-20 then buy(holding=1,1,market);
if holding<0 and openprofit/multiplier<=-20 then buyshort(holding=-1,1,market);
加粗是数字是1还是其他取决你策略开仓手数是多少