Download MetaTrader 5

Does Virt Serv Syncing Mess Up Running Expert Advisors?

To add comments, please log in or register

Hi!  I am new to MT4, although I have spent a few years studying, practicing, and scripting with Forex trading before I used metatrader.  Now I'm trading rather successfully with MT4 using Expert Advisors running a Virtual Server.

Question: If I am running expert advisers now, and I synchronize while trades are open, will my running expert advisers be messed up?

More Specifically:

In my strategy, I'm using virtual trailing stop.  My MT4 expert keeps track of its open trades and updates the stop loss.  I also have a take profit set, which doesn't change.  So in the two questions below, I want know if the updates to the trailing stop will cease to occur if I synchronize with my virtual server.  My guess would be that the take profits and the stop loss at the time of sync would still work since they are part of the order, but that the scripted trailing stop would cease to function.  As my balance is quickly increasing, I would like to add the expert to additional currencies and also increase the lot sizes of running advisers.

1. If I have 1 expert adviser running on one currency A, and, without changing that window , I add a window for another currency B with an expert adviser, and then I synchronize while currency A has open trades, will my expert adviser for A continue to run normally, or will it be as if I hit the "reset" button on it.  Will the advisory for currency B begin running on the server without having any effect on A?

2. If I am already running expert A on a virtual server, again with open trades, and I modify that adviser, for instance by changing the lot size from .01 to .04, how will my trades be effected.

3. Is there a way to continue running an adviser, but tell it that, starting now, I want it to no longer open new trades.  That way, I can wait for the open trade to close before I change the lot size of the adviser.


Carl Schreiber
Carl Schreiber  

As we do not know the code of the EA just try it out yourself:

  1. Install in the vps another instance of mt4.
  2. Open a demo account with you broker.
  3. Try what ever you what to do with your real account.
  4. Check what happens!
robohobo: , will my running expert advisers be messed up?
EAs must be coded to recover. If the power fails, OS crashes, terminal or chart is accidentally closed, on the next tick, any static/global ticket variables will have been lost. You will have an open order but don't know it, so the EA will never try to close it, trail SL, etc. How are you going to recover? Use a OrderSelect loop to recover, or persistent storage (GV+flush or files) of ticket numbers required.
Is yours coded properly?
To add comments, please log in or register