Change the chart color bar rule
Author: Karthik
Creation Date: 4/20/2009 10:06 AM
profile picture

Karthik

#1



Hi,

How to change the chart bar color rule. Currely in the chart if the close price is greater than the
open price then the bar is green eventhough it's close is less than the previouse day's close.

I want to change this one to compare with previous day's close price, e.g. i want to do as per
below, dont know whether this is possible or not.

if Today's Close price > Previous Days Close price then GREEN bar
if Today's Close price < Previous Days Close price then RED bar

really appreciate your help on this....


Thanks,
Karthik
profile picture

Cone

#2
Since an option doesn't exist for that coloring in the Candlesticks Chart Style Settings, you have to add it to your Strategy Code. Just put this inside the Execute() method -

CODE:
Please log in to see this code.
profile picture

Karthik

#3
Thanks Cone, but forgot to ask how to change the volume bar color also along with price bar...
profile picture

Cone

#4
CODE:
Please log in to see this code.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).