The indicator on this screenshot approaches the effect where I am looking for the best.
Instead of the colored zones It would make the indicator more clear when the zones are replaced for historgrams.
Ok so to be clear, you want the middle of the Bollinger band (which is a simple MA) to be the the zero line?
@Marcel
This is the code of the indicator you described. Are you using it in a mean reversion theory? Or sign of exhaustion of the price in a trend following strategy? I may put this one into the library for the benefit of everyone.
period=20
c=Chandle[period](close)
avg=average[period](c)
osc=c-avg
middle=average[period](osc)
dev=std[period](osc)
up=middle+dev*2
dn=middle-dev*2
return osc coloured(200,0,0) style(histogram),up style(dottedline),dn style(dottedline), middle style(line)
Thanks a lot.
But unfortunately in your picture the histogram is not build from the (dynamic) BB midline like the colored zone on my picture.
I use this indicator as a sign of exhaustion of the price in a trend following strategy.
By the way I named the indicator ‘Pressure Gage’
To get the middle of your bollinger band at the zero level, you only need to substract an SMA20 to CMO, and that’s what the indicator did. But I made wrong bollinger up and down in my first code sorry, so this is the correct code:
period=20
c=Chandle[period](close)
avg=average[period](c)
dev=std[period](c)
upper=avg+dev*2
lower=avg-dev*2
osc=c-avg
up=upper-avg
dn=lower-avg
return osc coloured(200,0,0) style(histogram),up style(dottedline),dn style(dottedline)
Please find attached comparison of the 2 indicators.
Great work, Thanks a lot!
I get attached, is this correct for the code in #37654 ??
Hi Grahal,
My excuses for my late reaction, I was on a holliday in the sun for a while.
I have tweaked the pressure Gage indicator a little . I encluded the code of the indicator as I am using it now.
period=20
c=Chandle[period](close)
avg=average[period](c)
dev=std[period](c)
upper=avg+dev*2
lower=avg-dev*2
osc=c-avg
up=upper-avg
dn=lower-avg
if osc>0 then
r=0
g=0
b=102
endif
if osc<0 then
r=255
g=102
b=102
endif
return osc coloured(r,g,b) style(histogram),up style(dottedline),dn style(dottedline)