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
| Label | Config Parameter | Default Value | Detailed Description |
|---|---|---|---|
| Buy enabled | BUY_ENABLED | true | Allows the strategy to initiate buy or long orders when this setting is enabled. |
Short settings
| Label | Config Parameter | Default Value | Detailed Description |
|---|---|---|---|
| Sell enabled | SELL_ENABLED | true | Allows the strategy to initiate sell or short orders when this setting is enabled. |
Indicators
| Label | Config Parameter | Default Value | Detailed Description |
|---|---|---|---|
| Period | PERIOD | 15 | The 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 short | MACD_SHORT | 5 | The 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 long | MACD_LONG | 20 | The 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 signal | MACD_SIGNAL | 10 | The number of candles used to calculate the MACD signal line, which is compared to the MACD line to trigger buy or sell moments. |