Login Page - Create Account

Support Board


Date/Time: Thu, 02 May 2024 09:53:58 +0000



[Programming Help] - Color Bar Based on Closing Price Above Bollinger Bands

View Count: 814

[2016-11-17 16:13:08]
User600819 - Posts: 43
Top bollinger Band is ID2.SG1. I'm attempting to create an alert that says count 5 bars that have closed above the top bollinger band after the first bar closed below the top bollinger band. Essentially, count the first five closes above the bollinger band. I attempted to create that below by having trying to think of a way to initiate the count which was count the last bar close below the top bollinger band and then start the count after that close. The fifth bar that closes above the top bollinger band should be highlighted.

My attempt which is not working:
=AND(C <= ID2.SG1[-5], C >= ID2.SG1[-4],C >= ID2.SG1[-3],C >= ID2.SG1[-2],C >= ID2.SG1[-1], C >= ID2.SG1)
[2016-11-17 22:38:20]
Sawtooth - Posts: 3989
You need to use the same offset for the Close as the BB.

Try this:

=AND(C[-5]<=ID2.SG1[-5],C[-4]>=ID2.SG1[-4],C[-3]>=ID2.SG1[-3],C[-2]>=ID2.SG1[-2],C[-1]>=ID2.SG1[-1],C>=ID2.SG1)
[2016-11-18 01:37:21]
User600819 - Posts: 43
Thanks worked perfect!

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

Login

Login Page - Create Account