//移动止盈
多盈1:盈利大于20小于40个变动点,从最大盈利点回撤5个变动点,卖出50%仓位,不要连续发出信号(意思是大于20小于40个变动点发出一次卖出,就不要再次发出卖出);
多盈2:盈利大于40小于60个变动点,从最大盈利点回撤5个变动点,卖出50%仓位,不要连续发出信号(意思是大于40小于60个变动点发出一次卖出,就不要再次发出卖出);;
空盈1:盈利大于20小于40个变动点,从最大盈利点回撤5个变动点,卖出50%仓位,不要连续发出信号;
空盈2:盈利大于40小于60个变动点

此主题相关图片如下:qq图片20180824105506.png

,从最大盈利点回撤5个变动点,卖出50%仓位,不要连续发出信号;
Hprofit1:hhv(h,ENTERBARS+2)-ENTERPRICE;//空头最大盈利
Cprofit1:c-ENTERPRICE;//当前盈利
cond1:Hprofit1>20*MINDIFF and Hprofit1<=40*MINDIFF and holding>0 and Hprofit1-Cprofit1>=5*MINDIFF;
cond2:Hprofit1>=40*MINDIFF and Hprofit1<=60*MINDIFF and holding>0 and Hprofit1-Cprofit1>=5*MINDIFF;
if (cond1 and count(cond1=1,ENTERBARS+2)) or (cond2 and count(cond2,ENTERBARS+2)=1) then
begin
sell(holding>0,50%,market);
end
Hprofit2:ENTERPRICE-llv(h,ENTERBARS+2);//空头最大盈利
Cprofit2:ENTERPRICE-c;//当前盈利
cond3:Hprofit2>20*MINDIFF and Hprofit2<=40*MINDIFF and holding<0 and Hprofit2-Cprofit2>=5*MINDIFF;
cond4:Hprofit2>=40*MINDIFF and Hprofit2<=60*MINDIFF and holding<0 and Hprofit2-Cprofit2>=5*MINDIFF;
if (cond1 and count(cond3=1,ENTERBARS+2)) or (cond2 and count(cond4,ENTERBARS+2)=1) then
begin
sell(holding>0,50%,market);
end