Login Page - Create Account

Support Board


Date/Time: Tue, 14 May 2024 23:56:41 +0000



Post From: Color Bar Based on Alert Condition

[2020-04-06 20:24:27]
Sawtooth - Posts: 3996
Try this:

1. Use the Spreadsheet Formula study with this formula in the Formula field to determine the color direction of the bar:
=IF(OR(C>O,AND(O>C[-1],O=C)),1,IF(OR(C<O,AND(O<C[-1],O=C)),-1,ID5.SG1[-1]))
where ID5 is the Spreadsheet Formula study. Hide this study.
If you are using Renko bars, use this formula instead:
=IF(OR(ID0.SG23>ID0.SG22,AND(ID0.SG22>ID0.SG23[-1],ID0.SG22=ID0.SG23)),1,IF(OR(ID0.SG23<ID0.SG22,AND(ID0.SG22<ID0.SG23[-1],ID0.SG22=ID0.SG23)),-1,ID5.SG1[-1]))
Study/Chart Alerts And Scanning: Available Main Price Graph Identifiers/Variables
Note: The above formulas are a Simple Alert adaptation of this spreadsheet study example:
Spreadsheet Example Formulas and Usage: Formula that Matches the Coloring of Up and Down Price Bars

2. Use a separate instance of the Color Bar Based On Alert Condition study for each color:
Bar is green with O=L:
=AND(O=L,ID5.SG1=1)
Bar is red with O=H:
=AND(O=H,ID5.SG1=-1)