Login Page - Create Account

Support Board


Date/Time: Fri, 03 May 2024 22:03:02 +0000



Color Bars when n Bars above Moving Average.

View Count: 721

[2016-10-02 17:29:29]
User150371 - Posts: 70
Hello, I am trying to color bars after there has been a sequence of n bars whose Lows have been above a moving average. eg the Low of the last 10 bars has been above the 20 MA. I have tried using the Color Bar Based on Alert Condition and the following formula

=AND(L>ID:6.SG1,L[-1]>ID:6.SG1,L[-2]>ID:6.SG1,L[-3]>ID:6.SG1,L[-4]>ID:6.SG1,L[-5]>ID:6.SG1,L[-6]>ID:6.SG1,L[-7]>ID:6.SG1,L[-8]>ID:6.SG1,L[-9]>ID:6.SG1)

where ID:6.SG1 is the 20MA. But this is not achieving the desired results. Is there a better way to do this ? Thank you.
[2016-10-02 18:17:41]
Sawtooth - Posts: 3993
Two things:
-remove the : from the ID#
-use [-#] for each of the MAs

Try this:

=AND(L>ID6.SG1,L[-1]>ID6.SG1[-1],L[-2]>ID6.SG1[-2],L[-3]>ID6.SG1[-3],L[-4]>ID6.SG1[-4],L[-5]>ID6.SG1[-5],L[-6]>ID6.SG1[-6],L[-7]>ID6.SG1[-7],L[-8]>ID6.SG1[-8],L[-9]>ID6.SG1[-9])
[2016-10-02 18:57:08]
User150371 - Posts: 70
Thanks tomgilb for the correction. It works now.

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

Login

Login Page - Create Account