Обсуждение статьи "Работа с таймсериями в библиотеке DoEasy (Часть 55): Класс-коллекция индикаторов"

 

Опубликована статья Работа с таймсериями в библиотеке DoEasy (Часть 55): Класс-коллекция индикаторов:

В статье продолжим развитие классов объектов-индикаторов и их коллекции. Создадим для каждого объекта-индикатора его описание и скорректируем класс-коллекцию для безошибочного хранения и получения объектов-индикаторов из списка-коллекции.

Скомпилируем советник и запустим его на графике в терминале.
После его инициализации в журнал "Эксперты" будут выведены сообщения библиотеки об инициализации, и в их числе полная и краткая распечатки параметров двух созданных индикаторов:

Account 8550475: Artyom Trishkin (MetaQuotes Software Corp.) 10425.23 USD, 1:100, Hedge, Demo account MetaTrader 5
--- Initializing the "DoEasy" library ---
Work only with the current symbol: "EURUSD"
Work with a predefined list of Periods:
"H1" "H4"
Symbol time series EURUSD: 
- Timeseries "EURUSD" H1: Required: 1000, Actual: 1000, Created: 1000, On server: 6350
- Timeseries "EURUSD" H4: Required: 1000, Actual: 1000, Created: 1000, On server: 6255
============= The beginning of the event parameter list: "Standard indicator" =============
Indicator status: Standard indicator
Indicator type: AMA
Indicator timeframe: H1
Indicator handle: 10
Indicator group: Trend indicator
------
Empty value for plotting, for which there is no drawing: EMPTY_VALUE
------
Indicator symbol: EURUSD
Indicator name: "Adaptive Moving Average"
Indicator shortname: "AMA(EURUSD,H1)"
--- Indicator parameters --- 
- Averaging period: 9
- Fast MA period: 2
- Slow MA period: 30
- Horizontal shift of the indicator: 0
- Price type or handle: CLOSE
================== End of the parameter list: "Standard indicator" ==================
 
============= The beginning of the event parameter list: "Standard indicator" =============
Indicator status: Standard indicator
Indicator type: AMA
Indicator timeframe: H1
Indicator handle: 11
Indicator group: Trend indicator
------
Empty value for plotting, for which there is no drawing: EMPTY_VALUE
------
Indicator symbol: EURUSD
Indicator name: "Adaptive Moving Average"
Indicator shortname: "AMA(EURUSD,H1)"
--- Indicator parameters --- 
- Averaging period: 10
- Fast MA period: 3
- Slow MA period: 32
- Horizontal shift of the indicator: 5
- Price type or handle: CLOSE
================== End of the parameter list: "Standard indicator" ==================
 
Standard indicator Adaptive Moving Average EURUSD H1 [10]
Standard indicator Adaptive Moving Average EURUSD H1 [11]
Library initialization time: 00:00:00.000

Хоть тип индикатора и один — AMA, но создано два хэндла этого индикатора, так как параметры создаваемых индикаторов были разными, и поэтому это два разных индикатора — каждый со своим хэндлом. Соответственно, были созданы и два объекта-индикатора и размещены в коллекцию индикаторов.

Автор: Artyom Trishkin