HPotter

Volatility

The Volatility function measures the market volatility by plotting a
smoothed average of the True Range. It returns an average of the TrueRange
over a specific number of bars, giving higher weight to the TrueRange of
the most recent bar.

Script open-source

Nello spirito di condivisione promosso da TradingView, l'autore (al quale vanno i nostri ringraziamenti) ha deciso di pubblicare questo script in modalità open-source, così che chiunque possa comprenderlo e testarlo. Puoi utilizzarlo gratuitamente, ma il riutilizzo del codice è subordinato al rispetto del Regolamento. Per aggiungerlo al grafico, mettilo tra i preferiti.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.

Vuoi usare questo script sui tuoi grafici?
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 29/05/2014
// The Volatility function measures the market volatility by plotting a 
// smoothed average of the True Range. It returns an average of the TrueRange 
// over a specific number of bars, giving higher weight to the TrueRange of 
// the most recent bar.
////////////////////////////////////////////////////////////
study(title="Volatility", shorttitle="Volatility")
Length = input(10, minval=1)
xATR = atr(Length)
nRes = ((Length - 1) * nz(nRes[1], 0) + xATR) / Length
plot(nRes, color=blue, title="Volatility")