Chances are you’ve heard the term Golden Cross and Death Cross being thrown around if you’re been in crypto for any amount of time. These two signals are used to determine trend reversals and they translate very well to Algorithmic Trading.
Today, I wanted to talk a bit about the power these indicators have, and show you how to easily automate a trading strategy based on them.
In order to understand what the Golden Cross and Death cross are, it’s important to understand what Moving Averages (MAs) are, and how they relate to these signals. Moving Averages are lines plotted over the price of an asset used to measure the average price over a period of time, just like the blue and yellow lines in the chart below.
Moving averages can be simple (SMA) or exponential (EMA), with the latter giving more weight to recent prices and less to older prices, while the former treats all prices the same. The period , for instance SMA50 takes into account the last 50 candles on a candlestick chart.
A golden cross occurs when a short-term moving average crosses above a long-term moving average, usually with the 50-day MA as the short-term and the 200-day MA as the long-term average.
Golden cross signals are typically used in swing trading strategies, that work with medium to long timeframes, but can also be employed on shorter timeframes if you can account for some additional volatility.
This pattern is typically considered a bullish signal and because it’s so strightforward to set up and automate, it renders very well to an algorithmic trading strategy.
All we need to do is ensure that the SMA50 is higher than the SMA200. However, note that you will most likely want to confirm the movement by also adding other moving average indicators to your strategy such as the MACD and RSI.
To set up this bot as a no-code solution, we’re going to head over to AESIR and create a free account.
Once you’re in, navigate over to Create New Strategy. There you will see a screen similar to the one below.
The main configuration box called “General Options Layer” is a set of configuration settings that must be defined for any kind of strategy, including our Golden Cross one.
They include parameters like: trade amount, maximum number of open orders, Coins to analyse (simply remove BTC and ETH to look at all exchange coins) and Exit Strategies such as Stop Loss and Take Profit.
Oh — one thing that might not be immediately obvious is the “Frequency”. This determines how often your strategy checks you buy and sell signals. The quicker the strategy, the smaller you want this number to be.
Scroll down to a section called “Layer Selection” and let’s add the Technical Analysis Layer. This will allow us to run any kind of comparison against most indicators.
Click on Add Condition and select 50 period Simple Moving Average Greater Than 200 Period Simple Moving Average. Set the candle interval to any value you like, but bear in mind longer timeframes tend to perform better.
Click save and now let’s add a confirmation signal. Click on Computed Oscillators layer, and add the 1h MACD Moving average.
You might want to experiment with different timeframes and different confirmation signals.
Click save, now save the strategy again on the right hand side. Navigate to “MyStrategies” and start your strategy.
Congratulations, you’re now running a Golden Cross strategy in Paper Trading mode (using virtual money to simulate live trading).
Remember to test different scenarios and configuration options, this is just and example and you should not use it with live funds.