Indicators Code

Author: Copyright © 2021, Vladimir Karputov
Indicators Used
Movement directional indexCommodity channel indexFractalsMoving average indicatorMACD HistogramStochastic oscillatorParabolic Stop and Reverse systemMomentum indicatorLarry William percent range indicatorBill Williams Accelerator/Decelerator oscillatorBulls Power indicator Bears Power indicatorIndicator of the average true rangeBollinger bands indicatorBill Williams AlligatorDeMarker indicatorRelative strength indexEnvelopes indicatorMoving Average of OscillatorIchimoku Kinko HyoGator oscillatorBill Williams Awesome oscillatorStandard Deviation indicatorRelative Vigor indexForce indexMoney flow indexOn Balance Volume indicator
0 Views
0 Downloads
0 Favorites
Indicators Code
ÿþ//+------------------------------------------------------------------+

//|                                              Indicators Code.mq5 |

//|                              Copyright © 2021, Vladimir Karputov |

//|                      https://www.mql5.com/en/users/barabashkakvn |

//+------------------------------------------------------------------+

#property copyright "Copyright © 2021, Vladimir Karputov"

#property link      "https://www.mql5.com/en/users/barabashkakvn"

#property version   "1.000"

//---

#include <Trade\SymbolInfo.mqh>

//---

CSymbolInfo    m_symbol;                     // object of CSymbolInfo class

//--- input parameters

input group             "ADX"

input ENUM_TIMEFRAMES      Inp_ADX_period                = PERIOD_D1;      // ADX: timeframe

input int                  Inp_ADX_adx_period            = 14;             // ADX: averaging period

input group             "CCI"

input ENUM_TIMEFRAMES      Inp_CCI_period                = PERIOD_D1;      // CCI: timeframe

input int                  Inp_CCI_ma_period             = 14;             // CCI: averaging period

input ENUM_APPLIED_PRICE   Inp_CCI_applied_price         = PRICE_TYPICAL;  // CCI: type of price

input group             "Fractals"

input ENUM_TIMEFRAMES      Inp_Fractals_period           = PERIOD_D1;      // Fractals: timeframe

input group             "MA"

input ENUM_TIMEFRAMES      Inp_MA_period                 = PERIOD_D1;      // MA: timeframe

input int                  Inp_MA_ma_period              = 12;             // MA: averaging period

input int                  Inp_MA_ma_shift               = 0;              // MA: horizontal shift

input ENUM_MA_METHOD       Inp_MA_ma_method              = MODE_SMA;       // MA: smoothing type

input ENUM_APPLIED_PRICE   Inp_MA_applied_price          = PRICE_CLOSE;    // MA: type of price

input group             "MACD"

input ENUM_TIMEFRAMES      Inp_MACD_period               = PERIOD_D1;      // MACD: timeframe

input int                  Inp_MACD_fast_ema_period      = 12;             // MACD: period for Fast average calculation

input int                  Inp_MACD_slow_ema_period      = 26;             // MACD: period for Slow average calculation

input int                  Inp_MACD_signal_period        = 9;              // MACD: period for their difference averaging

input ENUM_APPLIED_PRICE   Inp_MACD_applied_price        = PRICE_CLOSE;    // MACD: type of price

input group             "Stochastic"

input ENUM_TIMEFRAMES      Inp_STO_period                = PERIOD_D1;      // Stochastic: timeframe

input int                  Inp_STO_Kperiod               = 5;              // Stochastic: K-period (number of bars for calculations)

input int                  Inp_STO_Dperiod               = 3;              // Stochastic: D-period (period of first smoothing)

input int                  Inp_STO_slowing               = 3;              // Stochastic: final smoothing

input ENUM_MA_METHOD       Inp_STO_ma_method             = MODE_SMA;       // Stochastic: type of smoothing

input ENUM_STO_PRICE       Inp_STO_price_field           = STO_LOWHIGH;    // Stochastic: stochastic calculation method

input group             "SAR"

input ENUM_TIMEFRAMES      Inp_SAR_period                = PERIOD_D1;      // SAR: timeframe

input double               Inp_SAR_step                  = 0.02;           // SAR: price increment step - acceleration factor

input double               Inp_SAR_maximum               = 0.2;            // SAR: maximum value of step

input group             "Momentum"

input ENUM_TIMEFRAMES      Inp_Momentum_period           = PERIOD_D1;      // Momentum: timeframe

input int                  Inp_Momentum_mom_period       = 14;             // Momentum: averaging period

input ENUM_APPLIED_PRICE   Inp_Momentum_applied_price    = PRICE_CLOSE;    // Momentum: type of price

input group             "WPR"

input ENUM_TIMEFRAMES      Inp_WPR_period                = PERIOD_D1;      // WPR: timeframe

input int                  Inp_WPR_calc_period           = 21;             // WPR: averaging period

input group             "AC"

input ENUM_TIMEFRAMES      Inp_AC_period                 = PERIOD_D1;      // AC: timeframe

input group             "BullsPower"

input ENUM_TIMEFRAMES      Inp_Bulls_period              = PERIOD_D1;      // Bulls Power: timefram

input int                  Inp_Bulls_ma_period           = 7;              // Bulls Power: averaging period

input group             "Bears Power"

input ENUM_TIMEFRAMES      Inp_Bears_period              = PERIOD_D1;      // Bears Power: timeframe

input int                  Inp_Bears_ma_period           = 13;             // Bears Power: averaging period

input group             "ATR"

input ENUM_TIMEFRAMES      Inp_ATR_period                = PERIOD_D1;      // ATR timeframe

input int                  Inp_ATR_ma_period             = 14;             // ATR: averaging period

input group             "Bands"

input ENUM_TIMEFRAMES      Inp_Bands_period              = PERIOD_D1;      // Bands: timeframe

input int                  Inp_Bands_bands_period        = 20;             // Bands: period for average line calculation

input int                  Inp_Bands_bands_shift         = 0;              // Bands: horizontal shift of the indicator

input double               Inp_Bands_deviation           = 2.0;            // Bands: number of standard deviations

input ENUM_APPLIED_PRICE   Inp_Bands_applied_price       = PRICE_CLOSE;    // Bands: type of price

input group             "Alligator"

input ENUM_TIMEFRAMES      Inp_Alligator_period          = PERIOD_D1;      // Alligator: timeframe

input int                  Inp_Alligator_jaw_period      = 13;             // Alligator: period for the calculation of jaws

input int                  Inp_Alligator_jaw_shift       = 8;              // Alligator: horizontal shift of jaws

input int                  Inp_Alligator_teeth_period    = 8;              // Alligator: period for the calculation of teeth

input int                  Inp_Alligator_teeth_shift     = 5;              // Alligator: horizontal shift of teeth

input int                  Inp_Alligator_lips_period     = 5;              // Alligator: period for the calculation of lips

input int                  Inp_Alligator_lips_shift      = 3;              // Alligator: horizontal shift of lips

input ENUM_MA_METHOD       Inp_Alligator_ma_method       = MODE_SMMA;      // Alligator: type of smoothing

input ENUM_APPLIED_PRICE   Inp_Alligator_applied_price   = PRICE_MEDIAN;   // Alligator: type of price

input group             "DeMarker"

input ENUM_TIMEFRAMES      Inp_DeM_period                = PERIOD_D1;      // DeM: timeframe

input int                  Inp_DeM_ma_period             = 14;             // DeM: averaging period

input group             "RSI"

input ENUM_TIMEFRAMES      Inp_RSI_period                = PERIOD_D1;      // RSI: timeframe

input int                  Inp_RSI_ma_period             = 14;             // RSI: averaging period

input ENUM_APPLIED_PRICE   Inp_RSI_applied_price         = PRICE_CLOSE;    // RSI: type of price

input group             "Chaikin Oscillator, CHO"

input ENUM_TIMEFRAMES      Inp_CHO_period                = PERIOD_D1;      // CHO: timeframe

input int                  Inp_CHO_fast_ma_period        = 3;              // CHO: fast period

input int                  Inp_CHO_slow_ma_period        = 10;             // CHO: slow period

input ENUM_MA_METHOD       Inp_CHO_ma_method             = MODE_EMA;       // CHO: smoothing type

input ENUM_APPLIED_VOLUME  Inp_CHO_applied_volume        = VOLUME_TICK;    // CHO: type of volume

input group             "Envelopes"

input ENUM_TIMEFRAMES      Inp_Env_period                = PERIOD_D1;      // Envelopes: timeframe

input int                  Inp_Env_ma_period             = 14;             // Envelopes: averaging period

input int                  Inp_Env_ma_shift              = 0;              // Envelopes: horizontal shift

input ENUM_MA_METHOD       Inp_Env_ma_method             = MODE_SMA;       // Envelopes: smoothing type

input ENUM_APPLIED_PRICE   Inp_Env_applied_price         = PRICE_CLOSE;    // Envelopes: type of price

input double               Inp_Env_deviation             = 0.1;            // Envelopes: deviation of boundaries from the midline (in percents)

input group             "OsMA"

input ENUM_TIMEFRAMES      Inp_OsMA_period               = PERIOD_D1;      // OsMA: timeframe

input int                  Inp_OsMA_fast_ema_period      = 12;             // OsMA: period for Fast Moving Average

input int                  Inp_OsMA_slow_ema_period      = 26;             // OsMA: period for Slow Moving Average

input int                  Inp_OsMA_signal_period        = 9;              // OsMA: averaging period for their difference

input ENUM_APPLIED_PRICE   Inp_OsMA_applied_price        = PRICE_CLOSE;    // OsMA: type of price

input group             "Ichimoku"

input ENUM_TIMEFRAMES      Inp_Ichimoku_period           = PERIOD_D1;      // Ichimoku: timeframe

input int                  Inp_Ichimoku_tenkan_sen       = 9;              // Ichimoku: period of Tenkan-sen

input int                  Inp_Ichimoku_kijun_sen        = 26;             // Ichimoku: period of Kijun-sen

input int                  Inp_Ichimoku_senkou_span_b    = 52;             // Ichimoku: period of Senkou Span B

input group             "Gator"

input ENUM_TIMEFRAMES      Inp_Gator_period              = PERIOD_D1;      // Gator: timeframe

input int                  Inp_Gator_jaw_period          = 13;             // Gator: period for the calculation of jaws

input int                  Inp_Gator_jaw_shift           = 8;              // Gator: horizontal shift of jaws

input int                  Inp_Gator_teeth_period        = 8;              // Gator: period for the calculation of teeth

input int                  Inp_Gator_teeth_shift         = 5;              // Gator: horizontal shift of teeth

input int                  Inp_Gator_lips_period         = 5;              // Gator: period for the calculation of lips

input int                  Inp_Gator_lips_shift          = 3;              // Gator: horizontal shift of lips

input ENUM_MA_METHOD       Inp_Gator_ma_method           = MODE_SMMA;      // Gator: type of smoothing

input ENUM_APPLIED_PRICE   Inp_Gator_applied_price       = PRICE_MEDIAN;   // Gator: type of price

input group             "AO"

input ENUM_TIMEFRAMES      Inp_AO_period                 = PERIOD_D1;      // AO: timeframe

input group             "StdDev"

input ENUM_TIMEFRAMES      Inp_StdDev_period             = PERIOD_D1;      // StdDev: timeframe

input int                  Inp_StdDev_ma_period          = 12;             // StdDev:averaging period

input int                  Inp_StdDev_ma_shift           = 0;              // StdDev:horizontal shift

input ENUM_MA_METHOD       Inp_StdDev_ma_method          = MODE_SMA;       // StdDev:smoothing type

input ENUM_APPLIED_PRICE   Inp_StdDev_applied_price      = PRICE_CLOSE;    // StdDev:type of price

input group             "RVI"

input ENUM_TIMEFRAMES      Inp_RVI_period                = PERIOD_D1;      // RVI: timeframe

input int                  Inp_RVI_ma_period             = 15;             // RVI: averaging period

input group             "AMA"

input ENUM_TIMEFRAMES      Inp_AMA_period                = PERIOD_D1;      // AMA: timeframe

input int                  Inp_AMA_ama_period            = 15;             // AMA: average period for AMA

input int                  Inp_AMA_fast_ma_period        = 2;              // AMA: fast MA period

input int                  Inp_AMA_slow_ma_period        = 30;             // AMA: slow MA period

input int                  Inp_AMA_ama_shift             = 0;              // AMA: horizontal shift of the indicator

input ENUM_APPLIED_PRICE   Inp_AMA_applied_price         = PRICE_CLOSE;    // AMA: type of the price

input group             "TriX"

input ENUM_TIMEFRAMES      Inp_TriX_period               = PERIOD_D1;      // TriX: timeframe

input int                  Inp_TriX_ma_period            = 14;             // TriX: averaging period

input ENUM_APPLIED_PRICE   Inp_TriX_applied_price        = PRICE_CLOSE;    // TriX: type of price

input group             "Force Index"

input ENUM_TIMEFRAMES      Inp_Force_period              = PERIOD_D1;      // Force: timeframe

input int                  Inp_Force_ma_period           = 14;             // Force: averaging period

input ENUM_MA_METHOD       Inp_Force_ma_method           = MODE_SMA;       // Force: smoothing type

input ENUM_APPLIED_VOLUME  Inp_Force_applied_volume      = VOLUME_TICK;    // Force: volume type for calculation

input group             "MFI"

input ENUM_TIMEFRAMES      Inp_MFI_period                = PERIOD_D1;      // MFI: timeframe

input int                  Inp_MFI_ma_period             = 14;             // MFI: averaging period

input ENUM_APPLIED_VOLUME  Inp_MFI_applied_volume        = VOLUME_TICK;    // MFI: volume type for calculation

input group             "DEMA"

input ENUM_TIMEFRAMES      Inp_DEMA_period               = PERIOD_D1;      // DEMA: timeframe

input int                  Inp_DEMA_ma_period            = 14;             // DEMA: averaging period

input int                  Inp_DEMA_ma_shift             = 0;              // DEMA: horizontal shift

input ENUM_APPLIED_PRICE   Inp_DEMA_applied_price        = PRICE_CLOSE;    // DEMA: type of price

input group             "VIDyA"

input ENUM_TIMEFRAMES      Inp_VIDyA_ma_period           = PERIOD_D1;      // VIDyA: timeframe

input int                  Inp_VIDyA_cmo_period          = 15;             // VIDyA: period for Chande Momentum

input int                  Inp_VIDyA_ema_period          = 12;             // VIDyA: EMA smoothing period

input int                  Inp_VIDyA_ma_shift            = 0;              // VIDyA: horizontal shift on the price chart

input ENUM_APPLIED_PRICE   Inp_VIDyA_applied_price       = PRICE_CLOSE;    // VIDyA: type of price

input group             "TEMA"

input ENUM_TIMEFRAMES      Inp_TEMA_period               = PERIOD_D1;      // TEMA: timeframe

input int                  Inp_TEMA_ma_period            = 21;             // TEMA: averaging period

input int                  Inp_TEMA_ma_shift             = 0;              // TEMA: horizontal shift of indicator

input ENUM_APPLIED_PRICE   Inp_TEMA_applied_price        = PRICE_CLOSE;    // TEMA: type of price

input group             "FrAMA"

input ENUM_TIMEFRAMES      Inp_FrAMA_period              = PERIOD_D1;      // FrAMA: timeframe

input int                  Inp_FrAMA_ma_period           = 14;             // FrAMA: averaging period

input int                  Inp_FrAMA_ma_shift            = 0;              // FrAMA: horizontal shift of indicator

input ENUM_APPLIED_PRICE   Inp_FrAMA_applied_price       = PRICE_CLOSE;    // FrAMA: type of price

input group             "OBV"

input ENUM_TIMEFRAMES      Inp_OBV_period                = PERIOD_D1;      // OBV: timeframe

input ENUM_APPLIED_VOLUME  Inp_OBV_applied_volume        = VOLUME_TICK;    // OBV: volume type for calculation

input group             "Volumes"

input ENUM_TIMEFRAMES      Inp_Volumes_period            = PERIOD_D1;      // Volumes: timeframe

input ENUM_APPLIED_VOLUME  Inp_Volumes_applied_volume    = VOLUME_TICK;    // Volumes: volume type for calculation

input group             "ADXWilder"

input ENUM_TIMEFRAMES      Inp_ADXWilder_period          = PERIOD_D1;      // ADXWilder: timeframe

input int                  Inp_ADXWilder_adx_period      = 14;             // ADXWilder: averaging period

//---

int      handle_iADX;                           // variable for storing the handle of the iADX indicator

int      handle_iCCI;                           // variable for storing the handle of the iCCI indicator

int      handle_iFractals;                      // variable for storing the handle of the iFractals indicator

int      handle_iMA;                            // variable for storing the handle of the iMA indicator

int      handle_iMACD;                          // variable for storing the handle of the iMACD indicator

int      handle_iStochastic;                    // variable for storing the handle of the iStochastic indicator

int      handle_iSAR;                           // variable for storing the handle of the iSAR indicator

int      handle_iMomentum;                      // variable for storing the handle of the iMomentum indicator

int      handle_iWPR;                           // variable for storing the handle of the iWPR indicator

int      handle_iAC;                            // variable for storing the handle of the iAC indicator

int      handle_iBullsPower;                    // variable for storing the handle of the iBullsPower indicator

int      handle_iBearsPower;                    // variable for storing the handle of the iBearsPower indicator

int      handle_iATR;                           // variable for storing the handle of the iATR indicator

int      handle_iBands;                         // variable for storing the handle of the iBands indicator

int      handle_iAlligator;                     // variable for storing the handle of the iAlligator indicator

int      handle_iDeMarker;                      // variable for storing the handle of the iDeMarker indicator

int      handle_iRSI;                           // variable for storing the handle of the iRSI indicator

int      handle_iChaikin;                       // variable for storing the handle of the iChaikin indicator

int      handle_iEnvelopes;                     // variable for storing the handle of the iEnvelopes indicator

int      handle_iOsMA;                          // variable for storing the handle of the iOsMA indicator

int      handle_iIchimoku;                      // variable for storing the handle of the iIchimoku indicator

int      handle_iGator;                         // variable for storing the handle of the iGator indicator

int      handle_iAO;                            // variable for storing the handle of the iAO indicator

int      handle_iStdDev;                        // variable for storing the handle of the iStdDev indicator

int      handle_iCustom;                        // variable for storing the handle of the iCustom indicator

int      handle_iRVI;                           // variable for storing the handle of the iRVI indicator

int      handle_iAMA;                           // variable for storing the handle of the iAMA indicator

int      handle_iTriX;                          // variable for storing the handle of the iTriX indicator

int      handle_iForce;                         // variable for storing the handle of the iForce indicator

int      handle_iMFI;                           // variable for storing the handle of the iMFI indicator

int      handle_iDEMA;                          // variable for storing the handle of the iDEMA indicator

int      handle_iVIDyA;                         // variable for storing the handle of the iVIDyA indicator

int      handle_iTEMA;                          // variable for storing the handle of the iTEMA indicator

int      handle_iFrAMA;                         // variable for storing the handle of the iFrAMA indicator

int      handle_iOBV;                           // variable for storing the handle of the iOBV indicator

int      handle_iVolumes;                       // variable for storing the handle of the iVolumes indicator

int      handle_iADXWilder;                     // variable for storing the handle of the iADXWilder indicator

//---

bool     m_init_error               = false;    // error on InInit

//+------------------------------------------------------------------+

//| Expert initialization function                                   |

//+------------------------------------------------------------------+

int OnInit()

  {

   ResetLastError();

   if(!m_symbol.Name(Symbol())) // sets symbol name

     {

      Print(__FILE__," ",__FUNCTION__,", ERROR: CSymbolInfo.Name");

      return(INIT_FAILED);

     }

//--- create handle of the indicator iADX

   handle_iADX=iADX(m_symbol.Name(),Inp_ADX_period,Inp_ADX_adx_period);

//--- if the handle is not created

   if(handle_iADX==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iADX indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Period()),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator iCCI

   handle_iCCI=iCCI(m_symbol.Name(),Inp_CCI_period,Inp_CCI_ma_period,Inp_CCI_applied_price);

//--- if the handle is not created

   if(handle_iCCI==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iCCI indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_CCI_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator iFractals

   handle_iFractals=iFractals(m_symbol.Name(),Inp_Fractals_period);

//--- if the handle is not created

   if(handle_iFractals==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iFractals indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Period()),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator iMA

   handle_iMA=iMA(m_symbol.Name(),Inp_MA_period,Inp_MA_ma_period,Inp_MA_ma_shift,

                  Inp_MA_ma_method,Inp_MA_applied_price);

//--- if the handle is not created

   if(handle_iMA==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iMA indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Period()),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator iMACD

   handle_iMACD=iMACD(m_symbol.Name(),Inp_MACD_period,Inp_MACD_fast_ema_period,Inp_MACD_slow_ema_period,

                      Inp_MACD_signal_period,Inp_MACD_applied_price);

//--- if the handle is not created

   if(handle_iMACD==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iMACD indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_MACD_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator iStochastic

   handle_iStochastic=iStochastic(m_symbol.Name(),Inp_STO_period,

                                  Inp_STO_Kperiod,Inp_STO_Dperiod,Inp_STO_slowing,

                                  Inp_STO_ma_method,Inp_STO_price_field);

//--- if the handle is not created

   if(handle_iStochastic==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iStochastic indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_STO_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator iSAR

   handle_iSAR=iSAR(m_symbol.Name(),Inp_SAR_period,Inp_SAR_step,Inp_SAR_maximum);

//--- if the handle is not created

   if(handle_iSAR==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iSAR indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_SAR_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator iMomentum

   handle_iMomentum=iMomentum(m_symbol.Name(),Inp_Momentum_period,Inp_Momentum_mom_period,

                              Inp_Momentum_applied_price);

//--- if the handle is not created

   if(handle_iMomentum==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iMomentum indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_Momentum_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator iWPR

   handle_iWPR=iWPR(m_symbol.Name(),Inp_WPR_period,Inp_WPR_calc_period);

//--- if the handle is not created

   if(handle_iWPR==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iWPR indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_WPR_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator iAC

   handle_iAC=iAC(m_symbol.Name(),Inp_AC_period);

//--- if the handle is not created

   if(handle_iAC==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iAC indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_AC_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator iBullsPower

   handle_iBullsPower=iBullsPower(m_symbol.Name(),Inp_Bulls_period,Inp_Bulls_ma_period);

//--- if the handle is not created

   if(handle_iBullsPower==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iBullsPower indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_Bulls_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator iBearsPower

   handle_iBearsPower=iBearsPower(m_symbol.Name(),Inp_Bears_period,Inp_Bears_ma_period);

//--- if the handle is not created

   if(handle_iBearsPower==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iBearsPower indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_Bears_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator iATR

   handle_iATR=iATR(m_symbol.Name(),Inp_ATR_period,Inp_ATR_ma_period);

//--- if the handle is not created

   if(handle_iATR==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iATR indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_ATR_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator iBands

   handle_iBands=iBands(m_symbol.Name(),Inp_Bands_period,Inp_Bands_bands_period,

                        Inp_Bands_bands_shift,Inp_Bands_deviation,Inp_Bands_applied_price);

//--- if the handle is not created

   if(handle_iBands==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iBands indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_Bands_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator iAlligator

   handle_iAlligator=iAlligator(m_symbol.Name(),Inp_Alligator_period,

                                Inp_Alligator_jaw_period,Inp_Alligator_jaw_shift,

                                Inp_Alligator_teeth_period,Inp_Alligator_teeth_shift,

                                Inp_Alligator_lips_period,Inp_Alligator_lips_shift,

                                Inp_Alligator_ma_method,Inp_Alligator_applied_price);

//--- if the handle is not created

   if(handle_iAlligator==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iAlligator indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_Alligator_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator iDeMarker

   handle_iDeMarker=iDeMarker(m_symbol.Name(),Inp_DeM_period,Inp_DeM_ma_period);

//--- if the handle is not created

   if(handle_iDeMarker==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iDeMarker indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_DeM_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator iRSI

   handle_iRSI=iRSI(m_symbol.Name(),Inp_RSI_period,Inp_RSI_ma_period,Inp_RSI_applied_price);

//--- if the handle is not created

   if(handle_iRSI==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iRSI indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_RSI_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator iChaikin

   handle_iChaikin=iChaikin(m_symbol.Name(),Inp_CHO_period,Inp_CHO_fast_ma_period,

                            Inp_CHO_slow_ma_period,Inp_CHO_ma_method,Inp_CHO_applied_volume);

//--- if the handle is not created

   if(handle_iChaikin==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iChaikin indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_CHO_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator iEnvelopes

   handle_iEnvelopes=iEnvelopes(m_symbol.Name(),Inp_Env_period,Inp_Env_ma_period,Inp_Env_ma_shift,

                                Inp_Env_ma_method,Inp_Env_applied_price,Inp_Env_deviation);

//--- if the handle is not created

   if(handle_iEnvelopes==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iEnvelopes indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_Env_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator iOsMA

   handle_iOsMA=iOsMA(m_symbol.Name(),Inp_OsMA_period,Inp_OsMA_fast_ema_period,

                      Inp_OsMA_slow_ema_period,Inp_OsMA_signal_period,Inp_OsMA_applied_price);

//--- if the handle is not created

   if(handle_iOsMA==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create a handle of iOsMA for the pair %s/%s, error code is %d",

                  m_symbol.Name(),

                  EnumToString(Inp_OsMA_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator iIchimoku

   handle_iIchimoku=iIchimoku(m_symbol.Name(),Inp_Ichimoku_period,Inp_Ichimoku_tenkan_sen,

                              Inp_Ichimoku_kijun_sen,Inp_Ichimoku_senkou_span_b);

//--- if the handle is not created

   if(handle_iIchimoku==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iIchimoku indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_Ichimoku_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator iGator

   handle_iGator=iGator(m_symbol.Name(),Inp_Gator_period,

                        Inp_Gator_jaw_period,Inp_Gator_jaw_shift,

                        Inp_Gator_teeth_period,Inp_Gator_teeth_shift,

                        Inp_Gator_lips_period,Inp_Gator_lips_shift,

                        Inp_Gator_ma_method,Inp_Gator_applied_price);

//--- if the handle is not created

   if(handle_iGator==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iGator indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_Gator_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator iAO

   handle_iAO=iAO(m_symbol.Name(),Inp_AO_period);

//--- if the handle is not created

   if(handle_iAO==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iAO indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_AO_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator iStdDev

   handle_iStdDev=iStdDev(m_symbol.Name(),Inp_StdDev_period,Inp_StdDev_ma_period,

                          Inp_StdDev_ma_shift,Inp_StdDev_ma_method,Inp_StdDev_applied_price);

//--- if the handle is not created

   if(handle_iStdDev==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iStdDev indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_StdDev_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator iRVI

   handle_iRVI=iRVI(m_symbol.Name(),Inp_RVI_period,Inp_RVI_ma_period);

//--- if the handle is not created

   if(handle_iRVI==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iRVI indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_RVI_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator iCustom

   handle_iCustom=iCustom(m_symbol.Name(),Inp_DEMA_period,"Examples\\DEMA",

                          Inp_DEMA_ma_period,

                          Inp_DEMA_ma_shift,

                          Inp_DEMA_applied_price);

//--- if the handle is not created

   if(handle_iCustom==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iCustom indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_DEMA_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator iAMA

   handle_iAMA=iAMA(m_symbol.Name(),Inp_AMA_period,Inp_AMA_ama_period,Inp_AMA_fast_ma_period,

                    Inp_AMA_slow_ma_period,Inp_AMA_ama_shift,Inp_AMA_applied_price);

//--- if the handle is not created

   if(handle_iAMA==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iAMA indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_AMA_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator

   handle_iTriX=iTriX(m_symbol.Name(),Inp_TriX_period,Inp_TriX_ma_period,Inp_TriX_applied_price);

//--- if the handle is not created

   if(handle_iTriX==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iTriX indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_TriX_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator

   handle_iForce=iForce(m_symbol.Name(),Inp_Force_period,Inp_Force_ma_period,Inp_Force_ma_method,Inp_Force_applied_volume);

//--- if the handle is not created

   if(handle_iForce==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iForce indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_Force_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator

   handle_iMFI=iMFI(m_symbol.Name(),Inp_MFI_period,Inp_MFI_ma_period,Inp_MFI_applied_volume);

//--- if the handle is not created

   if(handle_iMFI==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iMFI indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_MFI_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator

   handle_iDEMA=iDEMA(m_symbol.Name(),Inp_DEMA_period,Inp_DEMA_ma_period,

                      Inp_DEMA_ma_shift,Inp_DEMA_applied_price);

//--- if the handle is not created

   if(handle_iDEMA==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iDEMA indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_DEMA_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator

   handle_iVIDyA=iVIDyA(m_symbol.Name(),Inp_VIDyA_ma_period,Inp_VIDyA_cmo_period,

                        Inp_VIDyA_ema_period,Inp_VIDyA_ma_shift,Inp_VIDyA_applied_price);

//--- if the handle is not created

   if(handle_iVIDyA==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iVIDyA indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_VIDyA_ma_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator

   handle_iTEMA=iTEMA(m_symbol.Name(),Inp_TEMA_period,Inp_TEMA_ma_period,

                      Inp_TEMA_ma_shift,Inp_TEMA_applied_price);

//--- if the handle is not created

   if(handle_iTEMA==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iTEMA indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_TEMA_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator

   handle_iFrAMA=iFrAMA(m_symbol.Name(),Inp_FrAMA_period,Inp_FrAMA_ma_period,

                        Inp_FrAMA_ma_shift,Inp_FrAMA_applied_price);

//--- if the handle is not created

   if(handle_iFrAMA==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iFrAMA indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_FrAMA_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the iOBV indicator

   handle_iOBV=iOBV(m_symbol.Name(),Inp_OBV_period,Inp_OBV_applied_volume);

//--- if the handle is not created

   if(handle_iOBV==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iOBV indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_OBV_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator

   handle_iVolumes=iVolumes(m_symbol.Name(),Inp_Volumes_period,Inp_Volumes_applied_volume);

//--- if the handle is not created

   if(handle_iVolumes==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iVolumes indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_Volumes_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//--- create handle of the indicator

   handle_iADXWilder=iADXWilder(m_symbol.Name(),Inp_ADXWilder_period,Inp_ADXWilder_adx_period);

//--- if the handle is not created

   if(handle_iADXWilder==INVALID_HANDLE)

     {

      //--- tell about the failure and output the error code

      PrintFormat("Failed to create handle of the iADXWilder indicator for the symbol %s/%s, error code %d",

                  m_symbol.Name(),

                  EnumToString(Inp_ADXWilder_period),

                  GetLastError());

      //--- the indicator is stopped early

      m_init_error=true;

      return(INIT_SUCCEEDED);

     }

//---

   return(INIT_SUCCEEDED);

  }

//+------------------------------------------------------------------+

//| Expert deinitialization function                                 |

//+------------------------------------------------------------------+

void OnDeinit(const int reason)

  {

//---

  }

//+------------------------------------------------------------------+

//| Expert tick function                                             |

//+------------------------------------------------------------------+

void OnTick()

  {

//---

  }

//+------------------------------------------------------------------+

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---