English
Languages
English
Japanese
German
Korean
Portuguese, Brazilian
French
Shortcuts

qiskit.finance.data_providers.ExchangeDataProvider

class ExchangeDataProvider(token, tickers, stockmarket=<StockMarket.LONDON: 'XLON'>, start=datetime.datetime(2016, 1, 1, 0, 0), end=datetime.datetime(2016, 1, 30, 0, 0))[source]

Exchange data provider.

Please see: https://github.com/Qiskit/qiskit-tutorials/blob/master/legacy_tutorials/aqua/finance/data_providers/time_series.ipynb for instructions on use, which involve obtaining a Quandl access token.

Initializer :type token: str :param token: quandl access token :type tickers: Union[str, List[str]] :param tickers: tickers :type stockmarket: StockMarket :param stockmarket: LONDON, EURONEXT, or SINGAPORE :type start: datetime :param start: first data point :type end: datetime :param end: last data point precedes this date

Raises
__init__(token, tickers, stockmarket=<StockMarket.LONDON: 'XLON'>, start=datetime.datetime(2016, 1, 1, 0, 0), end=datetime.datetime(2016, 1, 30, 0, 0))[source]

Initializer :type token: str :param token: quandl access token :type tickers: Union[str, List[str]] :param tickers: tickers :type stockmarket: StockMarket :param stockmarket: LONDON, EURONEXT, or SINGAPORE :type start: datetime :param start: first data point :type end: datetime :param end: last data point precedes this date

Raises

Methods

__init__(token, tickers[, stockmarket, …])

Initializer :type token: str :param token: quandl access token :type tickers: Union[str, List[str]] :param tickers: tickers :type stockmarket: StockMarket :param stockmarket: LONDON, EURONEXT, or SINGAPORE :type start: datetime :param start: first data point :type end: datetime :param end: last data point precedes this date

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()

Returns random coordinates for visualisation purposes.

Return type

Tuple[float, float]

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()

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()

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()

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()

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()[source]

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

Return type

None