Skip to main content

MACDH

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.

Long settings

Buy settings are the primary trigger for long orders. These parameters control the execution of long orders when using macdh as buy method.

Buy enabled

Set this to false to prevent Gunbot from opening long positions.


Short settings

Buy settings are the primary trigger for short orders. These parameters control the execution of short orders when using macdh as sell method.

Sell enabled

Set this to false to prevent Gunbot from opening short positions.


Indicator settings

Relevant indicators for trading with MACD.

These settings have a direct effect on trading with macdh.

Period

This sets the candlestick period used for trading, this affects all indicators within the strategy.

Only use supported values. The trading settings editor suggests valid values for the selected exchange..

Setting a short period allows you to trade on shorter trends, but be aware that these will be noisier than longer periods.


MACD Short

The number of periods used for calculating the short-term moving average for MACD.


MACD Long

The number of periods used for calculating the long-term moving average for MACD.


MACD Signal

The number of periods used for calculating the MACD signal line.