Skip to content

charton API


charton API / @chart-on/ta / historicalVolatility

Function: historicalVolatility() ​

historicalVolatility(values, length, periodsPerYear, out?, returns?): Float64Array

Defined in: volatility.ts:365

Historical volatility in percent: the stdev of the last length log returns, annualized by sqrt(periodsPerYear) (252 trading days for daily bars, for example). Lookback length. NaN when the window holds a NaN or a value that is not positive.

Pass returns to keep the log returns for historicalVolatilityAt.

Parameters ​

values ​

Series

length ​

number

periodsPerYear ​

number

out? ​

Float64Array<ArrayBufferLike>

returns? ​

Float64Array<ArrayBufferLike>

Returns ​

Float64Array