你好,
上叉买多盈利后止盈,其后未下叉且符合条件再次买多,希望控制“再买”次数,最多2次。
超过2次后等待下叉卖出。 写了2个方法控制次数,都无法成功,具体表现是经常超过2次。请帮助修改一下。谢谢
IF long then
begin
SELLSHORT(HOLDING<0,HOLDING,MARKET);
BUY (holding=0,1,thisclose);
end
方法1
variable:cishu=1;
IF MA1>MA2 and cishu<3 then begin
if止盈 then SELL(HOLDING>0,0,MARKET);
If再买then begin
buy(1,0,market) ;
Cishu:=cishu+1;
End
方法2
variable:cishu=1;
if 止盈
then begin
sell(holding>0,0,MARKET);
if再买then
for cishu=1 to 2 do begin
BUYSHORT (holding=0,1,thisclose);
Cishu:=cishu+1;
end
end
<!--[if gte mso 9]>variable:cishu=1;
if cishu<=2 and 再买条件 then begin
buy;
cishu:=cishu+1;
end