MarcoValente

Alpha/Bars converter

35
Simple tool to convert alpha in Bars length period. Often MA period's are express in alpha ratio, and become difficult to visualize the MA length's . Now you can convert alpha in to periods, and periods in alpha
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?
//@version=2
//Convert the period length (bars) in alpha using traditional ratio a=2/(n+1) , and reverse.
// By Marco
study("Alpha/Bars converter")
N=input(28,title="Period (Bars)"),aph=input(.07,step=0.001,title="Alpha")
alpha=2 / (N + 1),nbar=round(2/aph)-1
plot(alpha,title="Alpha Ratio",color=red),plot(nbar,title="Period (Bars)",color=red)