Hi there
Does anyone have the code for the standard/built in Bollinger Band indicator within Prorealtime? For some reason, it provides a significantly different reading/level to anything else I compare (compared to 3 other platforms/brokers) it to on identical settings.
Any help would be appreciated.
Thanks
Andrew
Here is the code of the Bollinger Bands:
period = 20
dev = 2.0
data = customclose
MA = average[period](data)
BolUp = MA+STD[period]*dev
BolDn = MA-STD[period]*dev
RETURN BolUp, BolDn
PiParticipant
New
I know this is an “old” post, but I react anyway:
Maybe the difference is in the MA. PRT uses expMovAv (exponentialAverage) and Nicolas uses SimpMovAv (Average) I think.
Gr. Pieter
@Pi
Did you spot any difference between this code and the original Bollinger Bands of the platform?
I confirm that BB uses SMA.
PiParticipant
New
Hi Nicolas,
I don’t have the PRT code, but I just compared the PRT BB and your BB in one chart and saw a different outcome.
Then I changed your BB SimpMovAv into a expMovAv, and the outcome was the same as the PRT BB. So then I knew.
I now made a combination indicator with BB and Keltner (both with the same SimpMovAv) so that I can easily change the periods, the BB deviation and the Keltner ATR-percentage with one action without opening the probuilder. (therefor you have to create indicator parameters named “per” (period) “dev” (BB deviation) and “ATR” (ATR-percentage)
Pieter
// you have to create indicator parameters named "per" (period) "dev" (BB deviation) and "ATR" (ATR-percentage)
period = per
dev = dev
data = customclose
MA = average[period](data)
BolUp = MA+STD[period]*dev
BolDn = MA-STD[period]*dev
MiddleMovingAverage=Average[per](close)
UpperKchannel=MiddleMovingAverage+ATR*AverageTrueRange[per](high)
LowerKchannel=MiddleMovingAverage-ATR*AverageTrueRange[per](low)
RETURN bolup as "BOLsim++", ma as "BOLkeltMA", BolDn as "BOLsim--", UpperKchannel AS "KeltSim hi",LowerKchannel AS "KeltSim Lo"