From the August 01, 2011 issue of Futures Magazine • Subscribe!

Trading with rolling contract data

Next, we'll look at the results for a triple moving average system. Here is the code:

Sub ThreeMACrossoverbreakdown(SLen As Integer,MLen As Integer,LLen As Integer)

Dim ShortAve As BarArray

Dim LongAve As BarArray

Dim MedAve As BarArray

ShortAve = Average(Close, SLen,0)

MedAve=Average(Close,MLen,0)

LongAve = Average(Close, LLen,0)

If ShortAve > MedAve And MedAve>LongAve Then

Buy("BuyEnt",1,0,Market,Day)

End If

If ShortAve < MedAve And MedAve

Sell("SellEnt",1,0,Market,Day)

End If

marketbreakdown2()

End Sub

<< Page 3 of 6 >>
Comments
comments powered by Disqus
Check out Futures Magazine - Polls on LockerDome on LockerDome