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

Painting bars Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
thnkbigr
Posted : Wednesday, January 31, 2018 10:59:22 AM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,207

I remember you showed me a way to paint bars in TC which I forgot 

I think It was by plotting two price history's 

Can you show me how to do that again 

and has anything changed to be able to paint bars based on rules in TC 

Bruce_L
Posted : Wednesday, January 31, 2018 11:06:33 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

We can kind of arbitrarily color candles, but things aren't going to line up exactly even though you are going to put all of these indicators in the same pane and scale, and it might look a bit off.

Change price to use the candle plot style. Set it Up Bars and Down Bars both filled. You can use one Color to set a default color for all candles, or use Net Change or Open vs Close for Color Based On to set two default colors based on either of those requirements.

Now, add as many different Custom PCF Indicators to the same Pane and Scale as price as you want for additional colors to use for price. The format of the Formula will be the following.

IIF(your condition formula here, GREATEST(O, C), 1 / 0)

Then add another Custom PCF Indicator using the Histogram Plot Style to the background color using the following Formula.

LEAST(O, C)

Finally, add the same symbol to the price pane a second time and set Symbol to Main Chart Symbol, Plot Style to Candlestick with the Up Bars and Down Bars both unfilled (unchecked). You can set Color Based On as desired here as well. This will give you the final outline and wick colors.

You might need to add child indicators of price like moving averages to the second copy of price. Otherwise the "background" histogram will cover them up. I can't think of a way to make it so it doesn't cause the watermark and gridlines under price to become dashed from being covered up by the background histogram. You can plot 1 / 0 instead of LEAST(O, C) when all of the other colors are false, but the stuff under the arbitrarily covered bars will still get covered up.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
thnkbigr
Posted : Wednesday, January 31, 2018 11:16:43 AM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,207

I remember I was able to plot price > 50 day one coloe while < 50 different 

 

Bruce_L
Posted : Wednesday, January 31, 2018 11:30:33 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

You could do this with two Custom PCF Indicators. Set the color of the main price inicator to whatever you want for at or below the moving average. Use the following Custom PCF Indicator for the color price is above the moving average.

IIF(C > AVGC50, GREATEST(O, C), 1 / 0)

Follow the rest of the instructions as given above.

BTW, I must be getting really old, as I still don't remember presenting this technique previously.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
thnkbigr
Posted : Wednesday, January 31, 2018 12:04:31 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,207

That's saying that if price is > 50 day plot the highest value between Open or Close and if price is < 50 day plot nothing? 

Bruce_L
Posted : Wednesday, January 31, 2018 12:06:47 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

After playing with this a bit, I must say I prefer using OHLC Bars instead of candles with this. That way I can know which is the open and close at a glance and still set Color Based On to Net Change in addition to the arbitrary body color.

This works best with a separate Custom PCF Indicator for each body color instead of being using the color of the first price history as a default fill color however.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Bruce_L
Posted : Wednesday, January 31, 2018 12:10:27 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Yes, that is what it is saying. This plots a histogram bar to the top of the body of the price bar only when the specified condition (price above SMA50 in this case) is true.

Then you plot another histogram using the background color to the bottom of the body of the price bar.

And then you get the bottom wick back by plotting another copy of price.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
thnkbigr
Posted : Wednesday, January 31, 2018 12:20:23 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,207

http://forums.worden.com/default.aspx?g=posts&t=67159

This is the post we talked about painting bars

 

thnkbigr
Posted : Wednesday, January 31, 2018 12:22:41 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,207

This plots a histogram bar to the top of the body of the price bar only when the specified condition (price above SMA50 in this case) is true  

It plots the histogram to the bottom not top on mine 

Can you share your chart  

Bruce_L
Posted : Wednesday, January 31, 2018 12:38:23 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

This technique is definitely different (albeit similar) to what was discussed in the Painting bars based in rules topic.

Are you histograms plotted in the same pane and scale as price?

Arbitrary Candle Fill Screenshot

Attachments:
ArbitraryFill.gif - 25 KB, downloaded 927 time(s).



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
thnkbigr
Posted : Wednesday, January 31, 2018 1:02:44 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,207

Yes they are but they plot from all the way down on the chart 

I plot a Custom PCF using this PCF IIF(C > AVGC50, GREATEST(O, C), 1 / 0)

Plot style set to Histogram, Color Green, Data source set to price history 

and I move the pane and scale it with price  

Your histogram plots between Open and Close but mine plots from all the way down on the chart which in your example will from 171 and up  

 

thnkbigr
Posted : Wednesday, January 31, 2018 1:04:16 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,207

Oh I see you have another indicator in Black that covers the bottom peice

 

thnkbigr
Posted : Wednesday, January 31, 2018 1:09:19 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,207

How do I add another price history to the chart 

I typed Price History and nothing comes up

 

Bruce_L
Posted : Wednesday, January 31, 2018 1:18:43 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

Click on Price and select Add Plot Here... | Symbols.

Then choose a symbol (or type in the original symbol and choose it).

Scale it with the original price.

Click on the new price plot and select Edit. Change Symbbol to Main Chart.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
thnkbigr
Posted : Wednesday, January 31, 2018 1:27:43 PM
Platinum Customer Platinum Customer

Joined: 3/31/2006
Posts: 3,207

Got it. thx

If instead of C < AVGC50 I want to say if price has dropped by 5 * ATR22 then I change the following to  

IIF(C < AVGC50, GREATEST(O, C), 1 / 0)

to

IIF((-1 * (MAXH63 - C) / ATR63 < -5), GREATEST(O, C), 1 / 0)

Am I correct

Bruce_L
Posted : Wednesday, January 31, 2018 1:34:41 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

You could shorten that a bit, but yes.

IIF(MAXH63 - C > 5 * ATR63, GREATEST(O, C), 1 / 0)



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