RelStrength.15 = Close / Close Data5;
If AllowLong = True Then Begin
LongAvgRelStre.12 = Average(RelStrength.12, LongRelStrengthLB);
LongAvgRelStre.13 = Average(RelStrength.13, LongRelStrengthLB);
LongAvgRelStre.14 = Average(RelStrength.14, LongRelStrengthLB);
LongAvgRelStre.15 = Average(RelStrength.15, LongRelStrengthLB);
LongPercRelStre.12 = RelStrength.12 / LongAvgRelStre.12;
LongPercRelStre.13 = RelStrength.13 / LongAvgRelStre.13;
LongPercRelStre.14 = RelStrength.14 / LongAvgRelStre.14;
LongPercRelStre.15 = RelStrength.15 / LongAvgRelStre.15;
LongTotRelStre = LongPercRelStre.12 * LongPercRelStre.13 *
LongPercRelStre.14 * LongPercRelStre.15;
LongBaseTriggerCalc = StdDev(LongTotRelStre, LongRelStrengthLB);
LongTriggerStrength = 1 + LongBaseTriggerCalc * LongStDevs;
If MarketPosition = 0 and LongTotRelStre > LongTriggerStrength Then
Buy ("L-Mar 01") NumCont Contracts Next Bar at Market;
End;
If AllowShort = True Then Begin
ShortAvgRelStre.12 = Average(RelStrength.12, ShortRelStrengthLB);
ShortAvgRelStre.13 = Average(RelStrength.13, ShortRelStrengthLB);
ShortAvgRelStre.14 = Average(RelStrength.14, ShortRelStrengthLB);
ShortAvgRelStre.15 = Average(RelStrength.15, ShortRelStrengthLB);
ShortPercRelStre.12 = RelStrength.12 / ShortAvgRelStre.12;
ShortPercRelStre.13 = RelStrength.13 / ShortAvgRelStre.13;
ShortPercRelStre.14 = RelStrength.14 / ShortAvgRelStre.14;
ShortPercRelStre.15 = RelStrength.15 / ShortAvgRelStre.15;
ShortTotRelStre = ShortPercRelStre.12 * ShortPercRelStre.13 *
ShortPercRelStre.14 * ShortPercRelStre.15;
ShortBaseTriggerCalc = StdDev(ShortTotRelStre, ShortRelStrengthLB);
ShortTriggerStrength = 1 - ShortBaseTriggerCalc * ShortStDevs;
If MarketPosition = 0 and TotRelStrength < ShortTriggerStrength Then
Sell ("S-Mar 01") NumCont Contracts Next Bar at Market;
End;
If EntryPrice > 0 and LongTotRelStre < LongTriggerStrength Then
ExitLong ("L-Trail") Next Bar at Market;
If EntryPrice > 0 and TotRelStrength > ShortTriggerStrength Then
ExitShort ("S-Trail") Next Bar at Market;
CHAPTER 11 Relative Strength Bands 135