Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK and does not exist in the latest version. We recommend you migrate to the latest version. See the release notes for more information.
Important

IBM Quantum Platform is moving and this version will be sunset on July 1. To get started on the new platform, read the migration guide.

qiskit.finance.data_providers.DataOnDemandProvider

class DataOnDemandProvider(token, tickers, start=datetime.datetime(2016, 1, 1, 0, 0), end=datetime.datetime(2016, 1, 30, 0, 0), verify=None)

GitHub

NASDAQ Data on Demand data provider.

Please see: https://github.com/Qiskit/qiskit-tutorials/blob/stable/0.25.x/tutorials/finance/11_time_series.ipynb for instructions on use, which involve obtaining a NASDAQ DOD access token.

Parameters

  • token (str) – data on demand access token
  • tickers (Union[str, List[str]]) – tickers
  • start (datetime) – first data point
  • end (datetime) – last data point precedes this date
  • verify (Union[str, bool, None]) – if verify is None, certify certificates will be used (default); if this is False, no certificates will be checked; if this is a string, it should be pointing to a certificate for the HTTPS connection to NASDAQ (dataondemand.nasdaq.com), either in the form of a CA_BUNDLE file or a directory wherein to look.

__init__

__init__(token, tickers, start=datetime.datetime(2016, 1, 1, 0, 0), end=datetime.datetime(2016, 1, 30, 0, 0), verify=None)

Parameters

  • token (str) – data on demand access token
  • tickers (Union[str, List[str]]) – tickers
  • start (datetime) – first data point
  • end (datetime) – last data point precedes this date
  • verify (Union[str, bool, None]) – if verify is None, certify certificates will be used (default); if this is False, no certificates will be checked; if this is a string, it should be pointing to a certificate for the HTTPS connection to NASDAQ (dataondemand.nasdaq.com), either in the form of a CA_BUNDLE file or a directory wherein to look.

Methods

__init__(token, tickers[, start, end, verify])type tokenstr
get_coordinates()Returns random coordinates for visualisation purposes.
get_covariance_matrix()Returns the covariance matrix.
get_mean_vector()Returns a vector containing the mean value of each asset.
get_period_return_covariance_matrix()Returns a vector containing the mean value of each asset.
get_period_return_mean_vector()Returns a vector containing the mean value of each asset.
get_similarity_matrix()Returns time-series similarity matrix computed using dynamic time warping.
run()Loads data, thus enabling get_similarity_matrix and get_covariance_matrix methods in the base class.

get_coordinates

get_coordinates()

Returns random coordinates for visualisation purposes.

Return type

Tuple[ndarray, ndarray]

get_covariance_matrix

get_covariance_matrix()

Returns the covariance matrix.

Return type

ndarray

Returns

an asset-to-asset covariance matrix.

Raises

QiskitFinanceError – no data loaded

get_mean_vector

get_mean_vector()

Returns a vector containing the mean value of each asset.

Return type

ndarray

Returns

a per-asset mean vector.

Raises

QiskitFinanceError – no data loaded

get_period_return_covariance_matrix

get_period_return_covariance_matrix()

Returns a vector containing the mean value of each asset.

Return type

ndarray

Returns

a per-asset mean vector.

Raises

QiskitFinanceError – no data loaded

get_period_return_mean_vector

get_period_return_mean_vector()

Returns a vector containing the mean value of each asset.

Return type

ndarray

Returns

a per-asset mean vector.

Raises

QiskitFinanceError – no data loaded

get_similarity_matrix

get_similarity_matrix()

Returns time-series similarity matrix computed using dynamic time warping.

Return type

ndarray

Returns

an asset-to-asset similarity matrix.

Raises

QiskitFinanceError – no data loaded

run

run()

Loads data, thus enabling get_similarity_matrix and get_covariance_matrix methods in the base class.

Return type

None

Was this page helpful?
Report a bug or request content on GitHub.