Login Page - Create Account

Support Board


Date/Time: Thu, 28 Nov 2024 17:52:58 +0000



Post From: coding help, colour based on alert

[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