Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Converting SF4 Real Code to SF5: plotting an indicator Dip Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
tomham
Posted : Wednesday, June 16, 2010 3:14:41 PM
Registered User
Joined: 11/21/2004
Posts: 84

I am trying to convert a RealCode indicator from SF4 to SF5; I am missing some process tho.

The indicator plots the "dip" (recent low) of the upper Keltner Band.
In SF4, I plotted the Keltner Band, made a 1moving average of it, then clicked and dragged it to the RealCode (already plotted) shown below:

'# MA = indicator.MovingAverage.3
Static Dip As Single
If isFirstBar Then
 Dip = Single.NaN
Else If MA.Value > MA.Value(1) AndAlso _
 MA.Value(1) < MA.Value(2) Then
 Dip = MA.Value(1)
End If
Plot = Dip

This worked great in SF4, but not SF5.  I am thinking that the "# MA = indicator.MovingAverage.3" statement is the problem.  It appears to reference another MA that I have plotted.
Any ideas to try would be appreciated.  Thanks.

Bruce_L
Posted : Wednesday, June 16, 2010 3:25:10 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
In StockFinder 5, you no longer need to do the 1-Period Moving Average trick. You can just Drag and Drop the Keltner Channels into the RealCode Editor (which will automatically create the '# KCTop and '# KCBottom lines):

'|******************************************************************
'|*** StockFinder RealCode Indicator - Version 5.0 www.worden.com
'|*** Copy and paste this header and code into StockFinder *********
'|*** Indicator:Keltner Dip
'|******************************************************************
'# KCTop = chart.KeltnerChannels.0
'# KCBottom = chart.KeltnerChannels.1
Static Dip As Single
If isFirstBar Then
    Dip = Single.NaN
Else If KCTop.Value > KCTop.Value(1) AndAlso _
    KCTop.Value(1) < KCTop.Value(2) Then
    Dip = KCTop.Value(1)
End If
Plot = Dip

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
tomham
Posted : Wednesday, June 16, 2010 5:27:29 PM
Registered User
Joined: 11/21/2004
Posts: 84
Thanks Bruce !  
I guess I'm too set in the old version work arounds, since this method is more straight forward & logical.  :)

This worked well, but when I dragged the plotted indicator into the price chart, it plotted the indicator with a different price scale.  Do I use the "Edit Scale" function in "Edit" to get the indicator scale to sync with the Price scale ?  Please advise.  Thanks.
Bruce_L
Posted : Wednesday, June 16, 2010 5:52:02 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
Right-click on the Indicator and select Scaling | Scale With | Price.

-Bruce
Personal Criteria Formulas
TC2000 Support Articles
tomham
Posted : Wednesday, June 16, 2010 7:53:00 PM
Registered User
Joined: 11/21/2004
Posts: 84
Super !  Thanks Bruce.  it's look'in great now.  Take Care.
Bruce_L
Posted : Monday, June 21, 2010 9:42:35 AM


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.