KendelChopp / alpaca-js-backtesting

Backtest trading algorithms built for Alpaca with JavaScript and Node.js
MIT License
14 stars 7 forks source link

backtesting timeframe #9

Open shaun-greenwood opened 3 years ago

shaun-greenwood commented 3 years ago

There seems to be an issue with the start and end times of the back tester. The onStockAggMin() function only runs a max of 100 times, regardless of how far back the start date has been set. And it doesn't run at all if the start and end date are fewer than 4 days apart.

shaun-greenwood commented 3 years ago

after some more digging, it looks like the alpaca API changed the getBars() method to default to 100 bars and cannot be changed (the plan was to deprecate the method entirely). I could only find confirmation of this for the Python SDK. Nobody seems to have mentioned it for the Node.js SDK.

shaun-greenwood commented 3 years ago

https://forum.alpaca.markets/t/alpaca-python-api-only-returns-100-days-data/4283