MACD
This approach utilizes the MACD indicator, which identifies possible shifts in momentum by analyzing signals.
The Moving Average Convergence Divergence (MACD) is a technical indicator that helps traders determine potential changes in an asset's momentum. The indicator is based on the convergence and divergence of two exponential moving averages, typically a 12-period EMA and a 26-period EMA. Traders use the MACD to identify whether an asset is likely to experience a bullish or bearish trend, as well as potential trend reversals. When the MACD line crosses above the signal line, it is considered a buy signal, while a crossover below the signal line indicates a sell signal.
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 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.
Long settings
Buy settings are the primary trigger for long orders. These parameters control the execution of long orders when using macd
as buy method.
Buy enabled
- Description
- Values
- Order types
- Name
Set this to false to prevent Gunbot from opening long positions.
Values: true or false
Default value: true
Affects | Does not affect |
---|---|
Strategy buy | Strategy sell |
DCA buy | Stop limit |
RT buy | Close |
RT buyback | RT sell |
Parameter name in config.js
: BUY_ENABLED
Short settings
Buy settings are the primary trigger for short orders. These parameters control the execution of short orders when using macd
as sell method.
Sell enabled
- Description
- Values
- Order types
- Name
Set this to false to prevent Gunbot from opening short positions.
Values: true or false
Default value: true
Affects | Does not affect |
---|---|
Strategy buy | Strategy sell |
DCA buy | Stop limit |
RT buy | Close |
RT buyback | RT sell |
Parameter name in config.js
: SELL_ENABLED
Indicator settings
Relevant indicators for trading with MACD.
These settings have a direct effect on trading with macd
.
Period
- Description
- Values
- Order types
- Name
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.
Values: numerical– represents candlestick size in minutes.
Default value: 15
Affects | Does not affect |
---|---|
Strategy sell | RT buy |
Strategy buy | RT buyback |
RT sell | |
Close | |
Stop limit | |
DCA buy |
Parameter name in config.js
: PERIOD
MACD Short
- Description
- Values
- Order types
- Name
The number of periods used for calculating the short-term moving average for MACD.
Values: numerical, represents a number of periods.
Default value: 5
Affects | Does not affect |
---|---|
Strategy sell | RT buy |
Strategy buy | RT buyback |
RT sell | |
Close | |
Stop limit | |
DCA buy |
Parameter name in config.js
: MACD_SHORT
MACD Long
- Description
- Values
- Order types
- Name
The number of periods used for calculating the long-term moving average for MACD.
Values: numerical, represents a number of periods.
Default value: 20
Affects | Does not affect |
---|---|
Strategy sell | RT buy |
Strategy buy | RT buyback |
RT sell | |
Close | |
Stop limit | |
DCA buy |
Parameter name in config.js
: MACD_LONG
MACD Signal
- Description
- Values
- Order types
- Name
The number of periods used for calculating the MACD signal line.
Values: numerical, represents a number of periods.
Default value: 10
Affects | Does not affect |
---|---|
Strategy sell | RT buy |
Strategy buy | RT buyback |
RT sell | |
Close | |
Stop limit | |
DCA buy |
Parameter name in config.js
: MACD_SIGNAL