MarketStressIndicator
- class qf_lib.indicators.market_stress_indicator_us.MarketStressIndicator(tickers: Sequence[Ticker], weights: Sequence[float], data_provider: DataProvider)[source]
Bases:
object
Calculates market stress indicator.
- Parameters:
tickers (Sequence[Ticker]) – tickers building the stress indicator
weights (Sequence[float]) – weights of the tickers in the indicator, do not need to sum to 1, will be normalized anyway
data_provider (DataProvider) – data provider that will be used to access the history of the individual tickers
Methods:
get_indicator
(years_rolling, start_date, ...)Returns the timeseries of the indicator.
- get_indicator(years_rolling: float, start_date: datetime, end_date: datetime, step: int = 1) QFSeries [source]
Returns the timeseries of the indicator.
- Parameters:
years_rolling (float) – How may years of the history is used for to evaluate the single point
start_date (datetime) – start date of the indicator returned
end_date (datetime) – end date of the indicator returned
step (int) – how many day is the rolling window shifted. It aslo tells us the step of the returned indicator in days
- Returns:
Timeseries of market stress indicator
- Return type: