Volatility
Volatility Indicators — Measure the magnitude of price fluctuations.
Functions
ATR — Average True Range NATR — Normalized Average True Range TRANGE — True Range CHAIKIN_VOL — Chaikin Volatility MASS — Mass Index BBPERCENT — Bollinger %B BBWIDTH — Bollinger Bandwidth HISTORICAL_VOLATILITY — Annualized close-to-close volatility ULCER_INDEX — Ulcer Index STARC — Stoller Average Range Channels
- ferro_ta.volatility.ATR(high, low, close, timeperiod=14, *, nan_policy='propagate')[source]
Average True Range.
- Parameters:
high (array-like) – Sequence of high prices.
low (array-like) – Sequence of low prices.
close (array-like) – Sequence of closing prices.
timeperiod (int, optional) – Smoothing period (default 14).
nan_policy ({"propagate", "skip"}, optional) –
"propagate"(default, TA-Lib semantics): a NaN input poisons every later value."skip": rows with a non-finite input are dropped, the indicator runs on the remaining rows, and NaN is written back at the dropped rows (matches the streaming classes tick for tick).
- Returns:
Array of ATR values; leading
timeperiod - 1entries areNaN.- Return type:
- ferro_ta.volatility.BBPERCENT(close, timeperiod=5, nbdevup=2.0, nbdevdn=2.0)[source]
Bollinger %B —
(close - lower) / (upper - lower).- Parameters:
- Returns:
Array of %B values. Leading
timeperiod - 1entries areNaN.- Return type:
- ferro_ta.volatility.BBWIDTH(close, timeperiod=5, nbdevup=2.0, nbdevdn=2.0)[source]
Bollinger Bandwidth —
(upper - lower) / middle.- Parameters:
- Returns:
Array of bandwidth values. Leading
timeperiod - 1entries areNaN.- Return type:
- ferro_ta.volatility.CHAIKIN_VOL(high, low, timeperiod=10, rocperiod=10)[source]
Chaikin Volatility — ROC of an EMA of the high–low range.
- Parameters:
- Returns:
Array of Chaikin Volatility values (percent).
- Return type:
- ferro_ta.volatility.HISTORICAL_VOLATILITY(close, timeperiod=20, annual=252.0)[source]
Close-to-close historical volatility, annualized and in percent.
- Parameters:
- Returns:
stddev(ln returns) * sqrt(annual) * 100. First valid value is at indextimeperiod.- Return type:
- ferro_ta.volatility.MASS(high, low, timeperiod=9, sumperiod=25)[source]
Mass Index — rolling sum of the single/double EMA ratio of the range.
- Parameters:
- Returns:
Array of Mass Index values.
- Return type:
- ferro_ta.volatility.NATR(high, low, close, timeperiod=14)[source]
Normalized Average True Range.
- Parameters:
high (array-like) – Sequence of high prices.
low (array-like) – Sequence of low prices.
close (array-like) – Sequence of closing prices.
timeperiod (int, optional) – Smoothing period (default 14).
- Returns:
Array of NATR values (percentage); leading
timeperiod - 1entries areNaN.- Return type:
- ferro_ta.volatility.STARC(high, low, close, timeperiod=15, atr_period=15, multiplier=2.0)[source]
Stoller Average Range Channels — SMA(close) ±
multiplier * ATR.- Parameters:
high (array-like) – Sequence of high prices.
low (array-like) – Sequence of low prices.
close (array-like) – Sequence of closing prices.
timeperiod (int, optional) – SMA period of close (default 15).
atr_period (int, optional) – ATR period (default 15).
multiplier (float, optional) – ATR multiple (default 2.0).
- Returns:
(upper, middle, lower).- Return type:
- ferro_ta.volatility.TRANGE(high, low, close)[source]
True Range.
- Parameters:
high (array-like) – Sequence of high prices.
low (array-like) – Sequence of low prices.
close (array-like) – Sequence of closing prices.
- Returns:
Array of True Range values.
- Return type:
- ferro_ta.volatility.ULCER_INDEX(close, timeperiod=14)[source]
Ulcer Index — RMS of percent drawdowns versus the rolling peak.
- Parameters:
close (array-like) – Sequence of closing prices.
timeperiod (int, optional) – Peak and RMS lookback (default 14).
- Returns:
Array of Ulcer Index values.
- Return type: