{Leave these variables alone.}
RetraceDistance(0), LongEntryLevel(0), ShortEntryLevel(0);
{Code for normalizing the number of contracts traded goes here.}
RetraceDistance = (Highest(High, RetracePeriod) - Lowest(Low, RetracePeriod)) /
Aggressiveness;
LongEntryLevel = Lowest(Low, RetracePeriod) + RetraceDistance;
ShortEntryLevel = Highest(High, RetracePeriod) - RetraceDistance;
If MarketPosition = 0 Then Begin
If AllowLong = True and Close < LongEntryLevel Then
Buy ("L-Sep 00") NumCont Contracts Next Bar on LongEntryLevel Stop;
If AllowShort = True and Close > ShortEntryLevel Then
Sell ("S-Sep 00") NumCont Contracts Next Bar on ShortEntryLevel Stop;
End;
If EntryPrice > 0 Then Begin
ExitLong ("L-Stop") Next Bar at Lowest(Low, RetracePeriod) Stop;
ExitShort ("S-Stop") Next Bar at Highest(High, RetracePeriod) Stop;
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 8 Hybrid System No. 1 103