Support Board
Date/Time: Sat, 11 Jan 2025 09:56:09 +0000
[Programming Help] - Color Bar Based on Closing Price Above Bollinger Bands
View Count: 897
[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: 4147 |
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: