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 |

RealCode Syntax Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
eroberts911
Posted : Saturday, April 10, 2010 1:23:28 PM
Registered User
Joined: 10/14/2008
Posts: 23
I'm creating a realcode paintbrush. I'm using a moving average and MACD histogram. The system automatically created '# variables named MA and MH, resp. I'm getting an error message "MA not declared" and "MH not declared" Doesn't the '# line constitute a declaration? Code as Follows: '# MH = indicator.MACDHistogram '# MA = indicator.MovingAverage.6 '11Bar EMA If MA.Value > MA.Value(1) And MH.Value > MH.Value(1) Then PlotColor = Color.Green ElseIf MA.Value < MA.Value(1) And MH.Value < MH.Value(1) Then PlotColor = Color.Red Else PlotColor = Color.Blue End If
Bruce_L
Posted : Monday, April 12, 2010 9:12:03 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138
My assumption is the formatting looks as follows:

'# MH = indicator.MACDHistogram
'# MA = indicator.MovingAverage.6
'11Bar EMA
If MA.Value > MA.Value(1) And MH.Value > MH.Value(1) Then
    PlotColor = Color.Green
ElseIf MA.Value < MA.Value(1) And MH.Value < MH.Value(1) Then
    PlotColor = Color.Red
Else PlotColor = Color.Blue
End If

Based on the assigned names, I'm also going to assume this is in SF4 and not in SF5. When I just paste your RealCode into the Paint Brush for Price History on my Charts I get the same messages. That said, if I add Moving Average.6 and a MACD Histogram Indicators to the Charts, the error messages go away and the Price History is Painted based on the RealCode Paint Brush.

Do you still have the Moving Average and MACD Histogram on the same Chart where you are attempting to use the RealCode Paint Brush? StockFinder 5 has the abilitiy to use reference Indicators that aren't Charted (using slightly different syntax), but StockFinder 4 does not.

-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.