!ind_DISCOteca_1.09

Author: Copyright © +string(__DATETIME__)+ by L€on$i (MT4 build:1260 | ME5 build:2302) MQLbuild:+__MQL4BUILD__
Price Data Components
Series array that contains open time of each bar
Indicators Used
Relative strength indexLarry William percent range indicatorIndicator of the average true range
Miscellaneous
Implements a curve of type %1It issuies visual alerts to the screenIt plays sound alerts
1 Views
0 Downloads
0 Favorites
!ind_DISCOteca_1.09
ÿþ//+------------------------------------------------------------------+

//|                                               !ind_DISCOteca.mq4 |

//|                  Copyright 02.11.2019 by LeonSi (MT4 Build 1260) |

//|        Made in RUSSIA. Rostov-on-Don :) mailto:nsi2000@ya.ru |

//|                            https://www.mql5.com/ru/users/leonsi/ |

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

#property copyright "Copyright © "+string(__DATETIME__)+" by L¬ on$i (MT4 build:1260 | ME5 build:2302) MQLbuild:"+__MQL4BUILD__

#property link      "https://www.mql5.com/ru/users/leonsi/"

#property version   "1.09"

#property strict

#property indicator_separate_window



#include <stderror.mqh>

#include <stdlib.mqh>

//--- ;O :>@@5:B=>9 @01>BK 8=48:0B>@0 =5>1E>48<>:

//--- 1)  >:=5 "17>@ @K=:0" 4>;6=K 1KBL 4>ABC?=K 20;NB=K5 ?0@K:

//--- EURUSD,EURGBP,EURAUD,EURNZD,EURCAD,EURCHF,EURJPY,

//--- GBPUSD,GBPAUD,GBPNZD,GBPCAD,GBPCHF,GBPJPY,

//--- AUDUSD,AUDNZD,AUDCAD,AUDCHF,AUDJPY,

//--- NZDUSD,NZDCAD,NZDCHF,NZDJPY,

//--- USDCHF,USDCAD,USDJPY

//--- CADCHF,CADJPY,

//--- CHFJPY

//--- 8=48:0B>@ ?>?KB05BAO A45;0BL 8E 2 "17>@ @K=:0" 4>ABC?=K<8 ?@8 8=8F80;870F88. A;8 =5>1E>48<K9 A8<2>; =5 =0945=,

//--- B> @01>B0 8=48:0B>@0 1C45B =52>7<>6=0. 0: 20@80=B 20< ?@8945BAO A<5=8BL 48;8=3>2K9 F5=B@ (8;8 ?>?KB0BLAO @5H8BL A =8< 2>?@>A)

//--- 2)  <8=N "!5@28A->@E82 :>B8@>2>:"-'F2' =5>1E>48<> ?>43@C78BL 8AB>@8N ?> :064>9 20;NB=>9 ?0@5.

//--- =48:0B>@ 1C45B 8A?>;L7>20BL 40==K5 4;O ?>AB@>5=85 8=45:A>2 RSI ?> <8=8<0;L=> 4>ABC?=K< 8AB>@8G5A:8< 40==K<.

//--- @8<5@: GBPUSD=150; EURUSD=100 bars; AUDUSD=200;... >B>1@060BLAO =0 M:@0=5 RSI index 1C45B 100 bars.

//---  =0AB@>9:0E 8=48:0B>@0 2K2545==> Input Bars for calculate (more bars=long time calculate) = 150; 1>;LH5 10@>2, 4>;LH5 8=8F80;870F8O.

//--- 3) =48:0B>@ 35=5@8@C5B A83=0;K ?>;CG5==K5 A RSI index 8 ?5@5405B 8E 2 '3;>10;L=K5 ?5@5<5==K5' F3 (5A;8 >?F8O 2:;NG5=0 2 =0AB@>9:0E).

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

//| Histori Modify                                                   |

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

//--- 02.03.2020 1.09

//--- >102;5=0 DC=:F8O SYMBOL SWITCHER.  ;52>< =86=5< C3;C 4 :=>?:8 4;O ?5@5:;NG5=8O 3@0D8:>2 87 >:=0 "17>@ @K=:0".

//--- 11.02.2020 1.08

//--- A?@02;5=> <=>65AB2> <5;:8E >H81>:. 7 206=KE (A83=0; RSI ?5@5A5G5=85 42CE 8=45:<>2. "5?5@L >48= 8=45:A 4>;65= 84B8 225@E, 2B>@>9 2=87

//--- 2> 2@5<O ?5@5A5G5=8O).  0=LH5 CG8BK20;>AL ?@>AB> ?5@5A5G5=85...

//--- 23.11.2019 1.07

//--- >D8:A8=0 8 >?B8<878@>20=0 8=8F80;870F8O 8=48:0B>@0. 5;:85 4>@>1>B:8 ?@02>3> >:=0 (WPR 4>102;5=> histogram closed bar)

//--- 20.11.2019 1.06

//--- >102;5= 2K1>@ 20@80=B0 A83=0;0 ?> 70:@KB>9 8;8 B5:CI59 A25G5. :=> 8=48:0B>@0 B5?5@L D8:A8@>20==>3> @07<5@0.

//--- 17.11.2019 1.05

//--- 5@545;0=> ?@02>5 >:=> 8=48:0B>@0. >102;5=K ?>:070=8O WPR 4;O 1KAB@>3> >?@545;5=8O A>AB>O=8O 20;NB=>9 ?0@K.

//--- >102;5=0 ?@>25@:0 =0 =0;8G85 =5>1E>48<KE 20;NB=KE ?0@ ?@8 8=8F80;870F88 8=48:0B>@0.

//--- 16.11.2019 1.04

//--- >4?@02;5==K F25B0 ;8=89 8=45:A>2. >102;5= A83=0; (3=RSI ?5@5A5G5=85 42CE 8=45:A>2).

//--- 15.11.2019 1.03

//--- >102;5= 2B>@>9 284 A83=0;0 (8=8O 8=45:A0 2KE>48B 87 7>=K ?5@5:C?;5==>AB8/?5@5?@>4>==>AB8).

//--- >102;5= 2K1>@ 20@80=B0 ?@54>AB>2;5=8O A83=0;0 (0=2A5 20@80=BK; 1=?5@5A5G5=85 =C;52>9; 2=2KE>4 87 7>=K ?5@5:C?;5==>AB8/?5@5?@>4>==>AB8)

//--- 09.11.2019 1.02

//--- >102;5=0 2>7<>6=>ABL ?@82O7:8 8=48:0B>@0 RSI : >?@545;5==><C B09<D@59<C.

//--- A?@02;5==>, 4>102;5=> 8 87<5=8=> >B>1@065=85 8=48:0B>@0 A?@020:))) :@0A>B0 8 C4>1AB2> 2>A?@8OB8O...

//--- 05.11.2019 1.01

//--- >102;5= 8=48:0B>@ ATR. B@8A>2K205BAO A?@020 2 >:=5. ATR AB@>8BAO =0 >A=>25 ?>;CG5==KE 8=45:A>2.

//--- >102;5=> 2K45;5=85 68@=K< ;8=89 :>B>@K5 A>>B25BAB2CNB =0720=8N 20;NB=>9 ?0@K. ?@8<5@: EURUSD = USD 8 EUR 2K45;5=K 68@=K<.

//--- ;O 1KAB@>9 A<5=K 3@0D8:0 2>;NB=>9 ?0@K 4>AB0B>G=> ?5@5B0I8BL 87 >:=0 '17>@ @K=:0' =>2CN ?0@C 8 1@>A8BL =0 3@0D8:.

//--- 02.11.2019 1.00

//--- =48:0B>@ A>7405B 8 8=45:A>2 ("USD","EUR","AUD","GBP","NZD","JPY","CHF","CAD");

//--- 0==K5 ?>;CG05B 8A?;L7CO RSI. ;O C4>1AB20 2>A?@5OB8O H:0;0 45;5=8O A<5I5=0:

//--- (2 AB0=40@B=>< RSI 0,30,70,100) 2 B5:CI5< 20@80=B5 -50,-20,0,20,50 (?5@5A5G5=85 RSI 0 + ATR 225@E = A83=0; ?>:C?:8/?@>4068)

//--- 5@54 8A?>;L7>20=85< 8=48:0B>@0 @5:><5=4C5BAO ?>4:0G0BL 8AB>@8G5A:85 40==K5 ?> 2A5< 8A?>;L7C5<K< ?0@0<.

//--- "0:65 A83=0;K <>6=> C2845BL 'F3->;>10;L=K5 ?5@5<5=K5', 5A;8 2:;NG5=0 >?F8O 2 =0AB@>9:0E 8=48:0B>@0 (4;O -:A?5@B0).

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

#property description "8=45:AK RSI 2 ;52>9 G0AB8 8=48:0B>@0 (8 A8<2>;>2).  ?@02>< >:=5 A;520 A83=0;K RSI."

#property description "AB0;L=>5 WPR 8 ATR 2A5 ?5@8>4K B5:CI53> 8=AB@C<5=B0. =48:0B>@ 8I5B 2 >:=5"

#property description "'17>@ @K=:0' 4>ABC?=K5 20;NB=K5 ?0@K A A8<2>;0<8 'USD', 'EUR', 'AUD', 'GBP', 'NZD',"

#property description "'JPY', 'CHF', 'CAD'. 5@54 8A?>;L7>20=85< 8=48:0B>@0 @5:><5=4C5BAO ?>43@C78BL"

#property description "8AB>@8G5A:85 40==K5 ?@8 ?><>I8 '!5@28A->@E82 :>B8@>2>:' F2 ?> 2A5< 20;NB=K< ?0@0<"

#property description "8<5NI8< 2 =0720=88 ?5@5G8A;5==K5 A8<2>;K. AB0;L=>5 4>;6=> 1KBL 8=BC8B82=> ?>=OB=>."



#property indicator_height 190

#property indicator_maximum 50

#property indicator_minimum -50



#property indicator_level1 40

#property indicator_level2 30

#property indicator_level3 20

#property indicator_level4 10

#property indicator_level5 0

#property indicator_level6 -10

#property indicator_level7 -20

#property indicator_level8 -30

#property indicator_level9 -40



#property indicator_levelcolor clrSilver

#property indicator_levelwidth 0

#property indicator_levelstyle STYLE_DOT



#property indicator_buffers 8

#property indicator_plots   8



#property indicator_color1  clrBlue

#property indicator_color2  clrGreen

#property indicator_color3  clrRed

#property indicator_color4  clrDeepSkyBlue

#property indicator_color5  clrDimGray

#property indicator_color6  clrOrange

#property indicator_color7  clrYellowGreen

#property indicator_color8  clrMagenta

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

//| input parameters                                                 |

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

input string   i1 = "==========================";           // ===== ATR =====

input int      eATR_period = 14;                            // Input ATR period

input bool     zzzATR = true;                               // Use ATR for create signals

input string   i2 = "==========================";           // ===== RSI =====

input int      eRSI_period = 14;                            // Input RSI period

input ENUM_APPLIED_PRICE eRSI_applied_price = PRICE_CLOSE;  // Input RSI applied price

input int      input_RSI_level = 20;                        // Input RSI level overbought/oversold (0-50)

input ENUM_TIMEFRAMES eTimeFrames = PERIOD_CURRENT;         // Input TimeFrame for plot RSI indexes

enum signal_variable

  {

   all,                                                     // All versions of signal

   zero,                                                    // 1) The RSI intersection of zero point

   over,                                                    // 2) The Index RSI output from the overbought/oversold

   inter,                                                   // 3) The intersection of the two indexes

   zero_over,                                               // 1/2) Intersection of zero point / overbought/oversold

   zero_inter,                                              // 1/3) Intersection of zero point / two indexes

   over_inter                                               // 2/3) Overbought/oversold / two indexes

  };

input signal_variable Type_Signal = all;                    // Choose type signal RSI

input string   i3 = "==========================";           // ===== WPR =====

input int      eWPR_period = 14;                            // Input WPR period

input int      input_WPR_level = 30;                        // Input WPR level overbought/oversold

enum signal_variable_WPR

  {

   wall,                                                    // All versions of signal

   wzero,                                                   // The WPR intersection of zero point

   wover                                                    // The WPR output from the overbought/oversold

  };

input signal_variable_WPR Type_Signal_WPR = wall;           // Choose type signal WPR

input string   i4 = "==========================";           // ===== Indicator set =====

input int      intBars = 150;                               // Input Bars for calculate (more bars=long time calculate)

input string   sIND = "DISCO_";                             // Input Text ID for drawing object name

input string   i5 = "==========================";           // ===== Alerts =====

input bool     Use_Global = true;                           // Use Global Variable for Expert

input bool     Use_Close = false;                           // Use Close candle for generate signal

input bool     Use_PlaySoundRSI = false;                    // Use Play Sound if signal on RSI

input bool     Use_PlaySoundWPR = false;                    // Use Play Sound if signal on WPR

input int      MaximumPercentageRisk = 99;                  // Percent Risk for LotSize (0-100)

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

//| indicator buffers                                                |

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

double         EURBuffer[];

double         GBPBuffer[];

double         AUDBuffer[];

double         NZDBuffer[];

double         USDBuffer[];

double         CADBuffer[];

double         CHFBuffer[];

double         JPYBuffer[];

//---

double         ATRBuffer[3][8];

double         RSIBuffer[3][8];

double         WPRBuffer[3][8];

//---



double         cur_ATR_Buffer[2][9];

double         cur_WPR_Buffer[3][9];

//---

string         short_name;

int            iTimeFrames;

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

//| indicator data                                                   |

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

string   sSymbol[8] = {"EUR", "GBP", "AUD", "NZD", "USD", "CAD", "CHF", "JPY"};

string   aSymbol[28] = {"EURUSD", "EURGBP", "EURAUD", "EURNZD", "EURCAD", "EURCHF", "EURJPY",

                        "GBPUSD", "GBPAUD", "GBPNZD", "GBPCAD", "GBPCHF", "GBPJPY",

                        "AUDUSD", "AUDNZD", "AUDCAD", "AUDCHF", "AUDJPY",

                        "NZDUSD", "NZDCAD", "NZDCHF", "NZDJPY",

                        "USDCHF", "USDCAD", "USDJPY",

                        "CADCHF", "CADJPY",

                        "CHFJPY"

                       };

string   sLevel[12] = {"-50", "-40", "-30", "-20", "-10", "+10", "+20", "+30", "+40", "+50"};

int      zBars;

string   sATR = "ATR_";

string   sRSI = "RSI_";

string   sWPR = "WPR_";

string   sTimeFrames[9] = {"M1", "M5", "M15", "M30", "H1", "H4", "D1", "W1", "MN"};

int      TIMEFRAMES[9] = {PERIOD_M1, PERIOD_M5, PERIOD_M15, PERIOD_M30, PERIOD_H1, PERIOD_H4, PERIOD_D1, PERIOD_W1, PERIOD_MN1};

//---

int      pos_x_data[9] = {60, 85, 110, 135, 160, 185, 210, 235, 260};

int      pos_y_data[15] = {30, 45, 60, 75, 90, 105, 120, 135, 150, 165, 180, 195, 210, 225, 240};

//---

int      pos_x = 280;

int      pos_y = 0;

//====== START SWITCH SYMBOL

string   obj_pref = sIND + "Switch_";    //Prefix

string   fast_button = "";                //Fixed symbol button

string   must_have_list = "";             //'Must have' list

string   exept_list = "";                 //Exeptions list

//---

string prev_symb, curr_symb, next_symb;

string MustHave[999],

       Exept[999];

int    MustHaveSize,

       ExeptSize;

//====== END SWITCH SYMBOL



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

//| Custom indicator initialization function                         |

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

int OnInit()

  {

//   Comment("Indicator initialization... Please wait...");

//--- Level

   IndicatorSetInteger(INDICATOR_LEVELS, 9);

   IndicatorSetDouble(INDICATOR_LEVELVALUE, 1, 40);

   IndicatorSetDouble(INDICATOR_LEVELVALUE, 2, 30);

   IndicatorSetDouble(INDICATOR_LEVELVALUE, 3, 20);

   IndicatorSetDouble(INDICATOR_LEVELVALUE, 4, 10);

   IndicatorSetDouble(INDICATOR_LEVELVALUE, 5, 0);

   IndicatorSetDouble(INDICATOR_LEVELVALUE, 6, -10);

   IndicatorSetDouble(INDICATOR_LEVELVALUE, 7, -20);

   IndicatorSetDouble(INDICATOR_LEVELVALUE, 8, -30);

   IndicatorSetDouble(INDICATOR_LEVELVALUE, 9, -40);

//--- Maximum and Minimum in subwindow

   IndicatorSetDouble(INDICATOR_MAXIMUM, 50);

   IndicatorSetDouble(INDICATOR_MINIMUM, -50);

//--- Plot line

   SetIndexBuffer(0, EURBuffer);

   SetIndexBuffer(1, GBPBuffer);

   SetIndexBuffer(2, AUDBuffer);

   SetIndexBuffer(3, NZDBuffer);

   SetIndexBuffer(4, USDBuffer);

   SetIndexBuffer(5, CADBuffer);

   SetIndexBuffer(6, CHFBuffer);

   SetIndexBuffer(7, JPYBuffer);

//--- Calculate Max avalable bars in chart and more symbols

   zBars = calcBars();

   if(iBars(Symbol(), iTimeFrames) > 2)

      zBars = MathMin(zBars, iBars(Symbol(), iTimeFrames));

   zBars = MathMin(zBars, intBars);

//--- Index Style and Label

   for(int i = 0; i < ArraySize(sSymbol); i++)

     {

      SetIndexLabel(i, sSymbol[i]);

      SetIndexStyle(i, DRAW_LINE, STYLE_DOT, 1);

      SetIndexDrawBegin(i, zBars);

      if(StringSubstr(Symbol(), 0, 3) == sSymbol[i] || StringSubstr(Symbol(), 3, 3) == sSymbol[i])

         SetIndexStyle(i, DRAW_LINE, STYLE_DOT, 2);

     }

//--- short name

   short_name = sIND + "(" + string(eRSI_period) + ")";

   IndicatorDigits(1);

   IndicatorShortName(short_name);

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

//| if Tester then skeep                                             |

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

   if(!MQLInfoInteger(MQL_TESTER) && !MQLInfoInteger(MQL_OPTIMIZATION) && !MQLInfoInteger(MQL_VISUAL_MODE))

     {

      //--- Check Symbol in MarketWath

      for(int i = 0; i < ArraySize(aSymbol); i++)

        {

         if(SymbolSelect(aSymbol[i], true) == false)

           {

            Alert("Error:" + aSymbol[i] + " not present in MarketWath list... Initialization failed");

            return(INIT_FAILED);

           }

        }

     }

//--- Check input parameters

   if(eRSI_period < 2)

     {

      Alert("Incorrect input eRSI_period = ", eRSI_period);

      return(INIT_FAILED);

     }

   if(eATR_period < 1)

     {

      Alert("Incorrect input eATR_period = ", eATR_period);

      return(INIT_FAILED);

     }

   if(eWPR_period < 1)

     {

      Alert("Incorrect input eWPR_period = ", eWPR_period);

      return(INIT_FAILED);

     }

   if(input_RSI_level < 1 || input_RSI_level > 49)

     {

      Alert("Incorrect input_RSI_level = ", input_RSI_level, " correct range from 1 then 49");

      return(INIT_FAILED);

     }

   if(input_WPR_level < 1 || input_WPR_level > 49)

     {

      Alert("Incorrect input_WPR_level = ", input_WPR_level, " correct range from 1 then 49");

      return(INIT_FAILED);

     }

   if(MaximumPercentageRisk < 1 || MaximumPercentageRisk > 100)

     {

      Alert("Incorrect Input MaximumPercentageRisk: 0-100 true range");

      return(INIT_FAILED);

     }

//--- init timeframe

   if(eTimeFrames == 0)

      iTimeFrames = Period();

   if(eTimeFrames != 0)

      iTimeFrames = eTimeFrames;

//--- Initialization Global Variable

   if(Use_Global == true)

     {

      for(int i = 0; i < ArraySize(sSymbol); i++)

        {

         int check = 0;

         //---

         ResetLastError();

         GlobalVariableSet(sSymbol[i], 0);

         check = GetLastError();

         if(check != ERR_NO_ERROR)

           {

            Comment(Symbol() + __FUNCTION__ + " GlobalVariableSet Error: " + ErrorDescription(check));

            Print(Symbol(), __FUNCTION__, " GlobalVariableSet Error: ", ErrorDescription(check));

            return(INIT_FAILED);

           }

        }

     }

//--- Fill zero in buffer

   ArrayInitialize(ATRBuffer, 0);

   ArrayInitialize(RSIBuffer, 0);

   ArrayInitialize(WPRBuffer, 0);

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

//| Init OBJECT                                                      |

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

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

//| Create Horizontal Level Line 1 - Ziro point                      |

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

   if(ObjectFind(0, sIND + "h_level_CTR") < 0)

     {

      if(!LabelCreate(0, sIND + "h_level_CTR", OBJ_HLINE, WindowFind(short_name), 0))

        {

         Print(__FUNCTION__);

         return(INIT_FAILED);

        }

      LabelInitialization(0, sIND + "h_level_CTR", 0, 0, 0, 0, CORNER_RIGHT_LOWER, ANCHOR_LEFT,

                          "Arial Black", 7, 0, clrGray, 2, clrGray, STYLE_SOLID, 1, false, false, true, 0,

                          "Ziro point");

     }

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

//| Create Horizontal Level Line 2 - UP LEVEL (Overbought)           |

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

   if(ObjectFind(0, sIND + "h_level_UP") < 0)

     {

      if(!LabelCreate(0, sIND + "h_level_UP", OBJ_HLINE, WindowFind(short_name), input_RSI_level))

        {

         Print(__FUNCTION__);

         return(INIT_FAILED);

        }

      LabelInitialization(0, sIND + "h_level_UP", 0, input_RSI_level, 0, 0, CORNER_RIGHT_LOWER, ANCHOR_LEFT,

                          "Arial Black", 7, 0, clrRed, 2, clrRed, STYLE_SOLID, 1, false, false, true, 0,

                          "Overbought");

     }

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

//| Create Horizontal Level Line 3 - DN LEVEL (Oversold)             |

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

   if(ObjectFind(0, sIND + "h_level_DN") < 0)

     {

      if(!LabelCreate(0, sIND + "h_level_DN", OBJ_HLINE, WindowFind(short_name), -input_RSI_level))

        {

         Print(__FUNCTION__);

         return(INIT_FAILED);

        }

      LabelInitialization(0, sIND + "h_level_DN", 0, -input_RSI_level, 0, 0, CORNER_RIGHT_LOWER, ANCHOR_LEFT,

                          "Arial Black", 7, 0, clrRed, 2, clrRed, STYLE_SOLID, 1, false, false, true, 0,

                          "Oversold");

     }

//---

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

//| Create White Background / START DRAWING RIGHT WINDOW             |

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

   if(ObjectFind(0, sIND + "label") < 0)

     {

      if(!LabelCreate(0, sIND + "label", OBJ_RECTANGLE_LABEL, WindowFind(short_name)))

        {

         Print(__FUNCTION__);

         return(INIT_FAILED);

        }

      LabelInitialization(0, sIND + "label", pos_x, pos_y + 190, 280, 200, CORNER_RIGHT_LOWER, ANCHOR_CENTER,

                          "Arial", 8, 0, clrWhite, 2, clrWhite, STYLE_SOLID, 1, false, false, true, 0, "BackGround");

     }

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

//| Create Logotype                                                  |

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

   if(ObjectFind(0, sIND + "logo1") < 0)

     {

      if(!LabelCreate(0, sIND + "logo1", OBJ_LABEL, WindowFind(short_name)))

        {

         Print(__FUNCTION__);

         return(INIT_FAILED);

        }

      LabelInitialization(0, sIND + "logo1", pos_x - pos_x_data[0] + 25, pos_y + pos_y_data[9] - 7, 0, 0, CORNER_RIGHT_LOWER, ANCHOR_LEFT,

                          "Arial Black", 23, 0, clrMistyRose, 2, clrMistyRose, STYLE_SOLID, 1, false, false, true, 0, "DISCO");

     }

//--- Logo T

   if(ObjectFind(0, sIND + "logo_t") < 0)

     {

      if(!LabelCreate(0, sIND + "logo_t", OBJ_LABEL, WindowFind(short_name)))

        {

         Print(__FUNCTION__);

         return(INIT_FAILED);

        }

      LabelInitialization(0, sIND + "logo_t", pos_x - pos_x_data[5] + 15, pos_y + pos_y_data[9] - 7, 0, 0, CORNER_RIGHT_LOWER, ANCHOR_LEFT,

                          "Arial Black", 18, 0, clrMoccasin, 2, clrMoccasin, STYLE_SOLID, 1, false, false, true, 0, "t");

     }

//--- Logo e

   if(ObjectFind(0, sIND + "logo_e") < 0)

     {

      if(!LabelCreate(0, sIND + "logo_e", OBJ_LABEL, WindowFind(short_name)))

        {

         Print(__FUNCTION__);

         return(INIT_FAILED);

        }

      LabelInitialization(0, sIND + "logo_e", pos_x - pos_x_data[6] + 20, pos_y + pos_y_data[9] - 7, 0, 0, CORNER_RIGHT_LOWER, ANCHOR_LEFT,

                          "Arial Black", 18, 0, clrPaleGoldenrod, 2, clrPaleGoldenrod, STYLE_SOLID, 1, false, false, true, 0, "e");

     }

//--- Logo c

   if(ObjectFind(0, sIND + "logo_c") < 0)

     {

      if(!LabelCreate(0, sIND + "logo_c", OBJ_LABEL, WindowFind(short_name)))

        {

         Print(__FUNCTION__);

         return(INIT_FAILED);

        }

      LabelInitialization(0, sIND + "logo_c", pos_x - pos_x_data[7] + 20, pos_y + pos_y_data[9] - 7, 0, 0, CORNER_RIGHT_LOWER, ANCHOR_LEFT,

                          "Arial Black", 18, 0, clrLightGreen, 2, clrLightGreen, STYLE_SOLID, 1, false, false, true, 0, "c");

     }

//--- Logo a

   if(ObjectFind(0, sIND + "logo_a") < 0)

     {

      if(!LabelCreate(0, sIND + "logo_a", OBJ_LABEL, WindowFind(short_name)))

        {

         Print(__FUNCTION__);

         return(INIT_FAILED);

        }

      LabelInitialization(0, sIND + "logo_a", pos_x - pos_x_data[8] + 10, pos_y + pos_y_data[9] - 7, 0, 0, CORNER_RIGHT_LOWER, ANCHOR_LEFT,

                          "Arial Black", 18, 0, clrPaleGreen, 2, clrPaleGreen, STYLE_SOLID, 1, false, false, true, 0, "a");

     }

//---Logo Design by

   if(ObjectFind(0, sIND + "logo_design") < 0)

     {

      if(!LabelCreate(0, sIND + "logo_design", OBJ_LABEL, WindowFind(short_name)))

        {

         Print(__FUNCTION__);

         return(INIT_FAILED);

        }

      LabelInitialization(0, sIND + "logo_design", pos_x - pos_x_data[8] - 10, pos_y + pos_y_data[10] - 5, 0, 0, CORNER_RIGHT_LOWER,

                          ANCHOR_RIGHT, "Arial", 6, 0, clrSilver, 2, clrSilver, STYLE_SOLID, 1, false, false, true, 0, "© Create by LeonSi");

     }

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

//| Create Object Right window                                       |

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

   for(int i = 0; i < 8; i++)

     {

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

      //| Create ATR Arrow                                                 |

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

      if(ObjectFind(0, sIND + sATR + sSymbol[i]) < 0)

        {

         if(!LabelCreate(0, sIND + sATR + sSymbol[i], OBJ_LABEL, WindowFind(short_name)))

           {

            Print(__FUNCTION__);

            return(INIT_FAILED);

           }

         LabelInitialization(0, sIND + sATR + sSymbol[i], pos_x - 20, pos_y + 15 + i * 22, 0, 0, CORNER_RIGHT_LOWER, ANCHOR_CENTER,

                             "Wingdings", 16, 241, clrGold, 2, clrGold, STYLE_SOLID, 1, false, false, true, 0, CharToString(220));

        }

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

      //| Create NUMBER RSI Symbol                                         |

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

      if(ObjectFind(0, sIND + sRSI + sSymbol[i]) < 0)

        {

         if(!LabelCreate(0, sIND + sRSI + sSymbol[i], OBJ_LABEL, WindowFind(short_name)))

           {

            Print(__FUNCTION__);

            return(INIT_FAILED);

           }

         LabelInitialization(0, sIND + sRSI + sSymbol[i], pos_x - pos_x_data[0] + 14, pos_y + 9 + i * 22, 0, 0, CORNER_RIGHT_LOWER,

                             ANCHOR_RIGHT, "Arial Narrow", 5, 0, clrBlack, 2, clrBlack, STYLE_SOLID, 1, false, false, true, 0, "0.0");

        }

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

      //| Create NAME index                                                |

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

      if(ObjectFind(0, sIND + sSymbol[i]) < 0)

        {

         if(!LabelCreate(0, sIND + sSymbol[i], OBJ_LABEL, WindowFind(short_name)))

           {

            Print(__FUNCTION__);

            return(INIT_FAILED);

           }

         LabelInitialization(0, sIND + sSymbol[i], pos_x - 20, pos_y + 20 + i * 22, 0, 0, CORNER_RIGHT_LOWER, ANCHOR_CENTER,

                             "Arial Black", 6, 0, clrDimGray, 2, clrDimGray, STYLE_SOLID, 1, false, false, true, 0, sSymbol[i]);

        }

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

      //--- Create RSI close

      if(ObjectFind(0, sIND + sSymbol[i] + "_close") < 0)

        {

         if(!LabelCreate(0, sIND + sSymbol[i] + "_close", OBJ_LABEL, WindowFind(short_name)))

           {

            Print(__FUNCTION__);

            return(INIT_FAILED);

           }

         LabelInitialization(0, sIND + sSymbol[i] + "_close", pos_x - 20, pos_y + 10 + i * 22, 0, 0, CORNER_RIGHT_LOWER, ANCHOR_CENTER,

                             "Arial Black", 5, 0, clrDimGray, 2, clrDimGray, STYLE_SOLID, 1, false, false, true, 0, "close");

         ObjectSetDouble(0, sIND + sSymbol[i] + "_close", OBJPROP_ANGLE, 15);

        }

     }

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

//| Create WPR Object                                                |

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

   for(int i = 0; i < 9; i++)

     {

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

      //| Create ATR WPR Arrow                                             |

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

      if(ObjectFind(0, sIND + sATR + sTimeFrames[i]) < 0)

        {

         if(!LabelCreate(0, sIND + sATR + sTimeFrames[i], OBJ_LABEL, WindowFind(short_name)))

           {

            Print(__FUNCTION__);

            return(INIT_FAILED);

           }

         LabelInitialization(0, sIND + sATR + sTimeFrames[i], pos_x - pos_x_data[i], pos_y + 17, 0, 0, CORNER_RIGHT_LOWER, ANCHOR_CENTER,

                             "Wingdings", 18, 241, clrGold, 2, clrGold, STYLE_SOLID, 1, false, false, true, 0, CharToString(220));

        }

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

      //| Create NUMBER WPR period                                         |

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

      if(ObjectFind(0, sIND + sWPR + sTimeFrames[i]) < 0)

        {

         if(!LabelCreate(0, sIND + sWPR + sTimeFrames[i], OBJ_LABEL, WindowFind(short_name)))

           {

            Print(__FUNCTION__);

            return(INIT_FAILED);

           }

         LabelInitialization(0, sIND + sWPR + sTimeFrames[i], pos_x - pos_x_data[i], pos_y + 32, 0, 0, CORNER_RIGHT_LOWER, ANCHOR_CENTER,

                             "Arial Narrow", 5, 0, clrBlack, 2, clrBlack, STYLE_SOLID, 1, false, false, true, 0, "0.0");

        }

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

      //| Create WPR NAME period                                           |

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

      if(ObjectFind(0, sIND + sTimeFrames[i]) < 0)

        {

         if(!LabelCreate(0, sIND + sTimeFrames[i], OBJ_LABEL, WindowFind(short_name)))

           {

            Print(__FUNCTION__);

            return(INIT_FAILED);

           }

         LabelInitialization(0, sIND + sTimeFrames[i], pos_x - pos_x_data[i], pos_y + 20, 0, 0, CORNER_RIGHT_LOWER, ANCHOR_CENTER,

                             "Arial Black", 6, 0, clrDimGray, 2, clrDimGray, STYLE_SOLID, 1, false, false, true, 0, sTimeFrames[i]);

        }

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

      //--- Create WPR close period                                           |

      if(ObjectFind(0, sIND + sTimeFrames[i] + "_close") < 0)

        {

         if(!LabelCreate(0, sIND + sTimeFrames[i] + "_close", OBJ_LABEL, WindowFind(short_name)))

           {

            Print(__FUNCTION__);

            return(INIT_FAILED);

           }

         LabelInitialization(0, sIND + sTimeFrames[i] + "_close", pos_x - pos_x_data[i], pos_y + 10, 0, 0, CORNER_RIGHT_LOWER, ANCHOR_CENTER,

                             "Arial Black", 5, 0, clrDimGray, 2, clrDimGray, STYLE_SOLID, 1, false, false, true, 0, "close");

         ObjectSetDouble(0, sIND + sTimeFrames[i] + "_close", OBJPROP_ANGLE, 15);

        }

     }

//====== START SWITCH SYMBOL

   if(fast_button == "")

      fast_button = SymbolName(0, true);

//---

   ObjectCreate(ChartID(), obj_pref + "BT0", OBJ_BUTTON, WindowFind(short_name), 0, 0);

   ObjectSetInteger(ChartID(), obj_pref + "BT0", OBJPROP_CORNER, CORNER_LEFT_LOWER); //--- CAB0=>28< C3>; 3@0D8:0, >B=>A8B5;L=> :>B>@>3> 1C4CB >?@545;OBLAO :>>@48=0BK B>G:8

   ObjectSetInteger(ChartID(), obj_pref + "BT0", OBJPROP_XDISTANCE, 4); //--- CAB0=>28< :>>@48=0BK :=>?:8

   ObjectSetInteger(ChartID(), obj_pref + "BT0", OBJPROP_YDISTANCE, 48);

   ObjectSetInteger(ChartID(), obj_pref + "BT0", OBJPROP_XSIZE, 100); //--- CAB0=>28< @07<5@ :=>?:8

   ObjectSetInteger(ChartID(), obj_pref + "BT0", OBJPROP_YSIZE, 20);

   ObjectSetString(ChartID(), obj_pref + "BT0", OBJPROP_FONT, "Arial");

   ObjectSetInteger(ChartID(), obj_pref + "BT0", OBJPROP_FONTSIZE, 10);

   ObjectSetInteger(ChartID(), obj_pref + "BT0", OBJPROP_COLOR, Black);

   ObjectSetInteger(ChartID(), obj_pref + "BT0", OBJPROP_BGCOLOR, clrGray);

   ObjectSetInteger(ChartID(), obj_pref + "BT0", OBJPROP_BORDER_COLOR, Black); //--- CAB0=>28< F25B 3@0=8FK

   ObjectSetInteger(ChartID(), obj_pref + "BT0", OBJPROP_BACK, false); //--- >B>1@078< =0 ?5@54=5< (false) 8;8 704=5< (true) ?;0=5

   ObjectSetInteger(ChartID(), obj_pref + "BT0", OBJPROP_STATE, false); //--- ?5@52545< :=>?:C 2 7040==>5 A>AB>O=85

   ObjectSetString(ChartID(), obj_pref + "BT0", OBJPROP_TEXT, fast_button);

//---

   ObjectCreate(ChartID(), obj_pref + "BT1", OBJ_BUTTON, WindowFind(short_name), 0, 0);

   ObjectSetInteger(ChartID(), obj_pref + "BT1", OBJPROP_CORNER, CORNER_LEFT_LOWER); //--- CAB0=>28< C3>; 3@0D8:0, >B=>A8B5;L=> :>B>@>3> 1C4CB >?@545;OBLAO :>>@48=0BK B>G:8

   ObjectSetInteger(ChartID(), obj_pref + "BT1", OBJPROP_XDISTANCE, 124); //--- CAB0=>28< :>>@48=0BK :=>?:8

   ObjectSetInteger(ChartID(), obj_pref + "BT1", OBJPROP_YDISTANCE, 24);

   ObjectSetInteger(ChartID(), obj_pref + "BT1", OBJPROP_XSIZE, 120); //--- CAB0=>28< @07<5@ :=>?:8

   ObjectSetInteger(ChartID(), obj_pref + "BT1", OBJPROP_YSIZE, 20);

   ObjectSetString(ChartID(), obj_pref + "BT1", OBJPROP_FONT, "Arial");

   ObjectSetInteger(ChartID(), obj_pref + "BT1", OBJPROP_FONTSIZE, 10);

   ObjectSetInteger(ChartID(), obj_pref + "BT1", OBJPROP_COLOR, Black);

   ObjectSetInteger(ChartID(), obj_pref + "BT1", OBJPROP_BGCOLOR, White);

   ObjectSetInteger(ChartID(), obj_pref + "BT1", OBJPROP_BORDER_COLOR, Black); //--- CAB0=>28< F25B 3@0=8FK

   ObjectSetInteger(ChartID(), obj_pref + "BT1", OBJPROP_BACK, false); //--- >B>1@078< =0 ?5@54=5< (false) 8;8 704=5< (true) ?;0=5

   ObjectSetInteger(ChartID(), obj_pref + "BT1", OBJPROP_STATE, false); //--- ?5@52545< :=>?:C 2 7040==>5 A>AB>O=85

//---

   ObjectCreate(ChartID(), obj_pref + "BT2", OBJ_BUTTON, WindowFind(short_name), 0, 0);

   ObjectSetInteger(ChartID(), obj_pref + "BT2", OBJPROP_CORNER, CORNER_LEFT_LOWER); //--- CAB0=>28< C3>; 3@0D8:0, >B=>A8B5;L=> :>B>@>3> 1C4CB >?@545;OBLAO :>>@48=0BK B>G:8

   ObjectSetInteger(ChartID(), obj_pref + "BT2", OBJPROP_XDISTANCE, 4); //--- CAB0=>28< :>>@48=0BK :=>?:8

   ObjectSetInteger(ChartID(), obj_pref + "BT2", OBJPROP_YDISTANCE, 24);

   ObjectSetInteger(ChartID(), obj_pref + "BT2", OBJPROP_XSIZE, 120); //--- CAB0=>28< @07<5@ :=>?:8

   ObjectSetInteger(ChartID(), obj_pref + "BT2", OBJPROP_YSIZE, 20);

   ObjectSetString(ChartID(), obj_pref + "BT2", OBJPROP_FONT, "Arial");

   ObjectSetInteger(ChartID(), obj_pref + "BT2", OBJPROP_FONTSIZE, 10);

   ObjectSetInteger(ChartID(), obj_pref + "BT2", OBJPROP_COLOR, Black);

   ObjectSetInteger(ChartID(), obj_pref + "BT2", OBJPROP_BGCOLOR, White);

   ObjectSetInteger(ChartID(), obj_pref + "BT2", OBJPROP_BORDER_COLOR, Black); //--- CAB0=>28< F25B 3@0=8FK

   ObjectSetInteger(ChartID(), obj_pref + "BT2", OBJPROP_BACK, false); //--- >B>1@078< =0 ?5@54=5< (false) 8;8 704=5< (true) ?;0=5

   ObjectSetInteger(ChartID(), obj_pref + "BT2", OBJPROP_STATE, false); //--- ?5@52545< :=>?:C 2 7040==>5 A>AB>O=85

//---

   ObjectCreate(ChartID(), obj_pref + "BT3", OBJ_BUTTON, WindowFind(short_name), 0, 0);

   ObjectSetInteger(ChartID(), obj_pref + "BT3", OBJPROP_CORNER, CORNER_LEFT_LOWER); //--- CAB0=>28< C3>; 3@0D8:0, >B=>A8B5;L=> :>B>@>3> 1C4CB >?@545;OBLAO :>>@48=0BK B>G:8

   ObjectSetInteger(ChartID(), obj_pref + "BT3", OBJPROP_XDISTANCE, 104); //--- CAB0=>28< :>>@48=0BK :=>?:8

   ObjectSetInteger(ChartID(), obj_pref + "BT3", OBJPROP_YDISTANCE, 48);

   ObjectSetInteger(ChartID(), obj_pref + "BT3", OBJPROP_XSIZE, 140); //--- CAB0=>28< @07<5@ :=>?:8

   ObjectSetInteger(ChartID(), obj_pref + "BT3", OBJPROP_YSIZE, 20);

   ObjectSetString(ChartID(), obj_pref + "BT3", OBJPROP_FONT, "Arial");

   ObjectSetInteger(ChartID(), obj_pref + "BT3", OBJPROP_FONTSIZE, 10);

   ObjectSetInteger(ChartID(), obj_pref + "BT3", OBJPROP_COLOR, Black);

   ObjectSetInteger(ChartID(), obj_pref + "BT3", OBJPROP_BGCOLOR, clrGray);

   ObjectSetInteger(ChartID(), obj_pref + "BT3", OBJPROP_BORDER_COLOR, Black); //--- CAB0=>28< F25B 3@0=8FK

   ObjectSetInteger(ChartID(), obj_pref + "BT3", OBJPROP_BACK, false); //--- >B>1@078< =0 ?5@54=5< (false) 8;8 704=5< (true) ?;0=5

   ObjectSetInteger(ChartID(), obj_pref + "BT3", OBJPROP_STATE, false); //--- ?5@52545< :=>?:C 2 7040==>5 A>AB>O=85

   ObjectSetString(ChartID(), obj_pref + "BT3", OBJPROP_TEXT, fast_button);

//---

   ExeptSize = 0;

   if(exept_list != "")

     {

      while(StringFind(exept_list, ",") > -1 && !IsStopped())

        {

         int pos = StringFind(exept_list, ",");

         if(pos == 0)

           {

            exept_list = StringSubstr(exept_list, 1);

            continue;

           }

         Exept[ExeptSize] = StringSubstr(exept_list, 0, pos);

         exept_list = StringSubstr(exept_list, pos + 1);

         ExeptSize++;

        }

      if(exept_list != "" && exept_list != ",")

        {

         Exept[ExeptSize] = exept_list;

         ExeptSize++;

        }

     }

   MustHaveSize = 0;

   if(must_have_list != "")

     {

      while(StringFind(must_have_list, ",") > -1 && !IsStopped())

        {

         int pos = StringFind(must_have_list, ",");

         if(pos == 0)

           {

            must_have_list = StringSubstr(must_have_list, 1);

            continue;

           }

         MustHave[MustHaveSize] = StringSubstr(must_have_list, 0, pos);

         must_have_list = StringSubstr(must_have_list, pos + 1);

         MustHaveSize++;

        }

      if(must_have_list != "" && must_have_list != ",")

        {

         MustHave[MustHaveSize] = must_have_list;

         MustHaveSize++;

        }

     }

   Find_Symb();

//====== END SWITCH SYMBOL

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

//--- Comment("Initialization completed! Good Luck!");

   return(INIT_SUCCEEDED);

  }

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

//| Deinitialization function                                        |

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

void OnDeinit(const int reason)

  {

//--- GlobalVariable Delet

   if(Use_Global == true)

     {

      int check = 0;

      for(int i = 0; i < 8; i++)

        {

         ResetLastError();

         if(GlobalVariableCheck(sSymbol[i]) == true)

           {

            //---

            GlobalVariableDel(sSymbol[i]);

            check = GetLastError();

            if(check != ERR_NO_ERROR)

              {

               Print(Symbol(), ":", __FUNCTION__, " GlobalVariableDel Error: ", ErrorDescription(check));

               return;

              }

           }

        }

     }

//--- Delet objects in chart

   for(int i = ObjectsTotal(0, WindowFind(short_name), -1); i >= 0; i--)

     {

      if(StringSubstr(ObjectName(i), 0, StringLen(sIND)) == sIND)

         LabelDelete(0, ObjectName(i));

     }

//====== START SWITCH SYMBOL

   ObjectsDeleteAll(0, obj_pref);

//====== END SWITCH SYMBOL

//--- End DeInit function

   return;

  }

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

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

//| Calculate Bars. Use Minimum                                      |

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

int calcBars()

  {

   int z = iBars(Symbol(), iTimeFrames);

   for(int i = 0; i < ArraySize(aSymbol); i++)

     {

      z = MathMin(iBars(aSymbol[i], iTimeFrames), z);

     }

   return(z);

  }

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

//| Calculate RSI                                                    |

//|--- double  iRSI(                                                 |

//|---   string       symbol,           // 8<O A8<2>;0               |

//|---   int          timeframe,        // B09<D@59<                 |

//|---   int          period,           // ?5@8>4                    |

//|---   int          applied_price,    // B8? F5=K                  |

//|---   int          shift             // A4283                     |

//|---   );                                                          |

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

double zRSI(string xSymbol, int z)

  {

   double out = 0;

   for(int x = 0; x < ArraySize(aSymbol); x++)

     {

      string pairs = aSymbol[x];

      if(xSymbol == StringSubstr(pairs, 0, 3))

        {

         out = out + iRSI(pairs, iTimeFrames, eRSI_period, eRSI_applied_price, z);

        }

      //---

      if(xSymbol == StringSubstr(pairs, 3, 3))

        {

         out = out + (100 - iRSI(pairs, iTimeFrames, eRSI_period, eRSI_applied_price, z));

        }

     }

   out = (out / 7) - 50;

   return(out);

  }

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

//| Calculate WPR                                                    |

//|--- double  iWPR(                                                 |

//|---   string       symbol,           // 8<O A8<2>;0               |

//|---   int          timeframe,        // B09<D@59<                 |

//|---   int          period,           // ?5@8>4                    |

//|---   int          shift             // A4283                     |

//|---   );                                                          |

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

double zWPR(string xSymbol, int z)

  {

   double out = 0;

   for(int x = 0; x < ArraySize(aSymbol); x++)

     {

      string pairs = aSymbol[x];

      if(xSymbol == StringSubstr(pairs, 0, 3))           // if SYMxxx

        {

         out = out + (iWPR(pairs, iTimeFrames, eWPR_period, z) + 50);

        }

      //---

      if(xSymbol == StringSubstr(pairs, 3, 3))           // if xxxSYM

        {

         out = out + (-iWPR(pairs, iTimeFrames, eWPR_period, z) - 50);

        }

     }

   out = (out / 7);

   return(out);

  }

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

//| Calculate ATR                                                    |

//|--- double  iATR(                                                 |

//|---   string       symbol,           // 8<O A8<2>;0               |

//|---   int          timeframe,        // B09<D@59<                 |

//|---   int          period,           // ?5@8>4                    |

//|---   int          shift             // A4283                     |

//|---   );                                                          |

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

double zATR(string xSymbol, int z)

  {

   double out = 0;

   for(int x = 1; x < ArraySize(aSymbol); x++)

     {

      string pairs = aSymbol[x];

      string sym1 = StringSubstr(pairs, 0, 3);

      string sym2 = StringSubstr(pairs, 3, 3);

      //---

      if((xSymbol == sym1 || xSymbol == sym2))

        {

         out = out + iATR(pairs, iTimeFrames, eATR_period, z);

        }

     }

   return(out);

  }

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

//| Label create procedure                                           |

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

bool LabelCreate(const long             chart_ID = 0,                   // ID 3@0D8:0

                 const string           name = "ID_",                   // 8<O <5B:8

                 const ENUM_OBJECT      obj_type = OBJ_RECTANGLE_LABEL, // B8? >1J5:L0

                 const int              sub_window = 0,                 // =><5@ ?>4>:=0

                 const double           price = 0)

  {

//--- A1@>A8< 7=0G5=85 >H81:8

   ResetLastError();

//--- A>74048< ?@O<>C3>;L=CN <5B:C

   if(!ObjectCreate(chart_ID, name, obj_type, sub_window, 0, price))

     {

      Print(__FUNCTION__,

            ": not create object! Error code=", GetLastError(), " Description=", ErrorDescription(GetLastError()));

      return(false);

     }

   return(true);

  }

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

//| change parameters object                                         |

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

bool LabelInitialization(const long             chart_ID = 0,                  // ID 3@0D8:0

                         const string           name = "ID_",                  // 8<O <5B:8

                         // const int              sub_window=1,                  // =><5@ ?>4>:=0

                         const int              x = 290,                       // :>>@48=0B0 ?> >A8 X

                         const int              y = 30,                        // :>>@48=0B0 ?> >A8 Y

                         const int              width = 270,                   // H8@8=0

                         const int              height = 200,                  // 2KA>B0

                         const ENUM_BASE_CORNER corner = CORNER_LEFT_UPPER,    // C3>; 3@0D8:0 4;O ?@82O7:8

                         const ENUM_ANCHOR_POINT anchor = ANCHOR_RIGHT_UPPER,   // C3>; >1J5:B0 ?@82O7:8

                         const string           font = "Arial",                // H@8DB B5:AB0

                         const int              fontsize = 8,                  // @07<5@ H@8DB0

                         const uchar            arrow_code = 221,              // :>4 AB@5;:8 Wingdings

                         const color            back_clr = clrMintCream,       // F25B D>=0

                         const ENUM_BORDER_TYPE border = BORDER_SUNKEN,        // B8? 3@0=8FK

                         const color            clr = clrThistle,              // F25B ?;>A:>9 3@0=8FK (Flat)

                         const ENUM_LINE_STYLE  style = STYLE_SOLID,           // AB8;L ?;>A:>9 3@0=8FK

                         const int              line_width = 1,                // B>;I8=0 ?;>A:>9 3@0=8FK

                         const bool             back = false,                  // =0 704=5< ?;0=5

                         const bool             selection = true,              // 2K45;8BL 4;O ?5@5<5I5=89

                         const bool             hidden = true,                 // A:@KB 2 A?8A:5 >1J5:B>2

                         const long             z_order = 0,                   // ?@8>@8B5B =0 =060B85 <KHLN

                         const string           names = "!RSI_All_8symbol_index") // ?8A0=85 >1J5:B0

  {

//--- CAB0=>28< :>>@48=0BK <5B:8

   ObjectSetInteger(chart_ID, name, OBJPROP_XDISTANCE, x);

   ObjectSetInteger(chart_ID, name, OBJPROP_YDISTANCE, y);

//--- CAB0=>28< @07<5@K <5B:8

   ObjectSetInteger(chart_ID, name, OBJPROP_XSIZE, width);

   ObjectSetInteger(chart_ID, name, OBJPROP_YSIZE, height);

//--- CAB0=>28< F25B D>=0

   ObjectSetInteger(chart_ID, name, OBJPROP_BGCOLOR, back_clr);

//--- CAB0=>28< B8? 3@0=8FK

   ObjectSetInteger(chart_ID, name, OBJPROP_BORDER_TYPE, border);

//--- CAB0=>28< C3>; 3@0D8:0, >B=>A8B5;L=> :>B>@>3> 1C4CB >?@545;OBLAO :>>@48=0BK B>G:8

   ObjectSetInteger(chart_ID, name, OBJPROP_CORNER, corner);

//--- CAB0=>28< C3>; >1J5:B0, >B=>A8B5;L=> :>B>@>3> 1C4CB >?@545;OBLAO :>>@48=0BK B>G:8

   ObjectSetInteger(chart_ID, name, OBJPROP_ANCHOR, anchor);

//--- CAB0=>28< H@BDB 8 @07<5@

   ObjectSetString(chart_ID, name, OBJPROP_FONT, font);

   ObjectSetInteger(chart_ID, name, OBJPROP_FONTSIZE, fontsize);

//--- CAB0=>28< :>4 AB@5;:8

   ObjectSetInteger(chart_ID, name, OBJPROP_ARROWCODE, arrow_code);

//--- CAB0=>28< F25B ?;>A:>9 @0<:8 (2 @568<5 Flat)

   ObjectSetInteger(chart_ID, name, OBJPROP_COLOR, clr);

//--- CAB0=>28< AB8;L ;8=88 ?;>A:>9 @0<:8

   ObjectSetInteger(chart_ID, name, OBJPROP_STYLE, style);

//--- CAB0=>28< B>;I8=C ?;>A:>9 3@0=8FK

   ObjectSetInteger(chart_ID, name, OBJPROP_WIDTH, line_width);

//--- >B>1@078< =0 ?5@54=5< (false) 8;8 704=5< (true) ?;0=5

   ObjectSetInteger(chart_ID, name, OBJPROP_BACK, back);

//--- 2:;NG8< (true) 8;8 >B:;NG8< (false) @568< ?5@5<5I5=8O <5B:8 <KHLN

   ObjectSetInteger(chart_ID, name, OBJPROP_SELECTABLE, selection);

   ObjectSetInteger(chart_ID, name, OBJPROP_SELECTED, selection);

//--- A:@>5< (true) 8;8 >B>1@078< (false) 8<O 3@0D8G5A:>3> >1J5:B0 2 A?8A:5 >1J5:B>2

   ObjectSetInteger(chart_ID, name, OBJPROP_HIDDEN, hidden);

//--- CAB0=>28< ?@8>@8B5B =0 ?>;CG5=85 A>1KB8O =060B8O <KH8 =0 3@0D8:5

   ObjectSetInteger(chart_ID, name, OBJPROP_ZORDER, z_order);

//--- CAB0=>28< >?8A0=85 >1J5:B0

   ObjectSetString(chart_ID, name, OBJPROP_TEXT, names);

//--- CA?5H=>5 2K?>;=5=85

   return(true);

  }

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

//| Change Color                                                     |

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

color clr_atr(double a, double b)

  {

   color col = 0;

   if(a > b)

      col = clrPaleGreen;

   if(a < b)

      col = clrLightPink;

   if(a == b)

      col = clrYellow;

//---

   return(col);

  }

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

//| Delete object                                                    |

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

bool LabelDelete(const long   chart_ID = 0,       // ID 3@0D8:0

                 const string name = "Ind8_")     // 8<O <5B:8

  {

//--- clear error code

   ResetLastError();

//--- Delete object

   if(!ObjectDelete(chart_ID, name))

     {

      Print(__FUNCTION__,

            ": not delet object! Error code=", GetLastError(), " Description=", ErrorDescription(GetLastError()));

      return(false);

     }

//--- Complete

   return(true);

  }

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

//| Signal ATR                                                       |

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

bool xATR(int x, int i)

  {

   if(zzzATR == false)

      return(true);

   if(ATRBuffer[i][x] > ATRBuffer[i + 1][x])

      return(true);

   return(false);

  }

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

//| Custom indicator iteration function                              |

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

int OnCalculate(const int rates_total,

                const int prev_calculated,

                const datetime &time[],

                const double &open[],

                const double &high[],

                const double &low[],

                const double &close[],

                const long &tick_volume[],

                const long &volume[],

                const int &spread[])

  {

//--- calculate Bars for Fill

   if(zBars < eRSI_period || zBars < eATR_period)

     {

      Alert(Symbol(), " = Low bars in database or chart = ", zBars);

      return(0);

     }

   if(rates_total - prev_calculated == 0)

     {

      zBars = MathMax(eRSI_period, eATR_period);

     }

   else

     {

      zBars = intBars;

     }

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

//| Full buffers data in indicators                                  |

//| Plot Line Indexes                                                |

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

   for(int z = zBars; z >= 0; z--)

     {

      EURBuffer[z] = zRSI(sSymbol[0], z);

      GBPBuffer[z] = zRSI(sSymbol[1], z);

      AUDBuffer[z] = zRSI(sSymbol[2], z);

      NZDBuffer[z] = zRSI(sSymbol[3], z);

      USDBuffer[z] = zRSI(sSymbol[4], z);

      CADBuffer[z] = zRSI(sSymbol[5], z);

      CHFBuffer[z] = zRSI(sSymbol[6], z);

      JPYBuffer[z] = zRSI(sSymbol[7], z);

     }

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

//| Full buffers data for right indicators and plot label            |

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

   PlaySound(NULL);

   string text = "";

//--- Full buffer and Plot

   for(int i = 0; i < ArraySize(sSymbol); i++)

     {

      ATRBuffer[0][i] = zATR(sSymbol[i], 0);

      ATRBuffer[1][i] = zATR(sSymbol[i], 1);

      ATRBuffer[2][i] = zATR(sSymbol[i], 2);

      //---

      RSIBuffer[0][i] = zRSI(sSymbol[i], 0);

      RSIBuffer[1][i] = zRSI(sSymbol[i], 1);

      RSIBuffer[2][i] = zRSI(sSymbol[i], 2);

      WPRBuffer[0][i] = zWPR(sSymbol[i], 0);

      WPRBuffer[1][i] = zWPR(sSymbol[i], 1);

      WPRBuffer[2][i] = zWPR(sSymbol[i], 2);

      //---// Reset GlobalVariable;

      ResetLastError();

      if(Use_Global == true)

        {

         GlobalVariableSet(sSymbol[i], 0);

         int check = GetLastError();

         if(check != ERR_NO_ERROR)

           {

            Print(Symbol(), __FUNCTION__, " GlobalVariableSet (sSymbol[i],0)Error code: ", check,

                  " Error Description: ", ErrorDescription(check));

            OnDeinit(check);

            return(INIT_FAILED);

           }

        }

      //+---

      //| Modify ATR ARROW                                                 |

      //+---

      ObjectSetInteger(0, sIND + sATR + sSymbol[i], OBJPROP_COLOR, clr_atr(ATRBuffer[0][i], ATRBuffer[1][i]));

      ObjectSetString(0, sIND + sATR + sSymbol[i], OBJPROP_TEXT, CharToString(220));

      if(ATRBuffer[0][i] > ATRBuffer[1][i])

         ObjectSetString(0, sIND + sATR + sSymbol[i], OBJPROP_TEXT, CharToString(221));

      if(ATRBuffer[0][i] < ATRBuffer[1][i])

         ObjectSetString(0, sIND + sATR + sSymbol[i], OBJPROP_TEXT, CharToString(222));

      //---

      //| Modify Number RSI

      //---

      ObjectSetString(0, sIND + sRSI + sSymbol[i], OBJPROP_TEXT, DoubleToString(RSIBuffer[0][i], 1));

      //---

      //| Modify NAME symbol

      //---

      ObjectSetInteger(0, sIND + sSymbol[i], OBJPROP_COLOR, clrDimGray);

      //--- Modify NAME close

      ObjectSetInteger(0, sIND + sSymbol[i] + "_close", OBJPROP_COLOR, clrDimGray);

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

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

      //| 3) Buy and Sell signal The intersection of the two indexes       |

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

      if(Type_Signal == all || Type_Signal == inter || Type_Signal == zero_inter || Type_Signal == over_inter)

        {

         for(int x = 0; x < ArraySize(sSymbol); x++)

           {

            //--- Buy

            if(xATR(i, 0) == true && xATR(x, 0) == true &&

               RSIBuffer[0][i] > RSIBuffer[1][i] && RSIBuffer[0][x] < RSIBuffer[1][x] &&

               RSIBuffer[0][i] > RSIBuffer[0][x] && RSIBuffer[1][i] < RSIBuffer[1][x])

              {

               if(Use_Close == false && Use_Global == true)

                 {

                  GlobalVariableSet(sSymbol[i], 3);

                  GlobalVariableSet(sSymbol[x], -3);

                 }

               ObjectSetInteger(0, sIND + sSymbol[i], OBJPROP_COLOR, clrBlue);

               ObjectSetInteger(0, sIND + sSymbol[x], OBJPROP_COLOR, clrRed);

               if(Use_Close == false && Use_PlaySoundRSI == true)

                 {

                  PlaySound("alert2.wav");

                 }

              }

            //--- Close buy

            if(xATR(i, 1) == true && xATR(x, 1) == true &&

               RSIBuffer[1][i] > RSIBuffer[2][i] && RSIBuffer[1][x] < RSIBuffer[2][x] &&

               RSIBuffer[1][i] > RSIBuffer[1][x] && RSIBuffer[2][i] < RSIBuffer[2][x])

              {

               if(Use_Close == true && Use_Global == true)

                 {

                  GlobalVariableSet(sSymbol[i], 3);

                  GlobalVariableSet(sSymbol[x], -3);

                 }

               ObjectSetInteger(0, sIND + sSymbol[i] + "_close", OBJPROP_COLOR, clrBlue);

               ObjectSetInteger(0, sIND + sSymbol[x] + "_close", OBJPROP_COLOR, clrRed);

               if(Use_Close == true && Use_PlaySoundRSI == true)

                 {

                  PlaySound("alert2.wav");

                 }

              }

            //--- Sell

            if(xATR(i, 0) == true && xATR(x, 0) == true &&

               RSIBuffer[0][i] < RSIBuffer[1][i] && RSIBuffer[0][x] > RSIBuffer[1][x] &&

               RSIBuffer[0][i] < RSIBuffer[0][x] && RSIBuffer[1][i] > RSIBuffer[1][x])

              {

               if(Use_Close == false && Use_Global == true)

                 {

                  GlobalVariableSet(sSymbol[i], -3);

                  GlobalVariableSet(sSymbol[x], 3);

                 }

               ObjectSetInteger(0, sIND + sSymbol[i], OBJPROP_COLOR, clrRed);

               ObjectSetInteger(0, sIND + sSymbol[x], OBJPROP_COLOR, clrBlue);

               if(Use_Close == false && Use_PlaySoundRSI == true)

                 {

                  PlaySound("alert2.wav");

                 }

              }

            //--- Close Sell

            if(xATR(i, 1) == true && xATR(x, 1) == true &&

               RSIBuffer[1][i] < RSIBuffer[2][i] && RSIBuffer[1][x] > RSIBuffer[2][x] &&

               RSIBuffer[1][i] < RSIBuffer[1][x] && RSIBuffer[2][i] > RSIBuffer[2][x])

              {

               if(Use_Close == true && Use_Global == true)

                 {

                  GlobalVariableSet(sSymbol[i], -3);

                  GlobalVariableSet(sSymbol[x], 3);

                 }

               ObjectSetInteger(0, sIND + sSymbol[i] + "_close", OBJPROP_COLOR, clrRed);

               ObjectSetInteger(0, sIND + sSymbol[x] + "_close", OBJPROP_COLOR, clrBlue);

               if(Use_Close == true && Use_PlaySoundRSI == true)

                 {

                  PlaySound("alert2.wav");

                 }

              }

           }

        }

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

      //| create Signal buy or sell and Global set 1/2 variables           |

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

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

      //--- BUY

      //--- 1) index intersect Ziro point from Down to UP

      if(Type_Signal == all || Type_Signal == zero || Type_Signal == zero_over || Type_Signal == zero_inter)

        {

         if(xATR(i, 0) == true && RSIBuffer[1][i] < 0 && RSIBuffer[0][i] > 0)

           {

            if(Use_Close == false && Use_Global == true)

              {

               GlobalVariableSet(sSymbol[i], 1);

              }

            ObjectSetInteger(0, sIND + sSymbol[i], OBJPROP_COLOR, clrBlue);

            if(Use_Close == false && Use_PlaySoundRSI == true)

              {

               PlaySound("alert2.wav");

              }

           }

         //--- close

         if(xATR(i, 1) == true && RSIBuffer[2][i] < 0 && RSIBuffer[1][i] > 0)

           {

            if(Use_Close == true && Use_Global == true)

              {

               GlobalVariableSet(sSymbol[i], 1);

              }

            ObjectSetInteger(0, sIND + sSymbol[i] + "_close", OBJPROP_COLOR, clrBlue);

            if(Use_Close == true && Use_PlaySoundRSI == true)

              {

               PlaySound("alert2.wav");

              }

           }

        }

      //--- Oversold Buy

      if(Type_Signal == all || Type_Signal == over || Type_Signal == over_inter)

        {

         if(xATR(i, 0) == true && RSIBuffer[1][i] < -input_RSI_level && RSIBuffer[0][i] > -input_RSI_level)

           {

            if(Use_Close == false && Use_Global == true)

              {

               GlobalVariableSet(sSymbol[i], 2);

              }

            ObjectSetInteger(0, sIND + sSymbol[i], OBJPROP_COLOR, clrBlue);

            if(Use_Close == false && Use_PlaySoundRSI == true)

              {

               PlaySound("alert2.wav");

              }

           }

         //--- close

         if(xATR(i, 1) == true && RSIBuffer[1][i] < -input_RSI_level && RSIBuffer[0][i] > -input_RSI_level)

           {

            if(Use_Close == true && Use_Global == true)

              {

               GlobalVariableSet(sSymbol[i], 2);

              }

            ObjectSetInteger(0, sIND + sSymbol[i] + "_close", OBJPROP_COLOR, clrBlue);

            if(Use_Close == true && Use_PlaySoundRSI == true)

              {

               PlaySound("alert2.wav");

              }

           }

        }

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

      //--- SELL

      //--- 1) index intersect Ziro point from UP to DOWN

      if(Type_Signal == all || Type_Signal == zero || Type_Signal == zero_over || Type_Signal == zero_inter)

        {

         if(xATR(i, 0) == true && RSIBuffer[1][i] > 0 && RSIBuffer[0][i] < 0)

           {

            if(Use_Close == false && Use_Global == true)

               GlobalVariableSet(sSymbol[i], -1);

            ObjectSetInteger(0, sIND + sSymbol[i], OBJPROP_COLOR, clrRed);

            if(Use_Close == false && Use_PlaySoundRSI == true)

               PlaySound("alert2.wav");

           }

         //--- close Sell

         if(xATR(i, 1) == true && RSIBuffer[2][i] > 0 && RSIBuffer[1][i] < 0)

           {

            if(Use_Close == true && Use_Global == true)

               GlobalVariableSet(sSymbol[i], -1);

            ObjectSetInteger(0, sIND + sSymbol[i] + "_close", OBJPROP_COLOR, clrRed);

            if(Use_Close == true && Use_PlaySoundRSI == true)

               PlaySound("alert2.wav");

           }

        }

      //--- Overbought SELL

      if(Type_Signal == all || Type_Signal == over || Type_Signal == over_inter)

        {

         if(xATR(i, 0) == true && RSIBuffer[1][i] > input_RSI_level && RSIBuffer[0][i] < input_RSI_level)

           {

            if(Use_Close == false && Use_Global == true)

               GlobalVariableSet(sSymbol[i], -2);

            ObjectSetInteger(0, sIND + sSymbol[i], OBJPROP_COLOR, clrRed);

            if(Use_Close == false && Use_PlaySoundRSI == true)

               PlaySound("alert2.wav");

           }

         //--- close Sell

         if(xATR(i, 1) == true && RSIBuffer[1][i] > input_RSI_level && RSIBuffer[0][i] < input_RSI_level)

           {

            if(Use_Close == true && Use_Global == true)

               GlobalVariableSet(sSymbol[i], -2);

            ObjectSetInteger(0, sIND + sSymbol[i] + "_close", OBJPROP_COLOR, clrRed);

            if(Use_Close == true && Use_PlaySoundRSI == true)

               PlaySound("alert2.wav");

           }

        }

     }

//--- END SIGNAL calculate

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

//--- *********************************************************** ---+

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

//--- Full current symbol ATR + WPR

   for(int i = 0; i < 9; i++)

     {

      cur_ATR_Buffer[0][i] = iATR(Symbol(), TIMEFRAMES[i], eATR_period, 0);

      cur_ATR_Buffer[1][i] = iATR(Symbol(), TIMEFRAMES[i], eATR_period, 1);

      cur_WPR_Buffer[0][i] = iWPR(Symbol(), TIMEFRAMES[i], eWPR_period, 0) + 50;

      cur_WPR_Buffer[1][i] = iWPR(Symbol(), TIMEFRAMES[i], eWPR_period, 1) + 50;

      cur_WPR_Buffer[2][i] = iWPR(Symbol(), TIMEFRAMES[i], eWPR_period, 2) + 50;

      //---

      //| Modify ATR WPR Arrow

      //---

      ObjectSetInteger(0, sIND + sATR + sTimeFrames[i], OBJPROP_COLOR, clr_atr(cur_ATR_Buffer[0][i], cur_ATR_Buffer[1][i]));

      ObjectSetString(0, sIND + sATR + sTimeFrames[i], OBJPROP_TEXT, CharToString(220));

      if(cur_ATR_Buffer[0][i] > cur_ATR_Buffer[1][i])

         ObjectSetString(0, sIND + sATR + sTimeFrames[i], OBJPROP_TEXT, CharToString(221));

      if(cur_ATR_Buffer[0][i] < cur_ATR_Buffer[1][i])

         ObjectSetString(0, sIND + sATR + sTimeFrames[i], OBJPROP_TEXT, CharToString(222));

      //---

      //| Modify WPR NUMBER period

      //---

      ObjectSetString(0, sIND + sWPR + sTimeFrames[i], OBJPROP_TEXT, DoubleToString(cur_WPR_Buffer[0][i], 1));

      //---

      //| Modify WPR NAME period

      //---

      ObjectSetInteger(0, sIND + sTimeFrames[i], OBJPROP_COLOR, clrDimGray);

      //| Modify WPR NAME period CLOSE

      ObjectSetInteger(0, sIND + sTimeFrames[i] + "_close", OBJPROP_COLOR, clrDimGray);

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

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

      //| create Signal  buy or sell WPR                                   |

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

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

      //--- BUY

      //--- Ziro point Move Down to UP

      if(Type_Signal_WPR == wall || Type_Signal_WPR == wzero)

        {

         if(cur_WPR_Buffer[1][i] < 0 && cur_WPR_Buffer[0][i] > 0)

           {

            ObjectSetInteger(0, sIND + sTimeFrames[i], OBJPROP_COLOR, clrBlue);

            if(Use_Close == false && Use_PlaySoundWPR == true)

               PlaySound("alert.wav");

           }

         //--- close

         if(cur_WPR_Buffer[2][i] < 0 && cur_WPR_Buffer[1][i] > 0)

           {

            ObjectSetInteger(0, sIND + sTimeFrames[i] + "_close", OBJPROP_COLOR, clrBlue);

            if(Use_Close == true && Use_PlaySoundWPR == true)

               PlaySound("alert.wav");

           }

        }

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

      //--- over DN to UP

      if(Type_Signal_WPR == wall || Type_Signal_WPR == wover)

        {

         if(cur_WPR_Buffer[1][i] < -input_WPR_level && cur_WPR_Buffer[0][i] > -input_WPR_level)

           {

            ObjectSetInteger(0, sIND + sTimeFrames[i], OBJPROP_COLOR, clrBlue);

            if(Use_Close == false && Use_PlaySoundWPR == true)

               PlaySound("alert.wav");

           }

         //--- close

         if(cur_WPR_Buffer[2][i] < -input_WPR_level && cur_WPR_Buffer[1][i] > -input_WPR_level)

           {

            ObjectSetInteger(0, sIND + sTimeFrames[i] + "_close", OBJPROP_COLOR, clrBlue);

            if(Use_Close == true && Use_PlaySoundWPR == true)

               PlaySound("alert.wav");

           }

        }

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

      //--- SELL

      //--- Ziro point Move UP to DOWN

      if(Type_Signal_WPR == wall || Type_Signal_WPR == wzero)

        {

         if(cur_WPR_Buffer[1][i] > 0 && cur_WPR_Buffer[0][i] < 0)

           {

            ObjectSetInteger(0, sIND + sTimeFrames[i], OBJPROP_COLOR, clrRed);

            if(Use_Close == false && Use_PlaySoundWPR == true)

               PlaySound("alert.wav");

           }

         //--- close

         if(cur_WPR_Buffer[2][i] > 0 && cur_WPR_Buffer[1][i] < 0)

           {

            ObjectSetInteger(0, sIND + sTimeFrames[i] + "_close", OBJPROP_COLOR, clrRed);

            if(Use_Close == true && Use_PlaySoundWPR == true)

               PlaySound("alert.wav");

           }

        }

      //--- over DN to UP

      if(Type_Signal_WPR == wall || Type_Signal_WPR == wover)

        {

         if(cur_WPR_Buffer[1][i] > input_WPR_level && cur_WPR_Buffer[0][i] < input_WPR_level)

           {

            ObjectSetInteger(0, sIND + sTimeFrames[i], OBJPROP_COLOR, clrRed);

            if(Use_Close == false && Use_PlaySoundWPR == true)

               PlaySound("alert.wav");

           }

        }

      //--- close

      if(cur_WPR_Buffer[2][i] > input_WPR_level && cur_WPR_Buffer[1][i] < input_WPR_level)

        {

         ObjectSetInteger(0, sIND + sTimeFrames[i] + "_close", OBJPROP_COLOR, clrRed);

         if(Use_Close == true && Use_PlaySoundWPR == true)

            PlaySound("alert.wav");

        }

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

      //| Create LABEL WPR period                                          |

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

      for(int y = 0; y < 11; y++)

        {

         //--- Current Candle WPR

         if(ObjectFind(0, sIND + sWPR + sTimeFrames[i] + sLevel[y]) < 0)

           {

            if(!LabelCreate(0, sIND + sWPR + sTimeFrames[i] + sLevel[y], OBJ_RECTANGLE_LABEL, WindowFind(short_name)))

              {

               Alert(__FUNCTION__);

               return(INIT_FAILED);

              }

            LabelInitialization(0, sIND + sWPR + sTimeFrames[i] + sLevel[y], pos_x - pos_x_data[i] + 1, pos_y + 50 + y * 10, 11, 10,

                                CORNER_RIGHT_LOWER, ANCHOR_CENTER, "Arial", 8, 0, clrWhite, 0, clrWhite, STYLE_SOLID, 1,

                                false, false, true, 0, sTimeFrames[i] + sLevel[y]);

           }

         ObjectSetInteger(0, sIND + sWPR + sTimeFrames[i] + sLevel[y], OBJPROP_BGCOLOR, clrWhite);

         //--- Closed Candle WPR

         if(ObjectFind(0, sIND + sWPR + sTimeFrames[i] + sLevel[y] + "_c") < 0)

           {

            if(!LabelCreate(0, sIND + sWPR + sTimeFrames[i] + sLevel[y] + "_c", OBJ_RECTANGLE_LABEL, WindowFind(short_name)))

              {

               Alert(__FUNCTION__);

               return(INIT_FAILED);

              }

            LabelInitialization(0, sIND + sWPR + sTimeFrames[i] + sLevel[y] + "_c", pos_x - pos_x_data[i] + 12, pos_y + 50 + y * 10, 11, 10,

                                CORNER_RIGHT_LOWER, ANCHOR_CENTER, "Arial", 8, 0, clrWhite, 0, clrWhite, STYLE_SOLID, 1,

                                false, false, true, 0, sTimeFrames[i] + sLevel[y]);

           }

         ObjectSetInteger(0, sIND + sWPR + sTimeFrames[i] + sLevel[y] + "_c", OBJPROP_BGCOLOR, clrWhite);

        }

      //--- Plot color Current candle

      if(cur_WPR_Buffer[0][i] < -40.0)

         ObjectSetInteger(0, sIND + sWPR + sTimeFrames[i] + sLevel[0], OBJPROP_BGCOLOR, clrLime);

      if(cur_WPR_Buffer[0][i] < -30.0)

         ObjectSetInteger(0, sIND + sWPR + sTimeFrames[i] + sLevel[1], OBJPROP_BGCOLOR, clrYellowGreen);

      if(cur_WPR_Buffer[0][i] < -20.0)

         ObjectSetInteger(0, sIND + sWPR + sTimeFrames[i] + sLevel[2], OBJPROP_BGCOLOR, clrGold);

      if(cur_WPR_Buffer[0][i] < -10.0)

         ObjectSetInteger(0, sIND + sWPR + sTimeFrames[i] + sLevel[3], OBJPROP_BGCOLOR, clrOrange);

      if(cur_WPR_Buffer[0][i] < 0.0)

         ObjectSetInteger(0, sIND + sWPR + sTimeFrames[i] + sLevel[4], OBJPROP_BGCOLOR, clrRed);

      //---

      if(cur_WPR_Buffer[0][i] > 0.0)

         ObjectSetInteger(0, sIND + sWPR + sTimeFrames[i] + sLevel[5], OBJPROP_BGCOLOR, clrLime);

      if(cur_WPR_Buffer[0][i] > 10.0)

         ObjectSetInteger(0, sIND + sWPR + sTimeFrames[i] + sLevel[6], OBJPROP_BGCOLOR, clrYellowGreen);

      if(cur_WPR_Buffer[0][i] > 20.0)

         ObjectSetInteger(0, sIND + sWPR + sTimeFrames[i] + sLevel[7], OBJPROP_BGCOLOR, clrGold);

      if(cur_WPR_Buffer[0][i] > 30.0)

         ObjectSetInteger(0, sIND + sWPR + sTimeFrames[i] + sLevel[8], OBJPROP_BGCOLOR, clrOrange);

      if(cur_WPR_Buffer[0][i] > 40.0)

         ObjectSetInteger(0, sIND + sWPR + sTimeFrames[i] + sLevel[9], OBJPROP_BGCOLOR, clrRed);

      //--- Plot color Close candle

      if(cur_WPR_Buffer[1][i] < -40.0)

         ObjectSetInteger(0, sIND + sWPR + sTimeFrames[i] + sLevel[0] + "_c", OBJPROP_BGCOLOR, clrLime);

      if(cur_WPR_Buffer[1][i] < -30.0)

         ObjectSetInteger(0, sIND + sWPR + sTimeFrames[i] + sLevel[1] + "_c", OBJPROP_BGCOLOR, clrYellowGreen);

      if(cur_WPR_Buffer[1][i] < -20.0)

         ObjectSetInteger(0, sIND + sWPR + sTimeFrames[i] + sLevel[2] + "_c", OBJPROP_BGCOLOR, clrGold);

      if(cur_WPR_Buffer[1][i] < -10.0)

         ObjectSetInteger(0, sIND + sWPR + sTimeFrames[i] + sLevel[3] + "_c", OBJPROP_BGCOLOR, clrOrange);

      if(cur_WPR_Buffer[1][i] < 0.0)

         ObjectSetInteger(0, sIND + sWPR + sTimeFrames[i] + sLevel[4] + "_c", OBJPROP_BGCOLOR, clrRed);

      //---

      if(cur_WPR_Buffer[1][i] > 0.0)

         ObjectSetInteger(0, sIND + sWPR + sTimeFrames[i] + sLevel[5] + "_c", OBJPROP_BGCOLOR, clrLime);

      if(cur_WPR_Buffer[1][i] > 10.0)

         ObjectSetInteger(0, sIND + sWPR + sTimeFrames[i] + sLevel[6] + "_c", OBJPROP_BGCOLOR, clrYellowGreen);

      if(cur_WPR_Buffer[1][i] > 20.0)

         ObjectSetInteger(0, sIND + sWPR + sTimeFrames[i] + sLevel[7] + "_c", OBJPROP_BGCOLOR, clrGold);

      if(cur_WPR_Buffer[1][i] > 30.0)

         ObjectSetInteger(0, sIND + sWPR + sTimeFrames[i] + sLevel[8] + "_c", OBJPROP_BGCOLOR, clrOrange);

      if(cur_WPR_Buffer[1][i] > 40.0)

         ObjectSetInteger(0, sIND + sWPR + sTimeFrames[i] + sLevel[9] + "_c", OBJPROP_BGCOLOR, clrRed);

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

      //| Create TIME START and END candle                                 |

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

      if(ObjectFind(0, sIND + "Time_" + sTimeFrames[i]) < 0)

        {

         if(!LabelCreate(0, sIND + "Time_" + sTimeFrames[i], OBJ_LABEL, WindowFind(short_name)))

           {

            Print(__FUNCTION__);

            return(INIT_FAILED);

           }

         LabelInitialization(0, sIND + "Time_" + sTimeFrames[i], pos_x - pos_x_data[i] + 5, pos_y + 143, 0, 0, CORNER_RIGHT_LOWER,

                             ANCHOR_LEFT, "Arial", 6, 0, clrBlack, 2, clrBlack, STYLE_SOLID, 1, false, false, true, 0,

                             TimeToString(iTime(Symbol(), TIMEFRAMES[i], 0) + TIMEFRAMES[i] * 60 - TimeCurrent(), TIME_SECONDS));

         ObjectSetDouble(0, sIND + "Time_" + sTimeFrames[i], OBJPROP_ANGLE, 70);

        }

      //---

      if(i < 7)

        {

         ObjectSetString(0, sIND + "Time_" + sTimeFrames[i], OBJPROP_TEXT, TimeToString(iTime(Symbol(), TIMEFRAMES[i], 0)

                         + TIMEFRAMES[i] * 60 - TimeCurrent(), TIME_SECONDS));

        }

      else

        {

         ObjectSetString(0, sIND + "Time_" + sTimeFrames[i], OBJPROP_TEXT, "");

        }

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

     }

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

//| Create INFO Spread / Swap / LotSize right window                 |

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

//--- LotSize

   double lotsize = ((AccountFreeMargin() / (MarketInfo(Symbol(), MODE_MARGINREQUIRED) * 0.01)) * MaximumPercentageRisk) / 10000;

   if(lotsize < SymbolInfoDouble(Symbol(), SYMBOL_VOLUME_MIN))

      lotsize = 0.00;

   if(lotsize > SymbolInfoDouble(Symbol(), SYMBOL_VOLUME_MAX))

      lotsize = SymbolInfoDouble(Symbol(), SYMBOL_VOLUME_MAX);

//---

   if(ObjectFind(0, sIND + "Info_lotsize") < 0)

     {

      if(!LabelCreate(0, sIND + "Info_lotsize", OBJ_LABEL, WindowFind(short_name)))

        {

         Print(__FUNCTION__);

         return(INIT_FAILED);

        }

      LabelInitialization(0, sIND + "Info_lotsize", pos_x - pos_x_data[8] - 10, pos_y + pos_y_data[10] - 5, 0, 0, CORNER_RIGHT_LOWER,

                          ANCHOR_RIGHT, "Arial Narrow", 6, 0, clrBlack, 2, clrBlack, STYLE_SOLID, 1, false, false, true, 0,

                          "LOT:" + DoubleToString(lotsize, 2)

                         );

     }

   ObjectSetString(0, sIND + "Info_lotsize", OBJPROP_TEXT, "LOT:" + DoubleToString(lotsize, 2));

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

//--- SPREAD

   if(ObjectFind(0, sIND + "Info_spread") < 0)

     {

      if(!LabelCreate(0, sIND + "Info_spread", OBJ_LABEL, WindowFind(short_name)))

        {

         Print(__FUNCTION__);

         return(INIT_FAILED);

        }

      LabelInitialization(0, sIND + "Info_spread", pos_x - pos_x_data[8] - 10, pos_y + pos_y_data[9], 0, 0, CORNER_RIGHT_LOWER,

                          ANCHOR_RIGHT, "Arial Narrow", 5, 0, clrBlack, 2, clrBlack, STYLE_SOLID, 1, false, false, true, 0,

                          "SPREAD:" + IntegerToString(SymbolInfoInteger(Symbol(), SYMBOL_SPREAD))

                         );

     }

   ObjectSetString(0, sIND + "Info_spread", OBJPROP_TEXT, "SPREAD:" + IntegerToString(SymbolInfoInteger(Symbol(), SYMBOL_SPREAD)));

//--- SWAP LONG

   if(ObjectFind(0, sIND + "Info_swap_long") < 0)

     {

      if(!LabelCreate(0, sIND + "Info_swap_long", OBJ_LABEL, WindowFind(short_name)))

        {

         Print(__FUNCTION__);

         return(INIT_FAILED);

        }

      LabelInitialization(0, sIND + "Info_swap_long", pos_x - pos_x_data[8] - 10, pos_y + pos_y_data[8] + 7, 0, 0, CORNER_RIGHT_LOWER,

                          ANCHOR_RIGHT, "Arial Narrow", 5, 0, clrBlack, 2, clrBlack, STYLE_SOLID, 1, false, false, true, 0,

                          "LONG:" + DoubleToString(SymbolInfoDouble(Symbol(), SYMBOL_SWAP_LONG), 1)

                         );

     }

//--- SWAP SHORT

   if(ObjectFind(0, sIND + "Info_swap_short") < 0)

     {

      if(!LabelCreate(0, sIND + "Info_swap_short", OBJ_LABEL, WindowFind(short_name)))

        {

         Print(__FUNCTION__);

         return(INIT_FAILED);

        }

      LabelInitialization(0, sIND + "Info_swap_short", pos_x - pos_x_data[8] - 10, pos_y + pos_y_data[8], 0, 0, CORNER_RIGHT_LOWER,

                          ANCHOR_RIGHT, "Arial Narrow", 5, 0, clrBlack, 2, clrBlack, STYLE_SOLID, 1, false, false, true, 0,

                          "SHORT:" + DoubleToString(SymbolInfoDouble(Symbol(), SYMBOL_SWAP_SHORT), 1)

                         );

     }

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

//| Create Horizontal Line 1 - Ziro point in right window            |

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

   if(ObjectFind(0, sIND + "h_line_1") < 0)

     {

      if(!LabelCreate(0, sIND + "h_line_1", OBJ_LABEL, WindowFind(short_name)))

        {

         Print(__FUNCTION__);

         return(INIT_FAILED);

        }

      LabelInitialization(0, sIND + "h_line_1", pos_x - pos_x_data[0] + 10, pos_y + pos_y_data[4] + 2, 0, 0, CORNER_RIGHT_LOWER,

                          ANCHOR_LEFT, "Arial Black", 7, 0, clrGray, 2, clrGray, STYLE_SOLID, 1, false, false, true, 0,

                          "- - - - - - - - - - - - - - - - - - - - - - - - - - - -");

     }

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

//| Create Horizontal Line 2 - Up Leve in right window               |

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

   if(ObjectFind(0, sIND + "h_line_2l") < 0)

     {

      if(!LabelCreate(0, sIND + "h_line_2l", OBJ_LABEL, WindowFind(short_name)))

        {

         Print(__FUNCTION__);

         return(INIT_FAILED);

        }

      LabelInitialization(0, sIND + "h_line_2l", pos_x - pos_x_data[0] + 15, pos_y + pos_y_data[4] + 1 + input_WPR_level, 0, 0,

                          CORNER_RIGHT_LOWER, ANCHOR_LEFT, "Arial", 6, 0, clrRed, 2, clrRed, STYLE_SOLID, 1, false, false, true, 0,

                          IntegerToString(input_WPR_level) + "- - - - - - - - - - - - - - - - -");

     }

   if(ObjectFind(0, sIND + "h_line_2r") < 0)

     {

      if(!LabelCreate(0, sIND + "h_line_2r", OBJ_LABEL, WindowFind(short_name)))

        {

         Print(__FUNCTION__);

         return(INIT_FAILED);

        }

      LabelInitialization(0, sIND + "h_line_2r", pos_x - pos_x_data[4], pos_y + pos_y_data[4] + 1 + input_WPR_level, 0, 0,

                          CORNER_RIGHT_LOWER, ANCHOR_LEFT, "Arial", 6, 0, clrRed, 2, clrRed, STYLE_SOLID, 1, false, false, true, 0,

                          "- - - - - - - - - - - - - - - - - -" + IntegerToString(input_WPR_level));

     }

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

//| Create Horizontal Line 3 - Dn Leve in right window               |

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

   if(ObjectFind(0, sIND + "h_line_3l") < 0)

     {

      if(!LabelCreate(0, sIND + "h_line_3l", OBJ_LABEL, WindowFind(short_name)))

        {

         Print(__FUNCTION__);

         return(INIT_FAILED);

        }

      LabelInitialization(0, sIND + "h_line_3l", pos_x - pos_x_data[0] + 15, pos_y + pos_y_data[4] + 1 - input_WPR_level, 0, 0,

                          CORNER_RIGHT_LOWER, ANCHOR_LEFT, "Arial", 6, 0, clrRed, 2, clrRed, STYLE_SOLID, 1, false, false, true, 0,

                          IntegerToString(input_WPR_level) + "- - - - - - - - - - - - - - - - -");

     }

   if(ObjectFind(0, sIND + "h_line_3r") < 0)

     {

      if(!LabelCreate(0, sIND + "h_line_3r", OBJ_LABEL, WindowFind(short_name)))

        {

         Print(__FUNCTION__);

         return(INIT_FAILED);

        }

      LabelInitialization(0, sIND + "h_line_3r", pos_x - pos_x_data[4], pos_y + pos_y_data[4] + 1 - input_WPR_level, 0, 0,

                          CORNER_RIGHT_LOWER, ANCHOR_LEFT, "Arial", 6, 0, clrRed, 2, clrRed, STYLE_SOLID, 1, false, false, true, 0,

                          "- - - - - - - - - - - - - - - - - -" + IntegerToString(input_WPR_level));

     }

//--- End calculate

   return(rates_total);

  }

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

//====== START SWITCH SYMBOL

void OnChartEvent(const int id,         // 845=B8D8:0B>@ A>1KB8O

                  const long& lparam,   // ?0@0<5B@ A>1KB8O B8?0 long

                  const double& dparam, // ?0@0<5B@ A>1KB8O B8?0 double

                  const string& sparam  // ?0@0<5B@ A>1KB8O B8?0 string

                 )

  {

   if(id == CHARTEVENT_OBJECT_CLICK)

     {

      if(ObjectGetInteger(ChartID(), obj_pref + "BT2", OBJPROP_STATE))

        {

         if(ChartSetSymbolPeriod(0, prev_symb, _Period))

            Find_Symb();

         ObjectSetInteger(ChartID(), obj_pref + "BT2", OBJPROP_STATE, false);

        }

      if(ObjectGetInteger(ChartID(), obj_pref + "BT1", OBJPROP_STATE))

        {

         if(ChartSetSymbolPeriod(0, next_symb, _Period))

            Find_Symb();

         ObjectSetInteger(ChartID(), obj_pref + "BT1", OBJPROP_STATE, false);

        }

      if(ObjectGetInteger(ChartID(), obj_pref + "BT0", OBJPROP_STATE))

        {

         if(ChartSetSymbolPeriod(0, fast_button, _Period))

            Find_Symb();

         ObjectSetInteger(ChartID(), obj_pref + "BT0", OBJPROP_STATE, false);

        }

      if(ObjectGetInteger(ChartID(), obj_pref + "BT3", OBJPROP_STATE))

        {

         long CurID = ChartID();

         long NewID = ChartOpen(Symbol(), _Period);

         if(NewID > 0)

           {

            ChartSetInteger(CurID, CHART_BRING_TO_TOP, true);

            ChartSaveTemplate(CurID, obj_pref + "_Temp_Template");

            ChartApplyTemplate(NewID, obj_pref + "_Temp_Template");

            ChartNavigate(NewID, CHART_END, 0);

           }

         ObjectSetInteger(ChartID(), obj_pref + "BT3", OBJPROP_STATE, false);

        }

     }

  }

//====== END SWITCH SYMBOL

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

//====== START SWITCH SYMBOL

void Find_Symb()

  {

   curr_symb = Symbol();

   int pos = 0;

   bool found = false;

   string fb = fast_button;

   for(int i = 0; i < SymbolsTotal(true); i++)

      if(StringFind(SymbolName(i, true), fb) > -1)

        {

         fast_button = SymbolName(i, true);

         ObjectSetString(ChartID(), obj_pref + "BT0", OBJPROP_TEXT, fast_button);

         found = true;

         break;

        }

   if(!found)

     {

      fast_button = SymbolName(0, true);

      ObjectSetString(ChartID(), obj_pref + "BT0", OBJPROP_TEXT, fast_button);

     }

   for(int i = 0; i < SymbolsTotal(true); i++)

      if(SymbolName(i, true) == curr_symb)

        {

         pos = i + 1;

         while(SymbolName(pos, true) != curr_symb && !IsStopped())

           {

            if(pos >= SymbolsTotal(true))

               pos = 0;

            if(CanSwitch(SymbolName(pos, true)))

              {

               next_symb = SymbolName(pos, true);

               break;

              }

            else

               pos++;

           }

         pos = i - 1;

         while(SymbolName(pos, true) != curr_symb && !IsStopped())

           {

            if(pos < 0)

               pos = SymbolsTotal(true) - 1;

            if(CanSwitch(SymbolName(pos, true)))

              {

               prev_symb = SymbolName(pos, true);

               break;

              }

            else

               pos--;

           }

         //prev_symb=i>0?SymbolName(i-1,true):SymbolName(SymbolsTotal(true)-1,true);

         //next_symb=i==SymbolsTotal(true)-1?SymbolName(0,true):SymbolName(i+1,true);

         ObjectSetString(ChartID(), obj_pref + "BT2", OBJPROP_TEXT, "<< " + prev_symb);

         ObjectSetString(ChartID(), obj_pref + "BT1", OBJPROP_TEXT, next_symb + " >>");

         ObjectSetString(ChartID(), obj_pref + "BT3", OBJPROP_TEXT, "New " + Symbol());

         return;

        }

//if symbol not found

   prev_symb = next_symb = SymbolName(0, true);

   ObjectSetString(ChartID(), obj_pref + "BT2", OBJPROP_TEXT, "<< " + prev_symb);

   ObjectSetString(ChartID(), obj_pref + "BT1", OBJPROP_TEXT, next_symb + " >>");

   ObjectSetString(ChartID(), obj_pref + "BT3", OBJPROP_TEXT, "New " + Symbol());

  }

//====== END SWITCH SYMBOL

//====== START SWITCH SYMBOL

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

//|                                                                  |

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

bool CanSwitch(string Curr_Symb)

  {

   for(int i = 0; i < ExeptSize; i++)

      if(StringFind(Curr_Symb, Exept[i]) > -1)

         return(false);

   bool have = MustHaveSize == 0 ? true : false;

   for(int i = 0; i < MustHaveSize; i++)

      if(StringFind(Curr_Symb, MustHave[i]) > -1)

         have = true;

   return(have);

  }

//====== END SWITCH SYMBOL

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



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 ---