honje19960321 wrote: Wed Aug 03, 2022 1:00 pm
Seems to be especially effective for range-bound trends
Don't buy this one.
Here's the Pinescript code. We can convert to MT4.
Code: Select all
//@version=4
study(title='Bermaui Deviation Percent', shorttitle='BDP', overlay=false)
//originally created by Muhammad Elbermawi
//https://www.mql5.com/en/blogs/post/718182
//Inputs
length = input(20)
src = input(close)
//Bermaui Deviation Percent
basis = sma(src, length)
dev = stdev(basis, length)
hh = highest(dev, length)
ll = lowest(dev, length)
bdp = ((hh - dev) / (hh - ll))*100
//Color Conditions
bull = (bdp < 90) and (src > basis)
bear = (bdp < 90) and (src < basis)
lowVolatility = bdp > 90
col = bear ? color.red : bull ? color.blue : lowVolatility ? color.white : na
//Plots
hline(90, color=color.white, linestyle=hline.style_dashed)
hline(10, color=color.white, linestyle=hline.style_dashed)
plot(bdp, color=col, linewidth=3)