/option-history

Back testing a very simple stock option strategy

Primary LanguageJupyter Notebook

option-history

Here we back test a very simple stock option strategy. We fetch historic data using Polygon.io API.

Setup

We need Python 3.10 or newer.

To run the code we need to create an API key on their site. Then we have to export it so the script can access it.

export POLYGON_API_KEY=<api-key>

Note that the script makes lots of requests to the options API, so it will quickly exceed the limit of 5 calls/minute of the Basic plan. The Starter plan should be sufficient.