Bollinger band different phase 1234
Forums › ProRealTime English forum › ProBuilder support › Bollinger band different phase 1234
- This topic has 15 replies, 4 voices, and was last updated 2 years ago by ZeroCafeine.
-
-
09/05/2022 at 3:55 PM #200187
hi everyone,
Do you know if there is a code here on the platform to detect the phases of the bollinger bands?
If it does not exist I would like to code it
Best Reguards,
ZeroCafeine09/05/2022 at 4:20 PM #200192I know this one available in the scripts library: https://www.prorealcode.com/prorealtime-indicators/multicolour-bollinger-bands-market-phases/
1 user thanked author for this post.
09/05/2022 at 4:31 PM #200193tks you Nicola, I saw it but I’m not sure it’s the same with different phase, tomorrow I will take my time to understand the code on the link you gave me and answer again, and tks again for quick answer
09/05/2022 at 5:27 PM #200201Phase 1 is one of those things which is easy with the eyes, but which needs coding criteria that may conclude differently for some cases… One way to not overcomplicate phase 1 coding is to consider bollinger bandwidth (variable bbw in code below) below a certain limit, chosen by user (variable bbwlimit in code below). Phases 2, 3, 4 are easy as soon as boll bandwidth is above your limit.
12345678910111213141516171819bbw=BollingerBandWidth[20](close)bsup=BollingerUp[20](close)binf=BollingerDown[20](close)bbwlimit=0.003if bbw<=bbwlimit thenphase=1elsif bsup>bsup[1] and binf<binf[1] thenphase=2elsif (bsup>bsup[1] and binf>binf[1]) or (bsup<bsup[1] and binf<binf[1]) thenphase=3elsif bsup<bsup[1] and binf>binf[1] thenphase=4elsephase=phase[1]endifreturn phase1 user thanked author for this post.
09/05/2022 at 7:29 PM #200209I will to try to understand you code tomorrow, but can you tell me from where or why 0.003 ?
09/06/2022 at 8:21 AM #200219Just read the explanation from JC in the last post, it is well explained IMO.
There is no “universal” setting accross time units and instruments to detect phase 1, so we need a trigger, that’s the reason 🙂
1 user thanked author for this post.
09/06/2022 at 8:31 AM #200220Tks you Nico ☺️
I totally agree with you, and I know it’s not easy, but I study a lot for it, I will try to make something correct, about the ph1 I know it’s not easy to detect but using the volatility cycle and some other idea it will be possible to make something, for detecting the ph1 I will use the ph3 and 4 and volatility for maybe try to detect the ph1, I will come back on this thread when I will in my office this afternoon
09/08/2022 at 10:21 AM #200349I know this one available in the scripts library: https://www.prorealcode.com/prorealtime-indicators/multicolour-bollinger-bands-market-phases/
tks you Nicola, I saw the code and try to understand it, it’s just based on moving average to detect the phase and I think it’s not like that, but it’s a good idea and it will help me to restart to program, tks again
Phase 1 is one of those things which is easy with the eyes, but which needs coding criteria that may conclude differently for some cases… One way to not overcomplicate phase 1 coding is to consider bollinger bandwidth (variable bbw in code below) below a certain limit, chosen by user (variable bbwlimit in code below). Phases 2, 3, 4 are easy as soon as boll bandwidth is above your limit.
12345678910111213141516171819bbw=BollingerBandWidth[20](close)bsup=BollingerUp[20](close)binf=BollingerDown[20](close)bbwlimit=0.003if bbw<=bbwlimit thenphase=1elsif bsup>bsup[1] and binf<binf[1] thenphase=2elsif (bsup>bsup[1] and binf>binf[1]) or (bsup<bsup[1] and binf<binf[1]) thenphase=3elsif bsup<bsup[1] and binf>binf[1] thenphase=4elsephase=phase[1]endifreturn phasetks again, I understand why 0.003
some can tell me how to do for my condition C1 and C2 is tru on a minimum of N bar ? I no want to use somethink like C1 = BBup > BBup[1] AND BBup[1] > BBup[2] AND …etc
123456789101112131415161718192021222324// (。♥‿♥。) Block StartBBup = BollingerUp[nBB](close)BBDown = BollingerDown[nBB](close)max1 = BollingerUp[nBB]min1 = BollingerDown[nBB]// Block End (。♥‿♥。)// (。♥‿♥。) Block Start// Conditions : C1/C2C1 = BBup > BBup[1] //AND BBup[1] > BBup[2] AND BBup[2] > BBup[3]C2 = BBDown < BBDown[1] //AND BBDown[1] < BBDown[2] AND BBDown[2] < BBDown[3]Signal = 0// Block End (。♥‿♥。)AllCondition = C1 AND C2IF AllCondition ThenSignal = 1DRAWCANDLE(max1, min1, max1, min1) Coloured (0, 255, 0, 42)ELSESignal = 0ENDIFReturn09/08/2022 at 11:51 AM #200357I will try with some For boucle and come back when I have somethink
09/08/2022 at 12:27 PM #200366Hoi @ZeroCafeine
Alternatively, you could use the conditions for Phase 2 (expansion / increase in volatility):
Fase 2 => BBup > BBup[n] and BBDown < BBDown[n]
In collaboration with the slope of the average for determining the direction of the price .
1 user thanked author for this post.
09/09/2022 at 10:29 AM #200407Hoi @ZeroCafeine
Alternatively, you could use the conditions for Phase 2 (expansion / increase in volatility):
Fase 2 => BBup > BBup[n] and BBDown < BBDown[n]
In collaboration with the slope of the average for determining the direction of the price .
tks for your help, it’s a nice idea to use the slope of the average but for me I use it now just in the ph3, it’s can help, in ph2 is more complicated,
Now I got this result but it’s just based on the direrction of the BB, I have to work more for solve some small probleme before to go to more complicated09/09/2022 at 10:53 AM #200414Hi @ZeroCafeine
Looks very good, you can now clearly see the different phase…
You can still try what I suggested:
Instead of, for example:
BBup > BBup[1] and BBDown < BBDown[1]
BBup > BBup[n] and BBDown < BBDown[n]
Where you give n a certain value, for example 20
As a result, the phases will jump less quickly, and the graph will become “calmer”
1 user thanked author for this post.
09/09/2022 at 11:02 AM #200417hi every one,
I need you help pls on the ph3, you can see my picture, the ph3 start in 1 and finish in 2, so condition is :
-1) First condition the upper band turns over (only the first time), we don’t need to check what happens afterwards on the upper band as long as the lower band is descending (in the whole part 3)
-2) Second condition, the lower band turns over, in our exemple in point 2 ( and we need only the first turn over)tks in advance for any help or idea or link
that is my code for ph31234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556//(。♥‿♥。)================================================(。♥‿♥。)// Setup: SAGAT Ph3// Code: # Sagat Ph3 v// Version 1// Index:// TF:// Spread:// Date: 08/09/2022// Notes: Detection de Phase 3 Bollinger//// Attribus:// - BBup / BBDown// -// -// Conditions:// - C1/C2/C3 -> Ph3 Haussiere// - C4/C5/C6 -> Ph3 Baissiere//(。♥‿♥。)================================================(。♥‿♥。)// (。♥‿♥。) Block Start// Block End (。♥‿♥。)// (。♥‿♥。) Block StartBBup = BollingerUp[nBB](close)BBDown = BollingerDown[nBB](close)BBSMA = Average[nBB]max1 = BollingerUp[nBB]min1 = BollingerDown[nBB]// Block End (。♥‿♥。)// (。♥‿♥。) Block Start// Conditions : C1/C2C1 = BBup > BBup[1] //AND BBup[1] > BBup[2] AND BBup[2] > BBup[3]C2 = BBDown > BBDown[1] //AND BBDown[1] < BBDown[2] AND BBDown[2] < BBDown[3]C3 = BBSMA > BBSMA[1]C4 = BBup < BBup[1] //AND BBup[1] > BBup[2] AND BBup[2] > BBup[3]C5 = BBDown < BBDown[1] //AND BBDown[1] < BBDown[2] AND BBDown[2] < BBDown[3]C6 = BBSMA < BBSMA[1]Signal = 0// Block End (。♥‿♥。)AllConditions = C1 AND C2 AND C3 OR C4 AND C5 AND C6IF AllConditions ThenSignal = 1DRAWCANDLE(max1, min1, max1, min1) Coloured (0, 153, 255, 42)ELSESignal = 0ENDIFReturnBest Reguards
09/09/2022 at 11:19 AM #200420@JS
tks for your answer, I saw it only now, maybe my second question can answer you, the problem with a code like BBup > BBup[n] and BBDown < BBDown[n] it’s not good for me, because I have to control each BB and not just the BB[0] with the BB[n], I have to know what happen with the BB1, BB2, …., BB[n]09/09/2022 at 11:26 AM #200421hi every one,
I need you help pls on the ph3, you can see my picture, the ph3 start in 1 and finish in 2, so condition is :
-1) First condition the upper band turns over (only the first time), we don’t need to check what happens afterwards on the upper band as long as the lower band is descending (in the whole part 3)
-2) Second condition, the lower band turns over, in our exemple in point 2 ( and we need only the first turn over)
tks in advance for any help or idea or link
that is my code for ph3
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556//(。♥‿♥。)================================================(。♥‿♥。)// Setup: SAGAT Ph3// Code: # Sagat Ph3 v// Version 1// Index:// TF:// Spread:// Date: 08/09/2022// Notes: Detection de Phase 3 Bollinger//// Attribus:// – BBup / BBDown// –// –// Conditions:// – C1/C2/C3 -> Ph3 Haussiere// – C4/C5/C6 -> Ph3 Baissiere//(。♥‿♥。)================================================(。♥‿♥。)// (。♥‿♥。) Block Start// Block End (。♥‿♥。)// (。♥‿♥。) Block StartBBup = BollingerUp[nBB](close)BBDown = BollingerDown[nBB](close)BBSMA = Average[nBB]max1 = BollingerUp[nBB]min1 = BollingerDown[nBB]// Block End (。♥‿♥。)// (。♥‿♥。) Block Start// Conditions : C1/C2C1 = BBup > BBup[1] //AND BBup[1] > BBup[2] AND BBup[2] > BBup[3]C2 = BBDown > BBDown[1] //AND BBDown[1] < BBDown[2] AND BBDown[2] < BBDown[3]C3 = BBSMA > BBSMA[1]C4 = BBup < BBup[1] //AND BBup[1] > BBup[2] AND BBup[2] > BBup[3]C5 = BBDown < BBDown[1] //AND BBDown[1] < BBDown[2] AND BBDown[2] < BBDown[3]C6 = BBSMA < BBSMA[1]Signal = 0// Block End (。♥‿♥。)AllConditions = C1 AND C2 AND C3 OR C4 AND C5 AND C6IF AllConditions ThenSignal = 1DRAWCANDLE(max1, min1, max1, min1) Coloured (0, 153, 255, 42)ELSESignal = 0ENDIFReturnBest Reguards
and other photo maybe can help, I want to detect only the 1 and 4, the point 2 and 3 it’s not important
-
AuthorPosts
Find exclusive trading pro-tools on