Index
Data is crucial for backtesting and live-trading. As such, Dejavu provides a few ways to ingest data into your strategies.
Backtesting¶
For backtesting, data is stored in Flat-files or ingested through data providers through an API (typically REST).
To get started, we suggest looking at the CSVDataFeed.
Bases: DataFeed
supports_asset_class(asset_class)
¶
Override if the feed only supports certain asset classes. Default: all supported.
Combining Data Sources¶
At times, it's not possible to get all data from the same place, or organised. Or Perhaps you want to combine Asset Classes.
To help with this, we've got CombinedDataFeed, that takes any number of DataFeed and combines it for use within your
strategy.
Bases: DataFeed
This merges data across any number of DataFeeds. For example, you may have a AlphaVantage Data feed and a CSV data feed.
Example:
feed = CombinedDataFeed(
CSVDataFeed("equity.csv", "options.csv"),
AlphaVantageRestFeed(api_key="...", symbols=["AAPL"], ...),
)
supports_asset_class(asset_class)
¶
Override if the feed only supports certain asset classes. Default: all supported.
Live-trading¶
For live trading, we transition from REST or Flat-file datasets to data that is streamed, typically through Websockets for FIX feeds.