If EntryPrice > 0 Then Begin
If MarketPosition = 1 Then Begin
If TrailingStop = True Then Begin
Top = MaxList(Top, High);
ExitLong ("L-Trail") Next Bar at Top * LongStop Stop;
End
Else
ExitLong ("L-Stop") Next Bar at EntryPrice * LongStop Stop;
ExitLong ("L-Trgt") Next Bar at EntryPrice * LongTarget Limit;
End;
If MarketPosition = -1 Then Begin
If TrailingStop = True Then Begin
Bottom = MinList(Bottom, Low);
ExitShort ("S-Trail") Next Bar at Bottom * ShortStop Stop;
End
Else
ExitShort ("S-Stop") Next Bar at EntryPrice * ShortStop Stop;
ExitShort ("S-Trgt") Next Bar at EntryPrice * ShortTarget Limit;
End;
If BarsSinceEntry = BarsInTrade + 1 Then Begin
ExitLong ("L-Time") Next Bar at Market;
ExitShort ("S-Time") Next Bar at Market;
End;
End;
{Code for testing stops in Excel goes here (see Part 3 of book), with
Normalize(False). Set SurfaceChartTest(True). Disable original stops in system.}
{Code for initial market export goes here, with Normalize(True). Set
ExportSwitch(True).}
{Code for testing robustness goes here (see Part 3 of book), with Normalize
(True). Set RobustnessSwitch(True).}
{Code for exporting results for money management analysis goes here (see Part 4
of book), with Normalize(False). Set MoneyExport(True).}
CHAPTER 15 Expert Exits 183