Support Board
Date/Time: Mon, 21 Apr 2025 13:08:38 +0000
Logic for Alert condition, colour bar
View Count: 162
[2025-02-26 16:44:29] |
User616054 - Posts: 25 |
Hello Sierra Support I find the alert conditions to colour bars very helpful it’s a fantastic feature in Sierra! Can you possibly help me with the correct logic to colour bars based on OHLC candle stick data… I would like to colour a bar if for example there is price rejection to the downside/upside. Let’s look at downside price rejection for example, if there’s a difference of at least 10 handles/40 ticks in the NQ between the low and close price on a down candle then colour the bar. How would this example be written in the alert condition please? |
[2025-02-26 17:17:31] |
John - SC Support - Posts: 39362 |
The alert condition for the down bar situation would be the following: =IF(C < O, C - L >= 10.00, 0) Where C is the Close of the bar, O is the Open of the bar, and L is the Low of the bar. Refer to the following: Study/Chart Alerts And Scanning: Available Main Price Graph Identifiers/Variables For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2025-02-26 18:00:58] |
User616054 - Posts: 25 |
Thank you John that’s really helpful. Would you help me to add another layer to the logic aswell… to reduce the noise, is there a way to colour bar only if 2 or more ‘true’ instances exist between the low and close zone. I understand this will be a little more complex. |
[2025-02-26 18:28:49] |
John - SC Support - Posts: 39362 |
What do you mean by "2 or more 'true' instances exist between the low and close zone"? We do not understand what this is referring to.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2025-02-26 18:59:53] |
User616054 - Posts: 25 |
Sorry thats my fault for not explaining the scenario well. When the condition "=IF(C < O, C - L >= 10.00, 0)" is 'true' which colours the bar. I actually only want to colour the bar if another bar also meets the same condition where C and L overlap on C and L for 2 or more bars. Date Time Of Last Edit: 2025-02-26 19:08:16
|
[2025-02-26 19:08:00] |
John - SC Support - Posts: 39362 |
So you want the same condition to be true for the current bar and two bars prior? So the two bars prior must also be down bars and also have a Close that is at least 10 points away from the Low?
For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2025-02-26 19:09:23] |
User616054 - Posts: 25 |
Correct, where there is effectively a cluster of price rejections.
|
[2025-02-26 19:26:08] |
John - SC Support - Posts: 39362 |
Here is the logic to test one bar back and the current bar: =AND(C < O, C - L >= 10.0, C[-1] < O[-1], C[-1] - L[-1] >= 10.0) Where the notation of [-1] denotes one bar back. Refer to the following: Study/Chart Alerts And Scanning: Referencing Data Other Than on the Last Bar/Column In the Chart We leave it to you to extend this to additional bars (just follow the pattern). For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
[2025-02-26 20:04:17] |
User616054 - Posts: 25 |
Yes I understand the pattern, thank you for helping. One more refinement, the logic colours one of the bars, how do I amend to colour both bars please? |
[2025-02-26 20:17:19] |
John - SC Support - Posts: 39362 |
To get the previous bar coloring as well, you would need to use the "Study Subgraph Reference" study and set it to be based on the "Color Bar Based on Alert Condition" study, as well as the referenced Study and Subgraph to be the "Color Bar Based on Alert Condition" study and "Color Bar" subgraph. Make sure to set the option for "Draw Zeros" to "No" and the Region to be "Region 1". You may also want to set the "Scale" for this study to be "Same as Region". Then, in the Subgraphs tab you would need to change the "Draw Style" to be "Color Bar" and you would set the "Displacement for that subgraph to be "-1". Refer to the following: Study Subgraph Reference Chart Studies: Settings and Inputs Tab >> Based On - Basing a Study on Another Study Chart Studies: Settings and Inputs Tab >> Chart Region Chart Studies: Settings and Inputs Tab >> Scale Chart Studies: Color Bar (ACSIL: DRAWSTYLE_COLOR_BAR) Chart Studies: Subgraphs Tab >> Displacement For the most reliable, advanced, and zero cost futures order routing, use the Teton service: Sierra Chart Teton Futures Order Routing |
To post a message in this thread, you need to log in with your Sierra Chart account: