Is it possible to implement a RELIABLE accounting of the aggregate position structure in MT5? - page 6

 
fwiq >> :

Here's another option

There is such a problem... for example, STP brokers (integrators) are forced not to send in trading orders for execution immediately, but to accumulate them for sending with a certain frequency. One reason is, for example, that banks (I'm talking about FOREX) do not welcome high frequencies (at their discretion) of incoming trade orders via FIX API to their server. Therefore, they may disable an abusive broker client as a threat to the stability of their server.

Only, it seems that the presence/absence of virtual positions on the server side of the broker has no effect on the number of trade orders between the broker and its liquidity providers.

 

Why is it unreliable via comments?

You should put in the comments of the order a magik or the name of the Expert Advisor that opened it, and also the logic code of the operation in the MT4 logic - opening/closing. And when the order is sent to close besides that in the comments specify what order closes (ticket). If the order is executed, there is always a trade associated with it, which can be found (by the DEAL_ORDER field). Therefore it is always possible to divide the current aggregate position into the orders that have not yet been closed (no order with a close comment) and which have been executed (there is a related deal), and all this information is stored on the server.

 
Avals >> :

Why is it unreliable via comments?

You should put in the comments of the order a magik or the name of the Expert Advisor that opened it, and also the logic code of the operation in the MT4 logic - opening/closing. And when the order is sent to close besides that in the comments specify what order closes (ticket). If the order is executed, there is always a trade associated with it, which can be found (by the DEAL_ORDER field). Therefore, the current aggregate position can always be split into the orders that are not yet closed (there is no order with a comment about it being closed) and that have been executed (there is a linked deal), and all that information is stored on the server.

This page discusses the reason.

 
getch писал(а) >>

This page discusses the cause.

getch wrote>>
Imagine you have an EA with Magic. At a certain moment, when the position of this EA was in the red, you decided that you are sick and tired of everything and want to rest. You delete the Expert Advisor, and close the open position by hand with a counter market order with Magic 0. When you come back from holiday and decide to run the same Expert Advisor, and it sees that its position is open from analysis of the history on the Magic.

This is a oblique example, but you can get the idea.

When removing an EA, make all its positions automatically close. Or, we can provide messaging to the EA (it is possible to make it universal). Everything that has been opened, the Expert Advisor should also close, though it can do so at user's request.

To make it short, it is possible, but not convenient to everyone.

 
Avals писал(а) >>

getch wrote>>
Imagine you have an EA with Magic. At a certain point, when the position of this EA was in the red, you decide that you're sick and tired of everything and want to rest. Your Expert Advisor deletes, and you close the open position by hand by the opposite market order with a Magic 0. When you return from holiday and decide to run the same Expert Advisor, and it sees that it is open in the history analysis by Magic.

It's a oblique example, but you can get the idea.

When you delete an EA, make it automatically close all of its positions. Or provide message exchange with the EA (you can make it universal). Everything that has been opened, the Expert Advisor should also close, although it may do so at user's request.

In short, it is possible, but not convenient for everyone.

This is too much...

 
getch >> :

Imagine you have an EA with Magic. At a certain point, when the position of this EA was in deficit, you decided that you are fed up with everything and want to rest. You delete the EA and close the open position by hand with a counter market order with Magic 0. When you return from holiday and decide to run the same Expert Advisor, it sees that its position is open based on analysis of the Magic history.

A oblique example, but you can get the idea.

I think that's where the example is far-fetched. You make a button on the display, call it something like "close everything" that closes everything, with the desired marking.

 
It's also sad that the aggregate position only has one TP and one SL....
 
avtomat писал(а) >>

This is clearly too much...

This is one option that can be implemented if it suits the way a particular trader works. It can be done differently for other traders. For example, I do not see the point in leaving the remote EA's orders to be manually executed. There is a logic for opening, and it corresponds to the logic for closing; it is a part of the whole.

 
Figar0 писал(а) >>
It's also sad that the aggregate position has only one TP and one SL....

The different control logics for linked orders could probably be done as separate library functions. The comments would probably do it all.

 
Avals >> :

The different control logics for linked orders could probably be done as separate library functions. Through the comments probably everything will be

A lot of things can be done, but "only one TP and one SL....". And the TP and SL are good in that they are able to work without the internet, and without an EA, and without all the library functions. Now, for example, we cannot manually set two or even one-directional pending orders with different TP levels. No, lots by lots, but this net position for the terminal is a step back. Of course, it's easier for DCs, they work with net positions anyway, but for a trader it's a hassle.

Reason: