Support Board
Date/Time: Thu, 28 Nov 2024 15:39:07 +0000
[User Discussion] - coding help, colour based on alert
View Count: 289
[2023-04-20 23:42:12] |
User259724 - Posts: 43 |
Hello: I am coding a colour based on alert. Is there a method such that once a bar is coloured, that the next and subsequent bars are not coloured even if the condition is satisfied. For example, in a simple case, if I wanted a coloured bar if a moving average is lower in value than the previous bar. As we all know moving averages can be falling for many bars. So I want to have the bar only coloured if the previous bar did not fulfill the condition. This would prevent "colour bar fatigue" if only new bars were coloured. If you look at the attached photo, the question becomes much clearer. Is there a way to write the code "ID1.SG1<ID1.SG1[-1]", such that I only have the bars highlighted in yellow vertical lines coloured instead of all the bars. The code I am writing is more complicated, but maybe I can apply if it can work with simple code. Thanks for any help received. https://www.sierrachart.com/image.php?Image=1682033943282.png Date Time Of Last Edit: 2023-04-20 23:43:18
|
[2023-04-21 01:52:25] |
Tony - Posts: 522 |
Are you working on spread sheet or ACSIL coding?
|
[2023-04-21 10:26:42] |
User259724 - Posts: 43 |
I am trying to write the condition in the alert box of the color bar based on alert study condition.
|
[2023-04-21 12:04:14] |
Sawtooth - Posts: 4120 |
Is there a method such that once a bar is coloured, that the next and subsequent bars are not coloured even if the condition is satisfied.
Try this:=CROSSOVER(C,ID1.SG1) |
To post a message in this thread, you need to log in with your Sierra Chart account: