Topic: EAS strategy with MACD has different trades than it's exported EA
I have a strategy generated by Expert Advisor Studio that includes a MACD crossover entry rule. When I view the journal of trades from this strategy in EAS I see a list of trades. However, when I export this strategy to MQL5 and backtest it on the exact same historical data, MT5 journal shows a different set of trades. There are a few trades MT5 executes which EAS did not. I'm trying to figure out why.
It seems that the MACD entry trigger is not the same in both environments. When comparing journals between EAS and the backtested EA, most of the trades match up perfectly. However, the MT5 EA seems to execute a few additional trades that EAS did not. This leads to MT5 backtest results that are different than EAS backtest results.
Is it possible that MACD in the EAS indicator chart has slightly different values than in MT5 and is not behaving exactly the same way it does in an expert advisor? As stated, the underlying historical data for both is identical.
UPDATE:
I attached a zip file contain three files so that anyone can replicate this issue.
USTECHIndex1.json - The historical data
Strategy Collection 1 USTECHIndex M1.json - The EAS strategy
EA Studio USTECHIndex M1 22212606.mq5 - The exported MT5 EA
Load the historical data into EAS (1), load the strategy into EAS (2), and then view the journal. Notice that at 05/11/2020, 19:36 a long position is opened. Let's call this the "19:36" position. The next position is another long position opened at 05/11/2020, 20:23. Let's call this the "20:23" position.
Now, load the MT5 EA (3) into MT5 and, using the same historical data, backtest the strategy using tick data resolution over a date range that includes 05/11/2020. Note that, as expected, the EA opens both of the positions mentioned above. However, it also opens a position in between them. The EA opens a third position at 05/11/2020, 19:36 a long position is opened. Let's call this the "19:36" position. The next position is another long position opened at 05/11/2020, 20:18 because the MACD entry criteria is met.
In short, it seems the MACD values in the EAS indicator chart are different than the MACD values considered by the expert advisor during backtests. How can this be?