In 2010, it was estimated that over 80% of the volume in the public equity markets was traded algorithmically. Furthermore, out of the best performing hedge funds, a very large percentage rely on algorithm-driven trading. This list includes:
- Bridgewater Associates, the worlds largest hedge fund, that manages about 150 billion US Dollars
- AQR Capital Management, the second largest fund with $70 billion under management
- Renaissance Technologies, the third largest hedge fund,
- Two Sigma Investments, the fifth largest hedge fund
- and many more.
Moreover, the deployment of algorithmic trading is expanding at a rising rate. This rapid growth is not expected to stop in the foreseeable future.
And now you want to join the party as well? If that’s the case, you have come to the right place! There has never been a better time to learn algorithmic trading than right now.
In this article, I will present you with a step by step guide for how you as a retail trader can get involved in the exciting world of algorithmic trading. You will learn how to acquire the skills necessary to develop your own trading algorithms and much more.
Algorithmic Trading vs Discretionary Trading
Before we dive into the nitty-gritty of learning algorithmic trading, I just want to draw a comparison between algorithmic and discretionary (manual) trading.
One major advantage of algorithmic trading over discretionary trading is the lack of emotions. The computer program that makes the trades follows the rules outlined in your code perfectly. There is no second-guessing or hesitation. If a buy or sell signal is found, it is followed by a reaction of the algorithm.
This can not be said about manual human traders. In fact, dealing with your psychology while trading can be one of the toughest things. Often, the quality of your decision making is impaired by emotions such as fear and greed.
With that being said, the complete mechanical nature of trading algorithms can also act as a disadvantage. Trading algorithms don’t think about their trades like humans do. They simply check pre-programmed conditions and take action if certain criteria are met.
This means if the creator of the algorithm made a mistake or forgot to think about certain things, this can lead to bad trades that no human in their right mind would ever take.
A different aspect in which algorithmic trading definitely comes out on top is the aspect of time. Not everyone, certainly not retail traders, can afford to watch the markets all day. This, however, is no problem for a computer program.
A further advantage would be the ability to backtest and optimize your trading strategies. This can’t really be done in the same way for manual trading strategies. This means algorithmic traders can take advantage of the insane amounts of data that are accessible in our world today.
|Algorithmic Trading||Discretionary Trading|
|100% Mechanical||Emotional Decision Making|
|Watches Market All The Time||Time Constraints|
|Ability To Backtest Your Strategies||Can’t Backtest To The Same Extent|
|Consistent Approach||Inconsistent Approach Due To Human Nature|
|The Trading Is As Good As Your Code||The Trading Is As Good As You|
Furthermore, algorithmic trading takes a much more consistent approach to the markets than discretionary traders do. If a trading algorithm would be confronted with the exact same situation twice, it will make the exact same decision every time. This can not be said about human traders because their decision making is heavily affected by human factors such as their mood, past experiences, prior trades, emotions etc.
In conclusion, both discretionary and algorithmic trading have their pros and cons. I wouldn’t necessarily say that either one is 100% better than the other. In my opinion, this really depends on the code and the trader that are being compared. At the end of the day, an algorithmic trader is only as good as his algorithm and a discretionary trader is only as good as himself. A good trader can beat a bad
If algorithmic trading is for you, depends on who you are and what your personal preferences are.
Now without further delay, let me present to you how to learn algorithmic trading.
Step 1: What is Algorithmic Trading?
The first step is understanding what algorithmic trading even is or at least, understanding what kind of algorithmic trading is relevant for you. For instance, in recent years,
You can check out the following video if you are interested in learning more about high frequency trading.
So when I am talking about learning algorithmic trading in this article, I am not talking about high frequency trading (because retail traders can’t use it). Instead, I am talking about developing trading strategies that can be translated into an algorithm that can be used by you. The goal with this algorithm is to let it trade profitably for you. You won’t make any trades manually. All the trading is automated and performed by your algorithm.
To drive this point home, here is an example of a very simple trading algorithm:
If SPY's price crosses above its 30-day moving average:
-Buy 100 shares of SPY
If SPY's price crosses below its 30-day moving average:
-Sell 100 shares of SPY
Like I just said, this is a very simple trading algorithm and I would not recommend trading real money with this
Step 2: Understanding the Basics of Trading
This step applies to any kind of trader. It really doesn’t matter if you want to learn algorithmic trading or become a discretionary trader. You need to understand the basics first. Understand how the markets work and learn some basic finance topics.
Here are just a few examples of things that you have to understand:
- How the markets work
- Supply and demand
- Asset types (e.g. stocks, futures, options, forex…)
- Buying and selling
- Bid/ask spreads
- Importance of liquidity
- Basic technical and fundamental factors
- Basic finance
- Trading on margin
- Risk management
As a trader, you need to know this stuff! Generally, I recommend building a solid knowledge foundation before risking any significant amounts of real money. Otherwise, I can tell you with a relatively high level of confidence that things won’t go too well.
Step 3: Learning to Program
There is simply no way around it. If you want to become an algorithmic trader, you will have to learn to code, unless you already have sufficient programming experience. But don’t worry. Learning to program can be fun and it is a very good skill to acquire anyway. Besides that, learning to program really isn’t that hard either.
Which programming language should you learn for algorithmic trading?
The language that you should learn for algorithmic trading purposes depends on what exactly you are planning to do with it. However, in my opinion, a very good and versatile language to start with is Python. It is easy to learn and you can do a lot with it. Furthermore, one of my favorite algorithmic trading platforms also solely supports Python for its algorithms. But more on that further down.
Alternatives to Python would be Java, C++, C# or even R. In an ideal world, you would learn more than one programming language. However, this isn’t necessary if you don’t want to do so. But believe me, after you learned one programming language such as Python, you will have a much better time learning a second or later even a third coding language.
A great place to start learning how to program is Udemy. Udemy is an online learning platform with thousands of courses on a wide variety of different topics including programming. Usually, you can get a course for as cheap as $10.
You can check out Udemy’s course catalog here.
Step 3.5: Learning Data Science
Before finally being able to start developing your own trading algorithms, you should learn how to deal with data. This can be just as essential as learning how to program. To develop your strategies, you will want to take advantage of the available data that exists in our day and age. However, to do so effectively, you should ideally acquire some data science skills.
Once again, no matter what you do, this is a useful skill to learn regardless. If you don’t learn how to handle large amounts of data, you could fall into some common pitfalls that could severely hinder your trading algorithms from performing as intended. So acquiring some basic data science knowledge is part of learning algorithmic trading.
Once again, a great place to learn about data science is Udemy. I know that having to learn all these different things might seem overwhelming. But don’t worry. At the end of this article, I will provide you with a link to a course that covers almost all the topics mentioned in this article. I have personally taken this course and can only recommend it.
Step 4: Develop Your Own Strategies/Algorithms
After learning how to program and about basic trading concepts, it is finally time to develop your own trading strategies in form of algorithms. But
Algorithmic Trading Platforms
To develop, backtest and optimize trading algorithms, you will need access to large amounts of data and access to a platform with a solid infrastructure that supports this. Luckily, you won’t have to acquire any of this yourself.
In fact, you can gain access to the just-mentioned things without having to spend a dime. Here are a few different platforms for algorithmic trading:
Quantopian is a web-based platform that allows you to backtest and create your own trading algorithms. Quantopian is probably the most popular and most used platforms when it comes to algorithmic trading for retail traders. They also offer the opportunity for your algorithms to participate in trading contests in which the creators of the best
The very best algorithms are even offered a chance to get funded with investors’ money. If you achieve this, you will obviously receive a certain percentage of the profits achieved with your algorithms (typically 10%).
Furthermore, every trading algorithm that you create on Quantopian is your intellectual property.
I have personally tried out Quantopian and can definitely recommend it.
Cost: Free (except for some premium data)
Assets: Equities and Futures
Quantiacs is an alternative to Quantopian. I personally don’t have any experience with them and thus, I can’t say too much about Quantiacs. However, I have heard a few good things about them.
They also offer contests with prize money and you can get funded with investors’ money if you develop a really good algorithm.
A few examples of brokers that support algorithmic trading are:
- Interactive Brokers
- (Tastyworks) Tastyworks has planned to launch an open API in 2019 which could lead to the ability to trade algorithmically with them.
With that being said, you really shouldn’t be concerned about signing up to a broker that has algo trading capabilities yet. Go through all the other steps first. Real life implementation is one of the very last steps.
Develop your own trading algorithms… finally!
Now it is finally time to develop your own trading strategies/algorithms. This is much more than just coming up with one good idea for a strategy. You also have to translate that idea to code, backtest it, optimize it…
Here are the steps necessary to create a winning trading algorithm:
- Come up with an idea: This will be the foundation of your trading strategy. Ideally, you find some kind of edge/inefficiency to exploit.
- Code it: The next step is to translate your idea into code.
- Backtest it: Next, it is time to test your algorithm on historical data.
- Optimize: You should continuously try to improve and optimize your
- Add safeguards: It is essential to add risk management to your trading algorithm. Add safeguards so that you can’t lose more than a certain amount of money on a single trade. Examples here would be stop-losses, dynamic position sizing, trailing stop losses, exposure and leverage limits etc.
- Test and optimize, optimize, optimize…: Don’t forget to backtest and to not stop optimizing! You should really stress-test your algorithm with a wide variety of different events to make sure it can handle the real world.
- Paper trade: Before letting your algorithm trade with any real money, let it trade with some no-risk, imaginary money. This will also allow you to find out if you overoptimized your
algoto the backtest data.
- Start small: Assuming everything else so far went good, it is finally time to start feeding your algorithm some real money. With that being said, make sure to start small.
- Increase size: If you are satisfied with the algorithm’s performance, you can slowly begin to allocate more capital to it.
- Optimize and monitor: Especially, in the beginning, it is very important to monitor your algorithm(s) so that you can see if it does what it should do. Ideally, all bugs should have been fixed in the previous steps. Nevertheless, you should oversee it and even consider intervening if there are problems.
I recommend checking out my article on how to develop a trading strategy to learn more about developing a profitable trading strategy with a real edge.
Here is how Quantopian’s integrated development environment looks like. This is where you can create and backtest your trading algorithms:
The world of quantitative trading is a very exciting and rapidly expanding one. I can only commend you if you want to get into it. I really hope this article gave you a good introduction to the ins and outs of algorithmic trading. Furthermore, I hope you now know how to continue your journey to learn
Here is a brief recap of the 4 steps you need to take to become an algorithmic trader:
- Understand what algorithmic trading is. (✅)
- Understand the world of trading. (❌)
- Learn to program and data science. (❌)
- Develop your own trading strategies/algorithms. (❌)
It is important to understand that all these steps go hand in hand with each other. Your ability to create robust and profitable trading algorithms highly depends on your understanding of the markets and coding/data science skills. The more you learn about programming and trading, the more tools you will have in your trading
Earlier in the article, I promised that I will provide you with a link to a course that I took that covers all of the above steps. So that’s exactly what I am going to do now:
The course is called Python for Financial Analysis and Algorithmic Trading. Just like the name implies, it covers everything from a crash course to python to some data science and how to use Quantopian to develop your own trading algorithms. Note, however, that if you are completely new to programming, you might want to take another course that is more tailored to learning how to program before taking this course.
The course has almost 20 hours of video material, 121 lectures, exercises, downloadable resources and more. Usually, you can gain access to the course for $10-$20.
If you prefer to take a different course, you can browse thousands of other courses on Udemy by clicking HERE.
Some of the links within this guide are affiliate links of which I receive a small compensation from sales of certain items. There are no added costs for you and these affiliate links do not influence the objectivity of my content. I do only recommend products that I have personally tested and used.