Discussion of article "Library for easy and quick development of MetaTrader programs (part XVII): Interactivity of library objects"

MetaQuotes
Moderator
238283

New article Library for easy and quick development of MetaTrader programs (part XVII): Interactivity of library objects has been published:

In this article, we are going to finish the development of the base object of all library objects, so that any library object based on it is able to interact with a user. For example, users will be able to set the maximum acceptable size of a spread for opening a position and a price level, upon reaching which an event from a symbol object is sent to the program with the spread or price level-based signal.

Compile and launch the EA in the tester:

As we can see, when a spread is increased or decreased beyond the specified control values, the appropriate entries are sent to the journal. Changes in the Bid price (its increase or decrease by more than 10 points) are also accompanied by journal entries. Finally, when the Bid price crosses the specified control level, an event is sent as well and the journal entry appears.

Thus, we have created the base object allowing us to track events of any of its descendant objects and send them to the control program where the program can track them and react according to its built-in logic, as well as set new tracked values and levels enabling flexible management of the program operation logic.

Author: Artyom Trishkin

Artyom Trishkin
Artyom Trishkin
  • www.mql5.com
Trader's profile
Marcin Rutkowski
336
Marcin Rutkowski  

Thank You  for all the work You put in to those articles. I can learn a lot from them :)

Artyom Trishkin
Moderator
83116
Marcin Rutkowski:

Thank You  for all the work You put in to those articles. I can learn a lot from them :)

You are welcome.
Dima Diall
61
Dima Diall  

Hello - I very much like the potential of the event-driven capability you implemented in CSymbol, such as SetControlBidDec, SetControlAskLevel, etc... I haven`t studied your later articles on indicators yet (after part 38), but would like to understand if you intend to add the ability to set similar events on indicators (e.g. price touching/crossing a certain moving average value, etc)?

What is your recommended approach to implement such checks in the current version of the library? Is there an alternative to checking every time in OnTick()? What about if I'm working with multiple symbols?

Artyom Trishkin
Moderator
83116
Dima Diall :

Hello - I very much like the potential of the event-driven capability you implemented in CSymbol, such as SetControlBidDec, SetControlAskLevel, etc... I haven`t studied your later articles on indicators yet (after part 38), but would like to understand if you intend to add the ability to set similar events on indicators (e.g. price touching/crossing a certain moving average value, etc)?

What is your recommended approach to implement such checks in the current version of the library? Is there an alternative to checking every time in OnTick()? What about if I'm working with multiple symbols?

Hi. I have not thought about implementing the same event model for indicators yet. I am not very happy with the implementation of indicators. Therefore, I will add indicator objects, and they will already refer to the required bars in the timeseries for the required indicator data. And there, the implementation of the event model will already be easier.

Dima Diall
61
Dima Diall  
Artyom Trishkin:

Hi. I have not thought about implementing the same event model for indicators yet. I am not very happy with the implementation of indicators. Therefore, I will add indicator objects, and they will already refer to the required bars in the timeseries for the required indicator data. And there, the implementation of the event model will already be easier.

Is the main purpose of your indicators support in DoEasy to help the library user to implement their own indicators? Do you also plan to allow multi-platform access to any indicator data in MT4/MT5 from other programs, for example EAs? As you know, currently functions such as iMACD(), iBands(), etc work very differently between MQL4 and MQL5 so I want to write some wrapper functions to enable my EAs coded with DoEasy can run on both versions.

Artyom Trishkin
Moderator
83116
Dima Diall :

Is the main purpose of your indicators support in DoEasy to help the library user to implement their own indicators? Do you also plan to allow multi-platform access to any indicator data in MT4/MT5  from other programs, for example EAs? As you know, currently functions such as iMACD(), iBands(), etc work very differently between MQL4 and MQL5 so I want to write some wrapper functions to enable my EAs coded with DoEasy can run on both versions.

Yes. I have already started writing an article about indicator objects. It is with their help that everything will be simple and, I hope, the way most users of the library will be satisfied.