Bollinger Bands with Shift (offset)
Forums › ProRealTime English forum › ProBuilder support › Bollinger Bands with Shift (offset)
- This topic has 9 replies, 3 voices, and was last updated 4 years ago by robertogozzi.
-
-
08/06/2019 at 1:50 PM #10428208/06/2019 at 2:48 PM #104285
What do you want to be shifted?
08/06/2019 at 3:33 PM #104287Hi
What I do need is the bollinger bands as follows Standard in brackets:
Periods: (20)
Shift/Offset days: ()
Standard Deviation: (2.0)
Then it offers me a chance to set it up as I wish with various day, sd and shift parameters.
Thanks
08/06/2019 at 5:45 PM #104294There you go:
BB - Bollinger Bands custom (standard)12345678//BBVal= 20 //20 periods BB//BBdev= 2.0 //2.0 deviation BBBBval = max(2,min(999,BBval)) //2 - 999BBdev = max(1.0,min(99.9,BBdev)) //1.0 - 99.9BBavg = average[BBval,1](close) //BB mean (middle line) - 1=emaBollUp = BBavg + ((std[BBval](close)) * BBdev) //BB Upper BandBollDn = BBavg - ((std[BBval](close)) * BBdev) //BB Lower BandRETURN BBavg AS "Mean",BollUp AS "Top",BollDn AS "Bottom"BB - Bollinger Bands shifted12345678910//BBVal = 20 //20 periods BB//BBdev = 2.0 //2.0 deviation BB//ShiftNum= 0 //0 numbers of shifted periodsBBval = max(2,min(999,BBval)) //2 - 999BBdev = max(1.0,min(99.9,BBdev)) //1.0 - 99.9ShiftNum = max(0,min(99,ShiftNum)) //0 - 99BBavg = average[BBval,1](close[ShiftNum]) //BB mean (middle line) - 1=emaBollUp = BBavg + ((std[BBval](close[ShiftNum])) * BBdev) //BB Upper BandBollDn = BBavg - ((std[BBval](close[ShiftNum])) * BBdev) //BB Lower BandRETURN BBavg AS "Mean",BollUp AS "Top",BollDn AS "Bottom"you cam import attached ITF file(s).
I hope that’s what you wanted (0=no shifting, 1=shift 1 period, ……).
08/06/2019 at 6:44 PM #104305Hi Robertogozzi,
Thank you very much for your assistance. Perhaps I did not explain myself well. What I mean by shift is to be able to move the bands forward (+ number) or backward (- number). for example here is an example on MT4.
The indicator you have provided is not doing that as shown.
Thanks again.
08/06/2019 at 7:02 PM #10431108/06/2019 at 11:12 PM #10431905/20/2020 at 9:16 AM #132354@Jozo
Sorry for not replying to you. I missed it. Indeed only PRT can plot into the future (like Ichimoku), not us users!
Actually v11.x allows to plot objects into the future, but not returned data.
10/21/2020 at 10:21 PM #14803410/22/2020 at 6:45 PM #148118There you go:
BB - Bollinger Bands Shifted LEFT12345678910111213141516//BBVal = 20 //20 periodi BB//BBdev = 2.0 //2.0 deviazione BB//ShiftNum= 0 //0 numbers of shifted periods o the LEFTBBval = max(2,min(999,BBval)) //2 - 999BBdev = max(1.0,min(99.9,BBdev)) //1.0 - 99.9ShiftNum = max(0,min(99,ShiftNum)) //0 - 99IF BarIndex > (BBval + ShiftNum) THENBBavg = average[BBval,1](close) //BB mean (middle line) - 1=emaBollUp = BBavg + ((std[BBval](close)) * BBdev) //BB Upper BandBollDn = BBavg - ((std[BBval](close)) * BBdev) //BB Lower BandBarNum = BarIndex - ShiftNumDRAWSEGMENT(BarNum[1],BBavg[1] ,BarNum,BBavg) coloured(255,0,0,255)DRAWSEGMENT(BarNum[1],BollUp[1],BarNum,BollUp) coloured(0,0,255,255)DRAWSEGMENT(BarNum[1],BollDn[1],BarNum,BollDn) coloured(0,0,255,255)ENDIFRETURNsince no data are RETURNed (it plots lines with a graphical instruction), the cursor cannot show any info about these bands.
In my screenshot the upper chart is shifted leftwards by 3 bars.
-
AuthorPosts
Find exclusive trading pro-tools on