Bollinger band contraction in programming
Forums › ProRealTime English forum › ProBuilder support › Bollinger band contraction in programming
- This topic has 6 replies, 2 voices, and was last updated 2 years ago by ZeroCafeine.
Tagged: bands, BB, Bollinger, bollinger bands, contraction, squeeze
-
-
03/28/2022 at 3:31 PM #190668
Hi all,
How to detect a Bollinger band contraction in Probuilder programming, I haven’t started yet, do you have any leads or ideas, I thought for example to measure the angles of the moving average that constitute the Bollinger bands, or perhaps an average angle calculation of the upper or upper and lower bands at the same time
Best Reguards
03/28/2022 at 4:38 PM #190674Have you tried Bollinger Band Width ? BollingerBandWidth
and measure a statistical width with a long term average applied to it.
1 user thanked author for this post.
03/28/2022 at 4:41 PM #190676another usual way to check bandwidth contraction is the “bollinger squeeze”: TTM Squeeze Oscillator and On price version
it checks if current standard deviation of volatility (Bbands) is located inside the average of candlesticks true range (keltner bands).
1 user thanked author for this post.
03/28/2022 at 9:21 PM #190684Have you tried Bollinger Band Width ? BollingerBandWidth
and measure a statistical width with a long term average applied to it.
tks you Nicolas, I tried quickly the result of the search indicator and I found the “BandWith”, I think it’s the same you showed me (the second indicator in the picture), the third one it’s the same but I removed the BBwidthSlow = BollingerBandWidth[30](close) and calculate just an Average on the the bandwith with 9 periode like a signal line, I will also check the history discus on the page indicator,
how to detect the flat part of the indicator ? I will try this methode of you on youtube and see what king of result I will find
03/29/2022 at 8:28 AM #190699Bollingerbandwidth is an internal instruction I gave you the link above 🙂
https://www.prorealcode.com/documentation/bollingerbandwidth/
It returns the value of the bollinger bands width in price. There is a also a normalized version named %BBands: https://www.prorealcode.com/prorealtime-indicators/b-bollinger/
1 user thanked author for this post.
03/29/2022 at 9:33 AM #190704It returns the value of the bollinger bands width in price. There is a also a normalized version named %BBands: https://www.prorealcode.com/prorealtime-indicators/b-bollinger/
tks you, I add it in the last in the photo and drawed a 0 ligne because I saw that the value can be negative, at first glance I do not see how we can detect a compression with this indicator, again thank you for all your answers I will search more and see what I can do
Best Reguards
03/31/2022 at 2:41 PM #190865when you said a statistical width with a long term average applied to it. I don’t understand a statistical ?
I do for exemple the the difference betwen the BBwidth and BBwidthSlow (it’s the differnce between the Slow and fast average like the MACD betwen 2 average),but after if I do an average of this variabl I get the same problem of how to determinate the good value of contraction, I do for exemple trying to get my maximum and minimum and try to find the condition is true when theis last value is under 10% from the highest value, but not working correctly
exemple :
1234567BBwidth = BollingerBandWidth[20](close)BBwidthSlow = BollingerBandWidth[21](close)BBMACD = ABS( BBwidth - BBwidthSlow )MMABS = Average[10](BBMACD)Return MMABSsecond solution, I’m trying to get the highest value of the difference between the slow and the fast with and try to find the contraction, sorry for my code is a mess (it’s not the final code ) :
123456789101112131415161718192021222324252627BBwidth = BollingerBandWidth[20](close)BBwidthSlow = BollingerBandWidth[21](close)ZeroLine = 0// LEs Extremes//BBHighest = Highest[200](BBwidthSlow)//BBLowest = Lowest[200](BBwidthSlow)BBMACD = ABS( BBwidth - BBwidthSlow )BBMACDHighest = 0ABSHighest = 0ABSHighest = Highest[20](BBMACD)ABSLowest = Lowest[50](BBMACD)//BBLowest2 = Min(BBLowest,0)XPourcent = 10ContractionBB = (XPourcent / 100) * ABSHighestC1 = BBMACD < ContractionBBCondition1 = summation[10](C1) = 30IF Condition1 ThenBACKGROUNDCOLOR (0, 255, 10, 25)ENDIFRETURN BBwidth AS "Fast", BBwidthSlow AS "Slow", BBMACD AS "BB ABS MACD", ABSHighest AS "ABS Highest", ABSLowest AS "ABS Lowest", ContractionBB AS "Contraction BB"//MMABS = Average[10](BBMACD)//Return MMABSany new idea for find the contraction is welcom
Best Reguards
-
AuthorPosts
Find exclusive trading pro-tools on