THE BASIC PRINCIPLES OF LEARNING PYTHON FOR ALGORITHMIC TRADING ​

Super simple - yet useful advice for beginners!

Let this introductory article be the basic explanation about how I started to work with Python and what helped me the most at a starting line. I’ll share some beginner tips with you, so you’ll be on the right path to creating successful algo-trading strategies.

Please note that this is not a guide on installing Python, what it is, how to use it, or why to use it. I believe you all know why to use it, that’s why you are here, reading this.

 I will write our articles about things you can find hardly on Google, but instead, they should have some added value for you. In this article, I will write about how I learned Python, targeting finance from the beginning. Basically, you will find practical articles on solving problems in finance, useful for traders or quants. 

The fastest and the most fun way to learn it is by solving problems (don’t worry if you are a total beginner, we will cover many useful topics, just be prepared to google a lot of stuff as well).

GOOGLE A LOT!

I have to admit that my programming beginnings were not from a totally different field – I studied applied math, so I had some classes for programming in Java, but that’s all. With Python, I had zero experience coding. 

I downloaded it, spent three days reading fundamentals, watching tutorials, writing codes, and there I developed all my programming skills – yes, it is simple like that! Everything you need to know about coding is already out there on google, and it’s free! Every programmer in the world can have another title as ‘professional googler.’

So if you’re asking if it’s normal to be googling everything, my answer is, yes – more than normal.

programming-and-googling-diagram

DO EVERY TASK IN PYTHON

So my another advice, especially when you are starting out and after you googled some basics, is to try to do every task you have to do in Python.

Even though it will take more time, in the end, you’ll realize that you learned much more by trying everything by yourself. It’s because you are not learning only the programming language. You are learning the way how to solve the problems; you are learning how to program. 

Python language is just a foreign language, like English or Spanish (I think C++ is something like Chinese – it is harder, but it makes every sh*t you need to be successful, no offense, just a silly joke from a fellow programmer). 

If you are not a student, but studied something a bit technical and used some software, try to look at your old notes and re-program the stuff you understand (or understood a long time ago) into Python. If you are not from any field with at least some basic math, well my advice, google even more and learn math, you will need it for trading (basic math, probability, and statistics).

Now you might be asking:

"Do I have to Have Math Background?"

Depending on what you want to do, if you’re going to do some machine learning for algo-trading and don’t know any math, optimization, statistics, or programming, well, it will take years. When you have a solid mathematical background like me, understanding most machine learning algorithms will be a lovely reading for evenings. 

I won’t continue this article about machine learning because I don’t think I am the right person to teach you how to start with that. But you don’t need machine learning to be a successful algo-trader (with machine learning comes enormous amounts of high quality and costly data + alternative data). 

The best working algorithms and the most successful ones are simple yet have some fundamental logic. The simpler it is, the fewer parameters it uses, fewer problems with biases, overfitting, and so on. I’m speaking from my own experience, I used unique data and made great machine learning models. 

Still, it had never beaten the algorithms with simple logic for which I didn’t even need to know anything about ML or advanced programming. Finding a simple, well-working logic is much harder than creating a machine learning algorithm!

I will show you some advanced and but also some basic stuff, in a more practical way. If you find it too advanced for you, yet you are dedicated to really learn it, it won’t be a problem.

DO NOT ASK FOR HELP

The thing that worked for me the most when I was learning Python was not asking others for help, but doing it myself.

Even when some tasks took me 3 hours instead of 10 minutes. My first simple task took me 3 hours, the second 2.5 hours, and the third for just one hour. Do you get my point? I learned so much only by looking for solving particular parts of my problem. The sooner you learn how to google correctly, you will learn how to code fast.

So my, I would say, the most useful advice is – just look for the answers wherever possible you can find them. And solve problems by yourself!

Leave a comment