{
if(MarketPosition > 0) then begin
If BarsSinceEntry = 0 then begin
LongSL = 0;
end;
LongSLPlaced = false;
// StopLoss
LongSL = Round2Fraction(EntryPrice - (3.0 * SQ_ATR(20)[1]));
LongSL = SQ_CorrectMinMaxSLPT(LongSL, MinimumSLPT, MaximumSLPT, true);
Sell("LongSL") next bar at LongSL stop;
LongSLPlaced = true;
// Trailing Stop
PriceLevel = 1.0 * SQ_ATR(15)[1]; //Choose a very tight Trailing Stop
If PriceLevel > 0 then begin
If CurrentBid - EntryPrice >= 0 and (LongSL = 0 or LongSL < CurrentBid - PriceLevel) then begin
LongSL = CurrentBid - PriceLevel;
Sell("LongTrailingStop") next bar at LongSL stop;
LongSLPlaced = true;
end;
end;
if LongSLPlaced = false and LongSL > 0 then begin
// no SL activated this bar, use default one - handling if there is no SL, only Trailing stop or Move2BE
Sell("LongSLD") next bar at LongSL stop;
end;
end;
}
Attachment RetestBE.cfx added
Attachment Strategy 5756BE trade525.sqx added
Attachment 525.jpg added
Attachment 1162.jpg added
Attachment 1833.jpg added
Like Traling stop, there is a chance that stops will not be executed
Number of transactions 525、1162、1833
it is questionable that
0.1 * SQ_ATR(45)[1] Conditions are very easy to trigger
Status changed from New to Fixed