Skip to main content

EMA spread (futures)

Gunbot uses the Exponential Moving Average (EMA) to aim for buys at the start of an uptrend and sells when prices begin to move down. It monitors the spread between fast and slow EMAs, buying when the spread starts decreasing and selling 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 refine the buying and selling signals. For example, you may 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

This page explains how futures trading operates with the emaspread method. The triggers for trades differ slightly from those used in spot trading.

Gunbot opens a single position, either long or short, and closes it when the target is met. If the stop triggers before closing the trade at a profit, Gunbot will place a stop order at a loss. After closing a position, Gunbot will seek to open a new long or short position.

Buy method conditions

A long position is allowed when fast EMA is below slow EMA and the spread decreases.

Sell method conditions

A short position is allowed when fast EMA is above slow EMA and the spread decreases.

Conditions to close

A position is closed when the desired ROE is reached.

Conditions to stop

A position is closed at loss when negative ROE reaches the STOP_LIMIT target.

Strategy settings for EMA spread (futures)

Long settings

LabelConfig ParameterDefault ValueDetailed Description
Buy enabledBUY_ENABLEDtrueEnable or disable buy or long orders. When enabled, the strategy executes buy orders based on its configuration.

Short settings

LabelConfig ParameterDefault ValueDetailed Description
Sell enabledSELL_ENABLEDtrueEnable or disable sell or short orders. When enabled, the strategy executes sell orders based on its configuration.

Indicators

LabelConfig ParameterDefault ValueDetailed Description
PeriodPERIOD15The period setting determines the candlestick size used for indicator calculations, measured in minutes. Ensure the selected value is supported by your exchange.
EMAxEMAx0.5Defines the minimum percentage difference between the fast and medium Exponential Moving Averages (EMAs) needed for the EMASPREAD strategy to activate. For example, a value of 0.5% means the fast EMA must be at least 0.5% different from the medium EMA for a trade signal.
Medium EMAEMA116This parameter sets the number of candles used to calculate the medium Exponential Moving Average (EMA), providing a basis for the indicator's slower moving average.
Fast EMAEMA28This parameter sets the number of candles used to calculate the fast Exponential Moving Average (EMA), which is used to generate quicker, more responsive trading signals compared to the medium EMA.