Disclaimer

Collect data

To run the sample strategy we need 1-day bars for a single symbol. Any symbol will work, we will use AAPL. Create a database for free sample data (if it doesn't already exist):

Then collect the data:

Use flightlog to monitor the progress:

quantrocket.history: INFO [usstock-free-1d] Collecting FREE history from 2007 to present
quantrocket.history: INFO [usstock-free-1d] Collecting updated FREE securities listings
quantrocket.history: INFO [usstock-free-1d] Collecting additional FREE history from 2020-04 to present
quantrocket.history: INFO [usstock-free-1d] Collected 160 monthly files in quantrocket.v2.history.usstock-free-1d.sqlite

Next we look up the Sid for AAPL (using the CLI in this example):

We'll use this Sid in our backtrader script.


Next Up

Part 3: Strategy code