EA not functioning effectively
-
Hello everyone,
My EA is not functioning effectively. When I tested the EA on a demo, it was not calculating the values effectively as compared to the moving average indicators available on the metatrader screen.
For example, the 10 moving average of a candle is 1.40001 and that of a 20 moving average of a candle is 1.40000 (a difference of 0.00001 = 0.1 pips) but instead of placing a buy trade as requested from my conditions, it places a sell trade.
My stop loss adjust number for the buy and sell orders are also not giving me the exact calculation e.g if a candle low candle 1 value is 1.10008 and I place stop loss adjust value of say 0.00008, the value it should give me is 1.10000 but at times it gives me a value different from the expected value of 1.10000.
what could be the problem to the EA not calculating values effectively? -
Can you please share the link to your project?
-
Here it is
-

From the picture above, the buy signal occurred at 03:00 before the moving averages crossed. The EA actually is meant to have the buy signal occur when the short MA (red) crosses above the long MA (blue).
Does anyone know how this can be corrected in the project that I shared above?
-
The problem is you're requesting the crossing to be confirmed at the opening of candle ID 0. That means the crossing is not confirmed at that moment. You need to specify candle ID on blocks 3 and 7 to avoid that.