Download MetaTrader 5

Virtual Servers and Global Variables

To add comments, please log in or register
BigAl
489
BigAl  

I am interested in the new virtual server but have a problem with the global variable statement saying that they will not work.

My current MT4 EA uses "TradeBusy", "TradeNotBusy" global variable to prevent problems with opening/closing trades.

How can I get around the problem to ensure I do not miss trades opening or closing or getting errors trying to trade when the server is already busy with another trade.

Stuart Browne
5970
Stuart Browne  
BigAl:

I am interested in the new virtual server but have a problem with the global variable statement saying that they will not work.

My current MT4 EA uses "TradeBusy", "TradeNotBusy" global variable to prevent problems with opening/closing trades.

How can I get around the problem to ensure I do not miss trades opening or closing or getting errors trying to trade when the server is already busy with another trade.

Sorry, maybe I've misunderstood your logic, but why use a global instead of the built in function IsTradeContextBusy() ?
BigAl
489
BigAl  
Stuart Browne:
Sorry, maybe I've misunderstood your logic, but why use a global instead of the built in function IsTradeContextBusy() ?

When using multiple symbol pairs and multiple charts it is possible that two executing EAs and/or two or more charts may contend for service at the same time causing trades to be missed or not closed etc.

Error 146 ("Trade context busy") and How to Deal with It

I therefore use a global variable to to control the possible conflictions for all currently executing EAs

To add comments, please log in or register