Bollinger Band Pinbar Indicator
Forums › ProRealTime English forum › ProBuilder support › Bollinger Band Pinbar Indicator
- This topic has 14 replies, 3 voices, and was last updated 1 year ago by Jdh320.
-
-
01/08/2023 at 11:36 AM #207031
Hello PRT Coders, Happy New Year. I hope you all enjoyed the festive break. Does anyone know if it is possible to code an indicator that draws an arrow above/below a sell/buy condition. The condition would be if price opens inside the bollinger band breaks outside of it and returns to close back in the band forming a pinbar?
Please see attached photo (as I am sure I havn’t explained it well!!)
Regards
Joe
01/08/2023 at 11:58 AM #20703201/08/2023 at 12:01 PM #20703301/08/2023 at 12:01 PM #20703401/08/2023 at 12:14 PM #20703501/08/2023 at 12:18 PM #20704101/08/2023 at 12:22 PM #20704501/08/2023 at 12:23 PM #20704601/08/2023 at 12:32 PM #207047Hi Joe,
Here is the indicator…
BB PinBars12345678If Open<BollingerUp[20](close) and High>BollingerUp[20](Close) and Close<BollingerUp[20](Close) and Close>Open then //Bullish PinBarDrawArrowDown(BarIndex,High+20*pipsize) coloured("Red")EndIfIf Open>BollingerDown[20](close) and Low<BollingerDown[20](Close) and Close>BollingerDown[20](Close) and Close<Open then //Bearish PinBarDrawArrowUp(BarIndex,Low-20*pipsize) Coloured("Green")EndIfReturn01/08/2023 at 12:35 PM #20704901/08/2023 at 12:43 PM #207050Hi JS
I have had a little look and I think the code is almost right, I have attached a screenshot and annotated arrows where I would have expected them.
so the candle opens inside the BB breaks outside and closes back inside. It can be both a bullish or a bearish pinbar in each scenario with a body height of I guess about 15% or less of the candle high minus low.
01/08/2023 at 3:40 PM #207058Hi @jdh320,
Hereby the adjusted indicator with both bullish and bearish pinbar breakthroughs…
You can set the percentage of the body yourself (now stands at 30%) …
BB PinBars v212345678If Open<BollingerUp[20](close) and High>BollingerUp[20](Close) and Close<BollingerUp[20](Close) and abs(Close-Open)<=0.30*(High-Low) then //Bullish PinBarDrawArrowDown(BarIndex,High+20*pipsize) coloured("Red")EndIfIf Open>BollingerDown[20](close) and Low<BollingerDown[20](Close) and Close>BollingerDown[20](Close) and abs(Close-Open)<=0.30*(High-Low) then //Bearish PinBarDrawArrowUp(BarIndex,Low-20*pipsize) Coloured("Green")EndIfReturn01/08/2023 at 4:43 PM #207066Please do not embed pictures and files in your post, as it slows down the loading of pages. To attach them use the “Select File” button, instead.
Thank you 🙂
01/08/2023 at 5:14 PM #20707901/08/2023 at 5:14 PM #207081 -
AuthorPosts
Find exclusive trading pro-tools on