backtrader.feeds.quandl module

Quandl Data Feed Module - Quandl data parsing.

自 Quandl 版本弃用: was acquired by Nasdaq and the free API has been sunset. Use Nasdaq Data Link or alternative data sources instead. This module is retained for backward compatibility but will be removed in a future release.

Classes:

QuandlCSV: Parses pre-downloaded Quandl CSV files. Quandl: Live Quandl data feed.

示例

>>> data = bt.feeds.QuandlCSV(dataname='quandl.csv')
>>> cerebro.adddata(data)
class backtrader.feeds.quandl.QuandlCSV[源代码]

基类:CSVDataBase

Parses pre-downloaded Quandl CSV Data Feeds (or locally generated if they comply to the Quandl format)

Specific parameters:

  • dataname: The filename to parse or a file-like object

  • reverse (default: False)

    It is assumed that locally stored files have already been reversed during the download process

  • adjclose (default: True)

    Whether to use the dividend/split adjusted close and adjust all values according to it.

  • round (default: False)

    Whether to round the values to a specific number of decimals after having adjusted the close

  • decimals (default: 2)

    Number of decimals to round to

start()[源代码]

Start the Quandl CSV data feed.

Reverses data if needed for correct chronological order.

frompackages = ()
packages = ()
class backtrader.feeds.quandl.Quandl[源代码]

基类:QuandlCSV

Executes a direct download of data from Quandl servers for the given time range.

Specific parameters (or specific meaning):

  • dataname

    The ticker to download ('YHOO', for example)

  • baseurl

    The server url. Someone might decide to open a Quandl compatible service in the future.

  • proxies

    A dict indicating which proxy to go through for the download as in {'http': 'http://myproxy.com'} or {'http': 'http://127.0.0.1:8080'}

  • buffered

    If True, the entire socket connection will be buffered locally before parsing starts.

  • reverse

    Quandl returns the value in descending order (newest first). If this is True (the default), the request will tell Quandl to return in ascending (oldest to newest) format

  • adjclose

    Whether to use the dividend/split adjusted close and adjust all values according to it.

  • apikey

    Apikey identification in case it may be needed

  • dataset

    String identifying the dataset to query. Defaults to WIKI

__init__(*args, **kwargs)

Initialize a LineMultiple instance.

Sets up the internal state for managing multiple lines, including line type indicator, lines collection, clock reference, and line iterator tracking.

Initializes:

_ltype: Line type indicator (None for base LineMultiple). lines: Collection of line objects (creates if not exists). _clock: Clock reference for synchronization. _lineiterators: Dictionary tracking registered lineiterators. _minperiod: Minimum period requirement (defaults to 1).

start()[源代码]

Start the Quandl data feed and download data.

Constructs URL with parameters and fetches data from Quandl API.

frompackages = ()
packages = ()