Login Page - Create Account

Support Board


Date/Time: Sun, 28 Apr 2024 21:58:25 +0000



[User Discussion] - Color Bar Based on Alert Condition

View Count: 1655

[2020-04-06 19:16:56]
User558380 - Posts: 30
Hi, I generally know how to color a bar based on certain alert conditions but haven't been able to figure out this one. If a bar closes green and the LOW of that bar was EQUAL to (not less than) the opening price of that bar, I'd like to color it a different color. Alternatively, if a bar closes red and the HIGH of that bar was EQUAL to (not greater than) the opening price of that bar, I'd like to color it a different color also. Hope this makes sense. Any help you can provide will be greatly appreciated.
[2020-04-06 20:24:27]
Sawtooth - Posts: 3980
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)
[2020-04-06 23:53:54]
WarriorTrader - Posts: 245
This may help: it is for the ES overnight coloring:

=OR(BARTIME >= ((16*60+30)/(24*60)), BARTIME < ((9*60+29)/(24*60)))
[2024-04-10 13:06:34]
Brad Haven - Posts: 7
=and(o[-1] < o[-2], l [-1]< l[-2],c[-1] < c[-2],h [-1]< h[-2])
then(l<l[-1])
then(o=and(o [-1] > o[-2], l [-1] > l[-2],c [-1] > c[-2],h [-1] > h[-2]) can anyone help with making this work to color bar by alert condition

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account