Skip to main content

MACDH (futures)

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

Gunbot will open one position, either long or short, and close this position when the target is reached. When the stop is hit before profitably closing a trade, Gunbot will place a stop order at loss. After closing a position, Gunbot will again look to open a new long or short position. Gunbot will 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. Make sure to select a value that is supported by your exchange.

This value helps determine the temporal resolution of data that will influence your MACD calculation.
MACD shortMACD_SHORT5The MACD short setting determines the number of candles used to calculate the short-term moving average for the MACD indicator. This affects how quickly the MACD 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. A higher number results in a smoother and less reactive moving average.
MACD signalMACD_SIGNAL10The number of candles used to calculate the MACD Signal line. This setting is crucial as it generates the signal line that helps identify potential buy or sell moments by comparing it to the MACD line.