Welcome Guest, please sign in to participate in a discussion. | Search | Active Topics | |
Registered User Joined: 5/13/2007 Posts: 48
|
Whenever I place a comparison symbol (aka Price for Symbol and/or Price History)in a window below the primary symbol and apply candlestick color rules for it, the colors do not paint correctly. The colors painted on the lower symbol are painted are the same as the color rules set for the upper symbol. For example, upper pane symbol may have a green candle representing rising price and the lower pane symbol will also have a green bar for a falling price candle. The color rule for the upper symbol seems to mirror itself onto the candles on the lower pane regardless of price direction. How do I correct this? Thanks. Steve
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You haven't said how you are Painting the Price for Symbol Indicator, so let's take a look at the Down Candle and Down Bar Rules as possibilities. If you look at the RealCode in the Down Candle Rule:
If price.Open>price.Close Then pass
You'll see that it is looking at the Price of the Active Symbol. If we Drag and Drop the Price for Symbol Indicator into the RealCode Editor, it would create somthing similar to the first line of the following RealCode Rule and allow us to use the Price for Symbol Indicator instead:
'# PfS = chart.PriceforSymbol
If Pfs.Open > PfS.Close Then Pass
We could do something very similar with the Down Bar Rule:
'# PfS = chart.PriceforSymbol
If PfS.NetChange < 0 Then Pass
You can then Drag and Drop one of these Rules onto the Price for Symbol Indicator to use it to Paint the Indicator.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 5/13/2007 Posts: 48
|
Bruce, I'm a novice so the best way for me to describe what is happening is to go step by step. Sorry for length of this but its the easiest way I know how.
1)only one symbol is present on the active chart window:GE
2)I click on price history/colors/paint indicator with Realcode Edit/ and paste the following:
If price.open < price.Close Then plotcolor = color.Lime
If price.open > price.Close Then plotcolor = color.Red
3)Everything looks great
4)I click Add Indicator/Price for Symbol and I add this comparison symbol (ie WMT)as a new pane below GE
5)I then click on Price History WMT and do step 2 above.
The chart does not paint properly. It paints exactly the same as the primary symbol in the upper pane regardless of price direction, just like a mirror. For example if the GE chart above has 3 green bars and 1 red etc, then the Price History WMT chart below paints it the same... 3 green and 1 red... regardless of price direction of WMT.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Price is the Price for the Active Symbol. If you are using a RealCode Paint Brush on an Indicator, you can use Line instead of Price to reference the Indicator being Painted:
If Line.Open < Line.Close Then
PlotColor = Color.Lime
Else If Line.Open > Line.Close Then
PlotColor = Color.Red
Else
PlotColor = Color.Yellow
End If
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 5/13/2007 Posts: 48
|
Bruce, I'm completely lost. My goal is to have a comparison stock symbol in the window below the primary stock symbol above, and to paint that comparison symbol with candlestick colors. Are you able to describe to me again in different terms what I what I should do to paint the Price History so the candles return the colors they should? I'm not quite following what you're telling me to do in your post. Thanks.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
The only difference between what you described in your Monday, March 22, 2010 1:41:07 PM ET post and what you need to do is to use the following RealCode:
If Line.Open < Line.Close Then
PlotColor = Color.Lime
Else If Line.Open > Line.Close Then
PlotColor = Color.Red
Else
PlotColor = Color.Yellow
End If
Instead of the RealCode you said you are using:
If price.open < price.Close Then plotcolor = color.Lime
If price.open > price.Close Then plotcolor = color.Red
If you really want, you can just change Price to Line in your RealCode:
If Line.open < Line.Close Then plotcolor = color.Lime
If Line.open > Line.Close Then plotcolor = color.Red
Price is the Price of the Active Symbol. In a RealCode Paint Brush that is part of an Indicator, Line refers to the Values of the Indicator.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 5/13/2007 Posts: 48
|
Bruce, I think I now understand the differences between price and indicator, hence the word line vs. price in the realcode editor. I tried both of your solutions above and here's what happened. I used your first example and received error message(s) 'Close' is not a member of 'WBI.CommonBlocks.ScriptingLine'. I then used your second example and received the same message(s): 'Close' is not a member of 'WBI.CommonBlocks.ScriptingLine'.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
I'm not sure why Close isn't working, but try replacing Close with Value.
If Line.Open < Line.Value Then
PlotColor = Color.Lime
Else If Line.Open > Line.Value Then
PlotColor = Color.Red
Else
PlotColor = Color.Yellow
End If
Or:
If Line.Open < Line.Value Then plotcolor = color.Lime
If Line.Open > Line.Value Then plotcolor = color.Red
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 5/13/2007 Posts: 48
|
Bruce, works great! Thanks a million! Steve
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |