ECBSystemicStress
QuantConnect.DataSource.ECBSystemicStress
ECBSystemicStress()
ECBSystemicStress(csv: List[str])
Bases: BaseData
The Composite Indicator of Systemic Stress, the European Central Bank's measure of how much stress the financial system is under. It aggregates fifteen market-based stress measures across five segments and weights them by how strongly the segments are moving together, so it rises further when trouble is broad than when one market is upset on its own. The scale runs from zero to one.
The euro area file carries the full decomposition: the headline index, the contribution of each of the five market segments, the correlation contribution, and two sovereign stress aggregates. Euro area countries publish the headline index and their own sovereign stress only, and the economies outside the euro publish the headline index alone, so the remaining columns are empty for them. Read a column against null rather than assuming zero.
One file per economy, from 1980, carrying a row for each day the ECB computed the index.
That is every weekday, plus the occasional weekend it prints. Subscribe with an economy
constant, for example AddData
A whole week of readings is released together, so an algorithm receives the newest reading of each batch rather than one point per day: the readings that share a release arrive as the single point that was current when the batch went out. A typed History call follows the same path and returns those same points, one per batch. The daily readings are all in the file, and a dataframe history request returns every one of them, which is how to reach both the days in between and the history back-computed before the 2012 debut.
Signature descriptions:
-
Creates a new default instance.
-
Creates a new instance from the columns of a row produced by the data processor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
csv
|
Optional[List[str]]
|
Columns of the row: date, release stamp, then one per series |
None
|
composite
composite: Optional[float]
The composite indicator itself, from zero to one. This is also the data point's Value.
sovereign_stress
sovereign_stress: Optional[float]
Stress in this economy's government bond market. Published for the euro area countries only. It is empty for the euro area aggregate, which carries the two weighted sovereign columns instead, and empty for the economies outside the euro.
bond_market_contribution
bond_market_contribution: Optional[float]
How much the bond market segment adds to the composite. Euro area only.
equity_market_contribution
equity_market_contribution: Optional[float]
How much the equity market segment adds to the composite. Euro area only.
financial_intermediaries_contribution
financial_intermediaries_contribution: Optional[float]
How much the financial intermediaries segment adds to the composite, the banks and insurers whose stress spreads fastest to the real economy. Euro area only.
foreign_exchange_contribution
foreign_exchange_contribution: Optional[float]
How much the foreign exchange segment adds to the composite. Euro area only.
money_market_contribution
money_market_contribution: Optional[float]
How much the money market segment adds to the composite. Euro area only.
correlation_contribution
correlation_contribution: Optional[float]
How much of the composite comes from the segments moving together rather than from any one of them. This is what separates a systemic episode from an isolated one, and it is the term that turns negative when the segments are uncorrelated. Euro area only.
sovereign_stress_equal_weighted
sovereign_stress_equal_weighted: Optional[float]
Euro area sovereign stress with every member country weighted equally, so a small country in trouble shows up as loudly as a large one. Euro area only.
sovereign_stress_gdp_weighted
sovereign_stress_gdp_weighted: Optional[float]
Euro area sovereign stress weighted by the size of each economy, so it tracks the large member states. Euro area only.
end_time
end_time: datetime
The moment the ECB released this reading, which is when LEAN makes the data point available. The index is daily but published in a weekly batch, so a reading waits between one and seven days for the next release. The ECB introduced the index in 2012 and computed the earlier years with it, so every reading from before then carries the day the series debuted rather than a date the index did not yet exist on. See https://data.ecb.europa.eu/data/datasets/CISS
data_type
data_type: MarketDataType
Market Data Type of this data - does it come in individual price packets or is it grouped into OHLC.
time
time: datetime
Current time marker of this data packet.
value
value: float
Value representation of this data packet. All data requires a representative value for this moment in time. For streams of data this is the price now, for OHLC packets this is the closing price.
price
price: float
As this is a backtesting platform we'll provide an alias of value as price.
ALL_RESOLUTIONS
ALL_RESOLUTIONS: List[Resolution] = ...
A list of all Resolution
This Field is protected.
DAILY_RESOLUTION
DAILY_RESOLUTION: List[Resolution] = ...
A list of Resolution.DAILY
This Field is protected.
MINUTE_RESOLUTION
MINUTE_RESOLUTION: List[Resolution] = ...
A list of Resolution.MINUTE
This Field is protected.
HIGH_RESOLUTION
HIGH_RESOLUTION: List[Resolution] = ...
A list of high Resolution, including minute, second, and tick.
This Field is protected.
OPTION_RESOLUTIONS
OPTION_RESOLUTIONS: List[Resolution] = ...
A list of resolutions support by Options
This Field is protected.
is_fill_forward
is_fill_forward: bool
True if this is a fill forward piece of data
clone
clone() -> BaseData
data_time_zone
data_time_zone() -> Any
Specifies the data time zone for this data type.
Returns:
| Type | Description |
|---|---|
Any
|
The Frankfurt time zone the ECB publishes in. |
default_resolution
default_resolution() -> Resolution
Gets the default resolution for this data and security type.
Returns:
| Type | Description |
|---|---|
Resolution
|
Daily resolution. |
get_source
get_source(
config: SubscriptionDataConfig,
date: datetime,
is_live_mode: bool,
) -> SubscriptionDataSource
Specifies the location of the data and directs LEAN where to load it from.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
SubscriptionDataConfig
|
Subscription configuration |
required |
date
|
datetime
|
Algorithm date |
required |
is_live_mode
|
bool
|
Is live mode |
required |
Returns:
| Type | Description |
|---|---|
SubscriptionDataSource
|
Subscription data source pointing at this economy's file. |
is_sparse_data
is_sparse_data() -> bool
Indicates whether the data is sparse.
Returns:
| Type | Description |
|---|---|
bool
|
True: one file per economy, and the index does not print every calendar day. |
reader
reader(
config: SubscriptionDataConfig,
line: str,
date: datetime,
is_live_mode: bool,
) -> BaseData
Parses one line of the source file into a data point.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
SubscriptionDataConfig
|
Subscription configuration |
required |
line
|
str
|
Line of the source CSV |
required |
date
|
datetime
|
Date the request was made for |
required |
is_live_mode
|
bool
|
Is live mode |
required |
Returns:
| Type | Description |
|---|---|
BaseData
|
Instance of the class with the parsed data. |
requires_mapping
requires_mapping() -> bool
Indicates whether the data source can undergo rename proof standardization.
Returns:
| Type | Description |
|---|---|
bool
|
False: the index is not tied to a tradable security. |
supported_resolutions
supported_resolutions() -> List[Resolution]
Gets the supported resolution for this data and security type.
Returns:
| Type | Description |
|---|---|
List[Resolution]
|
Daily resolution. |
to_string
to_string() -> str
Converts the instance to a string.
Returns:
| Type | Description |
|---|---|
str
|
A string containing the composite reading. |
deserialize_message
deserialize_message(serialized: str) -> Sequence[BaseData]
Deserialize the message from the data server
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
serialized
|
str
|
The data server's message |
required |
Returns:
| Type | Description |
|---|---|
Sequence[BaseData]
|
An enumerable of base data, if unsuccessful, returns an empty enumerable. |
should_cache_to_security
should_cache_to_security() -> bool
Indicates whether this contains data that should be stored in the security cache
Returns:
| Type | Description |
|---|---|
bool
|
Whether this contains data that should be stored in the security cache. |
update
update(
last_trade: float,
bid_price: float,
ask_price: float,
volume: float,
bid_size: float,
ask_size: float,
) -> None
Update routine to build a bar/tick from a data update.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
last_trade
|
float
|
The last trade price |
required |
bid_price
|
float
|
Current bid price |
required |
ask_price
|
float
|
Current asking price |
required |
volume
|
float
|
Volume of this trade |
required |
bid_size
|
float
|
The size of the current bid, if available |
required |
ask_size
|
float
|
The size of the current ask, if available |
required |
update_ask
update_ask(ask_price: float, ask_size: float) -> None
Updates this base data with the new quote ask information
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ask_price
|
float
|
The current ask price |
required |
ask_size
|
float
|
The current ask size |
required |
update_bid
update_bid(bid_price: float, bid_size: float) -> None
Updates this base data with the new quote bid information
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bid_price
|
float
|
The current bid price |
required |
bid_size
|
float
|
The current bid size |
required |
update_quote
update_quote(
bid_price: float,
bid_size: float,
ask_price: float,
ask_size: float,
) -> None
Updates this base data with new quote information
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
bid_price
|
float
|
The current bid price |
required |
bid_size
|
float
|
The current bid size |
required |
ask_price
|
float
|
The current ask price |
required |
ask_size
|
float
|
The current ask size |
required |
update_trade
update_trade(last_trade: float, trade_size: float) -> None
Updates this base data with a new trade
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
last_trade
|
float
|
The price of the last trade |
required |
trade_size
|
float
|
The quantity traded |
required |