Discussion of article "Other classes in DoEasy library (Part 71): Chart object collection events"

 

New article Other classes in DoEasy library (Part 71): Chart object collection events has been published:

In this article, I will create the functionality for tracking some chart object events — adding/removing symbol charts and chart subwindows, as well as adding/removing/changing indicators in chart windows.

Compile the EA and launch it on a symbol chart.

Open a new symbol chart — get the following journal message from the OnDoEasyEvent() handler:

OnDoEasyEvent: Open chart: AUDNZD H4, ID 131733844391938634

Add a new window of any oscillator to the open chart — get the following journal message from the OnDoEasyEvent() handler:

OnDoEasyEvent: AUDNZD H1, ID 131733844391938634: Added subwindow 1 Momentum(14)

Add any indicator drawn in the main window to the open chart — get the following journal message from the OnDoEasyEvent() handler:

OnDoEasyEvent: AUDNZD H4, ID 131733844391938634, Main chart window: Added indicator AMA(14,2,30)

Change the oscillator parameters — get the following journal message from the OnDoEasyEvent() handler:

OnDoEasyEvent: AUDNZD H4, ID 131733844391938634, Chart subwindow 1: Changed indicator Momentum(14) >>> Momentum(20)

Change the indicator parameters in the main window — get the following journal message from the OnDoEasyEvent() handler:

OnDoEasyEvent: AUDNZD H4, ID 131733844391938634, Main chart window: Changed indicator AMA(14,2,30) >>> AMA(20,2,30)

Remove the oscillator window — get the following two journal messages from the OnDoEasyEvent() handler:

OnDoEasyEvent: AUDNZD H4, ID 131733844391938634: Removed indicator Momentum(20)
OnDoEasyEvent: AUDNZD H1, ID 131733844391938634: Removed subwindow 1

Remove the indicator from the main window — get the following journal message from the OnDoEasyEvent() handler:

OnDoEasyEvent: AUDNZD H4, ID 131733844391938634, Main chart window: Removed indicator AMA(20,2,30)

Close the previously opened chart window — get the following journal message from the OnDoEasyEvent() handler:

OnDoEasyEvent: Closed chart: AUDNZD H4, ID 131733844391938634

As we can see, all events are handled correctly and sent to the control program.

Author: Artyom Trishkin

Reason: