Crypto bot

Recently I’ve been following the crypto market, which is very fascinating to me. I’ve subscribed to kraken, a popular exchange and put some money in it. After a service outage in the middle of january, kraken’s team decided to cut the transactions fees for a while, thus I took the opportunity to code and test a from-scratch crypto-trader bot.

I have no time to get into details, also because they are not so much interesting or particularly complex, but I’ll say that it uses a combination of some simple and common algorithms widely used in the study of the financial market. The bot actually works, in the sense that it makes trades on some deterministic rules, but unfortunately it is not clever enough to make profit (even without the fees) and barely breaks even.

Anyway, as always, it’s been very fun and instructive to code, as I had to study and learn how the market behaves, how to handle the market data and how to try to predict trends and accordingly set sell/buy points.

Since I’m not posting the code (yet), here’s its debug window:
cryptobot_best

Google Jam of Code

This is the second year I try to have some fun with python and the Google Code Jam.

This year I almost forgot about it, and started the challenge when almost half of the time was gone. Anyway I managed to complete almost half of the problems, which seemed pretty good to me, given that I spent just a few hours trying.

Unfortunately, my last attempt timed out by 3 minutes (out of 8 available) when trying to compute the result, which later proved correct. This reminded me about the importance of performance in my code: a little optimization of the code after my try gave it a speedup of 3x, which would have been enough to submit the result in time.

Anyway, both this and the last year I qualified for the second round. Last year I didn’t pass it, this year I hope to do better.

 

googlecodejam2015