Skip to content

JanVijfhuizen/STBT-Backtrader

Repository files navigation

STBT - Stock Trading Back Tester

This is a tool to test out stock trading algorithms on real historical data. It is an ongoing project but it is in a functional state and can be used freely under the MIT license.

image

How does it work?

First, you need to download the individual symbol data, and then enable all symbols you want to use in backtesting.

image

Then the application downloads all relevant information for the symbols and saves it locally. Afterwards you can run your algorithms on historical data and get detailed feedback on how it performed. This includes a scatter plot, performance bell curve, averages and more. You can also go through the simulation step by step if needed. A run can also be logged to a text file for external use.

image

The code can be set up rather quickly:

jv::bt::STBTBot bot;
bot.name = "GA trader";
bot.description = "Genetic Algorithm Trading.";
bot.author = "jannie";
bot.init = jv::GATraderInit;
bot.update = jv::GATraderUpdate;
bot.cleanup = jv::GATraderCleanup;
bot.bools = &training;
bot.boolsNames = &boolsNames;
bot.boolsLength = 1;
bot.userPtr = this;

auto stbt = jv::bt::CreateSTBT(&bot, 1);
while (!stbt.Update())
	continue;

Basically, you just define the bots that you want to potentially test out and that's it. The code is written with performance in mind and can run hundreds of simulations a second, so it should be a good way of quickly testing out algorithms before commiting them to live trading.

image

I will add a ready to go .exe in the future, but for now you'll need to build from source if you want to use it.

About

An attempt to make a recurrent deep learning algorithm using evolving topologies

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages