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.
Strategy settings for EMA spreadβ
Buy settingsβ
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Buy enabled | BUY_ENABLED | true | Enables the execution of buy or long orders. When enabled, the strategy can initiate buy orders. |
Sell settingsβ
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Sell enabled | SELL_ENABLED | true | Enables the execution of sell or short orders. When enabled, the strategy can initiate sell orders. |
Double check gain | DOUBLE_CHECK_GAIN | true | Verifies that a positive gain has been achieved before allowing a sell order. Disabling this option permits the strategy to execute sell orders at a loss, based on other indicatorsβ signals. |
Gain | GAIN | 1 | Defines the gain target above the break-even point that you aim to achieve before selling. |
Count sell | COUNT_SELL | 9999 | Disables a trading pair after reaching a specified number of sell orders since the pair was added. This parameter is used to limit exposure to frequently traded pairs and prevent overtrading. |
Indicatorsβ
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Period | PERIOD | 15 minutes | The period defines the duration of candlesticks in minutes used for calculating the indicators. It's important to select a value that is supported by your exchange to ensure accurate data. |
EMAx | EMAx | 0.5% | Sets the minimum percentage difference required between the fast and medium Exponential Moving Averages (EMAs) to consider it significant for the EMASPREAD strategy. |
Medium EMA | EMA1 | 16 | Specifies the number of candles used to calculate the medium Exponential Moving Average (EMA), which is crucial for smoothing out price data over a specified period. |
Fast EMA | EMA2 | 8 | Specifies the number of candles used to calculate the fast Exponential Moving Average (EMA), allowing for quicker response to price changes in your trading strategy. |
Overview of effects on different order typesβ
Config Parameter | Affected Order Types | Not Affected Order Types |
---|---|---|
Buy Enabled | Strategy buy, DCA buy, RT buy, RT buyback | Strategy sell, Stop limit, Close, RT sell |
Buy Level | Strategy buy | Strategy sell, Stop limit, Close, RT sell, DCA buy, RT buy, RT buyback |
Sell Enabled | Strategy sell, Stop limit, RT sell | Strategy buy, RT buy, RT buyback, Close, DCA buy |
Gain | Strategy sell | Strategy buy, RT buy, RT buyback, RT sell, Close, DCA buy, Stop limit |
Period | Strategy sell, Strategy buy, DCA buy (when using an indicator) | RT buy, RT buyback, RT sell, Close, Stop limit |
Slow EMA (EMA1) | Strategy buy | RT buy, RT buyback, RT sell, Close, Stop limit, Strategy sell, DCA buy |
Medium EMA (EMA2) | Strategy buy | RT buy, RT buyback, RT sell, Close, Stop limit, Strategy sell, DCA buy |
EMAx | Strategy sell, Strategy buy | RT buy, RT buyback, RT sell, Close, Stop limit, DCA buy |