Login Page - Create Account

Support Board


Date/Time: Fri, 07 Feb 2025 15:01:00 +0000



Color bar on alert detecting x consecutive bars

View Count: 92

[2025-01-14 18:52:04]
User474110 - Posts: 10
Hello,

I need to detect when x bars, for example 3, are consecutive (it means that alle the 3 bars are same direction, bullish or bearish).
This can be done with the Color bar on alert detecting or is necessary a different study, and eventually how?

For example, the 3 bars indicated by the arrow in the attached image.

Thank you,
E
imageImmagine 2025-01-14 083146.png / V - Attached On 2025-01-14 18:51:57 UTC - Size: 2.29 KB - 28 views
[2025-01-14 19:15:10]
John - SC Support - Posts: 37808
There are a number of ways to do this, including the Color Bar Based on Alert Condition. What exactly do you want to have occur when you have this situation occur (color a bar, place a marker, sound an alert, etc.)?

The general formula for testing for 3 up bars in a row would be the following:
=AND(C[-2] > O[-2], C[-1] > O[-1], C > O)

Where C is the Close of the bar, O is the Open of the bar and the [-2] [-1] reference the number of bars back from the current bar. Refer to the following:
Study/Chart Alerts And Scanning: Available Main Price Graph Identifiers/Variables

Study/Chart Alerts And Scanning: Referencing Data Other Than on the Last Bar/Column In the Chart
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2025-01-22 15:38:04]
User474110 - Posts: 10
Hello,

I have one more question about this topic.
It is possible to measure with a study the range of the last x bars and plot the result above the last bar.
What I mean is to measure this: H-L[-2] for example, and to plot this number above the last bar, and do it only when some conditions is valid.

Thank you,
Ervin
[2025-01-22 19:24:15]
John - SC Support - Posts: 37808
The following is a link to a Study Collection that gives the idea of how to do this:
https://www.sierrachart.com/AdditionalFiles/BarDifferenceOverValueOnLow.StdyCollct

Refer to the following for how to use a Study Collection:
Study Collections: Using a Study Collection Provided by Sierra Chart Support
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:

Login

Login Page - Create Account