StockPros is an interface for implementing custom trading strategies. Users can backtest their strategies, paper trade, and live trade. It runs in Node.js and uses a few external services.
- PostgreSQL - SQL database.
- Redis - in-memory data store.
- Alpaca - live/paper trading.
- Polygon - market data.
- Polygon data is free with a live Alpaca trading account. If you set a Polygon API key in the environment variables (see below), it be used, otherwise the live Alpaca API key will be used.
Use the .env.example
file to configure the environment variables for a given environment e.g. .env.local
, .env.development
, .env.staging
, or .env.production
.
$ export NODE_ENV=local
$ npm install
$ knex migrate:latest
$ knex seed:run
$ npm test
$ npm start
On start, StockPros will load the watched symbols into the DB, including up to 15 years of historical OHLC (open-high-low-close) data, and then begin running all active strategies for these symbols.
$ docker-compose build
$ docker-compose up
For each API, view the docs and try the requests in Postman.