Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

plot crossover Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
jtr
Posted : Tuesday, January 12, 2010 12:47:16 PM
Registered User
Joined: 8/19/2008
Posts: 19
Is it possible to plot the crossovers of an indicator or moving average?  For example, using the MACD is it possible to plot when the macd crosses the moving average? (up and down, or seperatly) in its own window.  Just like to see the points and the distance, slope, etc between the points. 
Bruce_L
Posted : Tuesday, January 12, 2010 3:27:45 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
If you Drag and Drop the MACD and Moving Average Signal Line into the RealCode Editor, they should create something similar to the first two lines of the following RealCode Indicator:

'# MACD = indicator.MACD
'# MovA = indicator.MovAvg.2
If System.Math.Sign(MACD.Value - MovA.Value) <> _
    System.Math.Sign(MACD.Value(1) - MovA.Value(1)) Then
    Plot = MACD.Value(1) + ((MovA.Value(1) - MACD.Value(1)) / _
        (MACD.NetChange - MovA.NetChange)) * MACD.NetChange
Else
    Plot = Single.NaN
End If

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
jtr
Posted : Tuesday, January 12, 2010 4:02:59 PM
Registered User
Joined: 8/19/2008
Posts: 19
Thank you!
Bruce_L
Posted : Tuesday, January 12, 2010 4:05:10 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
You're welcome.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.