Could someone convert Wave-PM from TradingView?


New member
The indicator is Wave-pm and I honestly think its the best volatility indicator there is. If someone could help me translate this into think script It would be awesome :D.


fastPeriod = input(14, "Fast Period", input.integer, minval=5, maxval=1000)
slowPeriod = input(55, "Slow Period", input.integer, minval=5, maxval=1000)
slowerPeriod = input(100, "Slow Period", input.integer, minval=5, maxval=1000)
multiplier = input(2.2, "Stddev Multiplier", input.float, minval=1, maxval=5)

wpm(length) =>
    dev = multiplier * stdev(close, round(length))
    dev1 = pow(dev / syminfo.pointvalue, 2)
    temp = sqrt(sma(dev1, 100)) * syminfo.pointvalue
    temp := temp != 0  ? dev/temp : temp
    return = if temp > 0
        iexp = exp(-2*temp)
        iexp = exp(2*temp)

val1 = wpm(fastPeriod)
val2 = wpm(slowPeriod)
val3 = wpm(slowerPeriod)

plot(val1, title="Fast",, style=plot.style_line, linewidth=2)
plot(val2, title="Slow",, style=plot.style_line, linewidth=2)
plot(val3, title="Slower", color=color.yellow, style=plot.style_line, linewidth=2)

hline(0.9, title="Danger",, linestyle=hline.style_dotted)
hline(0.7, title="Breakout",, linestyle=hline.style_dotted)
hline(0.5, title="Consolidation",, linestyle=hline.style_dotted)
hline(0.35, title="Gear Change",, linestyle=hline.style_dotted)

I came across wave-pm from crypto traders but never seen it used on stocks. Originally made for forex by mark whistler. The indicator aims to detect the weight of the pairs trading. Its like a rsi with no directional signal rather a prediction of volatility . I plan to use this on tos so I can scan penny stocks since I think this indicator does exceptionally well. The only problem being the window of entry being very short.
Last edited by a moderator:

Similar threads