If TrailingStop > 0 Then Begin
TrailRange = TrailingStop * OneRange;
ExitLong ("L-Trail") Next Bar at Close - TrailRange Stop;
ExitShort ("S-Trail") Next Bar at Close + TrailRange Stop;
End;
{***** The Profit Protector *****}
If ProfitStop > 0 Then Begin
TrueLength = BarsSinceEntry + 1;
LongProfit = (Highest(Close, TrueLength) - EntryPrice) * TrueProfitStop;
ShortProfit = (EntryPrice - Lowest(Close, TrueLength)) * TrueProfitStop;
ExitLong ("L-Prft") Next Bar at EntryPrice + LongProfit Stop;
ExitShort ("S-Prft") Next Bar at EntryPrice - ShortProfit Stop;
End;
{***** The Profit Target *****}
If TargetStop > 0 Then Begin
TargetRange = TargetStop * OneRange;
ExitLong ("L-Trgt") Next Bar at EntryPrice + TargetRange Limit;
ExitShort ("S-Trgt") Next Bar at EntryPrice - TargetRange Limit;
End;
If BarsSinceEntry >= TrueSlowBar Then Begin
{***** The Slow-trade Stop *****}
If TrueSlowBar > 0 and OpenPositionProfit < 0 Then Begin
ExitLong ("L-Slow") on Close;
ExitShort ("S-Slow") on Close;
End;
{***** The Min-move Stop *****}
If MinBarMove > 0 Then Begin
TrueNextBar = BarsSinceEntry + 2;
MinTradeMove = MinBarMove * OneRange * TrueNextBar;
ExitLong ("L-Min") Next Bar at EntryPrice +
MinTradeMove Stop;
ExitShort ("S-Min") Next Bar at EntryPrice –
MinTradeMove Stop;
End;
End;
{***** The Max-length Stop *****}
CHAPTER 20 Adding Exits 253