Skip to main content

EMA spread

Gunbot uses the Exponential Moving Average (EMA) to implement a method that aims to buy at the start of an uptrend and sell when prices begin to move down. This is achieved by monitoring the spread between fast and slow EMAs, with buying occurring when the spread starts decreasing and selling taking place when the spread decreases again as prices decline.

The spread is calculated each cycle by subtracting the lowest EMA value from the highest EMA. In addition to this core indicator, other tools can be used to refine the buying and selling signals. For example, you may choose to use the Relative Strength Index (RSI) as a confirmation signal

Spread calculation

The spread is calculated each cycle by subtracting the lowest EMA value from the highest EMA.

How to work with it

Buy method conditions

A buy order is allowed when the EMA spread decreases and slow EMA is above fast EMA. Additionally the spread must be at least as big as emaspread %.

Sell method conditions

A sell order is allowed when the EMA spread decreases and fast EMA is above slow EMA. Additionally the spread must be at least as big as emaspread %

:::Info Gain protection is optional for this strategy.

Be aware that this can lead to sell orders below your break-even point. :::

Trading example

Example of how trading with this strategy can perform. Details and settings.

The infographic below describes what triggers trades with this strategy.

Buy enabled

Set this to false to prevent Gunbot from placing buy orders.


Sell settings

Sell settings are the primary trigger for sell orders. These parameters control the execution of sell orders when using emaspread as sell method.

Sell enabled

Set this to false to prevent Gunbot from placing sell orders.


Gain

This sets the minimum target for selling when DOUBLE_CHECK_GAIN is enabled.


Indicator settings

Relevant indicators for trading with EMA spread

These settings have a direct effect on trading with emaspread.

Period

This sets the candlestick period used for trading, this affects all indicators within the strategy.

Only use supported values. The trading settings editor suggests valid values for the selected exchange..

Setting a short period allows you to trade on shorter trends, but be aware that these will be noisier than longer periods.


Slow EMA

Set this to the amount of candlesticks you want to use for your slow EMA. The closing price for each candle is used in the slow EMA calculation.

For example: when you set PERIOD to 5, and want to use 2h for slow EMA – you need to set EMA1 to 24 (24 * 5 mins).


Medium EMA

Set this to the amount of candlesticks you want to use for your medium EMA. The closing price for each candle is used in the fast EMA calculation.

For example: when you set PERIOD to 5, and want to use 1h for medium EMA – you need to set EMA2 to 12 (12 * 5 mins).


EMAx

Sets the minimum percentage difference between slow and fast EMA for emaspread.

When set to 1, the spread must reach at least 1% before emaspread can trigger a buy or sell.