Login Page - Create Account

Support Board


Date/Time: Fri, 07 Feb 2025 14:58:25 +0000



[User Discussion] - Spreadsheet formula change a study color

View Count: 449

[2022-10-11 00:52:32]
gabriel_demers - Posts: 12
Hey I want to use a keltner channel and change the middle line to green when we have a close above the top band and then it need to stay green until we get a close below the lower band where we will switch the color to red, from my understanding the spreadsheet formula would be my best to do that but I can't change the color of a different study with it is there another way? I have already tried the color based on alert condition study but it don't work because as soon as the bar stop to close above the top or lower band the color reset to the original color

Thanks a lot
[2022-10-11 01:46:08]
Sawtooth - Posts: 4173
Using the Color Bar Based On Alert Condition study, create a persistent TRUE for one condition and release it when the opposite condition is TRUE.
Then do the opposite in a second instance of the color bar study.

1. Add the Color Bar Based On Alert Condition study
- Set the 'Output When Condition True' to 'Study Subgraph Reference'
- Set the 'Study Subgraph Reference Value When True' to the ID#.SG1 of the Keltner Channel study.
- Set the Draw Style to Line - Skip Zeros
- Set the line color to Green
- Use a formula like this on the Alerts tab:
=IF(C>ID3.SG2,1,IF(C<ID3.SG3,0,ID5.SG1[-1]))
where ID3 is the Keltner study, and ID5 is this color bar study.

2. Duplicate the above color bar study
- Set the line color to Red
- Use a formula like this on the Alerts tab:
=IF(C<ID3.SG3,1,IF(C>ID3.SG2,0,ID6.SG1[-1]))
where ID3 is the Keltner study, and ID6 is this color bar study.

Note: the Keltner Channel study must be above both color bar studies in the Studies to Graph list.
[2022-10-11 13:01:57]
gabriel_demers - Posts: 12
It work great thanks a lot !

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

Login

Login Page - Create Account