Divergence Macd Rsi
- Experts
- Julian Gonzalez Conde
- 버전: 1.0
- 활성화: 5
This expert advisor finds divergences and opens a buy or sell position taking into account the input parameters set by the user. Positions are opened once the divergence is detected and the pullback signal is triggered. The condition for a divergence to occur, is that the price moves in a different direction to the MACD and RSI. The type of divergences and the frequency at which they are detected depends entirely on the inputs entered by the user.
Features
- Functional for any symbol or periodicity.
- It is possible to set the type of divergence that the expert advisor will detect, by means of the input parameters (number of candles between maximums or minimums, how long the trend was, etc.).
- The volume of each trade can be modified.
- The technical indicators MACD, RSI and EMAs used for trend detection can be configured.
- The take profit and stop loss of each trade is dynamically calculated in such a way that the use of divergence is optimal.
- The expert advisor can be configured so that it does not trade, and instead acts as a technical indicator, displaying the detected divergences.
- When a divergence is detected, the expert advisor paints it on the chart by means of lines, all of which can be modified.
- The user can activate the sending of notifications to his mobile device to receive information on the trades made.
- Using the input parameters, the expert advisor can be instructed to use break even or several take profits.
Input parameters
Management of the number of candles:
- ncandles: Number of candles on which the algorithm searches for a divergence.
- crossClavOffset: Maximum number of candles until the price crosses the clavicular. Since the divergence is detected, if the price does not cross the clavicular in a number of candles less than this parameter, the possible entry is cancelled.
- minCandleOffset: Minimum number of candles that can exists between two minimums or maximums.
- ncandlesTrend: Minimum number of consecutive candles in which the price was in trend, i.e. for a value of 20, the divergence will not be detected unless it has been in trend for 20 candles or more, bearish or bullish depending on the type of divergence.
- maxPBoffset: Once the price cuts the clavicular, it waits for the pullback to make the entry. This parameter sets a maximum distance in candles, between the crossing with the clavicular and the pullback.
MACD configuration:
- fastEmaPeriod: Period for the fast EMA of the MACD.
- slowEmaPeriod: Period for the slow MACD EMA.
- signalPeriod: Period for the MACD signal.
RSI configuration:
- rsiPeriod: Period for the RSI.
Period of the EMAs for trend detection:
- emaPeriodFast: Period for the fast EMA for trend detection.
- emaPeriodSlow: Period of the fast EMA for trend detection.
Volume management:
- volume: Volume set for each trade.
Price ratio management:
- minPriceOffsetPerc: In case of bullish divergence, minimum ratio when performing the division of the second minimum by the first. minmin2/minimum1> 1 + minPriceOffsetPerc.
- minDifferenceMaxMin: Of the two consecutive maximums or minimums of the divergence (in case of bearish divergence), this parameter sets a minimum ratio between the second maximum and the minimum between the first and second maximum. For a value of 0.1, max2/min> 1 + 0.1 .
General settings:
- useBreakEven: Uses breakeven in trading (only if mutiple take profit is enabled).
- useMultipleTp: Sets two take profit levels, the original and an intermediate one.
- macdDivergenceMargin: Hold at 0 for normal operation, allows to validate a divergence for an apparently flat MACD. Being x1 and x2 the MACD at the first and second maximum, entering this margin as 3, if x1 = 40 and x2 = 42, divergence would exist, as with x1 = -66 and x2 = -67.
- magicNumber: Magic number.
- sendNotification: If enabled, the user will receive push notifications on their mobile phone of trades made.
- enableTrading: If enabled, the expert advisor performs buy/sell trades, otherwise it acts as a divergence detector.