Introduction
When it comes to building trading algorithms, there tends to be a lot of knowledge you can only get by actually going out and developing and talking to others who have about their shared experiences. This information is not published online from our findings, so in this article, we share the learnings from our experience building trading algorithms. This article focuses specifically on the language Python, and gives advice on how to develop trading algorithms effectively, sharing knowledge that is otherwise only accrued through much trial and error. It is still very worthwhile to test this out for yourself and build your own trading algorithms to maximize learning and information absorption.
Whilst there is advantages and disadvantages to Python, it usually comes down to the question of how much you value time to implementation and your need for compute efficiency. Python can be made efficient but there are certain bottlenecks you really can’t cross no matter what. That said, for non-HFT and often less intense HFT algorithms (not too many data sources), these efficiency limitations are vastly outweighed by the speed at which you can implement. It’s also far more beginner friendly. I often hear of firms, and frankly have had similar experiences myself, where the initial version of the system is in Python or JS and then it eventually moved to Rust or C++.
This will tend to look at trading with a crypto focus as this is my current market of choice and in my view is a great one to start in for beginners since you can realistically be competitive (albeit likely on smaller exchanges) with very little capital.
I’d like to make it clear before we start that I’m not a developer and work as a researcher. This does mean I’ve implemented trading algorithms still, but my knowledge I’m sharing in this article today mostly revolves around tips and tricks I’ve come across along the way. I won’t write the cleanest of code, although I hope to think it’s not awful quality - AND you certainly shouldn’t take advice from me about data structures and algorithms, BUT there are certain tricks you figure out from observing what kills latency over the course of having deployed many algorithms, and seeing consistent solutions which work well and deliver results.
Index
Introduction
Index
API Interaction
Pandas = SLOW!
Optimizing I/O
Hybrid Systems
Multiple Methods of State Verification
Doing Logging Properly
Algorithm Management
Dashboards