Questions on combining signals with leading / lagging indicators (in my MT4 EA)


  1. In my (fully working) MQL4 EA, when i have an indicator that detects a trend early, how best can I confirm it with another indicator that detects a trend at a later time (at a different bar)?
  2. If the second (lagging) indicator is coming late, should i even bother confirming it with one that comes late, since it defeats the purpose of getting early signal?

What it is:

  1. Hi, I've created an EA that contains trend detection logic for about a dozen different indicators. (eg moving averages, ADX +/- crossovers, alligator crossovers, etc). In the EA input settings, you can mix and match the indicator method you want to use (set true / false ).

The way it works:

  1. On the open of every bar, I check for what trend is detected by each of the selected methods ( i usually use the previous bar's PRICE_CLOSE for my signals). If there is a corroboration across all of them (eg: all of them suggest an 'UP' trend), then I place my order, with a trailing stop stop loss that kicks in after 'X' pips of profit are secured (x is also an input).

Where I need help:

  1. These indicators get signals at different times, sometimes at different bars. In these cases, I wont get signal confirmation across all of them. In some cases, i have added logic to "Look back" at previous bars (using the 'shift' property that is included in most MQL4 indicators). This way i can look back a few bars to see if there was signal detected then. Should i continue going down this path? If so how many bars back should I look? Or is there, in fact, a better way?
  2. A more general question: should I even confirm a leading signal with a later signal? It seems that i would lose the benefit of early signal since i am waiting for a late confirmation. For example: a leading OBV+OBV MA crossover with a lagging moving average crossover.

Thanks in advance.

I am also running into a similar issue with my EA as several cross over functions will calculate several times before the end of the next candle, causing it to miss a ton of signals. Did you ever come to a conclusion on what was the best way to mitigate this? Ive been debating using a look back mechanic, but I am wondering if there is a better solution for this.