|
舒潔 發表於 15-9-3 01:11
試過上面的~還是出現停損後反向進場~之後又一次停損反向進場~沒有只要停損出場(不要再反向進場)~ ...
vars:stop_L(20),counter(0);
[出手條件]
if marketposition>0 and counter=0 then begin;
sellshort next bar at entryprice(0)-stop_L stop;
if L<entryprice(0)-stop_L then begin;
counter=1;
end;
end;
if marketposition<0 and counter=0 then begin;
buy next bar at entryprice(0)+stop_L stop;
if H>entryprice(0)+stop_L then begin;
counter=1;
end;
end;
if marketposition>0 and counter=1 then begin;
sell next bar at entryprice(0)-stop_L stop;
if L<entryprice(0)-stop_L then begin;
counter=2;
end;
end;
if marketposition<0 and counter=1 then begin;
buytocover next bar at entryprice(0)+stop_L stop;
if H>entryprice(0)+stop_L then begin;
counter=2;
end;
end;
改這樣試試,不過停損第二次後要重新進場時,記得要把counter=0,因為我不知道你進場邏輯為何
|
|