Skip to main content

MACD histogram

This approach relies on the MACD histogram, which is a technical indicator used to track trends. Specifically, it leverages signals that suggest a crossover is probable when the MACD signal line reaches a certain point.

The MACD histogram, short for Moving Average Convergence Divergence histogram, is a popular tool used by traders to identify potential buy and sell signals in a stock's price chart. It is created by subtracting the 26-period exponential moving average (EMA) from the 12-period EMA, resulting in a line that oscillates above and below a zero line. When the MACD line crosses above the signal line (a 9-period EMA of the MACD), it is seen as a bullish signal, while a cross below indicates a bearish signal.

The MACD histogram takes this analysis one step further by plotting the difference between the MACD line and the signal line as bars above and below the zero line. This makes it easier to identify changes in momentum and confirm trend reversals.

How to work with it

Buy method conditions

A buy order is allowed when the MACD histogram crosses up the zero line.

tip

Normal constraints like "buy once, sell once" don't apply to this strategy: each time buying criteria occur, Gunbot will place a buy order as high as set in your balance settings.

Sell method conditions

A sell order is allowed when the MACD histogram drops below 0.

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 MACDH

Buy settings

LabelConfig ParameterDefault ValueDetailed Description
Buy enabledBUY_ENABLEDtrueAllows you to enable or disable the ability to make buy or long orders. When enabled, buy orders are permitted.
Single buySINGLE_BUYfalseEnables you to restrict the strategy to only one buy order. If enabled, the strategy will only execute one buy order and then no further buy orders will be permitted.

Sell settings

LabelConfig ParameterDefault ValueDetailed Description
Sell enabledSELL_ENABLEDtrueAllows you to enable or disable the ability to make sell or short orders. When enabled, sell orders are permitted.
Double check gainDOUBLE_CHECK_GAINtrueThis setting ensures that there is a positive gain before allowing a sell order. If disabled, it allows the indicators to execute a sell order even at a loss, potentially useful in certain strategic scenarios.
GainGAIN1This setting targets a gain above break-even, expressed as a percentage. The default value is set at 1%, with adjustable values ranging from 0.1% to 5%. This helps in setting profit goals for each trade.
Count sellCOUNT_SELL9999Limits the number of sell orders for a pair after adding it to the trading strategy. The default setting allows for nearly unlimited sells, but can be adjusted to suit your strategy needs.

Indicators

LabelConfig ParameterDefault ValueDetailed Description
PeriodPERIOD15 minutesThe period setting defines the 'size' or duration of candlesticks used for indicator calculation. It's important to use a supported value for your exchange. The default is set at 15 minutes, which is commonly supported for intraday trading.
MACD shortMACD_SHORT5The short-term moving average for the MACD indicator is calculated over the number of candles specified.
MACD longMACD_LONG20The long-term moving average for the MACD indicator is calculated over a larger number of candles. The default value of 20 provides a broader view of market trends. This setting can be adjusted.
MACD signalMACD_SIGNAL10This setting specifies the number of candles used to calculate the MACD Signal line. A default setting of 10 provides a balance between sensitivity and reliability.

Overview of effects on different order types

Config ParameterAffected Order TypesNot Affected Order Types
Buy EnabledStrategy buy, DCA buy, RT buy, RT buybackStrategy sell, Stop limit, Close, RT sell
Single BuyStrategy buyStrategy sell, Stop limit, Close, RT sell, DCA buy, RT buy, RT buyback
Sell EnabledStrategy sell, Stop limit, RT sellStrategy buy, RT buy, RT buyback, Close, DCA buy
GainStrategy sellStrategy buy, RT buy, RT buyback, RT sell, Close, DCA buy, Stop limit
PeriodStrategy sell, Strategy buy, DCA buy (when using an indicator)RT buy, RT buyback, RT sell, Close, Stop limit
MACD ShortStrategy sell, Strategy buyRT buy, RT buyback, RT sell, Close, Stop limit, DCA buy
MACD LongStrategy sell, Strategy buyRT buy, RT buyback, RT sell, Close, Stop limit, DCA buy
MACD SignalStrategy sell, Strategy buyRT buy, RT buyback, RT sell, Close, Stop limit, DCA buy