ui#
API documentation for pandas_ta.volatility.ui Python function.
- ui(close, length=None, scalar=None, offset=None, **kwargs)[source]#
Ulcer Index (UI)
The Ulcer Index by Peter Martin measures the downside volatility with the use of the Quadratic Mean, which has the effect of emphasising large drawdowns.
- Sources:
https://library.tradingtechnologies.com/trade/chrt-ti-ulcer-index.html https://en.wikipedia.org/wiki/Ulcer_index http://www.tangotools.com/ui/ui.htm
- Calculation:
- Default Inputs:
length=14, scalar=100
HC = Highest Close SMA = Simple Moving Average
HCN = HC(close, length) DOWNSIDE = scalar * (close - HCN) / HCN if kwargs[“everget”]:
UI = SQRT(SMA(DOWNSIDE^2, length) / length)
- else:
UI = SQRT(SUM(DOWNSIDE^2, length) / length)
- Args:
high (pd.Series): Series of ‘high’s close (pd.Series): Series of ‘close’s length (int): The short period. Default: 14 scalar (float): A positive float to scale the bands. Default: 100 offset (int): How many periods to offset the result. Default: 0
- Kwargs:
fillna (value, optional): pd.DataFrame.fillna(value) fill_method (value, optional): Type of fill method everget (value, optional): TradingView’s Evergets SMA instead of SUM
calculation. Default: False
- Returns:
pd.Series: New feature