Multiple Indicator Confluence Trading Strategies  EA MT4/MT5 BACKTESTS & NEW OPTIMIZED SET FILES

Multiple Indicator Confluence Trading Strategies EA MT4/MT5 BACKTESTS & NEW OPTIMIZED SET FILES

17 November 2024, 16:23
Biswarup Banerjee
0
49

Combined Indicator Settings Documentation

This section provides comprehensive documentation for the multiple indicators included in the EA. Each indicator is configurable through its specific input parameters, allowing users to tailor their strategies for various market conditions. The Enable Settings section allows users to activate or deactivate specific indicators based on their trading preferences.

MT4 Version is available here   Multi Indicator Signal EA MT4

MT5 Version is available here   Multi Indicator Strategy EA MT5

1. RSI 1 Settings

Core Parameters:

  • RSI1_TIMEFRAME: Timeframe for the RSI indicator.
    Default: PERIOD_CURRENT .
  • RSI1_PERIOD: The number of periods used to calculate the RSI.
    Default: 14 .
  • RSI1_APPLIED_PRICE: Price type for calculation (e.g., Close, Open, High).
    Default: PRICE_CLOSE .
  • RSI1_UPPER_LEVEL: The overbought level of RSI.
    Default: 80 .
  • RSI1_LOWER_LEVEL: The oversold level of RSI.
    Default: 20 .

2. Moving Average (MA) Settings

MA 1 Settings:

  • MA1_TIMEFRAME: Timeframe for the MA calculation.
    Default: PERIOD_CURRENT .
  • MA1_MODE: MA method (SMA, EMA, etc.).
    Default: MODE_SMA .
  • MA1_PERIOD: The number of periods for the MA.
    Default: 10 .
  • MA1_SHIFT: Shift the MA line forward or backward.
    Default: 0 .
  • MA1_APPLIED_PRICE: Price type for calculation.
    Default: PRICE_CLOSE .

MA 2 Settings:

  • Same parameters as MA 1, with default MA2_PERIOD set to 30 .

3. ADX 1 Settings

Core Parameters:

  • ADX1_TIMEFRAME: Timeframe for ADX calculation.
    Default: PERIOD_CURRENT .
  • ADX1_PERIOD: The number of periods for ADX calculation.
    Default: 14 .
  • ADX1_PRICE_TYPE: Price type for calculation.
    Default: PRICE_CLOSE .
  • ADX1_MA_METHOD: The moving average method used in ADX.
    Default: MODE_SMA .
  • ADX1_LEVEL: ADX level threshold.
    Default: 20 .

4. CCI Settings

Core Parameters:

  • CCI1_TIMEFRAME: Timeframe for CCI calculation.
    Default: PERIOD_CURRENT .
  • CCI1_PERIOD: The number of periods for CCI calculation.
    Default: 14 .
  • CCI1_APPLIED_PRICE: Price type for calculation.
    Default: PRICE_CLOSE .
  • CCI1_UPPER_LEVEL: Overbought threshold for CCI.
    Default: 100 .
  • CCI1_LOWER_LEVEL: Oversold threshold for CCI.
    Default: -100 .

5. MACD 1 Settings

Core Parameters:

  • MACD1_TIMEFRAME: Timeframe for MACD calculation.
    Default: PERIOD_CURRENT .
  • MACD1_SHORT_PERIOD: Number of periods for the fast EMA.
    Default: 12 .
  • MACD1_LONG_PERIOD: Number of periods for the slow EMA.
    Default: 26 .
  • MACD1_SIGNAL_PERIOD: Number of periods for the signal line.
    Default: 9 .
  • MACD1_APPLIED_PRICE: Price type for calculation.
    Default: PRICE_CLOSE .

6. Stochastic 1 Settings

Core Parameters:

  • STOCHASTIC1_K_PERIOD: %K line period.
    Default: 14 .
  • STOCHASTIC1_D_PERIOD: %D line period.
    Default: 3 .
  • STOCHASTIC1_SLOWING_PERIOD: Smoothing period.
    Default: 3 .
  • STOCHASTIC1_MA_METHOD: MA method for smoothing.
    Default: MODE_SMA .
  • STOCHASTIC1_PRICE: Price type for calculation.
    Default: STO_LOWHIGH .
  • STOCHASTIC1_UPPER_LEVEL: Overbought threshold.
    Default: 80 .
  • STOCHASTIC1_LOWER_LEVEL: Oversold threshold.
    Default: 20 .

7. Awesome Oscillator 1 Settings

Core Parameters:

  • AWSOME_OSCILATOR1_TIMEFRAME: Timeframe for AO calculation.
    Default: PERIOD_CURRENT .

8. Bollinger Bands Settings

Core Parameters:

  • BOLLINGER_BAND1_TIMEFRAME: Timeframe for Bollinger Bands.
    Default: PERIOD_CURRENT .
  • BOLLINGER_BAND1_PERIOD: Number of periods for Bollinger Bands.
    Default: 14 .
  • BOLLINGER_BAND1_DEVIATION: Standard deviation multiplier.
    Default: 3 .
  • BOLLINGER_BAND1_SHIFT: Shift the bands forward or backward.
    Default: 0 .
  • BOLLINGER_BAND1_APPLIED_PRICE: Price type for calculation.
    Default: PRICE_CLOSE .

9. RVI 1 Settings

Core Parameters:

  • RVI1_TIMEFRAME: Timeframe for RVI calculation.
    Default: PERIOD_CURRENT .
  • RVI1_PERIOD: Number of periods for RVI calculation.
    Default: 10 .
  • RVI1_UPPER_LEVEL: Overbought threshold.
    Default: 0.4 .
  • RVI1_LOWER_LEVEL: Oversold threshold.
    Default: -0.4 .

10. Enable Settings

Activation Flags:

  • enableRSI: Enable or disable RSI. Default: false .
  • enableMA: Enable or disable MA indicators. Default: true .
  • enableADX: Enable or disable ADX. Default: false .
  • enableCCI: Enable or disable CCI. Default: false .
  • enableMACD: Enable or disable MACD. Default: false .
  • enableStochastic: Enable or disable Stochastic. Default: false .
  • enableAwesomeOscillator: Enable or disable AO. Default: false .
  • enableBollinger: Enable or disable Bollinger Bands. Default: false .
  • enableRVI: Enable or disable RVI. Default: false .
  • ENABLE_MA_FILTER: Enable or disable MA trend filtering. Default: false .

MA 3 Settings:

  • MA3_TIMEFRAME: Timeframe set to  H4  by default.This moving average is for trend determination
  • Same parameters as MA 1, with MA3_PERIOD set to  50 .
  • When close is above ma3 then trend is up otherwise down

Strategy Overview

The strategy works by combining multiple technical indicators to filter and confirm entry signals. Users can enable or disable specific indicators (like RSI, MACD, MA, etc.) in the settings to tailor the strategy to their preferences. Once enabled, the selected indicators are used in conjunction to identify buy and sell opportunities based on specific conditions. A trade signal is only generated if:

  1. The conditions for the selected indicators are satisfied on the last candle.
  2. These conditions were not satisfied on the previous candle, ensuring the signal represents a fresh setup.

Example with Enabled Indicators: MACD, Moving Average, RSI

Buy Entry Conditions:

  1. MACD Histogram on the last candle is greater than 0.
  2. MA1 value is greater than MA2 (indicating an uptrend).
  3. RSI value on the last candle is below the overbought zone (below 80).
  4. These conditions were not satisfied on the second-to-last candle.

Sell Entry Conditions:

  1. MACD Histogram on the last candle is less than 0.
  2. MA1 value is less than MA2 (indicating a downtrend).
  3. RSI value on the last candle is above the oversold zone (above 20).
  4. These conditions were not satisfied on the second-to-last candle.

Examples with Algorithms

Example 1: Buy Signal

  • Indicators Enabled: MACD, Moving Average, RSI
  • Scenario:
    • Candle 2 (two candles back):
      • MACD Histogram = -0.1
      • MA1 = 1.1200, MA2 = 1.1220 (MA1 < MA2)
      • RSI = 82 (above overbought)
    • Candle 1 (last candle):
      • MACD Histogram = 0.5
      • MA1 = 1.1230, MA2 = 1.1225 (MA1 > MA2)
      • RSI = 75 (below overbought)
  • Result: A Buy Entry is triggered on the last candle.
Algorithm:
  1. Check if MACD > 0 on the last candle.
  2. Confirm MA1 > MA2 on the last candle.
  3. Ensure RSI < overbought on the last candle.
  4. Verify that any of these conditions were not satisfied on the second-to-last candle.

Example 2: Sell Signal

  • Indicators Enabled: MACD, Moving Average, RSI
  • Scenario:
    • Candle 2 (two candles back):
      • MACD Histogram = 0.2
      • MA1 = 1.3050, MA2 = 1.3030 (MA1 > MA2)
      • RSI = 35 (below oversold)
    • Candle 1 (last candle):
      • MACD Histogram = -0.3
      • MA1 = 1.3020, MA2 = 1.3035 (MA1 < MA2)
      • RSI = 25 (above oversold)
  • Result: A Sell Entry is triggered on the last candle.
Algorithm:
  1. Check if MACD < 0 on the last candle.
  2. Confirm MA1 < MA2 on the last candle.
  3. Ensure RSI > oversold on the last candle.
  4. Verify that any of these conditions were not satisfied on the second-to-last candle.

Example 3: Complex Setup with Additional Filters

  • Indicators Enabled: MACD, Moving Average, RSI, Bollinger Bands
  • Scenario:
    • Candle 2 (two candles back):
      • MACD Histogram = 0.3
      • MA1 = 1.1500, MA2 = 1.1495 (MA1 > MA2)
      • RSI = 78
      • Price = Below the upper Bollinger Band.
    • Candle 1 (last candle):
      • MACD Histogram = -0.1
      • MA1 = 1.1480, MA2 = 1.1490 (MA1 < MA2)
      • RSI = 22
      • Price = Below the lower Bollinger Band.
  • Result: A Sell Entry is triggered, considering Bollinger Band confirmation.
Algorithm:
  1. Ensure the additional Bollinger Bands condition is met (price below lower band for sell, above upper band for buy).
  2. Proceed with the standard MACD, MA, and RSI checks for the last candle.
  3. Verify that conditions on the second-to-last candle differ.

Advantages of This Strategy:

  1. Flexibility: Users can enable/disable indicators to customize the strategy.
  2. Confirmation: Combines multiple indicators to reduce false signals.
  3. Freshness: Avoids repetitive signals by checking for unsatisfied conditions on the previous candle.


2. Additional Features

Moving Average (MA) Filter on Higher Timeframe

The MA filter enables trades that align with the broader trend based on a higher timeframe moving average:

  • Uptrend Condition - Allows buy trades when the close price is above the moving average.
  • Downtrend Condition - Allows sell trades when the close price is below the moving average.

Loss Recovery Strategies

There are couple of loss recovery strategies popular in the market. Grid, Hedge and Martingale is most popular among them. In this EA, we have these strategies inbuilt. But only one loss recovery strategy can be active at a time. EA will not load, if we enable more than one loss recovery strategies. There is one important point regarding these strategies, we can not set stoploss if you enable Grid or Hedge strategy. It will close trades earlier and will compromise the purpose of these strategies. All of these strategies are by default disabled.

Grid Recovery Strategy
In a losing position, the EA places additional trades in a grid pattern, averaging down the entry price to capitalize on retracements.
Hedge Strategy
To balance exposure during a losing position, the EA opens opposing trades (hedges), allowing profit potential in countertrend movements.
Martingale Strategy
Increases lot size after a loss on each subsequent signal, aiming for overall profitability.


Position Sizing Based on Profit
This feature adjusts the position size dynamically based on cumulative profit, aiming to optimize gains in favourable conditions. As profit accumulates, the EA increases the position size, allowing for scaled growth and larger potential returns.


Day Filter
Specifies trading days to avoid trading during specific days of the week, aligning with your strategy’s optimal market conditions. You can disable the entire day filter.


Time Filter
Limits trading to specific times, preventing trades during low-liquidity periods or other non-ideal market conditions. You can disable entire time filter.


This ADX-based EA, with versatile entry and exit strategies and advanced risk management features, is a comprehensive tool designed to adapt to various market conditions while offering robust control over trading operations. Use each feature thoughtfully to align with your trading objectives and risk management strategy.

 

3 .Backtests and Optimized Set files

The EA can be back tested with various different strategies with the help of different combinations of these options

  • Stop-Loss and Take-Profit
  • Single or Multiple Entry (Multiple entries is not suitable for Grid)
  • Entry Option
  • Exit Option (Not suitable for Grid, Hedge and Martingale) (Enable/Disable)
  • Time Filter (Enable/Disable)
  • Day Filter (Enable/Disable)
  • Breakeven (Enable/Disable)
  • Trailing Stop-Loss (Enable/Disable)
  • Daily, Weekly and Monthly Profit
  • Grid (Enable/Disable) with no stoploss
  • Hedge (Enable/Disable) with no stoploss
  • Martingale (Enable/Disable) with no stoploss
  • Higher timeframe Moving Average Trend Filter (Enable/Disable)

We have optimized our EA based on these different combinations in different timeframes (5Minute to 4 Hours). These optimizations are mainly performed on EURUSD, USDCHF, AUDUSD, GBPUSD, USDCAD, NZDUSD AND XAUUSD. We have run these optimizations on 4-10 years of data. You can find the optimized set files and results below.

Note: We have run the optimizations on every period calculation for faster results. In this approach calculation are perform on every candle loading. You can backtest on everytick mode, but backtest would be much slower. Optimization results may be different in different brokers. It depends on the mt5 data cache and specific broker data. Ideally mt5 has 99.99 tick quality data. For mt4 you need to purchase 99.99 quality data from specific providers. Each individual has their own preference of their settings and symbols. In case you need more optimized data you can always optimize yourself.

You can follow this video to learn how to optimize the EA.