Skip to content

jocon15/StockBench

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StockBench

A back-testing app for testing stock trading strategies with historical data.

How it Works

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!

Getting Started

  1. First, you need to get your own API keys from Alpaca Markets.

  2. Add them as Environment Variables.

  3. Restart your PC to enable the Environment Variables.

  4. Build your strategy .JSON file. See Building a Strategy or try our new Strategy Studio.

  5. Run the StockBench.exe.

  6. Set your simuation parameters.

  7. Run the simulation and view the results.

Configuration Results
single multi

Or test your strategy on multiple symbols and see overview analytics: chart

Head to Head

Want to run 2 strategies side by side? We have you covered with the compare tab!

Additional Results Analytics

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

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.

Diving Deeper

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. report

Roadmap

Check out our Trello Board for more information on where we're headed next.