ALGO-trading bot

Project ‘Pyron’ : Hobby project to develop a genetically-inspired evolutionary trading algorithm.

To build a successful automated trading strategy is to build a money-printing machine. Out of curiosity I decided to try my hand at algorithmic trading.

The system build on my previous experience with Genetic Algorithms (G.A’s) which I was introduced to during my Master’s thesis. I started with a whole population of individuals, each with their own trading strategy. Each individual strategy involved analysing volatility trends to find signals and use these signals to spot breakouts / trend reverals, trading into and out of the market accordingly. These individual strategies were abstracted by encoding them into digital ‘DNA’ genomes, which were then evolved using the process of natural selection to breed the best individuals, using genetic cross-over and mutation operations to optimise them over accelerated time.

I used bitcoin for the underlying asset, Kraken’s API for executing trades, MATLAB for the data science, Python for the algorithm software, and Heroku for the infrastructure.

I like projects that combine and make use of multiple different skills or passions of mine. I called it project Pyron as short for ‘Hyperpyron’ because this was the name of a gold coin from the days of the Byzantine Empire, and this perfectly symbolised my combined passions in investing (esp. gold ), and blockchain (in which ‘Byzantine Fault Tolerance’ is a fundamental property), both of which were inspiration for the project.

HIGHLIGHTS

  • The algorithm was able to make money in an up-market and stay safe in a down market, consistently returning more than a simple buy-and-hold strategy.

  • 100% built and deployed by myself despite no classical software engineering background

  • Successfully demonstrated genetically-inspired evolution in trading performance

 

A very early overview of the system.

 

The algorithm was able to make money in an up-market and stay safe in a down market. Once optimised, it could consistently return more than a simple buy-and-hold strategy. Image above shows performance on bitcoin price.

 
Technologies used included Python, Cloud9, Matlab, PostgreSQL, and Heroku

Technologies used included Python, Cloud9, Matlab, PostgreSQL, and Heroku