Login Page - Create Account

Support Board


Date/Time: Tue, 07 May 2024 09:43:18 +0000



Error Referencing Previous Color Bar Alert Code

View Count: 1211

[2018-05-10 15:43:23]
a Gem Tree - Posts: 60
When I try to reference a previous "color bar based on alert code"...

I can only reference the bars in which the 'color bar' code did not trigger:
IE. =AND(ID1.SG1=0)

I cannot reference the bars in which the 'color bar' code is true
IE. =AND(ID1.SG1=1) --->> This does not to work!
I've also tried saying, ID1.SG1=TRUE, which also does not work.

Any ideas as to what might be wrong?
[2018-05-10 18:55:02]
Sierra Chart Engineering - Posts: 104368
It does work properly. The problem is your formula. You should not be using the AND unless you have more than one item to check. Your formula should just be =ID1.SG1>0.

For future reference, here is the information on the AND function:
https://www.sierrachart.com/index.php?page=doc/SpreadsheetFunctions.html#AND_Function

Also refer to:
http://www.sierrachart.com/index.php?page=doc/StudyChartAlertsAndScanning.php#ReferencingDataOtherLastBar
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2018-05-10 18:56:28
[2018-05-10 19:34:00]
a Gem Tree - Posts: 60
Unfortunately for me, it does not work, whether I add the =AND statement, or if I just write it as:
=ID4.SG1=1

I have made a long list of parameters in the first color bar study, all of which are linked by an OR statement.
=OR(ID1.SG1[-1]>X,ID1.SG1[-2]>X,ID1.SG1[-3]>X)
Then, I am including whether the first Color Bar study had triggered / happened as a parameter in the second alert code study
" =ID4.SG1=1 "


The above statement " =ID4.SG1=1 " Does not cause any syntax errors, however, the color bar study fails to show a trigger event, and when referenced shows that it is referencing no bars at all.

However, I can type " =ID4.SG1=0 ". This shows a trigger event in all the opposing bars that I don't want to reference.
Also, as far as I can tell, =AND statements don't require 2 things. They work with just one parameter.





https://imgur.com/a/TYHS7mE

Here's a picture of a color bar (which uses deep blue colored bar) referencing another color bar study (which uses a Purple Star).
When the second, deep blue, color bar has its alert set to = 0, it references / triggers on all bars but the one in question.
When the second, deep blue, color bar has its alert set to = 1, it references / triggers on nothing.

THERE SHOULD BE, a DEEP BLUE bar on the last bar with a purple star.


Here's another, more simplified chart with only 3 studies.
https://imgur.com/a/xxXzxQj

The second color bar study (study ID 3), should be placing a white bar over the first color bar study's deep blue bar.
It works on all the bars other than the first color bar's trigger. " =ID2.SG1=0 "
But it doesn't work when set to " =ID2.SG1=1 "
Date Time Of Last Edit: 2018-05-10 20:47:11
[2018-05-11 14:32:55]
John - SC Support - Posts: 31419
Check the settings for the Color Bar Based on Alert Condition studies:
- On the Second Color Bar study: Be sure that the Based On is set to the First Color Bar Based on Alert Condition.
- On the Second Color Bar Study: Be sure that the Input Data is set to Color Bar.

For additional steps related to this, refer to:
Color Bar Based on Alert Condition: Coloring Subgraphs of Other Studies

- On the First Color Bar Study: Be sure that the Output When Condition True is 1.

We have tried this ourselves, and it does work correctly.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2018-05-11 20:32:28
[2018-05-11 20:32:36]
Sierra Chart Engineering - Posts: 104368
The prior post has been updated.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, *change* to 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