Build Your Own MACD Zero Cross Strategy using MetaTrader and Python
You’ll be getting your own MACD Zero Cross Strategy BUY signals and SELL signals by the end of this article!
Using Python code and MetaTrader 5, the signals will be completely customizable by you so you can figure out what combination generates profit for every trading pair!
Read on to find out how.
Update August 2023
I could never have anticipated how popular this blog, along with a YouTube channel would become.
After a listening to my readers/viewers feedback, I realized that many people were spending huge amounts of time trying to solve installation/configuration problems — rather than experiencing the joy of algorithmic trading.
I want to change this narrative — and in so doing, open up algorithmic trading for everyone.
To do this, I’ve recently launched Tradeoxy: Trading For Everyone.
If you’re reading this, Tradeoxy will simplify 90% of this series, using a series of powerful API’s and easy to use tooling.
Currently it’s in the early-access / building stage and I’d be incredibly grateful if you’d join us on this adventure. Your feedback will help us shape a better product.
The MACD Indicator
While this article is focused on building the MACD Zero Cross strategy into your Python trading bot, I did want to cover a few key pieces of information about the MACD Technical indicator.
First, the MACD indicator provides three separate elements:
- MACD Line
- MACD Signal Line
- MACD Histogram
Each of these elements provides different insight, however, for the MACD Zero Cross Strategy, we’ll be using the MACD Line and a Zero Line.
Secondly, the MACD indicator typically uses the following values to generate the analysis:
- Fast EMA: 12