Login Page - Create Account

Support Board


Date/Time: Mon, 16 Jun 2025 09:12:14 +0000



Post From: How to Colour Price Bars base on Green and Red Cumulative Delta Volume bars ?

[2025-05-18 22:56:58]
Sawtooth - Posts: 4227
is there a way to have the candle filled ONLY when there is a difference between the CD and Price?
1. Add the Spreadsheet Formula study, with a formula like this in its Formula field:
=IF(OR(C>O,AND(O>C[-1],O=C)),1, IF(OR(C<O,AND(O<C[-1],O=C)),-1,ID6.SG1[-1]))
-where ID6 is this Spreadsheet Formula study.
This will return a 1 when the price candle is green, and a -1 when the price candle is red.
Hide this study.

2. Add another Spreadsheet Formula study, with a formula like this in its Formula field:
=IF(OR(ID8.SG4>ID8.SG1,AND(ID8.SG1>ID8.SG4[-1],ID8.SG1=ID8.SG4)),1, IF(OR(ID8.SG4<ID8.SG1,AND(ID8.SG1<ID8.SG4[-1],ID8.SG1=ID8.SG4)),-1,ID7.SG1[-1]))
-where ID8 is the CD study, and ID7 is this Spreadsheet Formula study.
This will return a 1 when the CD candle is green, and a -1 when the CD candle is red.
Hide this study.

3. Add the Color Bar Based On Alert Condition study, with a formula like this on its Alerts tab:
=ID6.SG1<>ID7.SG1
This will color the price bar whenever the CD bar is a different color than the price bar.

The above formulas to find the candle direction colors are based on this example:
Spreadsheet Example Formulas and Usage: Formula that Matches the Coloring of Up and Down Price Bars