Discussion of article "A Virtual Order Manager to track orders within the position-centric MT5 environment" - page 2

 
phampton:

 

That's correct, wackena.  What you have done is to go direct to the server to with a conventional order, so there is no virtual order open.  You would need to use the VirtualOrderManagerTester to issue a manual virtual order.

 I should have made it clear in the article that if a VOM EA is introduced on a particular symbol, then all other EAs trading that symbol must also be VOM-enabled.  This is because of the Disaster Protection SL code in the VOM.

 Paul 

 

Thanks Paul.

Can the VirtualOrderManager.mqh be used in the MT-5  Strategy Tester? If yes, how should the EA be setup with VOM?

 
wackena:

Thanks Paul.

Can the VirtualOrderManager.mqh be used in the MT-5  Strategy Tester? If yes, how should the EA be setup with VOM?

Yes, my very limited testing in the ST indicates that it works with no alteration, although slowly because each tick must be processed.
 

Been working with VOM on Martingale type EA. With multiple Sell trades open, same type and currency pair, this CloseAllOrders function appears to only close last trade, leaving previous trades still open.

VOM.CloseAllOrders(_Symbol,VIRTUAL_ORDER_TYPE_SELL);

With multiple, same type and currency pair, virtual orders (vo) open, should this function code initiate closing of one vo order or should function close all open vo orders.

VOM.OrdersTotal() does track number of open vo orders quite well.

 
wackena:

Been working with VOM on Martingale type EA. With multiple Sell trades open, same type and currency pair, this CloseAllOrders function appears to only close last trade, leaving previous trades still open.

With multiple, same type and currency pair, virtual orders (vo) open, should this function code initiate closing of one vo order or should function close all open vo orders.

VOM.OrdersTotal() does track number of open vo orders quite well.

Hi wackena,

I've just added a Close all button to VirtualOrderManagerTester, see attached.  It works OK, although I admit it's a clunky way to close all virtual orders - a better way would be to sum them up and issue a single server order, and I'll look at doing that in the next release.

Feel free to send me a copy of a LOG_VERBOSE EA log so I can see better what's happening.

 Paul 

 
phampton:

Hi wackena,

I've just added a Close all button to VirtualOrderManagerTester, see attached.  It works OK, although I admit it's a clunky way to close all virtual orders - a better way would be to sum them up and issue a single server order, and I'll look at doing that in the next release.

Feel free to send me a copy of a LOG_VERBOSE EA log so I can see better what's happening.

 Paul 

 

Attached is the log file.
Files:
 
wackena:
Attached is the log file.

 

Thanks - from what I can tell in the log, the only calls to OrderClose occur when a virtual takeprofit has been hit, ie whatever code you have to explicitly close orders (like a CloseAllOrders) isn't being reached or is being reached when there are no orders left to close.

 

Update of the article appendices:

The documentation, user guide, and source code comments for the Virtual Order Manager library are now available in Russian.

 

There is a major problem with this library. Trades opened with VOM and closed manually are seen opened by VOM.

More than that when in VOM I try to close this trades, VOM will open trades in opposite direction.

For example:

- I open 5 buy orders with  VirtualOrderManagerTester and is ok

- I close manually all 5 orders: in MT5 I see no orders and on chart(VOM) 5 open orders

- I close the 5 orders from VirtualOrderManagerTester: I see 5 sell orders in MT5 and none in VOM(VirtualOrderManagerTester)

In my opinion this is a major problem because if my EA  orders are closed by broker or other EA, when my EA will try to close it using VOM, will open orders in opposite direction.

There is any solution for this problem?

Files:
vom_test.jpg  188 kb
 
mbt22:

There is a major problem with this library. Trades opened with VOM and closed manually are seen opened by VOM.

More than that when in VOM I try to close this trades, VOM will open trades in opposite direction.

For example:

- I open 5 buy orders with  VirtualOrderManagerTester and is ok

- I close manually all 5 orders: in MT5 I see no orders and on chart(VOM) 5 open orders

- I close the 5 orders from VirtualOrderManagerTester: I see 5 sell orders in MT5 and none in VOM(VirtualOrderManagerTester)

In my opinion this is a major problem because if my EA  orders are closed by broker or other EA, when my EA will try to close it using VOM, will open orders in opposite direction.

There is any solution for this problem?

 

Hi mbt22,

what you highlight is definitely a limitation of this library - all EAs running on an account must use the VOM, and that includes manual trades.  

Bear in mind however that this sociability limitation of the VOM EAs is likely to be seen in many MQL5 EAs.  In other words, these EAs can also fail in the event of manual trades or other EAs of any type operating on the same symbol.

Here's an example of a non-VOM EA sociability failure.  Supposing trades (manual and/or EA-generated) external to that EA total 1.0 lots short, and the EA issues a buy order of 0.1 lots with a 50 pip stop.  I can't remember exactly how the OrderSend function in the EA would work (whether is completes or returns a stop error), but what is certain is that the stop cannot be applied 50 pips below the resultant position size of 0.9 lots short.

The test EA is able to manage manual trades using the VOM, but if the situation gets to the broker closing orders then the VOM has lost control and careful assessment of the account would be needed.

One of the main reasons that the VOM is not sociable with non-VOM activities is its management of the disaster protection stop, which is an absolute risk management essential in any client-based trade closure process.

Paul 

 
phampton:

 

Hi mbt22,

what you highlight is definitely a limitation of this library - all EAs running on an account must use the VOM, and that includes manual trades.  

Bear in mind however that this sociability limitation of the VOM EAs is likely to be seen in many MQL5 EAs.  In other words, these EAs can also fail in the event of manual trades or other EAs of any type operating on the same symbol.

Here's an example of a non-VOM EA sociability failure.  Supposing trades (manual and/or EA-generated) external to that EA total 1.0 lots short, and the EA issues a buy order of 0.1 lots with a 50 pip stop.  I can't remember exactly how the OrderSend function in the EA would work (whether is completes or returns a stop error), but what is certain is that the stop cannot be applied 50 pips below the resultant position size of 0.9 lots short.

The test EA is able to manage manual trades using the VOM, but if the situation gets to the broker closing orders then the VOM has lost control and careful assessment of the account would be needed.

One of the main reasons that the VOM is not sociable with non-VOM activities is its management of the disaster protection stop, which is an absolute risk management essential in any client-based trade closure process.

Paul 

 

 


Ok.

Thank you for your quick response.