Multi oscillator divergence EA
This multi oscillator Expert Advisor identifies when a divergence occurs between price and an oscillator. It identifies both regular/classical (trend reversal) and hidden (trend continuation) divergences. It has RSI, Pin bar and Engulfing filter options which makes it possible to filter out only the strongest setups.
Due to the numerous amount of settings the Expert Advisor is mainly aimed for intermediate to advanced traders who already have experience with divergence trading.
- Can detect divergences for the following oscillators: MACD, OsMA (Moving average of Oscillator), Stochastic, RSI, CCI, RVI and Awesome. Only one oscillator can be selected.
- Possibility to close half position selecting from different strategies.
- 2 moving averages with different periods can be enabled as a trend filter. For instance MA 200 and MA 21.
- Spread and slippage filter.
- Averaging down function (the EA complies with NFA FIFO regulations when using the correct settings. Please see the blog.)
It is recommended to trade a portfolio of minimum 6 symbols at the same time to reduce risk as much as possible. Please also make sure that you test the EA on a demo account and let at least 20 trades be done. I recommend you to start with the preset (.set) files when you will do your own back testing and fine tuning in the strategy tester.
Parameters marked with an asterisk (*) in the beginning are explained here.
- * Time frame to operate on
- Send alert instead of opening trade - When set to 'true' an alert will be sent instead of opening a trade.
- ECN account - 'true' or 'false'.
- Main oscillator
- Second oscillator (double divergence) - If set to NONE then only the main oscillator will be used.
- Divergence candle shift (must be >0) - When set to 1 you will be able to catch the movement earlier. On the other hand, the signal is less reliable.
- Double divergence max. candle shift - How many candles back in time to look for the second divergence.
- * Second divergence time frame.
- * Bars to check (divergence depth).
- * Trade only if divergence candle high/low crossed.
- * Offset in points from candle high/low.
- Maximum bars signal is valid for - The market order will not be placed after this amount of bars.
- REGULAR DIVERGENCE SETTINGS (trend reversal)
- Trade regular.
- RSI filter method.
- Use moving average filter.
- HIDDEN DIVERGENCE SETTINGS (trend continuation)
- Trade hidden.
- RSI filter method.
- Use moving average filter.
- Open buy order - 'true' or 'false'.
- Open sell order - 'true' or 'false'.
- Enable trade time filter (your broker's server time) - Time filter for opening trades.
- Trade from/to time - Hour and minutes from/to.
- * Maximum allowed slippage in points.
- * Maximum allowed spread in points (0 = not used).
- * Risk in percentage (>0 = auto lot).
- * Point value for risk percentage.
- Manual lots - Will be used if Risk above is set to 0.
- * Max allowed balance drawdown % (100=disabled)
- * Orders with this Magic number (0=all)
- * Close orders
- * Type of stop loss/exit
- Fixed stop loss (SL).
- * Take profit method
- * Close half position
- Fixed take profit.
- * Trailing stop.
- * Trailing step.
- * Risk/Reward ratio.
- Break-even (0 = disabled).
- * Break-even trigger.
- MACD AND OsMA SETTINGS
- Fast MA - Default is 12 (5 for Awesome).
- Slow MA - Default is 26 (34 for Awesome).
- Signal MA - Default is 9 (not used with Awesome).
- STOCHASTIC SETTINGS
- CCI, RSI AND RVI SETTINGS
- * CANDLE PATTERNS FILTER SETTINGS
- MOVING AVERAGE (MA) FILTER SETTINGS
- Slow/fast MA - Default is 200/21. If fast is set to same as slow then only the slow MA filter will be used.
- Slow/fast MA method - Default is Simple (SMA).
- Slow/fast MA price type - Default is Close.
- MA time frame - It is recommended to set this to one time frame higher than the divergence time frame.
- RSI FILTER SETTINGS
- RSI overbought and oversold levels - The divergence candle must form above/below these levels in order to be valid.
- RSI Period - Default period is 10.
- RSI apply to price - RSI level is calculated from this setting. Default is Typical price.
- * Averaging settings
- ALERTS (if alert instead of trade is enabled)
- Set to 'true' for each alert type you would like to activate.
- EA SETTINGS
- * Magic number.
- * Order comment.
1) stop trade on all pairs if the accumulated floating profit is less than xx% compared with the account balance
2) added support for NFA FIFO regulations (must be when using averaging down)
3) added the possibility to show an on chart information panel when using the averaging down function
- added the possibility to use minutes as well in the time filters
- it is now possible to use separate RSI levels for hidden divergences
- the parameter 'Wait for candle close' has been replaced with Candle shift
- Added support for opening a trade only in case the divergence also appears on a higher time frame.
- added possibility for trailing step
- added possibility to close half position at support/resistance, pivot point, ATR level or pin bar
- added Risk/reward logic
- added support for double divergence
- added combo box for stop loss methods
- added parameter checkup when loading the EA