EMA Spread

The EMA is an ‘Exponential Moving Average’, which means that is uses previous prices to calculate an average and the more recent the prices are the more weight is gets in th calculation. By using a combination of 2 EMA’s with different values it is possible to determine a short and long term price trend. The difference between these EMA values is what we call the EMA spread and this in its turn is used to determine a trend too.

EMA spread in Gunbot

You can use the EMA spread as a primairy strategy but also as a confirming indicator, in this article we will only discuss the second option. When your buy strategy decides that is would be a good time to buy, Gunbot will check if the confirming EMA spread agrees that it is a good time to buy. Only when both agree that it is a good moment to buy, Gunbot will place an order to buy a coin. The same goes for sell orders.

To enable EMA spread as a confirming indicator in your trading strategy go to Settings > Strategy configurator and select your strategy. Next, click the indicator tab and select the EMA Spread button, it will turn blue when activated. You will now see a new parameter appear, the EMAx. Use the EMAx to set the percentage that the 2 EMA’s have to be seperated by at least to enable any order. You can change the length of the EMA’s with the Fast EMA and Slow EMA. Please note that when changing these, it will also have effect on your primairy strategy and not just the confirming indicators. We highly reccommend that you use the Backtesting Add-on to find out what settings work best.


EMASPREAD false Values: true or false.
Setting this to true will enable EMASPREAD as a confirming indicator for both buy and sell orders. The spread is calculated each cycle by subtracting the lowest EMA value from the highest EMA.A buy signal occurs when EMA1 (slow EMA) is at least EMAx higher than EMA2 (fast EMA) and the EMASPREAD value starts to decrease (after having increased first). A sell signal occurs when EMA1 (slow EMA) is at least EMAxlower than EMA2 (fast EMA) and the EMASPREAD value starts to increase (after having decreased first).
EMAx 0.5 Values: numerical, represents a percentage.
Sets the minimum percentage difference between EMA1 and EMA2 for EMASPREAD.When set to 1, the spread must reach at least 1% before EMASPREAD can trigger a buy or sell.
EMA_LENGTH 50 Values: numerical, represents a number of candlestick periods.
Set this to the number of candlestick periods you want be available for calculating EMA1 and EMA2.

Sign up for our newsletter: