//+------------------------------------------------------------------+
//| 2013г.                                              BarTimer.mq4 |
//| Доработанный BarTimer                               Author: LEXA |
//+------------------------------------------------------------------+
#property copyright "BarTimer"

#property indicator_chart_window
#property indicator_buffers 0

#import "kernel32.dll"
int GetTimeZoneInformation(int& TZInfoArray[]);
#import

extern bool   Показать.ИНФО.счета = false;      //Показать информацию о номере счёта и брокере.
extern bool   ПоказатьBarTimer = true;          //Показать BarTimer.
extern bool   ПоказатьДиапазон = true;          //Показать диапазон пройденных пунктов.
extern bool   ПоказатьСпрэд = true;             //Показать Спрэд.
extern bool   ПоказатьРасписаниеH4 = true;      //Показать Расписание ТФ-Н4.
extern bool   ПоказатьБезубыток = true;         //Показать уровень безубытка.
extern bool   ПоказатьUTC = true;               //Показать строку времени UTC,BROKER,LOCAL.
extern bool   ПоказатьСессии = true;            //Показать расписание торговых сессий стран мира.
extern bool   ПоказатьБаланс = true;            //Показать строку баланса $.
extern bool   ПоказатьПрофит = true;            //Показать ПРОФИТ "подробно".
extern int    КоличествоЦветовBID = 2;          //Количество цветов цены Bid (1...3; 0-не отображать).
extern bool   ПоказатьBIDSmall = true;          //Показывать младший разряд цены Bid (1/10 пункта).
extern color  Цвет.BID.Default = Gray;          //Цвет шрифта цены Bid для одноцветной схемы.
extern color  Цвет.BID.Price.Up = SpringGreen;  //Цвет шрифта цены Bid Up.
extern color  Цвет.BID.Price.Down = Red;        //Цвет шрифта цены Bid Down.
extern color  Цвет.BID.Price.Neutral = Orange;  //Цвет шрифта цены Bid Neutral.
extern color  ЦветBAR = Black;                  //Цвет шрифта ползунка Бара свечи.
extern color  ЦветДиапазона = Black;            //Цвет шрифта диапазона цены.
extern color  ЦветSpread = Black;               //Цвет шрифта строки Спрэда-Н4-Б/У.
extern color  ЦветUTC = Black;                  //Цвет шрифта строки времени.
extern color  ЦветБаланс = Black;               //Цвет шрифта строки баланса депозита.
extern bool   ПоказатьФОН = true;               //ФОН под поле отображения баланса инструмента.
extern color  ЦветФОНа = Gainsboro;             //Цвет ФОНа.
extern bool   РасписаниеВыходные = false;       //Показать расписание в выходные дни.
extern int    ОтображениеМаржи = 2;             //0-не отображать; 1-в процентах от размера депозита; 2-в валюте депозита.
extern string Цветовая.Схема.Сессий =           "==  Цветовая Схема Сессий  ==";
extern color  Session = Black;                  //Цвет Сессии Торговой фазы.
extern color  SessionActive = SeaGreen;         //Цвет Сессии Активной Торговой фазы.
extern color  SessionMemories = DarkOrange;     //Цвет Сессии Напоминание.
extern color  SessionWarning = FireBrick;       //Цвет Сессии Предупреждение.
extern color  SessionOther = SteelBlue;         //Цвет Сессии Разные события.
extern string Мультивалютный.Индикатор =        "== Мультивалютный Индикатор ==";
extern string Символ.01 = "EURUSD";
extern string Символ.02 = "GBPUSD";
extern string Символ.03 = "XAUUSD";
extern string Символ.04 = "";
extern string Символ.05 = "";
extern string Символ.06 = "";
extern string Символ.07 = "";
extern string Символ.08 = "";
extern string Символ.09 = "";
extern string Символ.10 = "";
extern string Символ.11 = "";
extern string Символ.12 = "";
extern color  ЦветМультивалютногоИнд = Black;   //Цвет шрифта строк Мультивалютного индикатора.
extern string Показывать.сделки.на.графике = "== 0 выкл / 2 все / 1 Buy / -1 Sell ==";
extern int    ТипСделок = 2;                    //Тип сделок: 0 - выкл; 2 - все; 1 - только BUY; -1 - только SELL.
extern string Шрифт.позиций = "== 1 - Wingdings / 2 - Wingdings 2 ==";
extern int    Шрифт = 1;                        //Тип шрифта: 1 - Wingdings; 2 - Wingdings 2.
//+------------------------------------------------------------------+
double nPoint=0, sPoint=0, OldPrice; int i=0, sec=0; color ЦветBidd, clr; string TMP, prefix;
int lenbase; string sbase = ":...:...:...:...:"; // строка для формирования индикатора с ползунком

int init()
  {
   lenbase = StringLen(sbase);
   return(0);
  }
int deinit()
  {
   ObjectDelete("Информация аккаунта");
   ObjectDelete("BarTimer");
   ObjectDelete("Диапазон по инструменту");
   ObjectDelete("Спрэд Н4 Б/У");
   ObjectDelete("ЦЕНА BID");
   ObjectDelete("ЦЕНА BIDs");
   ObjectDelete("Время UTC");
   ObjectDelete("Торговая Сессия Летнее Расписание");
   ObjectDelete("Торговая Сессия Зимнее Расписание");
   ObjectDelete("Мультивалютный Индикатор");
   ObjectDelete("Мультивалютный Индикатор ");
   ObjectDelete("Мультивалютный Индикатор  ");
   ObjectDelete("Баланс");
   ObjectDelete("ПРОФИТ");
   ObjectDelete("Профит пары");
   ObjectDelete("Профит Buy");
   ObjectDelete("Профит Sell");
   ObjectDelete("Позиции Buy");
   ObjectDelete("Позиции Sell");
   ObjectDelete("Лоты Buy");
   ObjectDelete("Лоты Sell");
   ObjectDelete("Box"); ObjectDelete("Box ");
   for(i=0; i<(OrdersTotal()+5); i++) {TMP = "Ордер открыт: " + DoubleToStr(i,0); ObjectDelete(TMP);}
   return(0);
  }
//+------------------------------------------------------------------+
//| ползунок отмечает текущиее положение по времени относительно     |
//| начала и конца текущего бара, дополнительно выводится время      |
//| прошедшее от начала бара в процентах                             |
//+------------------------------------------------------------------+
int start()
  {
   if (!IsDllsAllowed())
  {
   Comment("Индикатор BarTimer: Включите в настройках опцию 'Разрешить импорт DLL' - требуется для корректного отображения времени");
   return (0);
  }
   double pc=0.0; double nPoint = GetPoint(Symbol());
   string time = "", s_end = "", s_beg = "";

   if(ТипСделок >0 || ТипСделок <0 ) ShowOrders(MODE_TRADES);

   if (Показать.ИНФО.счета == true)
  {
   string Type = "REAL"; if (IsDemo()) {Type = "DEMO";}
   ObjectCreate("Информация аккаунта", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("Информация аккаунта", AccountCompany() + "  " + Type + ": " + AccountNumber() + "  " + AccountName(), 8, "Tahoma", ЦветSpread);
   ObjectSet("Информация аккаунта", OBJPROP_CORNER, 0);
   ObjectSet("Информация аккаунта", OBJPROP_XDISTANCE, 4); if (AccountNumber() <= 0) {ObjectDelete("Информация аккаунта");}
  }
   if (ПоказатьДиапазон == true)
  {
   ObjectCreate("Диапазон по инструменту", OBJ_LABEL, 0, 0, 0);
   ObjectSet("Диапазон по инструменту", OBJPROP_CORNER, 0);
   ObjectSet("Диапазон по инструменту", OBJPROP_YDISTANCE, 1);
  }
   if (ПоказатьBarTimer == true)
  {
   ObjectCreate("BarTimer", OBJ_LABEL, 0, 0, 0);
   ObjectSet("BarTimer", OBJPROP_CORNER, 0);
   ObjectSet("BarTimer", OBJPROP_XDISTANCE, 262);
   ObjectSet("BarTimer", OBJPROP_YDISTANCE, 1);
   ObjectSet("Диапазон по инструменту", OBJPROP_XDISTANCE, 420);
  }
   if (ПоказатьBarTimer == false)
  {
   ObjectSet("Диапазон по инструменту", OBJPROP_XDISTANCE, 262);
  }
   if (ПоказатьБаланс == true)
  {
   ObjectCreate("Баланс", OBJ_LABEL, 0, 0, 0);
   ObjectSet("Баланс", OBJPROP_CORNER, 3);
   ObjectSet("Баланс", OBJPROP_YDISTANCE, 1);
  }
   if (ПоказатьПрофит == true)
  {
   ObjectCreate("ПРОФИТ", OBJ_LABEL, 0, 0, 0);
   ObjectSet("ПРОФИТ", OBJPROP_CORNER, 3);
   ObjectSet("ПРОФИТ", OBJPROP_XDISTANCE, 4);
   ObjectSet("ПРОФИТ", OBJPROP_YDISTANCE, 1);
   ObjectCreate("Профит пары", OBJ_LABEL, 0, 0, 0);
   ObjectSet("Профит пары", OBJPROP_CORNER, 3);
   ObjectSet("Профит пары", OBJPROP_XDISTANCE, 4);
   ObjectSet("Профит пары", OBJPROP_YDISTANCE, 20);
   ObjectCreate("Профит Buy", OBJ_LABEL, 0, 0, 0);
   ObjectSet("Профит Buy", OBJPROP_CORNER, 3);
   ObjectSet("Профит Buy", OBJPROP_XDISTANCE, 4);
   ObjectCreate("Профит Sell", OBJ_LABEL, 0, 0, 0);
   ObjectSet("Профит Sell", OBJPROP_CORNER, 3);
   ObjectSet("Профит Sell", OBJPROP_XDISTANCE, 4);
   ObjectSet("Профит Sell", OBJPROP_YDISTANCE, 40);
   ObjectCreate("Позиции Buy", OBJ_LABEL, 0, 0, 0);
   ObjectSet("Позиции Buy", OBJPROP_CORNER, 3);
   ObjectCreate("Позиции Sell", OBJ_LABEL, 0, 0, 0);
   ObjectSet("Позиции Sell", OBJPROP_CORNER, 3);
   ObjectSet("Позиции Sell", OBJPROP_YDISTANCE, 40);
   ObjectCreate("Лоты Buy", OBJ_LABEL, 0, 0, 0);
   ObjectSet("Лоты Buy", OBJPROP_CORNER, 3);
   ObjectCreate("Лоты Sell", OBJ_LABEL, 0, 0, 0);
   ObjectSet("Лоты Sell", OBJPROP_CORNER, 3);
   ObjectSet("Лоты Sell", OBJPROP_YDISTANCE, 40);
  }
   ObjectCreate("Спрэд Н4 Б/У", OBJ_LABEL, 0, 0, 0);
   ObjectSet("Спрэд Н4 Б/У", OBJPROP_CORNER, 0);
   ObjectSet("Спрэд Н4 Б/У", OBJPROP_XDISTANCE, 4);
   ObjectSet("Спрэд Н4 Б/У", OBJPROP_YDISTANCE, 12);
   ObjectCreate("ЦЕНА BID", OBJ_LABEL, 0, 0, 0);
   ObjectSet("ЦЕНА BID", OBJPROP_CORNER, 1);
   ObjectSet("ЦЕНА BID", OBJPROP_XDISTANCE, 20);
   ObjectSet("ЦЕНА BID", OBJPROP_YDISTANCE, 2);
   ObjectCreate("ЦЕНА BIDs", OBJ_LABEL, 0, 0, 0);
   ObjectSet("ЦЕНА BIDs", OBJPROP_CORNER, 1);
   ObjectSet("ЦЕНА BIDs", OBJPROP_XDISTANCE, 6);
   ObjectSet("ЦЕНА BIDs", OBJPROP_YDISTANCE, 5);
   ObjectCreate("Мультивалютный Индикатор", OBJ_LABEL, 0, 0, 0);
   ObjectSet("Мультивалютный Индикатор", OBJPROP_CORNER, 0);
   ObjectSet("Мультивалютный Индикатор", OBJPROP_XDISTANCE, 4);
   ObjectCreate("Мультивалютный Индикатор ", OBJ_LABEL, 0, 0, 0);
   ObjectSet("Мультивалютный Индикатор ", OBJPROP_CORNER, 0);
   ObjectSet("Мультивалютный Индикатор ", OBJPROP_XDISTANCE, 4);
   ObjectCreate("Мультивалютный Индикатор  ", OBJ_LABEL, 0, 0, 0);
   ObjectSet("Мультивалютный Индикатор  ", OBJPROP_CORNER, 0);
   ObjectSet("Мультивалютный Индикатор  ", OBJPROP_XDISTANCE, 4);
//+------------------------------------------------------------------+
//| переменные бара свечи                                            |
//+------------------------------------------------------------------+
   sec = TimeCurrent()-Time[0];        // время в секундах от начала бара
   i = (lenbase-1)*sec/(Period()*60);  // позиция ползунка
   pc = 100.0*sec/(Period()*60);       // время от начала бара в процентах
   if (i>lenbase-1) i = lenbase-1;     // возможно излишний контроль границы
   if (i>0) s_beg = StringSubstr(sbase,0,i);
   if (i<lenbase-1) s_end = StringSubstr(sbase,i+1,lenbase-i-1); if (pc>100) {pc=100;}
   time = StringConcatenate(s_beg,"|",s_end," ",DoubleToStr(pc,0),"%");
   ObjectSetText("BarTimer", time, 14, "Arial", ЦветBAR);
//+------------------------------------------------------------------+
//| переменные диапазона цены                                        |
//+------------------------------------------------------------------+
   double rates[][6], MyPeriod;
   ArrayCopyRates(rates, NULL, MyPeriod);

   if (StringFind(Symbol(),"XP",0)>=0 || StringFind(Symbol(),"XA",0)>=0) {nPoint=1; sPoint=2;}

   string periodM1  = "M1/"  + DoubleToStr((iHigh(NULL,PERIOD_M1,0)-iLow(NULL,PERIOD_M1,0))/nPoint,sPoint);
   string periodM5  = "M5/"  + DoubleToStr((iHigh(NULL,PERIOD_M5,0)-iLow(NULL,PERIOD_M5,0))/nPoint,sPoint);
   string periodM15 = "M15/" + DoubleToStr((iHigh(NULL,PERIOD_M15,0)-iLow(NULL,PERIOD_M15,0))/nPoint,sPoint) +  "  ";
   string periodM30 = "M30/" + DoubleToStr((iHigh(NULL,PERIOD_M30,0)-iLow(NULL,PERIOD_M30,0))/nPoint,sPoint) +  "  ";
   string periodH1  = "H1/"  + DoubleToStr((iHigh(NULL,PERIOD_H1,0)-iLow(NULL,PERIOD_H1,0))/nPoint,sPoint) +  "  ";
   string periodH4  = "H4/"  + DoubleToStr((iHigh(NULL,PERIOD_H4,0)-iLow(NULL,PERIOD_H4,0))/nPoint,sPoint) +  "  ";
   string periodD1  = "D1/"  + DoubleToStr((iHigh(NULL,PERIOD_D1,0)-iLow(NULL,PERIOD_D1,0))/nPoint,sPoint) +  "  ";
   string periodW1  = "W1/"  + DoubleToStr((iHigh(NULL,PERIOD_W1,0)-iLow(NULL,PERIOD_W1,0))/nPoint,sPoint) +  "  ";
   string periodMN1 = "MN/"  + DoubleToStr((iHigh(NULL,PERIOD_MN1,0)-iLow(NULL,PERIOD_MN1,0))/nPoint,sPoint) +  "  ";
   string periodOLD = "(OLD " + DoubleToStr((rates[1][3]-rates[1][2])/nPoint,sPoint) + ")";

   if (Period() == PERIOD_M1)  {ObjectSetText("Диапазон по инструменту", periodD1 + periodM1, 14, "Arial", ЦветДиапазона);}
   if (Period() == PERIOD_M5)  {ObjectSetText("Диапазон по инструменту", periodD1 + periodM5, 14, "Arial", ЦветДиапазона);}
   if (Period() == PERIOD_M15) {ObjectSetText("Диапазон по инструменту", periodD1 + periodM15 + periodOLD, 14, "Arial", ЦветДиапазона);}
   if (Period() == PERIOD_M30) {ObjectSetText("Диапазон по инструменту", periodD1 + periodM30 + periodOLD, 14, "Arial", ЦветДиапазона);}
   if (Period() == PERIOD_H1)  {ObjectSetText("Диапазон по инструменту", periodD1 + periodH1 + periodOLD, 14, "Arial", ЦветДиапазона);}
   if (Period() == PERIOD_H4)  {ObjectSetText("Диапазон по инструменту", periodD1 + periodH1 + periodH4 + periodOLD, 14, "Arial", ЦветДиапазона);}
   if (Period() >= PERIOD_D1)  {ObjectSetText("Диапазон по инструменту", periodH4 + periodD1 + periodW1 + periodMN1 + periodOLD, 14, "Arial", ЦветДиапазона);}
//+------------------------------------------------------------------+
//| переменные мультивалютного индикатора                            |
//+------------------------------------------------------------------+
   string prefix[12], iclose[12]; double ZY1, ZY2, ZY3, ZY4, MC;

   if (Символ.01!= "") prefix[1]= Символ.01; if (Символ.05!= "") prefix[5]= Символ.05; if (Символ.09!= "") prefix[9] = Символ.09;
   if (Символ.02!= "") prefix[2]= Символ.02; if (Символ.06!= "") prefix[6]= Символ.06; if (Символ.10!= "") prefix[10]= Символ.10;
   if (Символ.03!= "") prefix[3]= Символ.03; if (Символ.07!= "") prefix[7]= Символ.07; if (Символ.11!= "") prefix[11]= Символ.11;
   if (Символ.04!= "") prefix[4]= Символ.04; if (Символ.08!= "") prefix[8]= Символ.08; if (Символ.12!= "") prefix[12]= Символ.12;

   if (StringFind(Символ.01,"JPY",0)>=0 || StringFind(Символ.01,"XA",0)>=0) {MC=2;} else MC=4; iclose[1] = " " + DoubleToStr(iClose(prefix[1],0,0),MC) + "   ";
   if (StringFind(Символ.02,"JPY",0)>=0 || StringFind(Символ.02,"XA",0)>=0) {MC=2;} else MC=4; iclose[2] = " " + DoubleToStr(iClose(prefix[2],0,0),MC) + "   ";
   if (StringFind(Символ.03,"JPY",0)>=0 || StringFind(Символ.03,"XA",0)>=0) {MC=2;} else MC=4; iclose[3] = " " + DoubleToStr(iClose(prefix[3],0,0),MC) + "   ";
   if (StringFind(Символ.04,"JPY",0)>=0 || StringFind(Символ.04,"XA",0)>=0) {MC=2;} else MC=4; iclose[4] = " " + DoubleToStr(iClose(prefix[4],0,0),MC);
   if (StringFind(Символ.05,"JPY",0)>=0 || StringFind(Символ.05,"XA",0)>=0) {MC=2;} else MC=4; iclose[5] = " " + DoubleToStr(iClose(prefix[5],0,0),MC) + "   ";
   if (StringFind(Символ.06,"JPY",0)>=0 || StringFind(Символ.06,"XA",0)>=0) {MC=2;} else MC=4; iclose[6] = " " + DoubleToStr(iClose(prefix[6],0,0),MC) + "   ";
   if (StringFind(Символ.07,"JPY",0)>=0 || StringFind(Символ.07,"XA",0)>=0) {MC=2;} else MC=4; iclose[7] = " " + DoubleToStr(iClose(prefix[7],0,0),MC) + "   ";
   if (StringFind(Символ.08,"JPY",0)>=0 || StringFind(Символ.08,"XA",0)>=0) {MC=2;} else MC=4; iclose[8] = " " + DoubleToStr(iClose(prefix[8],0,0),MC);
   if (StringFind(Символ.09,"JPY",0)>=0 || StringFind(Символ.09,"XA",0)>=0) {MC=2;} else MC=4; iclose[9] = " " + DoubleToStr(iClose(prefix[9],0,0),MC) + "   ";
   if (StringFind(Символ.10,"JPY",0)>=0 || StringFind(Символ.10,"XA",0)>=0) {MC=2;} else MC=4; iclose[10]= " " + DoubleToStr(iClose(prefix[10],0,0),MC) + "   ";
   if (StringFind(Символ.11,"JPY",0)>=0 || StringFind(Символ.11,"XA",0)>=0) {MC=2;} else MC=4; iclose[11]= " " + DoubleToStr(iClose(prefix[11],0,0),MC) + "   ";
   if (StringFind(Символ.12,"JPY",0)>=0 || StringFind(Символ.12,"XA",0)>=0) {MC=2;} else MC=4; iclose[12]= " " + DoubleToStr(iClose(prefix[12],0,0),MC);

   if (iClose(prefix[1],0,0)==0)  {iclose[1]= " - None" + "   ";}
   if (iClose(prefix[2],0,0)==0)  {iclose[2]= " - None" + "   ";}
   if (iClose(prefix[3],0,0)==0)  {iclose[3]= " - None" + "   ";}
   if (iClose(prefix[4],0,0)==0)  {iclose[4]= " - None";}
   if (iClose(prefix[5],0,0)==0)  {iclose[5]= " - None" + "   ";}
   if (iClose(prefix[6],0,0)==0)  {iclose[6]= " - None" + "   ";}
   if (iClose(prefix[7],0,0)==0)  {iclose[7]= " - None" + "   ";}
   if (iClose(prefix[8],0,0)==0)  {iclose[8]= " - None";}
   if (iClose(prefix[9],0,0)==0)  {iclose[9]= " - None" + "   ";}
   if (iClose(prefix[10],0,0)==0) {iclose[10]= " - None" + "   ";}
   if (iClose(prefix[11],0,0)==0) {iclose[11]= " - None" + "   ";}
   if (iClose(prefix[12],0,0)==0) {iclose[12]= " - None";}

   if (Символ.01 == "" || Символ.01 == Symbol()) {string Symb1 = "";}  else  Symb1 = prefix[1] + iclose[1];
   if (Символ.02 == "" || Символ.02 == Symbol()) {string Symb2 = "";}  else  Symb2 = prefix[2] + iclose[2];
   if (Символ.03 == "" || Символ.03 == Symbol()) {string Symb3 = "";}  else  Symb3 = prefix[3] + iclose[3];
   if (Символ.04 == "" || Символ.04 == Symbol()) {string Symb4 = "";}  else  Symb4 = prefix[4] + iclose[4];
   if (Символ.05 == "" || Символ.05 == Symbol()) {string Symb5 = "";}  else  Symb5 = prefix[5] + iclose[5];
   if (Символ.06 == "" || Символ.06 == Symbol()) {string Symb6 = "";}  else  Symb6 = prefix[6] + iclose[6];
   if (Символ.07 == "" || Символ.07 == Symbol()) {string Symb7 = "";}  else  Symb7 = prefix[7] + iclose[7];
   if (Символ.08 == "" || Символ.08 == Symbol()) {string Symb8 = "";}  else  Symb8 = prefix[8] + iclose[8];
   if (Символ.09 == "" || Символ.09 == Symbol()) {string Symb9 = "";}  else  Symb9 = prefix[9] + iclose[9];
   if (Символ.10 == "" || Символ.10 == Symbol()) {string Symb10 = "";} else  Symb10 = prefix[10] + iclose[10];
   if (Символ.11 == "" || Символ.11 == Symbol()) {string Symb11 = "";} else  Symb11 = prefix[11] + iclose[11];
   if (Символ.12 == "" || Символ.12 == Symbol()) {string Symb12 = "";} else  Symb12 = prefix[12] + iclose[12];

   ObjectSetText("Мультивалютный Индикатор", Symb1 + Symb2 + Symb3 + Symb4, 8, "Tahoma", ЦветМультивалютногоИнд);
   ObjectSetText("Мультивалютный Индикатор ", Symb5 + Symb6 + Symb7 + Symb8, 8, "Tahoma", ЦветМультивалютногоИнд);
   ObjectSetText("Мультивалютный Индикатор  ", Symb9 + Symb10 + Symb11 + Symb12, 8, "Tahoma", ЦветМультивалютногоИнд);
//+------------------------------------------------------------------+
//| переменные времени                                               |
//+------------------------------------------------------------------+
   int TZInfoArray[43]; int dst = GetTimeZoneInformation(TZInfoArray); double H4Nexx = 0; int SummerTime; int TMonth = TimeMonth(TimeLocal());

   int TimeZone = TZInfoArray[0];     // часовой пояс на основе локальных данных DLL (разница с GMT)
   if (TMonth <= 3 || TMonth >= 11) SummerTime = 0; else SummerTime = 1; // переход на зимнее/летнее время: 0 = зима, 1 = лето

   datetime Broker = TimeCurrent();   // переменная времени BROKER
   datetime Local = TimeLocal();      // переменная времени LOCAL
   datetime UTC = Local + (TimeZone*60);  // переменная времени UTC

   string Brokers = TimeToStr(Broker, TIME_MINUTES); // вывод времени BROKER
   string Locals = TimeToStr(Local, TIME_MINUTES);   // вывод времени LOCAL
   string UTCs = TimeToStr(UTC, TIME_MINUTES);       // вывод времени UTC

   if (ПоказатьСессии == true)
  {
   if (SummerTime == 1)
  {
   ObjectCreate("Торговая Сессия Летнее Расписание", OBJ_LABEL, 0, 0, 0);
   ObjectSet("Торговая Сессия Летнее Расписание", OBJPROP_CORNER, 2);
   ObjectSet("Торговая Сессия Летнее Расписание", OBJPROP_YDISTANCE, 1);
   ObjectDelete("Торговая Сессия Зимнее Расписание");
  }
   if (SummerTime == 0)
  {
   ObjectCreate("Торговая Сессия Зимнее Расписание", OBJ_LABEL, 0, 0, 0);
   ObjectSet("Торговая Сессия Зимнее Расписание", OBJPROP_CORNER, 2);
   ObjectSet("Торговая Сессия Зимнее Расписание", OBJPROP_YDISTANCE, 1);
   ObjectDelete("Торговая Сессия Летнее Расписание");
  }}
   if (ПоказатьUTC == true)
  {
   ObjectCreate("Время UTC", OBJ_LABEL, 0, 0, 0);
   ObjectSet("Время UTC", OBJPROP_CORNER, 2);
   ObjectSet("Время UTC", OBJPROP_XDISTANCE, 4);
   ObjectSet("Время UTC", OBJPROP_YDISTANCE, 3);
   ObjectSet("Торговая Сессия Летнее Расписание", OBJPROP_XDISTANCE, 242);
   ObjectSet("Торговая Сессия Зимнее Расписание", OBJPROP_XDISTANCE, 242);
  }
   if (ПоказатьUTC == false)
  {
   ObjectSet("Торговая Сессия Летнее Расписание", OBJPROP_XDISTANCE, 4);
   ObjectSet("Торговая Сессия Зимнее Расписание", OBJPROP_XDISTANCE, 4);
  }
//+------------------------------------------------------------------+
//| условия выполнения расписания сессий и Н4 в выходные дни         |
//+------------------------------------------------------------------+
   if (РасписаниеВыходные == false)
  {
   int WeekDay = TimeDayOfWeek(TimeLocal()); int HoliDays = 0; datetime TZGMT = (-TimeZone/60);

   if (TZGMT >= 0 && TZGMT <= 2)
  {
   if (WeekDay == 5 && UTCs >= "21:00") HoliDays = 1;
   if (WeekDay == 6 && UTCs >= "00:00") HoliDays = 1;
   if (WeekDay == 0 && UTCs >= "00:00") HoliDays = 1;
   if (WeekDay == 0 && UTCs >= "21:00") HoliDays = 0;
  }
   if (TZGMT == 3)
  {
   if (WeekDay == 6) HoliDays = 1;
   if (WeekDay == 0) HoliDays = 1;
  }
   if (TZGMT >= 4 && TZGMT <= 13)
  {
   if (WeekDay == 6 && TZGMT == 4  && Locals >= "01:00") HoliDays = 1;
   if (WeekDay == 6 && TZGMT == 5  && Locals >= "02:00") HoliDays = 1;
   if (WeekDay == 6 && TZGMT == 6  && Locals >= "03:00") HoliDays = 1;
   if (WeekDay == 6 && TZGMT == 7  && Locals >= "04:00") HoliDays = 1;
   if (WeekDay == 6 && TZGMT == 8  && Locals >= "05:00") HoliDays = 1;
   if (WeekDay == 6 && TZGMT == 9  && Locals >= "06:00") HoliDays = 1;
   if (WeekDay == 6 && TZGMT == 10 && Locals >= "07:00") HoliDays = 1;
   if (WeekDay == 6 && TZGMT == 11 && Locals >= "08:00") HoliDays = 1;
   if (WeekDay == 6 && TZGMT == 12 && Locals >= "09:00") HoliDays = 1;
   if (WeekDay == 6 && TZGMT == 13 && Locals >= "10:00") HoliDays = 1;
   if (WeekDay == 0 && Locals >= "00:00") HoliDays = 1;
   if (WeekDay == 1 && Locals >= "00:00") HoliDays = 1;
   if (WeekDay == 1 && TZGMT == 4  && Locals >= "01:00") HoliDays = 0;
   if (WeekDay == 1 && TZGMT == 5  && Locals >= "02:00") HoliDays = 0;
   if (WeekDay == 1 && TZGMT == 6  && Locals >= "03:00") HoliDays = 0;
   if (WeekDay == 1 && TZGMT == 7  && Locals >= "04:00") HoliDays = 0;
   if (WeekDay == 1 && TZGMT == 8  && Locals >= "05:00") HoliDays = 0;
   if (WeekDay == 1 && TZGMT == 9  && Locals >= "06:00") HoliDays = 0;
   if (WeekDay == 1 && TZGMT == 10 && Locals >= "07:00") HoliDays = 0;
   if (WeekDay == 1 && TZGMT == 11 && Locals >= "08:00") HoliDays = 0;
   if (WeekDay == 1 && TZGMT == 12 && Locals >= "09:00") HoliDays = 0;
   if (WeekDay == 1 && TZGMT == 13 && Locals >= "10:00") HoliDays = 0;
  }}
//+------------------------------------------------------------------+
//| расписание таймфреймов Н4                                        |
//+------------------------------------------------------------------+
   if (Brokers >= "00:00") H4Nexx = 04;
   if (Brokers >= "04:00") H4Nexx = 08;
   if (Brokers >= "08:00") H4Nexx = 12;
   if (Brokers >= "12:00") H4Nexx = 16;
   if (Brokers >= "16:00") H4Nexx = 20;
   if (Brokers >= "20:00") H4Nexx = 00;

   datetime H4Nextt = (Local/3600 - Broker/3600 + H4Nexx) * 3600; // вычисление периода Н4 на основе расписания брокера, с учётом разницы с локальным временем

   if (ПоказатьРасписаниеH4 == true)
  {
   string H4Next = "H4 next " + TimeToStr(H4Nextt, TIME_MINUTES) + "   ";
   if (HoliDays == 1) H4Next = "";
  }
   else H4Next = "";
//+------------------------------------------------------------------+
//| переменные экономических показателей                             |
//+------------------------------------------------------------------+
   color SColor, ЦвПрофит, ЦвПрофитT, ЦвПрофитB, ЦвПрофитS;
   color BuyLevel.1 = C'188,215,188'; color BuyLevel.2 = DarkSeaGreen; color BuyLevel.3 = MediumSeaGreen; color BuyLevel.4 = SpringGreen;
   color SelLevel.1 = LightPink; color SelLevel.2 = C'242,153,153'; color SelLevel.3 = Tomato; color SelLevel.4 = FireBrick;
   double Digital = Digits, Points = Point, LotDRB=2, LotDRS=2, MD=1, ZB=0, ZP=0, ZPO=0; string SText, probel = "  ";
   double TickValue = MarketInfo(Symbol(), MODE_TICKVALUE);
   double Balans = AccountBalance(); double FreeMargin = AccountFreeMargin(); string Balanse = "$: " + DoubleToStr(Balans, 0) + "  ";
   double CurrencY = OrdersTotal(); double ProfitAll = AccountProfit();  string Currency = DoubleToStr(OrdersTotal(), 0);
   double Spred = MarketInfo(Symbol(), MODE_SPREAD); double SP=0, SPM=1; if (CurrencY == 0) {Currency = ""; probel = "";}
   if (Balans <= 0) {double MarginPercent=0;} else MarginPercent = ((Balans*FreeMargin)/Balans)/(Balans/100);

   if (ОтображениеМаржи <= 0 || ОтображениеМаржи >= 3) {string FreeMagrin = "";}
   if (ОтображениеМаржи == 1) {FreeMagrin = "M: " + DoubleToStr(MarginPercent, 0) + "%" + probel;}
   if (ОтображениеМаржи == 2) {FreeMagrin = "M: " + DoubleToStr(AccountFreeMargin(), 0) + probel;}
   if (ПоказатьСпрэд == true)
  {
   if (Digital == 4 || Digital <= 2) {SP=0; SPM=1;}
   if (Digital == 5 || Digital == 3) {SP=1; SPM=10;}
   string SpreaD = "Spread " + DoubleToStr(Spred/SPM, SP) + "   ";
  }
   else SpreaD = "";
//+------------------------------------------------------------------+
//| переменные указателя цены BID и его разноцветность               |
//+------------------------------------------------------------------+
   double bidd = Bid, askk = Ask; double ima = iMA(Symbol(), PERIOD_M1, 1, 0, MODE_EMA, PRICE_CLOSE, 1);
   string BID, BIDs, sbidd=bidd;

   if (КоличествоЦветовBID <= 0 || КоличествоЦветовBID >= 4) {ObjectDelete("ЦЕНА BID"); ObjectDelete("ЦЕНА BIDs");}
   if (КоличествоЦветовBID == 1) {ЦветBidd = Цвет.BID.Default;}
   if (КоличествоЦветовBID == 2)
  {
   if (OldPrice < bidd) {ЦветBidd = Цвет.BID.Price.Up;}
   if (OldPrice > bidd) {ЦветBidd = Цвет.BID.Price.Down;}
   OldPrice = bidd;
  }
   if (КоличествоЦветовBID == 3)
  {
   if (ima < bidd)  {ЦветBidd = Цвет.BID.Price.Up;}
   if (ima > bidd)  {ЦветBidd = Цвет.BID.Price.Down;}
   if (ima == bidd) {ЦветBidd = Цвет.BID.Price.Neutral;}
  }
   if (Digital == 4 || Digital <= 2)
  {
   ObjectDelete("ЦЕНА BIDs"); ObjectSet("ЦЕНА BID", OBJPROP_XDISTANCE, 6); BID = DoubleToStr(bidd, Digital);
  }
   if (Digital == 5 || Digital == 3)
  {
   Digital = Digital - 1; BID = StringSubstr(sbidd, 0, 6); BIDs = StringSubstr(sbidd, 6, 1);
   if (StringFind(Symbol(),"JPY",0)>=0 && bidd >= 100) {BID = StringSubstr(sbidd, 0, 6); BIDs = StringSubstr(sbidd, 6, 1);}
   if (StringFind(Symbol(),"JPY",0)>=0 && bidd < 100)  {BID = StringSubstr(sbidd, 0, 5); BIDs = StringSubstr(sbidd, 5, 1);}
   if (ПоказатьBIDSmall == false) {ObjectDelete("ЦЕНА BIDs"); ObjectSet("ЦЕНА BID", OBJPROP_XDISTANCE, 6); BID = DoubleToStr(bidd, Digital);}
  }
//+------------------------------------------------------------------+
//| расчёт экономических показателей                                 |
//+------------------------------------------------------------------+
   double LotB=0, LotS=0, Profit=0, ProfitBuy=0, ProfitSell=0, LotBuy=0, LotSell=0, PosBuy=0, PosSell=0, PriceBzu=0, FntB=14, FntS=14, FntR; string PoSB, PoSS, FontB, FontS;

   for (int a1=0; a1<OrdersTotal(); a1++)
   if ((OrderSelect(a1, SELECT_BY_POS, MODE_TRADES))&&(OrderSymbol()==Symbol())&&(OrderType()==OP_BUY))ProfitBuy+=OrderProfit()+OrderCommission()+OrderSwap();
   for (int b1=0; b1<OrdersTotal(); b1++)
   if ((OrderSelect(b1, SELECT_BY_POS, MODE_TRADES))&&(OrderSymbol()==Symbol())&&(OrderType()==OP_BUY))LotBuy+=OrderLots();
   for (int c1=0; c1<OrdersTotal(); c1++)
   if ((OrderSelect(c1, SELECT_BY_POS, MODE_TRADES))&&(OrderSymbol()==Symbol())&&(OrderType()==OP_BUY))PosBuy+=OrderSelect(c1, SELECT_BY_POS);

   for (int d1=0; d1<OrdersTotal(); d1++)
   if ((OrderSelect(d1, SELECT_BY_POS, MODE_TRADES))&&(OrderSymbol()==Symbol())&&(OrderType()==OP_SELL))ProfitSell+=OrderProfit()+OrderCommission()+OrderSwap();
   for (int e1=0; e1<OrdersTotal(); e1++)
   if ((OrderSelect(e1, SELECT_BY_POS, MODE_TRADES))&&(OrderSymbol()==Symbol())&&(OrderType()==OP_SELL))LotSell+=OrderLots();
   for (int f1=0; f1<OrdersTotal(); f1++)
   if ((OrderSelect(f1, SELECT_BY_POS, MODE_TRADES))&&(OrderSymbol()==Symbol())&&(OrderType()==OP_SELL))PosSell+=OrderSelect(f1, SELECT_BY_POS);

   for (int g1=0; g1<OrdersTotal(); g1++)
   if ((OrderSelect(g1, SELECT_BY_POS, MODE_TRADES))&&(OrderType()==OP_BUY))LotB+=OrderLots();
   for (int h1=0; h1<OrdersTotal(); h1++)
   if ((OrderSelect(h1, SELECT_BY_POS, MODE_TRADES))&&(OrderType()==OP_SELL))LotS+=OrderLots();

   double allpos = PosSell + PosBuy; if (LotBuy >= 10) {LotDRB=1;} if (LotSell >= 10) {LotDRS=1;}
   if (LotB+LotS == 0) {string LotALL = "";} else LotALL = "/" + DoubleToStr(LotB+LotS, 2);
   if (LotB+LotS >= 1) {LotALL = "/" + DoubleToStr(LotB+LotS, 1);}

   for (int w1=0; w1<OrdersTotal(); w1++)
   if ((OrderSelect(w1, SELECT_BY_POS, MODE_TRADES))&&(OrderSymbol()==Symbol())&&(OrderType()==OP_BUY)||(OrderType()==OP_SELL))Profit+=OrderProfit()+OrderCommission()+OrderSwap();
   if (allpos == 0) {string ProfiT = " ";} else ProfiT = "PROFIT: " + DoubleToStr(Profit, 2);

   if (ProfitBuy >= 10 || ProfitSell >= 10) {ZP=4;} if (ProfitBuy <= -10 || ProfitSell <= -10) {ZP=7;}
   if (ProfitBuy >= 100 || ProfitSell >= 100) {ZP=14;} if (ProfitBuy <= -100 || ProfitSell <= -100) {ZP=17;}
   if (ProfitBuy >= 1000 || ProfitSell >= 1000) {ZP=24;} if (ProfitBuy <= -1000 || ProfitSell <= -1000) {ZP=27;}
   if (ProfitBuy >= 10000 || ProfitSell >= 10000) {ZP=34; ZB=8;} if (ProfitBuy <= -10000 || ProfitSell <= -10000) {ZP=37; ZB=10;}
   if (ProfitBuy >= 100000 || ProfitSell >= 100000) {ZP=44; ZB=16;} if (ProfitBuy <= -100000 || ProfitSell <= -100000) {ZP=47; ZB=18;}
   if (ProfitBuy >= 1000000 || ProfitSell >= 1000000) {ZP=54; ZB=24;} if (ProfitBuy <= -1000000 || ProfitSell <= -1000000) {ZP=57; ZB=27;}

   if (ProfitAll <= -100 || Profit <= -100) {ZB=5;}
   if (ProfitAll >= 1000 || Profit >= 1000) {ZB=10;} if (ProfitAll <= -1000 || Profit <= -1000) {ZB=14;}
   if (ProfitAll >= 10000 || Profit >= 10000) {ZB=19;} if (ProfitAll <= -10000 || Profit <= -10000) {ZB=24;}
   if (ProfitAll >= 100000 || Profit >= 100000) {ZB=27;} if (ProfitAll <= - 100000 || Profit <= -100000) {ZB=27;}
   if (ProfitAll >= 1000000 || Profit >= 1000000) {ZB=27;} if (ProfitAll <= - 1000000 || Profit <= -1000000) {ZB=27;}

   if (PosSell == 0) {ObjectSet("Профит Buy", OBJPROP_YDISTANCE, 40);} else ObjectSet("Профит Buy", OBJPROP_YDISTANCE, 60);
   if (PosSell == 0) {ObjectSet("Позиции Buy", OBJPROP_YDISTANCE, 40);} else ObjectSet("Позиции Buy", OBJPROP_YDISTANCE, 60);
   if (LotSell == 0) {ObjectSet("Лоты Buy", OBJPROP_YDISTANCE, 40);} else ObjectSet("Лоты Buy", OBJPROP_YDISTANCE, 60);
   if (CurrencY == 0) {ObjectDelete("ПРОФИТ"); ObjectSet("Баланс", OBJPROP_XDISTANCE, 4);} else ObjectSet("Баланс", OBJPROP_XDISTANCE, 142+ZB);

   if (PosBuy == 0) {string ProfitBUY = " ";} else ProfitBUY = DoubleToStr(ProfitBuy, 2);
   if (PosSell == 0){string ProfitSELL = " ";} else ProfitSELL = DoubleToStr(ProfitSell, 2);
   if (LotBuy == 0) {string LotBUY = " ";} else LotBUY = DoubleToStr(LotBuy, LotDRB);
   if (LotSell == 0){string LotSELL = " ";} else LotSELL = DoubleToStr(LotSell, LotDRS);
//+------------------------------------------------------------------+
//| фон под экономические показатели                                 |
//+------------------------------------------------------------------+
   if ( ПоказатьФОН == true)
  {
   if (allpos >= 1)
  {
   ObjectCreate("Box", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("Box", "g", 60, "Webdings", ЦветФОНа);
   ObjectSet("Box", OBJPROP_CORNER, 3);
   ObjectSet("Box", OBJPROP_XDISTANCE, 2);
   ObjectSet("Box", OBJPROP_YDISTANCE, 2);
   ObjectSet("Box", OBJPROP_BACK, FALSE);

   ObjectCreate("Box ", OBJ_LABEL, 0, 0, 0);
   ObjectSetText("Box ", "g", 60, "Webdings", ЦветФОНа);
   ObjectSet("Box ", OBJPROP_CORNER, 3);
   ObjectSet("Box ", OBJPROP_XDISTANCE, 54+ZB);
   ObjectSet("Box ", OBJPROP_YDISTANCE, 2);
   ObjectSet("Box ", OBJPROP_BACK, FALSE);
  }
   if (allpos == 0)
  {
   ObjectDelete("Box"); ObjectDelete("Box ");
  }}
   if (ПоказатьПрофит == false)
  {
   ObjectDelete("Box"); ObjectDelete("Box ");
   ObjectSet("Баланс", OBJPROP_XDISTANCE, 4);
  }
//+------------------------------------------------------------------+
//| уровень безубытка (если безубытка нет - не отображать!)          |
//+------------------------------------------------------------------+
   if ((LotBuy - LotSell) > 0) {PriceBzu = bidd - ((ProfitBuy + ProfitSell) / (TickValue * (LotBuy - LotSell)) * Points);}
   if ((LotSell - LotBuy) > 0) {PriceBzu = askk + ((ProfitBuy + ProfitSell) / (TickValue * (LotSell - LotBuy)) * Points);}

   if (ПоказатьБезубыток == true)
  {
   if (PriceBzu > 0) string PriceBzub = DoubleToStr(PriceBzu, Digital);
   else  PriceBzub = "";
  }
   else  PriceBzub = "";
//+---------------------------------------------------------------------------------+
//| условия отображения информации спрэда, H4, безубытка, мультивалютника, аккаунта |
//+---------------------------------------------------------------------------------+
  if (SpreaD == "" && H4Next == "" && PriceBzub == "") {ПоказатьСпрэд = false; ПоказатьРасписаниеH4 = false; ПоказатьБезубыток = false;}

  if (ПоказатьСпрэд == false && ПоказатьРасписаниеH4 == false && ПоказатьБезубыток == false)
  { 
   ZY1=12; ZY2=24; ZY3=36; ZY4=48;
   if (Symb1 == "" && Symb2 == "" && Symb3 == "" && Symb4 == "")    {ZY2=ZY2-12; ZY3=ZY3-12; ZY4=ZY4-12;}
   if (Symb5 == "" && Symb6 == "" && Symb7 == "" && Symb8 == "")    {ZY3=ZY3-12; ZY4=ZY4-12;}
   if (Symb9 == "" && Symb10 == "" && Symb11 == "" && Symb12 == "") {ZY4=ZY4-12;}
  }
   else
  {
   ZY1=24; ZY2=36; ZY3=48; ZY4=60;
   if (Symb1 == "" && Symb2 == "" && Symb3 == "" && Symb4 == "")    {ZY2=ZY2-12; ZY3=ZY3-12; ZY4=ZY4-12;}
   if (Symb5 == "" && Symb6 == "" && Symb7 == "" && Symb8 == "")    {ZY3=ZY3-12; ZY4=ZY4-12;}
   if (Symb9 == "" && Symb10 == "" && Symb11 == "" && Symb12 == "") {ZY4=ZY4-12;}
  }
   if (ПоказатьДиапазон == true  && ПоказатьBarTimer == true  && ZY4==12) {ZY4=24;}
   if (ПоказатьДиапазон == false && ПоказатьBarTimer == true  && ZY4==12) {ZY4=24;}
   if (ПоказатьДиапазон == true  && ПоказатьBarTimer == false && ZY4==12) {ZY4=24;}

   ObjectSet("Мультивалютный Индикатор", OBJPROP_YDISTANCE, ZY1);
   ObjectSet("Мультивалютный Индикатор ", OBJPROP_YDISTANCE, ZY2);
   ObjectSet("Мультивалютный Индикатор  ", OBJPROP_YDISTANCE, ZY3);
   ObjectSet("Информация аккаунта", OBJPROP_YDISTANCE, ZY4);
//+------------------------------------------------------------------+
//| условия отображения финансовой информации                        |
//+------------------------------------------------------------------+
   if (Balans >= 2000) {MD=2;}  if (Balans >= 3000)  {MD=3;}   if (Balans >= 4000)   {MD=4;}
   if (Balans >= 5000) {MD=5;}  if (Balans >= 6000)  {MD=6;}   if (Balans >= 7000)   {MD=7;}
   if (Balans >= 8000) {MD=8;}  if (Balans >= 9000)  {MD=9;}   if (Balans >= 10000)  {MD=10;}
   if (Balans >= 50000){MD=50;} if (Balans >= 100000){MD=100;} if (Balans >= 1000000){MD=1000;}

   if (ProfitAll >= 0.00 || ProfitAll <= 0.00){ЦвПрофит = ЦветБаланс;} if (Profit >= 0.00 || Profit <= 0.00){ЦвПрофитT = ЦветБаланс;}
   if (ProfitAll >= 1.00*MD)    {ЦвПрофит = BuyLevel.1;} if (Profit >= 1.00*MD)    {ЦвПрофитT = BuyLevel.1;}
   if (ProfitAll >= 5.00*MD)    {ЦвПрофит = BuyLevel.2;} if (Profit >= 5.00*MD)    {ЦвПрофитT = BuyLevel.2;}
   if (ProfitAll >= 30.00*MD)   {ЦвПрофит = BuyLevel.3;} if (Profit >= 30.00*MD)   {ЦвПрофитT = BuyLevel.3;}
   if (ProfitAll >= 100.00*MD)  {ЦвПрофит = BuyLevel.4;} if (Profit >= 100.00*MD)  {ЦвПрофитT = BuyLevel.4;}
   if (ProfitAll <= -1.00*MD)   {ЦвПрофит = SelLevel.1;} if (Profit <= -1.00*MD)   {ЦвПрофитT = SelLevel.1;}
   if (ProfitAll <= -5.00*MD)   {ЦвПрофит = SelLevel.2;} if (Profit <= -5.00*MD)   {ЦвПрофитT = SelLevel.2;}
   if (ProfitAll <= -30.00*MD)  {ЦвПрофит = SelLevel.3;} if (Profit <= -30.00*MD)  {ЦвПрофитT = SelLevel.3;}
   if (ProfitAll <= -100.00*MD) {ЦвПрофит = SelLevel.4;} if (Profit <= -100.00*MD) {ЦвПрофитT = SelLevel.4;}

   if (ProfitBuy >= 0.00 || ProfitBuy <= 0.00){ЦвПрофитB = ЦветБаланс;} if (ProfitSell >= 0.00 || ProfitSell <= 0.00){ЦвПрофитS = ЦветБаланс;}
   if (ProfitBuy >= 1.00*MD)    {ЦвПрофитB = BuyLevel.1;} if (ProfitSell >= 1.00*MD)    {ЦвПрофитS = BuyLevel.1;}
   if (ProfitBuy >= 5.00*MD)    {ЦвПрофитB = BuyLevel.2;} if (ProfitSell >= 5.00*MD)    {ЦвПрофитS = BuyLevel.2;}
   if (ProfitBuy >= 30.00*MD)   {ЦвПрофитB = BuyLevel.3;} if (ProfitSell >= 30.00*MD)   {ЦвПрофитS = BuyLevel.3;}
   if (ProfitBuy >= 100.00*MD)  {ЦвПрофитB = BuyLevel.4;} if (ProfitSell >= 100.00*MD)  {ЦвПрофитS = BuyLevel.4;}
   if (ProfitBuy <= -1.00*MD)   {ЦвПрофитB = SelLevel.1;} if (ProfitSell <= -1.00*MD)   {ЦвПрофитS = SelLevel.1;}
   if (ProfitBuy <= -5.00*MD)   {ЦвПрофитB = SelLevel.2;} if (ProfitSell <= -5.00*MD)   {ЦвПрофитS = SelLevel.2;}
   if (ProfitBuy <= -30.00*MD)  {ЦвПрофитB = SelLevel.3;} if (ProfitSell <= -30.00*MD)  {ЦвПрофитS = SelLevel.3;}
   if (ProfitBuy <= -100.00*MD) {ЦвПрофитB = SelLevel.4;} if (ProfitSell <= -100.00*MD) {ЦвПрофитS = SelLevel.4;}

   if (Шрифт <= 1) {FontB = "Wingdings"; FontS = "Wingdings"; FntR=23;}
   if (Шрифт >= 2) {FontB = "Wingdings 2"; FontS = "Wingdings 2"; FntR=0;}

   if (PosBuy == 0)  {PoSB = " ";}                 if (PosSell == 0)  {PoSS = " ";}
   if (PosBuy == 1)  {PoSB = CharToStr(117+FntR);} if (PosSell == 1)  {PoSS = CharToStr(117+FntR);}
   if (PosBuy == 2)  {PoSB = CharToStr(118+FntR);} if (PosSell == 2)  {PoSS = CharToStr(118+FntR);}
   if (PosBuy == 3)  {PoSB = CharToStr(119+FntR);} if (PosSell == 3)  {PoSS = CharToStr(119+FntR);}
   if (PosBuy == 4)  {PoSB = CharToStr(120+FntR);} if (PosSell == 4)  {PoSS = CharToStr(120+FntR);}
   if (PosBuy == 5)  {PoSB = CharToStr(121+FntR);} if (PosSell == 5)  {PoSS = CharToStr(121+FntR);}
   if (PosBuy == 6)  {PoSB = CharToStr(122+FntR);} if (PosSell == 6)  {PoSS = CharToStr(122+FntR);}
   if (PosBuy == 7)  {PoSB = CharToStr(123+FntR);} if (PosSell == 7)  {PoSS = CharToStr(123+FntR);}
   if (PosBuy == 8)  {PoSB = CharToStr(124+FntR);} if (PosSell == 8)  {PoSS = CharToStr(124+FntR);}
   if (PosBuy == 9)  {PoSB = CharToStr(125+FntR);} if (PosSell == 9)  {PoSS = CharToStr(125+FntR);}
   if (PosBuy == 10) {PoSB = CharToStr(126+FntR);} if (PosSell == 10) {PoSS = CharToStr(126+FntR);}

   if (PosBuy >= 11) {FontB = "Arial Black"; FntB=11; ZPO=3; PoSB = DoubleToStr(PosBuy,0);}
   if (PosSell >= 11){FontS = "Arial Black"; FntS=11; ZPO=3; PoSS = DoubleToStr(PosSell,0);}

   ObjectSet("Позиции Buy", OBJPROP_XDISTANCE, 48+ZP); ObjectSet("Позиции Sell", OBJPROP_XDISTANCE, 48+ZP);
   ObjectSet("Лоты Buy", OBJPROP_XDISTANCE, 66+ZP+ZPO); ObjectSet("Лоты Sell", OBJPROP_XDISTANCE, 66+ZP+ZPO);
//+------------------------------------------------------------------+
//| строки отображения финансовой информации, спрэда и времени       |
//+------------------------------------------------------------------+
   ObjectSetText("Баланс", Balanse + FreeMagrin + Currency + LotALL, 11, "Arial Black", ЦветБаланс);
   ObjectSetText("ПРОФИТ", "  TOTAL: " + DoubleToStr(ProfitAll, 2), 11, "Arial Black", ЦвПрофит);
   ObjectSetText("Профит пары", ProfiT, 11, "Arial Black", ЦвПрофитT);
   ObjectSetText("Профит Buy", ProfitBUY, 11, "Arial Black", ЦвПрофитB);
   ObjectSetText("Профит Sell", ProfitSELL, 11, "Arial Black", ЦвПрофитS);
   ObjectSetText("Позиции Buy", PoSB, FntB, FontB, SeaGreen);
   ObjectSetText("Позиции Sell", PoSS, FntS, FontS, Brown);
   ObjectSetText("Лоты Buy", LotBUY, 11, "Arial Black", ЦветБаланс);
   ObjectSetText("Лоты Sell", LotSELL, 11, "Arial Black", ЦветБаланс);
   ObjectSetText("ЦЕНА BID", BID, 26, "Arial", ЦветBidd);
   ObjectSetText("ЦЕНА BIDs", BIDs, 14, "Arial", ЦветBidd);
   ObjectSetText("Спрэд Н4 Б/У", SpreaD + H4Next + PriceBzub, 8, "Tahoma", ЦветSpread);
   ObjectSetText("Время UTC", "UTC " + UTCs + "  BROKER " + Brokers + "  LOCAL " + Locals, 9, "Tahoma", ЦветUTC);
//+------------------------------------------------------------------+
//| расписание торговых сессий летнее                                |
//+------------------------------------------------------------------+
   if (SummerTime == 1)
  {
   if (UTCs >= "00:00") {SText = " = OPEN ASIA SESSION ACTIVE = "; SColor = SessionWarning;}
   if (UTCs >= "00:01") {SText = " = ASIA SESSION ACTIVE FIRST HOUR= "; SColor = SessionActive;}
   if (UTCs >= "01:00") {SText = " = ASIA SESSION ACTIVE = "; SColor = SessionActive;}
   if (UTCs >= "02:00") {SText = " = ASIA SESSION = "; SColor = Session;}
   if (UTCs >= "06:00") {SText = " = ASIA CLOSE - EUROPA OPEN 60M = "; SColor = SessionMemories;}
   if (UTCs >= "06:01") {SText = " = ASIA SESSION LAST HOUR = "; SColor = Session;}
   if (UTCs >= "06:30") {SText = " = ASIA CLOSE - EUROPA OPEN 30M = "; SColor = SessionMemories;}
   if (UTCs >= "06:31") {SText = " = ASIA SESSION LAST 30M = "; SColor = Session;}
   if (UTCs >= "06:45") {SText = " = ASIA CLOSE - EUROPA OPEN 15M = "; SColor = SessionMemories;}
   if (UTCs >= "06:46") {SText = " = ASIA SESSION LAST 15M = "; SColor = Session;}
   if (UTCs >= "06:50") {SText = " = ASIA CLOSE - EUROPA OPEN 10M = "; SColor = SessionMemories;}
   if (UTCs >= "06:51") {SText = " = ASIA SESSION LAST 10M = "; SColor = Session;}
   if (UTCs >= "06:55") {SText = " = ASIA CLOSE 5M - EUROPA OPEN 5M = "; SColor = SessionMemories;}
   if (UTCs >= "06:59") {SText = " = ASIA CLOSE SESSION - EUROPA OPEN SESSION = "; SColor = SessionWarning;}
   if (UTCs >= "07:00") {SText = " = OPEN EUROPA SESSION ACTIVE = "; SColor = SessionWarning;}
   if (UTCs >= "07:01") {SText = " = EUROPA SESSION ACTIVE FIRST HOUR = "; SColor = SessionActive;}
   if (UTCs >= "08:00") {SText = " = EUROPA SESSION ACTIVE = "; SColor = SessionActive;}
   if (UTCs >= "11:00") {SText = " = EUROPA SESSION = "; SColor = Session;}
   if (UTCs >= "12:30") {SText = " = EUROPA SESSION - AMERICA OPEN 60M = "; SColor = SessionMemories;}
   if (UTCs >= "12:31") {SText = " = EUROPA SESSION ACTIVE = "; SColor = SessionActive;}
   if (UTCs >= "13:00") {SText = " = EUROPA ACTIVE - AMERICA OPEN 30M = "; SColor = SessionMemories;}
   if (UTCs >= "13:01") {SText = " = EUROPA SESSION ACTIVE = "; SColor = SessionActive;}
   if (UTCs >= "13:15") {SText = " = EUROPA ACTIVE - AMERICA OPEN 15M = "; SColor = SessionMemories;}
   if (UTCs >= "13:16") {SText = " = EUROPA SESSION ACTIVE = "; SColor = SessionActive;}
   if (UTCs >= "13:20") {SText = " = EUROPA ACTIVE - AMERICA OPEN 10M = "; SColor = SessionMemories;}
   if (UTCs >= "13:21") {SText = " = EUROPA SESSION ACTIVE = "; SColor = SessionActive;}
   if (UTCs >= "13:25") {SText = " = EUROPA ACTIVE - AMERICA OPEN 5M = "; SColor = SessionMemories;}
   if (UTCs >= "13:30") {SText = " = EUROPA - AMERICA OPEN SESSION ACTIVE = "; SColor = SessionWarning;}
   if (UTCs >= "13:31") {SText = " = EUROPA - AMERICA SESSION ACTIVE = "; SColor = SessionActive;}
   if (UTCs >= "14:30") {SText = " = EUROPA CLOSE 60M - AMERICA SESSION ACTIVE = "; SColor = SessionMemories;}
   if (UTCs >= "14:31") {SText = " = EUROPA LAST HOUR - AMERICA SESSION ACTIVE = "; SColor = SessionActive;}
   if (UTCs >= "15:00") {SText = " = EUROPA CLOSE 30M - AMERICA SESSION ACTIVE = "; SColor = SessionMemories;}
   if (UTCs >= "15:01") {SText = " = EUROPA LAST 30M - AMERICA SESSION ACTIVE = "; SColor = SessionActive;}
   if (UTCs >= "15:15") {SText = " = EUROPA CLOSE 15M - AMERICA SESSION ACTIVE = "; SColor = SessionMemories;}
   if (UTCs >= "15:16") {SText = " = EUROPA LAST 15M - AMERICA SESSION ACTIVE = "; SColor = SessionActive;}
   if (UTCs >= "15:20") {SText = " = EUROPA CLOSE 10M - AMERICA SESSION ACTIVE = "; SColor = SessionMemories;}
   if (UTCs >= "15:21") {SText = " = EUROPA LAST 10M - AMERICA SESSION ACTIVE = "; SColor = SessionActive;}
   if (UTCs >= "15:25") {SText = " = EUROPA CLOSE 5M - AMERICA SESSION ACTIVE = "; SColor = SessionMemories;}
   if (UTCs >= "15:29") {SText = " = EUROPA CLOSE SESSION - AMERICA SESSION ACTIVE = "; SColor = SessionWarning;}
   if (UTCs >= "15:30") {SText = " = AMERICA SESSION ACTIVE = "; SColor = SessionActive;}
   if (UTCs >= "17:00") {SText = " = AMERICA SESSION = "; SColor = Session;}
   if (UTCs >= "19:00") {SText = " = AMERICA SESSION ACTIVE CLOSE 60M = "; SColor = SessionMemories;}
   if (UTCs >= "19:01") {SText = " = AMERICA SESSION ACTIVE LAST HOUR = "; SColor = SessionActive;}
   if (UTCs >= "19:30") {SText = " = AMERICA SESSION ACTIVE CLOSE 30M = "; SColor = SessionMemories;}
   if (UTCs >= "19:31") {SText = " = AMERICA SESSION ACTIVE LAST 30M = "; SColor = SessionActive;}
   if (UTCs >= "19:45") {SText = " = AMERICA SESSION ACTIVE CLOSE 15M = "; SColor = SessionMemories;}
   if (UTCs >= "19:46") {SText = " = AMERICA SESSION ACTIVE LAST 15M = "; SColor = SessionActive;}
   if (UTCs >= "19:50") {SText = " = AMERICA SESSION ACTIVE CLOSE 10M = "; SColor = SessionMemories;}
   if (UTCs >= "19:51") {SText = " = AMERICA SESSION ACTIVE LAST 10M = "; SColor = SessionActive;}
   if (UTCs >= "19:55") {SText = " = AMERICA SESSION ACTIVE CLOSE 5M = "; SColor = SessionMemories;}
   if (UTCs >= "19:59") {SText = " = AMERICA CLOSE SESSION = "; SColor = SessionWarning;}
   if (UTCs >= "20:00") {SText = " = NOT ACTIVE SESSION = "; SColor = Session;}
   if (UTCs >= "20:01") {SText = " = CLOSE OLD TRADE DAY 60M = "; SColor = SessionMemories;}
   if (UTCs >= "20:02") {SText = " = NOT ACTIVE SESSION = "; SColor = Session;}
   if (UTCs >= "20:30") {SText = " = CLOSE OLD TRADE DAY 30M = "; SColor = SessionMemories;}
   if (UTCs >= "20:31") {SText = " = NOT ACTIVE SESSION = "; SColor = Session;}
   if (UTCs >= "20:45") {SText = " = CLOSE OLD TRADE DAY 15M = "; SColor = SessionMemories;}
   if (UTCs >= "20:46") {SText = " = NOT ACTIVE SESSION = "; SColor = Session;}
   if (UTCs >= "20:55") {SText = " = CLOSE OLD TRADE DAY 5M = "; SColor = SessionWarning;}
   if (UTCs >= "21:00") {SText = " = NEW TRADE DAY = "; SColor = SessionOther;}
   if (UTCs >= "21:01") {SText = " = OPEN NEW TRADE DAY = "; SColor = SessionMemories;}
   if (UTCs >= "21:05") {SText = " = NEW ZELAND = "; SColor = Session;}
   if (UTCs >= "23:00") {SText = " = ASIA OPEN SESSION 60M = "; SColor = SessionMemories;}
   if (UTCs >= "23:01") {SText = " = NEW ZELAND = "; SColor = Session;}
   if (UTCs >= "23:45") {SText = " = ASIA OPEN SESSION 15M = "; SColor = SessionMemories;}
   if (UTCs >= "23:46") {SText = " = NEW ZELAND = "; SColor = Session;}
   if (UTCs >= "23:50") {SText = " = ASIA OPEN SESSION 10M = "; SColor = SessionMemories;}
   if (UTCs >= "23:51") {SText = " = NEW ZELAND = "; SColor = Session;}
   if (UTCs >= "23:55") {SText = " = ASIA OPEN SESSION 5M = "; SColor = SessionMemories;}
   if (UTCs == "23:59") {SText = " = ASIA OPEN SESSION 1M = "; SColor = SessionWarning;}

   if (HoliDays == 1) {SText = " = MARKET CLOSE FOR TRADING = "; SColor = SessionOther;}
   ObjectSetText("Торговая Сессия Летнее Расписание", SText, 9 , "Arial Black", SColor);
  }
//+------------------------------------------------------------------+
//| расписание торговых сессий зимнее                                |
//+------------------------------------------------------------------+
   if (SummerTime == 0)
  {
   if (UTCs >= "00:00") {SText = " = OPEN ASIA SESSION ACTIVE = "; SColor = SessionWarning;}
   if (UTCs >= "00:01") {SText = " = ASIA SESSION ACTIVE FIRST HOUR= "; SColor = SessionActive;}
   if (UTCs >= "01:00") {SText = " = ASIA SESSION ACTIVE = "; SColor = SessionActive;}
   if (UTCs >= "02:00") {SText = " = ASIA SESSION = "; SColor = Session;}
   if (UTCs >= "06:00") {SText = " = ASIA CLOSE - EUROPA OPEN 60M = "; SColor = SessionMemories;}
   if (UTCs >= "06:01") {SText = " = ASIA SESSION LAST HOUR = "; SColor = Session;}
   if (UTCs >= "06:30") {SText = " = ASIA CLOSE - EUROPA OPEN 30M = "; SColor = SessionMemories;}
   if (UTCs >= "06:31") {SText = " = ASIA SESSION LAST 30M = "; SColor = Session;}
   if (UTCs >= "06:45") {SText = " = ASIA CLOSE - EUROPA OPEN 15M = "; SColor = SessionMemories;}
   if (UTCs >= "06:46") {SText = " = ASIA SESSION LAST 15M = "; SColor = Session;}
   if (UTCs >= "06:50") {SText = " = ASIA CLOSE - EUROPA OPEN 10M = "; SColor = SessionMemories;}
   if (UTCs >= "06:51") {SText = " = ASIA SESSION LAST 10M = "; SColor = Session;}
   if (UTCs >= "06:55") {SText = " = ASIA CLOSE 5M - EUROPA OPEN 5M = "; SColor = SessionMemories;}
   if (UTCs >= "06:59") {SText = " = ASIA CLOSE SESSION - EUROPA OPEN SESSION = "; SColor = SessionWarning;}
   if (UTCs >= "07:00") {SText = " = OPEN EUROPA SESSION ACTIVE= "; SColor = SessionWarning;}
   if (UTCs >= "07:01") {SText = " = EUROPA SESSION ACTIVE FIRST HOUR = "; SColor = SessionActive;}
   if (UTCs >= "08:00") {SText = " = EUROPA SESSION ACTIVE = "; SColor = SessionActive;}
   if (UTCs >= "11:00") {SText = " = EUROPA SESSION = "; SColor = Session;}
   if (UTCs >= "13:00") {SText = " = EUROPA SESSION ACTIVE = "; SColor = SessionActive;}
   if (UTCs >= "13:30") {SText = " = EUROPA ACTIVE - AMERICA OPEN 60M = "; SColor = SessionMemories;}
   if (UTCs >= "13:31") {SText = " = EUROPA SESSION ACTIVE = "; SColor = SessionActive;}
   if (UTCs >= "14:00") {SText = " = EUROPA ACTIVE - AMERICA OPEN 30M = "; SColor = SessionMemories;}
   if (UTCs >= "14:01") {SText = " = EUROPA SESSION ACTIVE = "; SColor = SessionActive;}
   if (UTCs >= "14:15") {SText = " = EUROPA ACTIVE - AMERICA OPEN 15M = "; SColor = SessionMemories;}
   if (UTCs >= "14:16") {SText = " = EUROPA SESSION ACTIVE = "; SColor = SessionActive;}
   if (UTCs >= "14:20") {SText = " = EUROPA ACTIVE - AMERICA OPEN 10M = "; SColor = SessionMemories;}
   if (UTCs >= "14:21") {SText = " = EUROPA SESSION ACTIVE = "; SColor = SessionActive;}
   if (UTCs >= "14:25") {SText = " = EUROPA ACTIVE - AMERICA OPEN 5M = "; SColor = SessionMemories;}
   if (UTCs >= "14:30") {SText = " = EUROPA - AMERICA OPEN SESSION ACTIVE = "; SColor = SessionWarning;}
   if (UTCs >= "14:31") {SText = " = EUROPA - AMERICA SESSION ACTIVE = "; SColor = SessionActive;}
   if (UTCs >= "15:30") {SText = " = EUROPA CLOSE 60M - AMERICA SESSION ACTIVE = "; SColor = SessionMemories;}
   if (UTCs >= "15:31") {SText = " = EUROPA LAST HOUR - AMERICA SESSION ACTIVE = "; SColor = SessionActive;}
   if (UTCs >= "16:00") {SText = " = EUROPA CLOSE 30M - AMERICA SESSION ACTIVE = "; SColor = SessionMemories;}
   if (UTCs >= "16:01") {SText = " = EUROPA LAST 30M - AMERICA SESSION ACTIVE = "; SColor = SessionActive;}
   if (UTCs >= "16:15") {SText = " = EUROPA CLOSE 15M - AMERICA SESSION ACTIVE = "; SColor = SessionMemories;}
   if (UTCs >= "16:16") {SText = " = EUROPA LAST 15M - AMERICA SESSION ACTIVE = "; SColor = SessionActive;}
   if (UTCs >= "16:20") {SText = " = EUROPA CLOSE 10M - AMERICA SESSION ACTIVE = "; SColor = SessionMemories;}
   if (UTCs >= "16:21") {SText = " = EUROPA LAST 10M - AMERICA SESSION ACTIVE = "; SColor = SessionActive;}
   if (UTCs >= "16:25") {SText = " = EUROPA CLOSE 5M - AMERICA SESSION ACTIVE = "; SColor = SessionMemories;}
   if (UTCs >= "16:29") {SText = " = EUROPA CLOSE SESSION - AMERICA SESSION ACTIVE = "; SColor = SessionWarning;}
   if (UTCs >= "16:30") {SText = " = AMERICA SESSION ACTIVE = "; SColor = SessionActive;}
   if (UTCs >= "17:00") {SText = " = AMERICA SESSION = "; SColor = Session;}
   if (UTCs >= "19:00") {SText = " = AMERICA SESSION ACTIVE = "; SColor = SessionActive;}
   if (UTCs >= "20:00") {SText = " = AMERICA SESSION ACTIVE CLOSE 60M = "; SColor = SessionMemories;}
   if (UTCs >= "20:01") {SText = " = CLOSE OLD TRADE DAY 60M = "; SColor = SessionMemories;}
   if (UTCs >= "20:02") {SText = " = AMERICA SESSION ACTIVE LAST HOUR = "; SColor = SessionActive;}
   if (UTCs >= "20:30") {SText = " = CLOSE OLD TRADE DAY 30M = "; SColor = SessionMemories;}
   if (UTCs >= "20:31") {SText = " = AMERICA SESSION ACTIVE CLOSE 30M = "; SColor = SessionMemories;}
   if (UTCs >= "20:32") {SText = " = AMERICA SESSION ACTIVE LAST 30M = "; SColor = SessionActive;}
   if (UTCs >= "20:45") {SText = " = CLOSE OLD TRADE DAY 15M = "; SColor = SessionMemories;}
   if (UTCs >= "20:46") {SText = " = AMERICA SESSION ACTIVE CLOSE 15M = "; SColor = SessionMemories;}
   if (UTCs >= "20:47") {SText = " = AMERICA SESSION ACTIVE LAST 15M = "; SColor = SessionActive;}
   if (UTCs >= "20:50") {SText = " = AMERICA SESSION ACTIVE CLOSE 10M = "; SColor = SessionMemories;}
   if (UTCs >= "20:51") {SText = " = AMERICA SESSION ACTIVE LAST 10M = "; SColor = SessionActive;}
   if (UTCs >= "20:55") {SText = " = CLOSE OLD TRADE DAY 5M = "; SColor = SessionWarning;}
   if (UTCs >= "20:56") {SText = " = AMERICA SESSION ACTIVE CLOSE 5M = "; SColor = SessionMemories;}
   if (UTCs >= "20:59") {SText = " = AMERICA CLOSE SESSION = "; SColor = SessionWarning;}
   if (UTCs >= "21:00") {SText = " = NEW TRADE DAY = "; SColor = SessionOther;}
   if (UTCs >= "21:01") {SText = " = OPEN NEW TRADE DAY = "; SColor = SessionMemories;}
   if (UTCs >= "21:05") {SText = " = NEW ZELAND = "; SColor = Session;}
   if (UTCs >= "23:00") {SText = " = ASIA OPEN SESSION 60M = "; SColor = SessionMemories;}
   if (UTCs >= "23:01") {SText = " = NEW ZELAND + AUSTRALIA = "; SColor = Session;}
   if (UTCs >= "23:30") {SText = " = ASIA OPEN SESSION 30M = "; SColor = SessionMemories;}
   if (UTCs >= "23:31") {SText = " = NEW ZELAND + AUSTRALIA = "; SColor = Session;}
   if (UTCs >= "23:45") {SText = " = ASIA OPEN SESSION 15M = "; SColor = SessionMemories;}
   if (UTCs >= "23:46") {SText = " = NEW ZELAND + AUSTRALIA = "; SColor = Session;}
   if (UTCs >= "23:50") {SText = " = ASIA OPEN SESSION 10M = "; SColor = SessionMemories;}
   if (UTCs >= "23:51") {SText = " = NEW ZELAND + AUSTRALIA = "; SColor = Session;}
   if (UTCs >= "23:55") {SText = " = ASIA OPEN SESSION 5M = "; SColor = SessionMemories;}
   if (UTCs == "23:59") {SText = " = ASIA OPEN SESSION 1M = "; SColor = SessionWarning;}

   if (HoliDays == 1) {SText = " = MARKET CLOSE FOR TRADING = "; SColor = SessionOther;}
   ObjectSetText("Торговая Сессия Зимнее Расписание", SText, 9 , "Arial Black", SColor);
  }
//+------------------------------------------------------------------+
   return(0);
  }
   double GetPoint(string vSymbol)
  {
   int vres = StringFind(vSymbol,"JPY",0);
   if (vres == -1) return(0.0001); return(0.01);
  }
//+------------------------------------------------------------------+
//| переменные индикатора времени сделок на графике                  |
//+------------------------------------------------------------------+
   void ShowOrders(int mode = MODE_TRADES)
  {
   if (mode == MODE_TRADES) {prefix = "Ордер открыт: ";}  // торгуемые ордера

   for(i=0; i<(OrdersTotal()+100); i++)                    // удаляем старые метки
  {
   TMP = prefix + DoubleToStr(i,0); ObjectDelete(TMP);
  }
   for(i=0; i<OrdersTotal(); i++)                         // добавляем новые метки
  {
   if(OrderSelect(i, SELECT_BY_POS, mode)==true && OrderSymbol()==Symbol())
  {
   if(OrderSymbol()==Symbol() && ((ТипСделок>=2&&(OrderType()==OP_BUY||OrderType()==OP_SELL)) || (ТипСделок==1&&OrderType()==OP_BUY) || (ТипСделок<=-1&&OrderType()==OP_SELL)))
  {
   TMP = prefix + DoubleToStr(i,0);

   if(OrderType()==OP_BUY)  {clr=Lime;}
   if(OrderType()==OP_SELL) {clr=Red;}

   ObjectCreate(TMP, OBJ_ARROW, 0, OrderOpenTime(), OrderOpenPrice());
   ObjectSet(TMP, OBJPROP_COLOR, clr);
   ObjectSet(TMP, OBJPROP_ARROWCODE, 1);
  }
  }}}
//+------------------------------------------------------------------+