MACD (futures)
This method uses the Moving Average Convergence Divergence (MACD) indicator to detect momentum shifts. The MACD is built from two exponential moving averages; a bullish signal occurs when the MACD line crosses above the signal line, and a bearish signal occurs when it crosses below.
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 crosses up the signal line.
Sell method conditions
Opening a short position is allowed when MACD crosses down the signal 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 MACD (futures)
Long settings
| Label | Config Parameter | Default Value | Detailed Description |
|---|---|---|---|
| Buy enabled | BUY_ENABLED | true | When enabled, the strategy can place buy or long orders when conditions are met. |
Short settings
| Label | Config Parameter | Default Value | Detailed Description |
|---|---|---|---|
| Sell enabled | SELL_ENABLED | true | When enabled, the strategy can place sell or short orders when conditions are met. |
Indicators
| Label | Config Parameter | Default Value | Detailed Description |
|---|---|---|---|
| Period | PERIOD | 15 | The period setting defines the candlestick size, in minutes, used for indicator calculation. Select a value supported by your exchange to ensure accurate data. |
| MACD short | MACD_SHORT | 5 | The MACD short term setting specifies the number of candles used to calculate the short-term moving average for MACD. Lower values make the indicator more sensitive to recent price changes. |
| MACD long | MACD_LONG | 20 | The MACD long term setting determines the number of candles used to calculate the long-term moving average for MACD. Higher values make the indicator less sensitive to recent price changes. |
| MACD signal | MACD_SIGNAL | 10 | The MACD signal setting controls the number of candles used to calculate the MACD signal line, which triggers buy and sell signals when compared to the MACD line. |