多头三次加仓,第一次加仓1手,第二次加仓2手,第三次加仓3手
3次加仓后,跌破最近第三次加仓价格的50点后,只平掉第三次加仓的3手。
跌破第二次加仓价格的50点后,只平掉第二次加仓的2手。
交易是没有特定的哪个3手,哪个2手的,只有平3手,平2手
variable:k=0;
variable:e1=0;
variable:e2=0;
if k=0 and 开仓条件 and holding=0 then begin
buy;
k:=1;
end
if k=1 and 加仓条件 and holding=1 then begin
buy(1,1,market);
k:=2;
end
if k=2 and 加仓条件 and holding=2 then begin
buy(1,2,market);
e1:=enterprice;
k:=3;
end
if k=3 and 加仓条件 and holding=3 then begin
buy(1,3,market);
e2:=enterprice;
k:=4;
end
if e1-c>50*mindiff then sell(1,2,market);
if e2-c>50*mindiff then sell(1,3,market);