Los Angeles (CA)
Experience: Master
Platform: ThinkOrSwim
Trading: Currency Future, Stocks
Posts: 34 since Apr 2019
Thanks Given: 1
Thanks Received: 40
|
From time to time I come across a question why when using bars their color differs from candles. The point is that the color of the bar depends on the price in relation to the price of the previous close. And the color of the candlestick depends on the price in relation to the opening price. Therefore, for those who want to use bars on charts, but are used to candlestick coloring, I made a simple script for repainting bars. The script works on both light and dark backgrounds, on any timeframes.
#bars repainting
#
def c = close;
def o = open;
AssignPriceColor(if c > o then Color.uptick else if c < o then Color.downtick else color.gray);
|