Monthly Archives: October 2015

Genetic optimization of trading algorithm

I just commited some code to show how one can optimize a parameter of a trading algorithm to increase the sharpe ratio. The code works with the open source LEAN engine.

Currently there’s a 40 second delay from running each iteration meaning it can take a long time to run say 10,000 iterations 🙂

But hopefully this can be fixed either in the engine or with some further hacks.

Quantconnect LEAN open source trading engine

I recently found a cool open source project which I started using for a trading algorithm I am making now based on mean reversion – buy low sell high.

For testing purposes I made a rough GTK# client in Mono on Linux and it works really well. Monodevelop has really come a long way since I started using it years ago. Very good debugger.


Anyway, the LEAN engine is very nice and fast. Of course the algorithm you have to make on your own. Profits do not come easily in this game it seems 🙂

Right now I am paper trading live with Interactive Brokers and I find new bugs every day. There are a lot of small things you need to consider, like partial fills, updating non-filled orders, correlations between symbols, market regimes, risk management and position sizing.

However, it is very exciting and I get new ideas on what to build into the program continously.