AverageUpVolume = Average(Volume, AverageUpLength);
HighAvgUpVolume = Highest(AverageUpVolume, AverageUpLength);
LowAvgUpVolume = Lowest(AverageUpVolume, AverageUpLength);
RelAvgUpVolume = (AverageUpVolume - LowAvgUpVolume) /
(HighAvgUpVolume - LowAvgUpVolume);
InvRelAvgUpVolume = 1 - RelAvgUpVolume;
VolWeightedUpAvg = RelAvgUpVolume * AvgPrice +
InvRelAvgUpVolume * VolWeightedUpAvg;
If MarketPosition = 0 and Close < VolWeightedUpAvg and
VolWeightedUpAvg < VolWeightedUpAvg[1] Then
Buy ("L-July01") Next Bar NumCont Contracts at Highest(High,
TriggerLength) Stop;
End;
If AllowShort = True Then Begin
160 PART 2 Trading System Development
FIGURE 13.1
Merck trading using revised volume-weighted average system.