derivitec.core.client.DerivitecClient.calculate_historical_price_series_on_contracts

DerivitecClient.calculate_historical_price_series_on_contracts(contracts, run_date=None, reporting_currency=None, market_data_override=None, first_observation_date=None, historical_start_date_rule=None, horizon=None, market_data_environment_name=None, last_observation_date=None, historical_end_date_rule=None)[source]

Calculate historical price series on a set of contracts.

Parameters:
  • contracts (list[derivitec.tradables.types.Contract]) – The contracts.

  • run_date (datetime.datetime) – The run date.

  • reporting_currency – The reporting currency. (optional; default local currency except for FX contracts)

reporting_currency == None is forbidden) :type reporting_currency: str :param market_data_override: The market data override (optional) :type market_data_override: derivitec.market_data.types.MarketDataOverride :param first_observation_date: The first observation date :type first_observation_date: datetime.datetime :param historical_start_date_rule: The historical start date rule :type historical_start_date_rule: str :param horizon: The horizon :type horizon: int :param market_data_environment_name: The market data environment name (optional with default Organisation Level Environment) :type market_data_environment_name: str :param last_observation_date: The last observation date :type last_observation_date: datetime.datetime :param historical_end_date_rule: The historical end date rule :type historical_end_date_rule: str :rtype: derivitec.risk_engine.types.VarResult

Code

>>> var_results = client.calculate_historical_price_series_on_contracts(
...    contracts=[EqFutureByCode(code=ric("SPZ7"))],
...    run_date=datetime.datetime(2017, 11, 1),
...    reporting_currency='USD',
...    historical_start_date_rule='-6m',
...    horizon=1,
...    market_data_environment_name="My Example Environment")