Discussion of article "Timeseries in DoEasy library (part 50): Multi-period multi-symbol standard indicators with a shift"

MetaQuotes
Moderator
228773
MetaQuotes  

New article Timeseries in DoEasy library (part 50): Multi-period multi-symbol standard indicators with a shift has been published:

In the article, let’s improve library methods for correct display of multi-symbol multi-period standard indicators, which lines are displayed on the current symbol chart with a shift set in the settings. As well, let’s put things in order in methods of work with standard indicators and remove the redundant code to the library area in the final indicator program.

Leave OnCalculate() handler unchanged. Find the entire code of the test indicator in the files attached below.

Compile the indicator and launch it on EURUSD H1 chart having preliminary set the use of EURUSD H4 symbol in the settings. Set indicator line shift as 4 bars and select Bollinger Bands indicator. Then select Alligator indicator in the settings:


As we see, Bollinger Bands is correctly displayed with the specified shift of 4 bars and Alligator does not react to a 4 bar shift - it possesses set default values immediately when created in OnInit() code equal to those values in the standard indicator:

//--- Multi-buffer standard indicators in the main window
      case IND_ALLIGATOR   :  success=engine.BufferCreateAlligator(InpUsedSymbols,InpPeriod,13,8,8,5,5,3,MODE_SMMA,PRICE_MEDIAN,1);    break;

And Alligator also correctly displays its lines with the standard shift of its lines.

Author: Artyom Trishkin