Hi, Im trying to make an indicator that will identify conditions when the market is ranging. I want to use the squeeze of the bollinger bands to tell me when the market is ranging.
Can anybody help me with a peice of code to do that?
I can finish the rest of the indicator myself I just need the code for the squeeze.
Thanks !
Hi 8284
Find attached a Bollinger Squeeze indicator that I often use. YOu can have a look to see if it helps.
Let me know how you get on.
whocares
Hi whocares,
your idea had occured to me before but I thought there could be another way to do it.
Thanks for the help though.
Hi whocares,
your idea had occured to me before but I thought there could be another way to do it.
Thanks for the help though.
You can try calculting the avarage of bandDifference (BandHigh - BandLow) for a set number of Bars. (make the number of Bars a variable so you can test at diffirent values). Then you can assume (and test this assumption) that when your bandDifference is less than the avarage (or a ratio of it) you are experiencing a squeeze. Then when your candle closes outside the bands you have your breakout.
What do you think?
whocares
Nope, this is a combination of systems. Its going to be a difficult task unless we can have a fixed minimum wherebye if the difference between the upper and lower bands fall below this number we can say the market is ranging.
My aim is to make an indicator that doesnt draw lines, just displays certain data about the market, price, etc. I would use the bands as a measure of whether the market is ranging or trending.
This is a noodle scratcher for me.
Nope, this is a combination of systems. Its going to be a difficult task unless we can have a fixed minimum wherebye if the difference between the upper and lower bands fall below this number we can say the market is ranging.
My aim is to make an indicator that doesnt draw lines, just displays certain data about the market, price, etc. I would use the bands as a measure of whether the market is ranging or trending.
This is a noodle scratcher for me.
Sorry I was a bit trigger happy and posted 2 notes before. Did you see this note?
You can try calculting the avarage of bandDifference (BandHigh - BandLow) for a set number of Bars. (make the number of Bars a variable so you can test at diffirent values). Then you can assume (and test this assumption) that when your bandDifference is less than the avarage (or a ratio of it) you are experiencing a squeeze. Then when your candle closes outside the bands you have your breakout.
What do you think?
whocares
Nope, this is a combination of systems. Its going to be a difficult task unless we can have a fixed minimum wherebye if the difference between the upper and lower bands fall below this number we can say the market is ranging.
My aim is to make an indicator that doesnt draw lines, just displays certain data about the market, price, etc. I would use the bands as a measure of whether the market is ranging or trending.
This is a noodle scratcher for me.
Sorry I was a bit trigger happy and posted 2 notes before. Did you see this note?
You can try calculting the avarage of bandDifference (BandHigh - BandLow) for a set number of Bars. (make the number of Bars a variable so you can test at diffirent values). Then you can assume (and test this assumption) that when your bandDifference is less than the avarage (or a ratio of it) you are experiencing a squeeze. Then when your candle closes outside the bands you have your breakout.
What do you think?
whocares
Sorry I was a bit trigger happy and posted 2 notes before. Did you see this note?
You can try calculting the avarage of bandDifference (BandHigh - BandLow) for a set number of Bars. (make the number of Bars a variable so you can test at diffirent values). Then you can assume (and test this assumption) that when your bandDifference is less than the avarage (or a ratio of it) you are experiencing a squeeze. Then when your candle closes outside the bands you have your breakout.
What do you think?
whocares
Hey thats a really good idea. A really good one. Thanks,Ill try it out.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi, Im trying to make an indicator that will identify conditions when the market is ranging. I want to use the squeeze of the bollinger bands to tell me when the market is ranging.
Can anybody help me with a peice of code to do that?
I can finish the rest of the indicator myself I just need the code for the squeeze.
Thanks !