Discussion of article "Library for easy and quick development of MetaTrader programs (part XIII): Account object events"

To add comments, please log in or register
MetaQuotes Software Corp.
Moderator
209838
MetaQuotes Software Corp.  

New article Library for easy and quick development of MetaTrader programs (part XIII): Account object events has been published:

The article considers working with account events for tracking important changes in account properties affecting the automated trading. We have already implemented some functionality for tracking account events in the previous article when developing the account object collection.

Now launch the EA in the tester and open more positions to quickly detect the equity increase event followed by closing the most profitable position:


As we can see, the most profitable position is automatically closed when the equity exceeds the specified value. The journal displays the messages about the tracked account event.

Author: Artyom Trishkin

Mohammad Bazrkar
4275
Mohammad Bazrkar  

Thanks for your great and helpful job @Artyom Trishkin, I should ask a question here;

I think it is necessary to Save engine state and Load it in next run of scripts/EAs to resume capturing events and identify changes in EA closed time.

But it has CObject Save/Load virtual functions and returning true with no action.

Q: What should we save and how access them to save?

Artyom Trishkin
Moderator
123724
Artyom Trishkin  
Mohammad Bazrkar :

Thank you for your wonderful and useful work @ Artyom Trishkin , I have to ask a question here;

I think that it is necessary to save the state of the engine and load it the next time the scripts / advisors are started, in order to resume capturing events and detect changes in the closed time of the adviser.

But it has virtual CObject Save / Load functions that return true without any action.

Q: What should we save and how to get access to them?

To take advantage of virtual functions, they need to be implemented at objects-heirs. See how this is done and described in the article on creating a collection of accounts. In it, each of the account objects is written to a file, and then read from the file.

I plan to gradually save all the objects stored in different library collections to files. But while busy with trade classes for the library.

To add comments, please log in or register