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 |

Paint Price History Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
scvenne
Posted : Sunday, March 21, 2010 7:48:26 PM
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
Bruce_L
Posted : Monday, March 22, 2010 10:20:21 AM


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
scvenne
Posted : Monday, March 22, 2010 1:41:07 PM
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.
Bruce_L
Posted : Monday, March 22, 2010 1:46:13 PM


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
scvenne
Posted : Monday, March 22, 2010 1:59:59 PM
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.
Bruce_L
Posted : Monday, March 22, 2010 2:03:29 PM


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
scvenne
Posted : Monday, March 22, 2010 2:47:41 PM
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'.
Bruce_L
Posted : Monday, March 22, 2010 2:59:19 PM


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
scvenne
Posted : Monday, March 22, 2010 3:43:20 PM
Registered User
Joined: 5/13/2007
Posts: 48
Bruce, works great! Thanks a million! Steve
Bruce_L
Posted : Monday, March 22, 2010 3:57:54 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.