StockBench is a stock simulation suite designed for testing strategies on historical data. StockBench sources market data from Alpaca Markets.
StockBench is designed to test strategies that use technical analysis. StockBench allows for quite some freedom in defining a strategy. It can be simple or complex. Once you have a strategy picked out, you can play with the simulation settings. Check out the StockBench Wiki for more information on settings, indicators, and rules.
Now that you have everything the way you like, you can start the simulation. The simulator will request the data relevant to your strategy. As expected, the simulator iterates over the data as if it were trading in real time. The simulator is allowed to access previous data, but never future data. The simulator makes artificial trades based on your strategy. Once the simulation is complete, the terminal will show the results of the simulation. A chart will then pop up showing the price data and any other indicators defined in the strategy.
And just like that, you have simulated a strategy on historical data. Have fun!
-
First, you need to get your own API keys from Alpaca Markets.
-
Add them as Environment Variables.
-
Restart your PC to enable the Environment Variables.
-
Build your strategy .JSON file. See Building a Strategy or try our new Strategy Studio.
-
Run the StockBench.exe.
-
Set your simuation parameters.
-
Run the simulation and view the results.
Configuration | Results |
---|---|
Or test your strategy on multiple symbols and see overview analytics:
Want to run 2 strategies side by side? We have you covered with the compare tab!
Simulation results are split up into different tabs within the results window, giving you an in-depth look at how your strategy performed.
Strategy Studio allows you to create and update strategy .json files. You can edit existing files or create new ones from a provided basic template.
If you are curious to see the underlying data used by the simulation, you can choose to export the simulation data using the reporting option. When chosen, a report of all the data used during the simulation will be generated. The report will be an excel (.xlsx) file.
Check out our Trello Board for more information on where we're headed next.