Login Page - Create Account

Support Board


Date/Time: Sat, 18 May 2024 04:55:25 +0000



[Programming Help] - Coloring bars if they are between two particular subgraphs

View Count: 631

[2020-12-20 16:18:48]
jeden8l - Posts: 46
Hello. Im a beginner trying to create a study alert.

I need to change the color of the bar if price (C) is between two subgraphs.
Color Bar Based On Alert Condition study will be used for further development, the [In:14= 0 or 1] will define the bars that can be used to search for buy or sell signal, but first of all I have to define the alert formula.
Example of the subgraphs canal is below, I have 6 canals, 12 subgraphs on the chart all together.

http://www.sierrachart.com/image.php?Image=1608480637965.png

I'm assuming this can be done in two ways:
1. If (C) is below ID4.SG7 and above ID:5.SG7
2. Change bar color if (C) crosses ID:4.SG7, ID:5.SG7 etc. for all 12 subgraphs.

I just need an alert formula please if anyone may help me.
[2020-12-20 17:38:45]
jeden8l - Posts: 46
Okay, I figured out how to define formula

=AND
(C<ID4.SG7, C>ID5.SG7)

but I had to put each formula alert for one canal to separate Color Bar Based On Alert Condition studies, it's 6 of them all together.
Is any chance to put all 6 formulas for all 6 canals in one Color Bar Based On Alert Condition study so the future algo will have to check In:14 in one study only?
[2020-12-21 17:36:24]
Sawtooth - Posts: 4000
Is any chance to put all 6 formulas for all 6 canals in one Color Bar Based On Alert Condition study
To color the bar if any one of the formulas are true, combine the ANDs with OR:
=OR(AND(C<ID4.SG7, C>ID5.SG7),AND(Condition2),,AND(Condition3),AND(Condition4),AND(Condition5),AND(Condition6))

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

Login

Login Page - Create Account