Skip to main content

MACDH (futures)

This method uses the MACD histogram to detect momentum shifts. The histogram shows the difference between the MACD line and its signal line, so zero-line crosses indicate a change in momentum.

What is MACD Histogram

The MACD histogram plots the difference between the MACD line and the signal line as bars above or below zero, making momentum shifts easier to see.

How to work with it

Gunbot opens one position, either long or short, and closes it when the target is reached. If the stop triggers before a profitable close, Gunbot places a stop order at a loss. After closing a position, Gunbot looks to open a new long or short position. Gunbot does not add to existing open positions.

Buy method conditions

Opening a long position is allowed when MACD histogram crosses up the zero line.

Sell method conditions

Opening a short position is allowed when MACD histogram crosses down the zero line.

Conditions to close

Position is closed when the desired ROE (return on equity) is reached. This is a percentage from the entry point, taking leverage into consideration.

Conditions to stop

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

Strategy settings for MACDH (futures)

Long settings

LabelConfig ParameterDefault ValueDetailed Description
Buy enabledBUY_ENABLEDtrueAllows the strategy to initiate buy or long orders when this setting is enabled.

Short settings

LabelConfig ParameterDefault ValueDetailed Description
Sell enabledSELL_ENABLEDtrueAllows the strategy to initiate sell or short orders when this setting is enabled.

Indicators

LabelConfig ParameterDefault ValueDetailed Description
PeriodPERIOD15The period setting represents the \"size\" of the candlesticks, in minutes, used for indicator calculations. Select a value supported by your exchange. This determines the temporal resolution that drives MACD calculations.
MACD shortMACD_SHORT5The MACD short setting determines the number of candles used to calculate the short-term moving average for the MACD indicator, affecting how quickly it reacts to price changes.
MACD longMACD_LONG20The MACD long setting defines the number of candles used to calculate the long-term moving average for the MACD indicator. Higher values result in a smoother, less reactive average.
MACD signalMACD_SIGNAL10The number of candles used to calculate the MACD signal line, which is compared to the MACD line to trigger buy or sell moments.