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

 
getch >> :

Another way of implementing through a high level API in MQL5, but again unreliable:

nen wrote >>

This is an incorrect statement. You need to try MQL5 first, then talk about the order of complication.

It will be hard to change the programming process logic gained over the years. But programs in MQL5 can be more complex than in MQL4, and it will take less time. There are so many new features that now it is difficult to imagine the entire scope of innovations. The number of useful innovations.

-------

Too bad that you will have to rewrite EVERYTHING from MQL4 to MQL5.

Of course, you can! But in most cases it is not so in MQL4->MQL5 porting.

nen, please share your vision of strategy implementation in MQL5, which allows running of several independent strategies in one trading tool.

Take any simple strategy from the standard MT4 delivery and make it a universal (independent) strategy.

With MQL4 it takes 10 lines of code and less than 5 minutes.

At MQL5 it is ... cannot even imagine.

I see the solution to this problem in creation of a higher level API in MQL5 than in MQL5 itself. This API will implement trading functions that allow working with virtual positions, which will have all the features of MT4 positions. I'm sure (a simple prophecy) that various versions of such API will appear in CodeBase MQL5, they will eliminate bugs over time and everything will be brought to perfection. Traders will simply plug in this API and then the solution of the above problem and similar ones will also take less than 5 minutes.

But, unfortunately, this solution will still not be reliable, because the database of logical links of virtual positions will not be stored on the trading server.

P.S. Also through this API the powerful means of MQL5 will create an interface for working with these virtual positions by hand - an analogue of MT4.

Actually, I don't quite understand the reliability issues. Just a quick glimpse. Expert Advisor 1 gives a signal to buy, Expert Advisor 2 gives a signal to m-m-m, never mind, also buy. They have replaced trade functions with, say, functions that use general variables. Then the Accounting-Trading block forms an aggregate position and sends the appropriate order. It waits for the confirmation of its execution. Then it informs the Expert Advisors that their orders have been executed. Or has not been executed. I.e. the Accounting block emulates the work of the MT4 server, but based on the real execution of net orders. It emulates it through the main variables. Or via log file - more reliable by idea.

I.e. it can also be done in MT4. It might be easier in MT5 - I don't know.

 
kombat писал(а) >>

Thank you, dear one! That's the end of the problem, well done to those who participated!

 
Svinozavr >> :

Actually, I don't quite understand the reliability issues. Just a quick thought. EA1 gives a buy signal, EA2 gives a m-m-m, never mind, also buy signal. They have replaced trade functions with, say, functions that use general variables. Then the Accounting-Trading block forms an aggregate position and sends the appropriate order. It waits for the confirmation of its execution. Then it informs the Expert Advisors that their orders have been executed. Or has not been executed. I.e. the Accounting block emulates the work of the MT4 server, but following the real execution of net orders. It emulates it through the main variables. Or through a log file, which is more reliable.

I.e. it can be done in MT4 as well. Probably, it will be easier to do it in MT5 - I don't know.

Absolutely, it can and is done by many in MQL4 for NFA brokers. It also may be done in MQL5. But it won't be reliable, because all logical links will be stored on your local machine, which is subject to any technical problems. If a database of logical links would be stored on the trade server and could be changed by the same server, the reliability would be 100%, as it is done on non-NFA-MT4.

Having mages and comments in MQL5 doesn't solve the reliability problem at all. You have crashed the computer where the systems were running. You want to connect to an account on another computer and continue running your EAs there. But they will not be able to retrieve information in MT5. Only if you analyse the history of FILLED orders, but this is not reliable.

 
getch >> :

Quite right, it can and has been done by many in MQL4 under NFA brokers. It can also be done in MQL5. But there will be no reliability in this, because all logical links will be stored on your local machine, which is subject to all kinds of technical troubles. If the database of logical links was stored on the trade server and could be changed by the same server, the reliability would be 100%, as it is done on non-NFA-MT4.

The presence of magicians and comments in MQL5 does not solve the problem of reliability at all. Your computer, where the systems were running, crashed. You want to connect to the account on another computer and continue running your EAs there. But they will not be able to retrieve information in MT5. Only if you analyse the history of FILLED orders, but this is not reliable.

It is possible to store the information necessary for internal accounting in comments to the orders. They are stored on the server.

===

No. Not in all cases - the order must be open for that.

 
Svinozavr >> :

It is possible to store the information needed for internal accounting in the comments to the orders. They are on the server.

It is unreliable. >>It's not hard to think of a counterexample yourself.

 
getch >> :

Unreliable. It's not hard to think of an example yourself.

If the order is open, it is just as reliable as in the case of MT4 accounting. Another thing is that the net will not always be open-modified. It doesn't really matter!

Well, the machine is down. The internal history is lost. Then somehow or other, the Expert Advisors will be launched again. The balance, the position is available. Expert Advisors make decisions based on the available information. That is all.

 
getch >> :
It's amazing, that MT5 is nothing but admiration and at the same time it does not allow to do elementary things reliably.

How can you not admire it?

So much power to it!

I'm already short of 511 characters in a comment...

to pull out everything you can from the marketinfo...


And as for the lockboxing based on a specially written complex on the mcl5...

... how can I put this delicately... I'd rather have nothing than this...

Can't do it "like it was in 4"!!! That's my opinion, and I'm not going to change it yet.

 

Thanks Integer It's been ages since I heard Serga sing :o)

You just had to read the verse, open the Music folder/SerGa and life was good.

 
))) I don't give a shit about that either. Just an idea. I'm originally without locs.
 
You were trading hands and you had an EA that remembers the structure of the aggregate position locally so that you could only touch its part. The computer crashed. You run the same EA on another computer (there is no logical connection now). How will it handle its current part of the open position? Imagine that before the computer crashed, the Expert Advisor has placed several positions, some of which were executed after the crash, but before the restart.