EA executes trades on one terminal but not on another

 

Hello everyone,

I have several Expert Advisors running on different MT5 terminals, all with the same broker. However, sometimes I notice a strange issue: one terminal executes a setup even though the conditions are not met, while on another terminal (same EA, same broker, same timeframe, same configuration) it behaves correctly.

For example:

  • On one terminal, the EA may open a trade even though the setup conditions are not satisfied.

  • On another occasion, the setup conditions are met but the EA does not open the trade, while on the other terminals it does open correctly.

This doesn’t happen all the time, but occasionally one terminal seems to behave differently than the others, even though everything is supposed to be identical (same EA, same broker, same settings, same chart).

I don’t understand if this could be related to the data feed that each terminal receives, or if there is something else I should check. It is problematic for me since sometimes trades are executed when they shouldn’t be, or setups are skipped when they should be taken.

Has anyone experienced something similar, or does anyone know what I could investigate to solve this issue?

Thanks in advance.

PS: Each terminal is running on a different account (no duplicate EA on the same account/terminal). I’m also using a reliable high-trust VPS and have never had issues with the VPS itself.

MetaTrader VPS
MetaTrader VPS
  • www.mql5.com
Reliable trading hosting for uninterrupted robot operations and instant trade copying
 

If you have different "output" (trade), then either the "inputs" (parameters, data, ...) are different or the "processing" (EA) behaves differently (or both).

It's impossible to answer concretely with the information you provided.

 

Thank you very much for your answer. I’ll try to explain the situation in more detail to see if you believe it is 100% an issue with my algorithm, or if there could also be something else happening.

  1. No indicators involved
    My algorithm does not use any indicators. It only performs calculations based purely on the price of the instrument. So repainting indicators are not the issue here.

  2. Same EA, same configuration, same chart
    I copied the EA executable with the full configuration ready, so I only have to attach it to the chart. That’s why it feels strange to me: with two MT5 terminals on the same VPS, attaching the exact same EA to the exact same symbol and timeframe, both terminals form the setup and draw everything correctly (I added drawings to my EA so I can visually confirm that the logic is running as expected).

  3. How the setup works
    The EA waits for the price to reach a certain level and then places a Buy Stop order. The issue is that in both terminals the drawings and setup are formed correctly, but when the price reaches that level, in one terminal the Buy Stop is placed, while in the other it is not.

  4. Inconsistency
    This doesn’t always happen — sometimes it happens in one terminal, other times in the other. It feels random. That’s what makes me question if it’s entirely my algorithm or if there is some other factor involved.

  5. Error handling / logs
    I don’t see any “order opening error” in the logs. So, the request to place the order is not failing — it looks more like the order placement function is never triggered in some cases. I understand that adding detailed Print() logs is probably the next step to debug exactly what is happening internally.

  6. Additional context

    • Each terminal is running on a different account (not the same account duplicated).

    • I run around 50 algorithms in each terminal.

    • The VPS is reliable and not low on resources.

    • I restart all terminals every Sunday.

    • The EA relies on recent candles for its calculations (not very far back in history).

I fully accept that something in my algorithm might not be correct, but what I don’t understand is why, given that it is the exact same EA and configuration, the behaviour can differ between accounts/terminals in this way.

 

No matter how much information you provide, even if you provide the full source code of all the EAs used, it will be very difficult for anyone to help you much, because it is impossible for others to replicate the environment and the issue.

Usually (most of the time), such situations can be traced back to some coding or logic bug. Please remember, that the OnTick event is not called for every single tick that arrives. It can and will skip ticks if you are only relying on the current tick quotes. Any kind of delay, due to your own EA processing or other applications running, or even the "virtualisation" nature of the VPS services provided, or even network delays, will cause tick events to be missed and cause differences in the EA's processing compared to the same EA on other terminals or other VPS instances.

One way to minimise this, is to work off the tick history (instead of only the current tick), so that you can process every tick without skipping any. 

 
Matias L Leguizamon Fernandez:

could be a broker issue also. There has been some similar threads where issue is same as you say: pending orders don’t always get triggered even thou price clearly went by the trigger price; and they proved that it didn’t happen on a new broker. This could happen because pending orders are not guaranteed to open orders, unlike market orders.