//+------------------------------------------------------------------+
//|                                                     i-WIZARD.mq4 |
//|                                                      Version 4.0 |
//|                                     Copyright © 2009, Goalkeeper |
//|                                   http://forum.forexpeoples.com/ |
//+------------------------------------------------------------------+
//| Индикатор выводит в дополнительное окно экрана информацию        |
//| о результатах работы советников (экспертов) с различными         |
//| магическими номерами по текущей валютной паре                    |
//+------------------------------------------------------------------+
//|                   Б Л А Г О Д А Р Н О С Т И :                    |
//+------------------------------------------------------------------+
//|                                         За основу взят индикатор |
//|                                                    i-Profit.mq4  |
//|                                          Ким Игорь В. aka KimIV  |
//|                                             http://www.kimiv.ru  |
//+------------------------------------------------------------------+
#property copyright                   "Copyright © 2009, Goalkeeper"
#property link                      "http://forum.forexpeoples.com/"
#property indicator_separate_window
//==== внешние переменные индикатора ====
extern string     _   = "Укажите магические номера";
extern int   mag_01   = 305;              // Магическое число ордеров
extern int   mag_02   = 403;              // Магическое число ордеров
extern int   mag_03   = 107;              // Магическое число ордеров
extern int   mag_04   = 206;              // Магическое число ордеров
extern int   mag_05   = 908;              // Магическое число ордеров
extern int   mag_06   = 701;              // Магическое число ордеров
extern int   mag_07   = 802;              // Магическое число ордеров
extern int   mag_08   = 803;              // Магическое число ордеров

extern string    __   = "Координаты столбцов";
extern int   X02      = 130;              // координата Х первого столбца
extern int   SX2      = 95;               // смещение между столбцами
extern int   CX7      = 47;               // смещение до процентов


//==== цвета ====
color    Color1   = Gray;        // Цвет текста
color    Color2   = Lime;        // Цвет значений (+)
color    Color3   = Red;         // Цвет значений (-)
color    Color4   = Aqua;        // Цвет значений (0)
//==== шрифт ====
int      FontSize = 8;           // Размер шрифта
string   FontName = "Arial";     // Шрифт
string   ShortName = "WIZARD.";

//+----------------------------------------------------------------------------+
//|  Custom indicator initialization function                                  |
//+----------------------------------------------------------------------------+
void init()
   {
   DeleteObjects();
   IndicatorShortName(ShortName);
   return(0);
   }
//+----------------------------------------------------------------------------+
//|  Custom indicator deinitialization function                                |
//+----------------------------------------------------------------------------+
void deinit()
   {
   DeleteObjects();
   return(0);
   }
//+----------------------------------------------------------------------------+
//|  Custom indicator iteration function                                       |
//+----------------------------------------------------------------------------+
void start()
   {
//==== внутренние переменные ====
   int         X01      = 3;                          // первая координата Х
   int         Y01      = 20;                         // координата Y первой строки
   int         StepY    = MathCeil(1.6*FontSize);     // интервал между строками

//==== вычислительная часть ====
   datetime d0, d5, d6, d7, d8;

   d0=StrToTime(TimeToStr(TimeCurrent(), TIME_DATE));
   while (TimeDayOfWeek(d0)<1 || TimeDayOfWeek(d0)>5) d0-=24*60*60;
   d5=DateOfMonday();
   d6=StrToTime(Year()+"."+Month()+".01");
   d8=StrToTime(Year()+".01.01");

   double tb=AccountBalance();
   double p0=GetProfitFromDateInCurrency("", -1, -1, d0);
   double p5=GetProfitFromDateInCurrency("", -1, -1, d5);
   double p6=GetProfitFromDateInCurrency("", -1, -1, d6);
   double p8=GetProfitFromDateInCurrency("", -1, -1, d8);


   double p110 = GetCurrentProfitInCurrency("", -1, mag_01);
   double p120 = GetCurrentProfitInCurrency("", -1, mag_02);
   double p130 = GetCurrentProfitInCurrency("", -1, mag_03);
   double p140 = GetCurrentProfitInCurrency("", -1, mag_04);
   double p150 = GetCurrentProfitInCurrency("", -1, mag_05);
   double p160 = GetCurrentProfitInCurrency("", -1, mag_06);
   double p170 = GetCurrentProfitInCurrency("", -1, mag_07);
   double p180 = GetCurrentProfitInCurrency("", -1, mag_08);

   double r111 = p110*100/(tb-p0);
   double r121 = p120*100/(tb-p0);
   double r131 = p130*100/(tb-p0);
   double r141 = p140*100/(tb-p0);
   double r151 = p150*100/(tb-p0);
   double r161 = p160*100/(tb-p0);
   double r171 = p170*100/(tb-p0);
   double r181 = p180*100/(tb-p0);

   double p210 = GetProfitFromDateInCurrency("", -1, mag_01, d0);
   double p220 = GetProfitFromDateInCurrency("", -1, mag_02, d0);
   double p230 = GetProfitFromDateInCurrency("", -1, mag_03, d0);
   double p240 = GetProfitFromDateInCurrency("", -1, mag_04, d0);
   double p250 = GetProfitFromDateInCurrency("", -1, mag_05, d0);
   double p260 = GetProfitFromDateInCurrency("", -1, mag_06, d0);
   double p270 = GetProfitFromDateInCurrency("", -1, mag_07, d0);
   double p280 = GetProfitFromDateInCurrency("", -1, mag_08, d0);

   double r211 = p210*100/(tb-p0);
   double r221 = p220*100/(tb-p0);
   double r231 = p230*100/(tb-p0);
   double r241 = p240*100/(tb-p0);
   double r251 = p250*100/(tb-p0);
   double r261 = p260*100/(tb-p0);
   double r271 = p270*100/(tb-p0);
   double r281 = p280*100/(tb-p0);

   double p310 = GetProfitFromDateInCurrency("", -1, mag_01, d5);
   double p320 = GetProfitFromDateInCurrency("", -1, mag_02, d5);
   double p330 = GetProfitFromDateInCurrency("", -1, mag_03, d5);
   double p340 = GetProfitFromDateInCurrency("", -1, mag_04, d5);
   double p350 = GetProfitFromDateInCurrency("", -1, mag_05, d5);
   double p360 = GetProfitFromDateInCurrency("", -1, mag_06, d5);
   double p370 = GetProfitFromDateInCurrency("", -1, mag_07, d5);
   double p380 = GetProfitFromDateInCurrency("", -1, mag_08, d5);

   double r311 = p310*100/(tb-p5);
   double r321 = p320*100/(tb-p5);
   double r331 = p330*100/(tb-p5);
   double r341 = p340*100/(tb-p5);
   double r351 = p350*100/(tb-p5);
   double r361 = p360*100/(tb-p5);
   double r371 = p370*100/(tb-p5);
   double r381 = p380*100/(tb-p5);

   double p410 = GetProfitFromDateInCurrency("", -1, mag_01, d6);
   double p420 = GetProfitFromDateInCurrency("", -1, mag_02, d6);
   double p430 = GetProfitFromDateInCurrency("", -1, mag_03, d6);
   double p440 = GetProfitFromDateInCurrency("", -1, mag_04, d6);
   double p450 = GetProfitFromDateInCurrency("", -1, mag_05, d6);
   double p460 = GetProfitFromDateInCurrency("", -1, mag_06, d6);
   double p470 = GetProfitFromDateInCurrency("", -1, mag_07, d6);
   double p480 = GetProfitFromDateInCurrency("", -1, mag_08, d6);

   double r411 = p410*100/(tb-p6);
   double r421 = p420*100/(tb-p6);
   double r431 = p430*100/(tb-p6);
   double r441 = p440*100/(tb-p6);
   double r451 = p450*100/(tb-p6);
   double r461 = p460*100/(tb-p6);
   double r471 = p470*100/(tb-p6);
   double r481 = p480*100/(tb-p6);

   double p510 = GetProfitFromDateInCurrency("", -1, mag_01, d8);
   double p520 = GetProfitFromDateInCurrency("", -1, mag_02, d8);
   double p530 = GetProfitFromDateInCurrency("", -1, mag_03, d8);
   double p540 = GetProfitFromDateInCurrency("", -1, mag_04, d8);
   double p550 = GetProfitFromDateInCurrency("", -1, mag_05, d8);
   double p560 = GetProfitFromDateInCurrency("", -1, mag_06, d8);
   double p570 = GetProfitFromDateInCurrency("", -1, mag_07, d8);
   double p580 = GetProfitFromDateInCurrency("", -1, mag_08, d8);

   double r511 = p510*100/(tb-p8);
   double r521 = p520*100/(tb-p8);
   double r531 = p530*100/(tb-p8);
   double r541 = p540*100/(tb-p8);
   double r551 = p550*100/(tb-p8);
   double r561 = p560*100/(tb-p8);
   double r571 = p570*100/(tb-p8);
   double r581 = p580*100/(tb-p8);

//==== подготовка к прорисовке объектов ====
   if(mag_01>0)
      {
      string s_701   = "Magic # " + DoubleToStr(mag_01, 0) + " [" + OpenMagic(mag_01) + "]";
      string s_110   = DoubleToStr(p110, 1);
      string s_111   = "(" + DoubleToStr(r111, 1) + "%)";
      string s_210   = DoubleToStr(p210, 1);
      string s_211   = "(" + DoubleToStr(r211, 1) + "%)";
      string s_310   = DoubleToStr(p310, 1);
      string s_311   = "(" + DoubleToStr(r311, 1) + "%)";
      string s_410   = DoubleToStr(p410, 1);
      string s_411   = "(" + DoubleToStr(r411, 1) + "%)";
      string s_510   = DoubleToStr(p510, 1);
      string s_511   = "(" + DoubleToStr(r511, 1) + "%)";
      }
      else
         {
         s_701   = "";
         s_110   = "";
         s_111   = "";
         s_210   = "";
         s_211   = "";
         s_310   = "";
         s_311   = "";
         s_410   = "";
         s_411   = "";
         s_510   = "";
         s_511   = "";
         }
   if(mag_02>0)
      {
      string s_702   = "Magic # " + DoubleToStr(mag_02, 0) + " [" + OpenMagic(mag_02) + "]";
      string s_120   = DoubleToStr(p120, 1);
      string s_121   = "(" + DoubleToStr(r121, 1) + "%)";
      string s_220   = DoubleToStr(p220, 1);
      string s_221   = "(" + DoubleToStr(r221, 1) + "%)";
      string s_320   = DoubleToStr(p320, 1);
      string s_321   = "(" + DoubleToStr(r321, 1) + "%)";
      string s_420   = DoubleToStr(p420, 1);
      string s_421   = "(" + DoubleToStr(r421, 1) + "%)";
      string s_520   = DoubleToStr(p520, 1);
      string s_521   = "(" + DoubleToStr(r521, 1) + "%)";
      }
      else
         {
         s_702   = "";
         s_120   = "";
         s_121   = "";
         s_220   = "";
         s_221   = "";
         s_320   = "";
         s_321   = "";
         s_420   = "";
         s_421   = "";
         s_520   = "";
         s_521   = "";
         }
   if(mag_03>0)
      {
      string s_703   = "Magic # " + DoubleToStr(mag_03, 0) + " [" + OpenMagic(mag_03) + "]";
      string s_130   = DoubleToStr(p130, 1);
      string s_131   = "(" + DoubleToStr(r131, 1) + "%)";
      string s_230   = DoubleToStr(p230, 1);
      string s_231   = "(" + DoubleToStr(r231, 1) + "%)";
      string s_330   = DoubleToStr(p330, 1);
      string s_331   = "(" + DoubleToStr(r331, 1) + "%)";
      string s_430   = DoubleToStr(p430, 1);
      string s_431   = "(" + DoubleToStr(r431, 1) + "%)";
      string s_530   = DoubleToStr(p530, 1);
      string s_531   = "(" + DoubleToStr(r531, 1) + "%)";
      }
      else
         {
         s_703   = "";
         s_130   = "";
         s_131   = "";
         s_230   = "";
         s_231   = "";
         s_330   = "";
         s_331   = "";
         s_430   = "";
         s_431   = "";
         s_530   = "";
         s_531   = "";
         }
   if(mag_04>0)
      {
      string s_704   = "Magic # " + DoubleToStr(mag_04, 0) + " [" + OpenMagic(mag_04) + "]";
      string s_140   = DoubleToStr(p140, 1);
      string s_141   = "(" + DoubleToStr(r141, 1) + "%)";
      string s_240   = DoubleToStr(p240, 1);
      string s_241   = "(" + DoubleToStr(r241, 1) + "%)";
      string s_340   = DoubleToStr(p340, 1);
      string s_341   = "(" + DoubleToStr(r341, 1) + "%)";
      string s_440   = DoubleToStr(p440, 1);
      string s_441   = "(" + DoubleToStr(r441, 1) + "%)";
      string s_540   = DoubleToStr(p540, 1);
      string s_541   = "(" + DoubleToStr(r541, 1) + "%)";
      }
      else
         {
         s_704   = "";
         s_140   = "";
         s_141   = "";
         s_240   = "";
         s_241   = "";
         s_340   = "";
         s_341   = "";
         s_440   = "";
         s_441   = "";
         s_540   = "";
         s_541   = "";
         }
   if(mag_05>0)
      {
      string s_705   = "Magic # " + DoubleToStr(mag_05, 0) + " [" + OpenMagic(mag_05) + "]";
      string s_150   = DoubleToStr(p150, 1);
      string s_151   = "(" + DoubleToStr(r151, 1) + "%)";
      string s_250   = DoubleToStr(p250, 1);
      string s_251   = "(" + DoubleToStr(r251, 1) + "%)";
      string s_350   = DoubleToStr(p350, 1);
      string s_351   = "(" + DoubleToStr(r351, 1) + "%)";
      string s_450   = DoubleToStr(p450, 1);
      string s_451   = "(" + DoubleToStr(r451, 1) + "%)";
      string s_550   = DoubleToStr(p550, 1);
      string s_551   = "(" + DoubleToStr(r551, 1) + "%)";
      }
      else
         {
         s_705   = "";
         s_150   = "";
         s_151   = "";
         s_250   = "";
         s_251   = "";
         s_350   = "";
         s_351   = "";
         s_450   = "";
         s_451   = "";
         s_550   = "";
         s_551   = "";
         }
   if(mag_06>0)
      {
      string s_706   = "Magic # " + DoubleToStr(mag_06, 0) + " [" + OpenMagic(mag_06) + "]";
      string s_160   = DoubleToStr(p160, 1);
      string s_161   = "(" + DoubleToStr(r161, 1) + "%)";
      string s_260   = DoubleToStr(p260, 1);
      string s_261   = "(" + DoubleToStr(r261, 1) + "%)";
      string s_360   = DoubleToStr(p360, 1);
      string s_361   = "(" + DoubleToStr(r361, 1) + "%)";
      string s_460   = DoubleToStr(p460, 1);
      string s_461   = "(" + DoubleToStr(r461, 1) + "%)";
      string s_560   = DoubleToStr(p560, 1);
      string s_561   = "(" + DoubleToStr(r561, 1) + "%)";
      }
      else
         {
         s_706   = "";
         s_160   = "";
         s_161   = "";
         s_260   = "";
         s_261   = "";
         s_360   = "";
         s_361   = "";
         s_460   = "";
         s_461   = "";
         s_560   = "";
         s_561   = "";
         }
   if(mag_07>0)
      {
      string s_707   = "Magic # " + DoubleToStr(mag_07, 0) + " [" + OpenMagic(mag_07) + "]";
      string s_170   = DoubleToStr(p170, 1);
      string s_171   = "(" + DoubleToStr(r171, 1) + "%)";
      string s_270   = DoubleToStr(p270, 1);
      string s_271   = "(" + DoubleToStr(r271, 1) + "%)";
      string s_370   = DoubleToStr(p370, 1);
      string s_371   = "(" + DoubleToStr(r371, 1) + "%)";
      string s_470   = DoubleToStr(p470, 1);
      string s_471   = "(" + DoubleToStr(r471, 1) + "%)";
      string s_570   = DoubleToStr(p570, 1);
      string s_571   = "(" + DoubleToStr(r571, 1) + "%)";
      }
      else
         {
         s_707   = "";
         s_170   = "";
         s_171   = "";
         s_270   = "";
         s_271   = "";
         s_370   = "";
         s_371   = "";
         s_470   = "";
         s_471   = "";
         s_570   = "";
         s_571   = "";
         }
   if(mag_08>0)
      {
      string s_708   = "Magic # " + DoubleToStr(mag_08, 0) + " [" + OpenMagic(mag_08) + "]";
      string s_180   = DoubleToStr(p180, 1);
      string s_181   = "(" + DoubleToStr(r181, 1) + "%)";
      string s_280   = DoubleToStr(p280, 1);
      string s_281   = "(" + DoubleToStr(r281, 1) + "%)";
      string s_380   = DoubleToStr(p380, 1);
      string s_381   = "(" + DoubleToStr(r381, 1) + "%)";
      string s_480   = DoubleToStr(p480, 1);
      string s_481   = "(" + DoubleToStr(r481, 1) + "%)";
      string s_580   = DoubleToStr(p580, 1);
      string s_581   = "(" + DoubleToStr(r581, 1) + "%)";
      }
      else
         {
         s_708   = "";
         s_180   = "";
         s_181   = "";
         s_280   = "";
         s_281   = "";
         s_380   = "";
         s_381   = "";
         s_480   = "";
         s_481   = "";
         s_580   = "";
         s_581   = "";
         }

//==== прорисовка надписей ====
   ObjectCreate   ("i-G_100", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_100", "Текущая прибыль :", FontSize, FontName, Color1);
   ObjectSet      ("i-G_100", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_100", OBJPROP_XDISTANCE, X01);
   ObjectSet      ("i-G_100", OBJPROP_YDISTANCE, Y01);
//--------------------------
   ObjectCreate   ("i-G_200", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_200", "Прибыль за сегодня :", FontSize, FontName, Color1);
   ObjectSet      ("i-G_200", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_200", OBJPROP_XDISTANCE, X01);
   ObjectSet      ("i-G_200", OBJPROP_YDISTANCE, Y01+StepY);
//--------------------------
   ObjectCreate   ("i-G_300", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_300", "С начала недели :", FontSize, FontName, Color1);
   ObjectSet      ("i-G_300", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_300", OBJPROP_XDISTANCE, X01);
   ObjectSet      ("i-G_300", OBJPROP_YDISTANCE, Y01+2*StepY);
//--------------------------
   ObjectCreate   ("i-G_400", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_400", "С начала месяца :", FontSize, FontName, Color1);
   ObjectSet      ("i-G_400", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_400", OBJPROP_XDISTANCE, X01);
   ObjectSet      ("i-G_400", OBJPROP_YDISTANCE, Y01+3*StepY);
//--------------------------
   ObjectCreate   ("i-G_500", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_500", "С начала года :", FontSize, FontName, Color1);
   ObjectSet      ("i-G_500", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_500", OBJPROP_XDISTANCE, X01);
   ObjectSet      ("i-G_500", OBJPROP_YDISTANCE, Y01+4*StepY);

//==== прорисовка магиков ====
   ObjectCreate   ("i-G_701", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_701", s_701, FontSize, FontName, ColorOnOrders(OpenMagic(mag_01)));
   ObjectSet      ("i-G_701", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_701", OBJPROP_XDISTANCE, X02);
   ObjectSet      ("i-G_701", OBJPROP_YDISTANCE, Y01-StepY);
//--------------------------
   ObjectCreate   ("i-G_702", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_702", s_702, FontSize, FontName, ColorOnOrders(OpenMagic(mag_02)));
   ObjectSet      ("i-G_702", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_702", OBJPROP_XDISTANCE, X02+SX2);
   ObjectSet      ("i-G_702", OBJPROP_YDISTANCE, Y01-StepY);
//--------------------------
   ObjectCreate   ("i-G_703", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_703", s_703, FontSize, FontName, ColorOnOrders(OpenMagic(mag_03)));
   ObjectSet      ("i-G_703", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_703", OBJPROP_XDISTANCE, X02+2*SX2);
   ObjectSet      ("i-G_703", OBJPROP_YDISTANCE, Y01-StepY);
//--------------------------
   ObjectCreate   ("i-G_704", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_704", s_704, FontSize, FontName, ColorOnOrders(OpenMagic(mag_04)));
   ObjectSet      ("i-G_704", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_704", OBJPROP_XDISTANCE, X02+3*SX2);
   ObjectSet      ("i-G_704", OBJPROP_YDISTANCE, Y01-StepY);
//--------------------------
   ObjectCreate   ("i-G_705", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_705", s_705, FontSize, FontName, ColorOnOrders(OpenMagic(mag_05)));
   ObjectSet      ("i-G_705", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_705", OBJPROP_XDISTANCE, X02+4*SX2);
   ObjectSet      ("i-G_705", OBJPROP_YDISTANCE, Y01-StepY);
//--------------------------
   ObjectCreate   ("i-G_706", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_706", s_706, FontSize, FontName, ColorOnOrders(OpenMagic(mag_06)));
   ObjectSet      ("i-G_706", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_706", OBJPROP_XDISTANCE, X02+5*SX2);
   ObjectSet      ("i-G_706", OBJPROP_YDISTANCE, Y01-StepY);
//--------------------------
   ObjectCreate   ("i-G_707", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_707", s_707, FontSize, FontName, ColorOnOrders(OpenMagic(mag_07)));
   ObjectSet      ("i-G_707", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_707", OBJPROP_XDISTANCE, X02+6*SX2);
   ObjectSet      ("i-G_707", OBJPROP_YDISTANCE, Y01-StepY);
//--------------------------
   ObjectCreate   ("i-G_708", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_708", s_708, FontSize, FontName, ColorOnOrders(OpenMagic(mag_08)));
   ObjectSet      ("i-G_708", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_708", OBJPROP_XDISTANCE, X02+7*SX2);
   ObjectSet      ("i-G_708", OBJPROP_YDISTANCE, Y01-StepY);

//==== прорисовка значений по mag_01 ====
//---текущая прибыль---
   ObjectCreate   ("i-G_110", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_110", s_110, FontSize, FontName, ColorOnSign(p110));
   ObjectSet      ("i-G_110", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_110", OBJPROP_XDISTANCE, X02);
   ObjectSet      ("i-G_110", OBJPROP_YDISTANCE, Y01);
//--------------------------
   ObjectCreate   ("i-G_111", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_111", s_111, FontSize, FontName, ColorOnSign(p110));
   ObjectSet      ("i-G_111", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_111", OBJPROP_XDISTANCE, X02+CX7);
   ObjectSet      ("i-G_111", OBJPROP_YDISTANCE, Y01);
//---прибыль за сегодня---
   ObjectCreate   ("i-G_210", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_210", s_210, FontSize, FontName, ColorOnSign(p210));
   ObjectSet      ("i-G_210", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_210", OBJPROP_XDISTANCE, X02);
   ObjectSet      ("i-G_210", OBJPROP_YDISTANCE, Y01+StepY);
//--------------------------
   ObjectCreate   ("i-G_211", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_211", s_211, FontSize, FontName, ColorOnSign(p210));
   ObjectSet      ("i-G_211", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_211", OBJPROP_XDISTANCE, X02+CX7);
   ObjectSet      ("i-G_211", OBJPROP_YDISTANCE, Y01+StepY);
//---прибыль с начала недели---
   ObjectCreate   ("i-G_310", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_310", s_310, FontSize, FontName, ColorOnSign(p310));
   ObjectSet      ("i-G_310", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_310", OBJPROP_XDISTANCE, X02);
   ObjectSet      ("i-G_310", OBJPROP_YDISTANCE, Y01+2*StepY);
//--------------------------
   ObjectCreate   ("i-G_311", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_311", s_311, FontSize, FontName, ColorOnSign(p310));
   ObjectSet      ("i-G_311", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_311", OBJPROP_XDISTANCE, X02+CX7);
   ObjectSet      ("i-G_311", OBJPROP_YDISTANCE, Y01+2*StepY);
//---прибыль с начала месяца---
   ObjectCreate   ("i-G_410", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_410", s_410, FontSize, FontName, ColorOnSign(p410));
   ObjectSet      ("i-G_410", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_410", OBJPROP_XDISTANCE, X02);
   ObjectSet      ("i-G_410", OBJPROP_YDISTANCE, Y01+3*StepY);
//--------------------------
   ObjectCreate   ("i-G_411", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_411", s_411, FontSize, FontName, ColorOnSign(p410));
   ObjectSet      ("i-G_411", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_411", OBJPROP_XDISTANCE, X02+CX7);
   ObjectSet      ("i-G_411", OBJPROP_YDISTANCE, Y01+3*StepY);
//---прибыль с начала года---
   ObjectCreate   ("i-G_510", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_510", s_510, FontSize, FontName, ColorOnSign(p510));
   ObjectSet      ("i-G_510", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_510", OBJPROP_XDISTANCE, X02);
   ObjectSet      ("i-G_510", OBJPROP_YDISTANCE, Y01+4*StepY);
//--------------------------
   ObjectCreate   ("i-G_511", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_511", s_511, FontSize, FontName, ColorOnSign(p510));
   ObjectSet      ("i-G_511", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_511", OBJPROP_XDISTANCE, X02+CX7);
   ObjectSet      ("i-G_511", OBJPROP_YDISTANCE, Y01+4*StepY);

//==== прорисовка значений по mag_02 ====
//---текущая прибыль---
   ObjectCreate   ("i-G_120", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_120", s_120, FontSize, FontName, ColorOnSign(p120));
   ObjectSet      ("i-G_120", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_120", OBJPROP_XDISTANCE, X02+SX2);
   ObjectSet      ("i-G_120", OBJPROP_YDISTANCE, Y01);
//--------------------------
   ObjectCreate   ("i-G_121", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_121", s_121, FontSize, FontName, ColorOnSign(p120));
   ObjectSet      ("i-G_121", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_121", OBJPROP_XDISTANCE, X02+SX2+CX7);
   ObjectSet      ("i-G_121", OBJPROP_YDISTANCE, Y01);
//---прибыль за сегодня---
   ObjectCreate   ("i-G_220", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_220", s_220, FontSize, FontName, ColorOnSign(p220));
   ObjectSet      ("i-G_220", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_220", OBJPROP_XDISTANCE, X02+SX2);
   ObjectSet      ("i-G_220", OBJPROP_YDISTANCE, Y01+StepY);
//--------------------------
   ObjectCreate   ("i-G_221", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_221", s_221, FontSize, FontName, ColorOnSign(p220));
   ObjectSet      ("i-G_221", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_221", OBJPROP_XDISTANCE, X02+SX2+CX7);
   ObjectSet      ("i-G_221", OBJPROP_YDISTANCE, Y01+StepY);
//---прибыль с начала недели---
   ObjectCreate   ("i-G_320", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_320", s_320, FontSize, FontName, ColorOnSign(p320));
   ObjectSet      ("i-G_320", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_320", OBJPROP_XDISTANCE, X02+SX2);
   ObjectSet      ("i-G_320", OBJPROP_YDISTANCE, Y01+2*StepY);
//--------------------------
   ObjectCreate   ("i-G_321", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_321", s_321, FontSize, FontName, ColorOnSign(p320));
   ObjectSet      ("i-G_321", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_321", OBJPROP_XDISTANCE, X02+SX2+CX7);
   ObjectSet      ("i-G_321", OBJPROP_YDISTANCE, Y01+2*StepY);
//---прибыль с начала месяца---
   ObjectCreate   ("i-G_420", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_420", s_420, FontSize, FontName, ColorOnSign(p420));
   ObjectSet      ("i-G_420", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_420", OBJPROP_XDISTANCE, X02+SX2);
   ObjectSet      ("i-G_420", OBJPROP_YDISTANCE, Y01+3*StepY);
//--------------------------
   ObjectCreate   ("i-G_421", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_421", s_421, FontSize, FontName, ColorOnSign(p420));
   ObjectSet      ("i-G_421", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_421", OBJPROP_XDISTANCE, X02+SX2+CX7);
   ObjectSet      ("i-G_421", OBJPROP_YDISTANCE, Y01+3*StepY);
//---прибыль с начала года---
   ObjectCreate   ("i-G_520", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_520", s_520, FontSize, FontName, ColorOnSign(p520));
   ObjectSet      ("i-G_520", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_520", OBJPROP_XDISTANCE, X02+SX2);
   ObjectSet      ("i-G_520", OBJPROP_YDISTANCE, Y01+4*StepY);
//--------------------------
   ObjectCreate   ("i-G_521", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_521", s_521, FontSize, FontName, ColorOnSign(p520));
   ObjectSet      ("i-G_521", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_521", OBJPROP_XDISTANCE, X02+SX2+CX7);
   ObjectSet      ("i-G_521", OBJPROP_YDISTANCE, Y01+4*StepY);

//==== прорисовка значений по mag_03 ====
//---текущая прибыль---
   ObjectCreate   ("i-G_130", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_130", s_130, FontSize, FontName, ColorOnSign(p130));
   ObjectSet      ("i-G_130", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_130", OBJPROP_XDISTANCE, X02+2*SX2);
   ObjectSet      ("i-G_130", OBJPROP_YDISTANCE, Y01);
//--------------------------
   ObjectCreate   ("i-G_131", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_131", s_131, FontSize, FontName, ColorOnSign(p130));
   ObjectSet      ("i-G_131", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_131", OBJPROP_XDISTANCE, X02+2*SX2+CX7);
   ObjectSet      ("i-G_131", OBJPROP_YDISTANCE, Y01);
//---прибыль за сегодня---
   ObjectCreate   ("i-G_230", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_230", s_230, FontSize, FontName, ColorOnSign(p230));
   ObjectSet      ("i-G_230", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_230", OBJPROP_XDISTANCE, X02+2*SX2);
   ObjectSet      ("i-G_230", OBJPROP_YDISTANCE, Y01+StepY);
//--------------------------
   ObjectCreate   ("i-G_231", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_231", s_231, FontSize, FontName, ColorOnSign(p230));
   ObjectSet      ("i-G_231", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_231", OBJPROP_XDISTANCE, X02+2*SX2+CX7);
   ObjectSet      ("i-G_231", OBJPROP_YDISTANCE, Y01+StepY);
//---прибыль с начала недели---
   ObjectCreate   ("i-G_330", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_330", s_330, FontSize, FontName, ColorOnSign(p330));
   ObjectSet      ("i-G_330", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_330", OBJPROP_XDISTANCE, X02+2*SX2);
   ObjectSet      ("i-G_330", OBJPROP_YDISTANCE, Y01+2*StepY);
//--------------------------
   ObjectCreate   ("i-G_331", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_331", s_331, FontSize, FontName, ColorOnSign(p330));
   ObjectSet      ("i-G_331", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_331", OBJPROP_XDISTANCE, X02+2*SX2+CX7);
   ObjectSet      ("i-G_331", OBJPROP_YDISTANCE, Y01+2*StepY);
//---прибыль с начала месяца---
   ObjectCreate   ("i-G_430", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_430", s_430, FontSize, FontName, ColorOnSign(p430));
   ObjectSet      ("i-G_430", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_430", OBJPROP_XDISTANCE, X02+2*SX2);
   ObjectSet      ("i-G_430", OBJPROP_YDISTANCE, Y01+3*StepY);
//--------------------------
   ObjectCreate   ("i-G_431", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_431", s_431, FontSize, FontName, ColorOnSign(p430));
   ObjectSet      ("i-G_431", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_431", OBJPROP_XDISTANCE, X02+2*SX2+CX7);
   ObjectSet      ("i-G_431", OBJPROP_YDISTANCE, Y01+3*StepY);
//---прибыль с начала года---
   ObjectCreate   ("i-G_530", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_530", s_530, FontSize, FontName, ColorOnSign(p530));
   ObjectSet      ("i-G_530", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_530", OBJPROP_XDISTANCE, X02+2*SX2);
   ObjectSet      ("i-G_530", OBJPROP_YDISTANCE, Y01+4*StepY);
//--------------------------
   ObjectCreate   ("i-G_531", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_531", s_531, FontSize, FontName, ColorOnSign(p530));
   ObjectSet      ("i-G_531", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_531", OBJPROP_XDISTANCE, X02+2*SX2+CX7);
   ObjectSet      ("i-G_531", OBJPROP_YDISTANCE, Y01+4*StepY);

//==== прорисовка значений по mag_04 ====
//---текущая прибыль---
   ObjectCreate   ("i-G_140", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_140", s_140, FontSize, FontName, ColorOnSign(p140));
   ObjectSet      ("i-G_140", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_140", OBJPROP_XDISTANCE, X02+3*SX2);
   ObjectSet      ("i-G_140", OBJPROP_YDISTANCE, Y01);
//--------------------------
   ObjectCreate   ("i-G_141", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_141", s_141, FontSize, FontName, ColorOnSign(p140));
   ObjectSet      ("i-G_141", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_141", OBJPROP_XDISTANCE, X02+3*SX2+CX7);
   ObjectSet      ("i-G_141", OBJPROP_YDISTANCE, Y01);
//---прибыль за сегодня---
   ObjectCreate   ("i-G_240", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_240", s_240, FontSize, FontName, ColorOnSign(p240));
   ObjectSet      ("i-G_240", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_240", OBJPROP_XDISTANCE, X02+3*SX2);
   ObjectSet      ("i-G_240", OBJPROP_YDISTANCE, Y01+StepY);
//--------------------------
   ObjectCreate   ("i-G_241", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_241", s_241, FontSize, FontName, ColorOnSign(p240));
   ObjectSet      ("i-G_241", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_241", OBJPROP_XDISTANCE, X02+3*SX2+CX7);
   ObjectSet      ("i-G_241", OBJPROP_YDISTANCE, Y01+StepY);
//---прибыль с начала недели---
   ObjectCreate   ("i-G_340", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_340", s_340, FontSize, FontName, ColorOnSign(p340));
   ObjectSet      ("i-G_340", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_340", OBJPROP_XDISTANCE, X02+3*SX2);
   ObjectSet      ("i-G_340", OBJPROP_YDISTANCE, Y01+2*StepY);
//--------------------------
   ObjectCreate   ("i-G_341", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_341", s_341, FontSize, FontName, ColorOnSign(p340));
   ObjectSet      ("i-G_341", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_341", OBJPROP_XDISTANCE, X02+3*SX2+CX7);
   ObjectSet      ("i-G_341", OBJPROP_YDISTANCE, Y01+2*StepY);
//---прибыль с начала месяца---
   ObjectCreate   ("i-G_440", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_440", s_440, FontSize, FontName, ColorOnSign(p440));
   ObjectSet      ("i-G_440", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_440", OBJPROP_XDISTANCE, X02+3*SX2);
   ObjectSet      ("i-G_440", OBJPROP_YDISTANCE, Y01+3*StepY);
//--------------------------
   ObjectCreate   ("i-G_441", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_441", s_441, FontSize, FontName, ColorOnSign(p440));
   ObjectSet      ("i-G_441", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_441", OBJPROP_XDISTANCE, X02+3*SX2+CX7);
   ObjectSet      ("i-G_441", OBJPROP_YDISTANCE, Y01+3*StepY);
//---прибыль с начала года---
   ObjectCreate   ("i-G_540", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_540", s_540, FontSize, FontName, ColorOnSign(p540));
   ObjectSet      ("i-G_540", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_540", OBJPROP_XDISTANCE, X02+3*SX2);
   ObjectSet      ("i-G_540", OBJPROP_YDISTANCE, Y01+4*StepY);
//--------------------------
   ObjectCreate   ("i-G_541", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_541", s_541, FontSize, FontName, ColorOnSign(p540));
   ObjectSet      ("i-G_541", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_541", OBJPROP_XDISTANCE, X02+3*SX2+CX7);
   ObjectSet      ("i-G_541", OBJPROP_YDISTANCE, Y01+4*StepY);

//==== прорисовка значений по mag_05 ====
//---текущая прибыль---
   ObjectCreate   ("i-G_150", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_150", s_150, FontSize, FontName, ColorOnSign(p150));
   ObjectSet      ("i-G_150", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_150", OBJPROP_XDISTANCE, X02+4*SX2);
   ObjectSet      ("i-G_150", OBJPROP_YDISTANCE, Y01);
//--------------------------
   ObjectCreate   ("i-G_151", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_151", s_151, FontSize, FontName, ColorOnSign(p150));
   ObjectSet      ("i-G_151", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_151", OBJPROP_XDISTANCE, X02+4*SX2+CX7);
   ObjectSet      ("i-G_151", OBJPROP_YDISTANCE, Y01);
//---прибыль за сегодня---
   ObjectCreate   ("i-G_250", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_250", s_250, FontSize, FontName, ColorOnSign(p250));
   ObjectSet      ("i-G_250", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_250", OBJPROP_XDISTANCE, X02+4*SX2);
   ObjectSet      ("i-G_250", OBJPROP_YDISTANCE, Y01+StepY);
//--------------------------
   ObjectCreate   ("i-G_251", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_251", s_251, FontSize, FontName, ColorOnSign(p250));
   ObjectSet      ("i-G_251", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_251", OBJPROP_XDISTANCE, X02+4*SX2+CX7);
   ObjectSet      ("i-G_251", OBJPROP_YDISTANCE, Y01+StepY);
//---прибыль с начала недели---
   ObjectCreate   ("i-G_350", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_350", s_350, FontSize, FontName, ColorOnSign(p350));
   ObjectSet      ("i-G_350", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_350", OBJPROP_XDISTANCE, X02+4*SX2);
   ObjectSet      ("i-G_350", OBJPROP_YDISTANCE, Y01+2*StepY);
//--------------------------
   ObjectCreate   ("i-G_351", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_351", s_351, FontSize, FontName, ColorOnSign(p350));
   ObjectSet      ("i-G_351", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_351", OBJPROP_XDISTANCE, X02+4*SX2+CX7);
   ObjectSet      ("i-G_351", OBJPROP_YDISTANCE, Y01+2*StepY);
//---прибыль с начала месяца---
   ObjectCreate   ("i-G_450", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_450", s_450, FontSize, FontName, ColorOnSign(p450));
   ObjectSet      ("i-G_450", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_450", OBJPROP_XDISTANCE, X02+4*SX2);
   ObjectSet      ("i-G_450", OBJPROP_YDISTANCE, Y01+3*StepY);
//--------------------------
   ObjectCreate   ("i-G_451", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_451", s_451, FontSize, FontName, ColorOnSign(p450));
   ObjectSet      ("i-G_451", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_451", OBJPROP_XDISTANCE, X02+4*SX2+CX7);
   ObjectSet      ("i-G_451", OBJPROP_YDISTANCE, Y01+3*StepY);
//---прибыль с начала года---
   ObjectCreate   ("i-G_550", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_550", s_550, FontSize, FontName, ColorOnSign(p550));
   ObjectSet      ("i-G_550", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_550", OBJPROP_XDISTANCE, X02+4*SX2);
   ObjectSet      ("i-G_550", OBJPROP_YDISTANCE, Y01+4*StepY);
//--------------------------
   ObjectCreate   ("i-G_551", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_551", s_551, FontSize, FontName, ColorOnSign(p550));
   ObjectSet      ("i-G_551", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_551", OBJPROP_XDISTANCE, X02+4*SX2+CX7);
   ObjectSet      ("i-G_551", OBJPROP_YDISTANCE, Y01+4*StepY);

//==== прорисовка значений по mag_06 ====
//---текущая прибыль---
   ObjectCreate   ("i-G_160", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_160", s_160, FontSize, FontName, ColorOnSign(p160));
   ObjectSet      ("i-G_160", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_160", OBJPROP_XDISTANCE, X02+5*SX2);
   ObjectSet      ("i-G_160", OBJPROP_YDISTANCE, Y01);
//--------------------------
   ObjectCreate   ("i-G_161", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_161", s_161, FontSize, FontName, ColorOnSign(p160));
   ObjectSet      ("i-G_161", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_161", OBJPROP_XDISTANCE, X02+5*SX2+CX7);
   ObjectSet      ("i-G_161", OBJPROP_YDISTANCE, Y01);
//---прибыль за сегодня---
   ObjectCreate   ("i-G_260", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_260", s_260, FontSize, FontName, ColorOnSign(p260));
   ObjectSet      ("i-G_260", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_260", OBJPROP_XDISTANCE, X02+5*SX2);
   ObjectSet      ("i-G_260", OBJPROP_YDISTANCE, Y01+StepY);
//--------------------------
   ObjectCreate   ("i-G_261", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_261", s_261, FontSize, FontName, ColorOnSign(p260));
   ObjectSet      ("i-G_261", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_261", OBJPROP_XDISTANCE, X02+5*SX2+CX7);
   ObjectSet      ("i-G_261", OBJPROP_YDISTANCE, Y01+StepY);
//---прибыль с начала недели---
   ObjectCreate   ("i-G_360", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_360", s_360, FontSize, FontName, ColorOnSign(p360));
   ObjectSet      ("i-G_360", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_360", OBJPROP_XDISTANCE, X02+5*SX2);
   ObjectSet      ("i-G_360", OBJPROP_YDISTANCE, Y01+2*StepY);
//--------------------------
   ObjectCreate   ("i-G_361", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_361", s_361, FontSize, FontName, ColorOnSign(p360));
   ObjectSet      ("i-G_361", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_361", OBJPROP_XDISTANCE, X02+5*SX2+CX7);
   ObjectSet      ("i-G_361", OBJPROP_YDISTANCE, Y01+2*StepY);
//---прибыль с начала месяца---
   ObjectCreate   ("i-G_460", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_460", s_460, FontSize, FontName, ColorOnSign(p460));
   ObjectSet      ("i-G_460", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_460", OBJPROP_XDISTANCE, X02+5*SX2);
   ObjectSet      ("i-G_460", OBJPROP_YDISTANCE, Y01+3*StepY);
//--------------------------
   ObjectCreate   ("i-G_461", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_461", s_461, FontSize, FontName, ColorOnSign(p460));
   ObjectSet      ("i-G_461", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_461", OBJPROP_XDISTANCE, X02+5*SX2+CX7);
   ObjectSet      ("i-G_461", OBJPROP_YDISTANCE, Y01+3*StepY);
//---прибыль с начала года---
   ObjectCreate   ("i-G_560", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_560", s_560, FontSize, FontName, ColorOnSign(p560));
   ObjectSet      ("i-G_560", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_560", OBJPROP_XDISTANCE, X02+5*SX2);
   ObjectSet      ("i-G_560", OBJPROP_YDISTANCE, Y01+4*StepY);
//--------------------------
   ObjectCreate   ("i-G_561", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_561", s_561, FontSize, FontName, ColorOnSign(p560));
   ObjectSet      ("i-G_561", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_561", OBJPROP_XDISTANCE, X02+5*SX2+CX7);
   ObjectSet      ("i-G_561", OBJPROP_YDISTANCE, Y01+4*StepY);

//==== прорисовка значений по mag_07 ====
//---текущая прибыль---
   ObjectCreate   ("i-G_170", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_170", s_170, FontSize, FontName, ColorOnSign(p170));
   ObjectSet      ("i-G_170", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_170", OBJPROP_XDISTANCE, X02+6*SX2);
   ObjectSet      ("i-G_170", OBJPROP_YDISTANCE, Y01);
//--------------------------
   ObjectCreate   ("i-G_171", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_171", s_171, FontSize, FontName, ColorOnSign(p170));
   ObjectSet      ("i-G_171", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_171", OBJPROP_XDISTANCE, X02+6*SX2+CX7);
   ObjectSet      ("i-G_171", OBJPROP_YDISTANCE, Y01);
//---прибыль за сегодня---
   ObjectCreate   ("i-G_270", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_270", s_270, FontSize, FontName, ColorOnSign(p270));
   ObjectSet      ("i-G_270", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_270", OBJPROP_XDISTANCE, X02+6*SX2);
   ObjectSet      ("i-G_270", OBJPROP_YDISTANCE, Y01+StepY);
//--------------------------
   ObjectCreate   ("i-G_271", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_271", s_271, FontSize, FontName, ColorOnSign(p270));
   ObjectSet      ("i-G_271", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_271", OBJPROP_XDISTANCE, X02+6*SX2+CX7);
   ObjectSet      ("i-G_271", OBJPROP_YDISTANCE, Y01+StepY);
//---прибыль с начала недели---
   ObjectCreate   ("i-G_370", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_370", s_370, FontSize, FontName, ColorOnSign(p370));
   ObjectSet      ("i-G_370", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_370", OBJPROP_XDISTANCE, X02+6*SX2);
   ObjectSet      ("i-G_370", OBJPROP_YDISTANCE, Y01+2*StepY);
//--------------------------
   ObjectCreate   ("i-G_371", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_371", s_371, FontSize, FontName, ColorOnSign(p370));
   ObjectSet      ("i-G_371", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_371", OBJPROP_XDISTANCE, X02+6*SX2+CX7);
   ObjectSet      ("i-G_371", OBJPROP_YDISTANCE, Y01+2*StepY);
//---прибыль с начала месяца---
   ObjectCreate   ("i-G_470", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_470", s_470, FontSize, FontName, ColorOnSign(p470));
   ObjectSet      ("i-G_470", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_470", OBJPROP_XDISTANCE, X02+6*SX2);
   ObjectSet      ("i-G_470", OBJPROP_YDISTANCE, Y01+3*StepY);
//--------------------------
   ObjectCreate   ("i-G_471", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_471", s_471, FontSize, FontName, ColorOnSign(p470));
   ObjectSet      ("i-G_471", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_471", OBJPROP_XDISTANCE, X02+6*SX2+CX7);
   ObjectSet      ("i-G_471", OBJPROP_YDISTANCE, Y01+3*StepY);
//---прибыль с начала года---
   ObjectCreate   ("i-G_570", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_570", s_570, FontSize, FontName, ColorOnSign(p570));
   ObjectSet      ("i-G_570", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_570", OBJPROP_XDISTANCE, X02+6*SX2);
   ObjectSet      ("i-G_570", OBJPROP_YDISTANCE, Y01+4*StepY);
//--------------------------
   ObjectCreate   ("i-G_571", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_571", s_571, FontSize, FontName, ColorOnSign(p570));
   ObjectSet      ("i-G_571", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_571", OBJPROP_XDISTANCE, X02+6*SX2+CX7);
   ObjectSet      ("i-G_571", OBJPROP_YDISTANCE, Y01+4*StepY);

//==== прорисовка значений по mag_08 ====
//---текущая прибыль---
   ObjectCreate   ("i-G_180", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_180", s_180, FontSize, FontName, ColorOnSign(p180));
   ObjectSet      ("i-G_180", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_180", OBJPROP_XDISTANCE, X02+7*SX2);
   ObjectSet      ("i-G_180", OBJPROP_YDISTANCE, Y01);
//--------------------------
   ObjectCreate   ("i-G_181", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_181", s_181, FontSize, FontName, ColorOnSign(p180));
   ObjectSet      ("i-G_181", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_181", OBJPROP_XDISTANCE, X02+7*SX2+CX7);
   ObjectSet      ("i-G_181", OBJPROP_YDISTANCE, Y01);
//---прибыль за сегодня---
   ObjectCreate   ("i-G_280", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_280", s_280, FontSize, FontName, ColorOnSign(p280));
   ObjectSet      ("i-G_280", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_280", OBJPROP_XDISTANCE, X02+7*SX2);
   ObjectSet      ("i-G_280", OBJPROP_YDISTANCE, Y01+StepY);
//--------------------------
   ObjectCreate   ("i-G_281", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_281", s_281, FontSize, FontName, ColorOnSign(p280));
   ObjectSet      ("i-G_281", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_281", OBJPROP_XDISTANCE, X02+7*SX2+CX7);
   ObjectSet      ("i-G_281", OBJPROP_YDISTANCE, Y01+StepY);
//---прибыль с начала недели---
   ObjectCreate   ("i-G_380", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_380", s_380, FontSize, FontName, ColorOnSign(p380));
   ObjectSet      ("i-G_380", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_380", OBJPROP_XDISTANCE, X02+7*SX2);
   ObjectSet      ("i-G_380", OBJPROP_YDISTANCE, Y01+2*StepY);
//--------------------------
   ObjectCreate   ("i-G_381", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_381", s_381, FontSize, FontName, ColorOnSign(p380));
   ObjectSet      ("i-G_381", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_381", OBJPROP_XDISTANCE, X02+7*SX2+CX7);
   ObjectSet      ("i-G_381", OBJPROP_YDISTANCE, Y01+2*StepY);
//---прибыль с начала месяца---
   ObjectCreate   ("i-G_480", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_480", s_480, FontSize, FontName, ColorOnSign(p480));
   ObjectSet      ("i-G_480", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_480", OBJPROP_XDISTANCE, X02+7*SX2);
   ObjectSet      ("i-G_480", OBJPROP_YDISTANCE, Y01+3*StepY);
//--------------------------
   ObjectCreate   ("i-G_481", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_481", s_481, FontSize, FontName, ColorOnSign(p480));
   ObjectSet      ("i-G_481", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_481", OBJPROP_XDISTANCE, X02+7*SX2+CX7);
   ObjectSet      ("i-G_481", OBJPROP_YDISTANCE, Y01+3*StepY);
//---прибыль с начала года---
   ObjectCreate   ("i-G_580", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_580", s_580, FontSize, FontName, ColorOnSign(p580));
   ObjectSet      ("i-G_580", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_580", OBJPROP_XDISTANCE, X02+7*SX2);
   ObjectSet      ("i-G_580", OBJPROP_YDISTANCE, Y01+4*StepY);
//--------------------------
   ObjectCreate   ("i-G_581", OBJ_LABEL, WindowFind(ShortName), 0, 0);
   ObjectSetText  ("i-G_581", s_581, FontSize, FontName, ColorOnSign(p580));
   ObjectSet      ("i-G_581", OBJPROP_CORNER, 0);
   ObjectSet      ("i-G_581", OBJPROP_XDISTANCE, X02+7*SX2+CX7);
   ObjectSet      ("i-G_581", OBJPROP_YDISTANCE, Y01+4*StepY);

   }
//+----------------------------------------------------------------------------+
//|  Возвращает цвет по знаку числа                                            |
//+----------------------------------------------------------------------------+
color ColorOnSign(double nu) {
  color lcColor=Color1;

  if (nu>0) lcColor=Color2;
  if (nu<0) lcColor=Color3;

  return(lcColor);
}
//+----------------------------------------------------------------------------+
//|  Возвращает цвет по знаку числа                                            |
//+----------------------------------------------------------------------------+
color ColorOnOrders(int dor) {
  color lcColor=Color1;
  if (dor>0) lcColor=Color4;
  return(lcColor);
}
//+----------------------------------------------------------------------------+
//|  Автор    : Ким Игорь В. aka KimIV,  http://www.kimiv.ru                   |
//+----------------------------------------------------------------------------+
//|  Версия   : 12.05.2008                                                     |
//|  Описание : Возвращает дату понедельника                                   |
//+----------------------------------------------------------------------------+
//|  Параметры:                                                                |
//|                                    (-2 - позатой недели)                   |
//|                                    (-1 - прошлой недели)                   |
//|    no - номер понедельника         ( 0 - текущей недели)                   |
//|                                    ( 1 - следующий, ближайший будущий)     |
//|                                    ( 2 - последующий)                      |
//+----------------------------------------------------------------------------+
datetime DateOfMonday(int no=0) {
  datetime dt=StrToTime(TimeToStr(TimeCurrent(), TIME_DATE));

  while (TimeDayOfWeek(dt)!=1) dt-=24*60*60;
  dt+=no*7*24*60*60;

  return(dt);
}
//+----------------------------------------------------------------------------+
//|  Удаление объектов.                                                        |
//+----------------------------------------------------------------------------+
void DeleteObjects() {
  string st="iProfit";
  int    i, j;

  for (i=0; i<10; i++) {
    for (j=1; j<8; j++) ObjectDelete(st+i+j);
  }
}
//+----------------------------------------------------------------------------+
//|  Автор    : Ким Игорь В. aka KimIV,  http://www.kimiv.ru                   |
//+----------------------------------------------------------------------------+
//|  Версия   : 19.02.2008                                                     |
//|  Описание : Возвращает суммарный профит в валюте депозита                  |
//|             закрытых с определённой даты позиций                           |
//+----------------------------------------------------------------------------+
//|  Параметры:                                                                |
//|    sy - наименование инструмента             (""   - любой символ,         |
//|                                               NULL - текущий символ)       |
//|    op - операция                             (-1   - любая позиция)        |
//|    mn - MagicNumber                          (-1   - любой магик)          |
//|    dt - Дата и время в секундах с 1970 года  ( 0   - с начала истории)     |
//+----------------------------------------------------------------------------+
double GetProfitFromDateInCurrency(string sy="", int op=-1, int mn=-1, datetime dt=0)
{
  double p=0;
  int    i, k=OrdersHistoryTotal();

  if (sy=="0") sy=Symbol();
  for (i=0; i<k; i++) {
    if (OrderSelect(i, SELECT_BY_POS, MODE_HISTORY)) {
      if ((OrderSymbol()==sy || sy=="") && (op<0 || OrderType()==op)) {
        if (OrderType()==OP_BUY || OrderType()==OP_SELL) {
          if (mn<0 || OrderMagicNumber()==mn) {
            if (dt<OrderCloseTime()) {
              p+=OrderProfit()+OrderCommission()+OrderSwap();
            }
          }
        }
      }
    }
  }
  return(p);
}
//+----------------------------------------------------------------------------+
//|  Описание : Возвращает суммарный профит открытых позиций в валюте депозита |
//+----------------------------------------------------------------------------+
//|  Параметры:                                                                |
//|    sy - наименование инструмента             (""   - любой символ,         |
//|                                               NULL - текущий символ)       |
//|    op - операция                             (-1   - любая позиция)        |
//|    mn - MagicNumber                          (-1   - любой магик)          |
//+----------------------------------------------------------------------------+
double GetCurrentProfitInCurrency(string sy="", int op=-1, int mn=-1)
{
  double p=0;
  int    i, k=OrdersTotal();

  if (sy=="0") sy=Symbol();
  for (i=0; i<k; i++) {
    if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
      if ((OrderSymbol()==sy || sy=="") && (op<0 || OrderType()==op)) {
        if (OrderType()==OP_BUY || OrderType()==OP_SELL) {
          if (mn<0 || OrderMagicNumber()==mn) {
            p+=OrderProfit()+OrderCommission()+OrderSwap();
          }
        }
      }
    }
  }
  return(p);
}
//+----------------------------------------------------------------------------+
//|  Функция вычисления количества открытых ордеров с указанным магическим     |
//|  номером по текущему инструменту                                           |
//+----------------------------------------------------------------------------+
//|  Параметры:                                                                |
//|    mag - магический номер открытого ордера                                 |
//+----------------------------------------------------------------------------+
int OpenMagic(int mag=0)
{
   int cP=0;
   if(OrdersTotal()>0)
      {
      for(int i=0; i<OrdersTotal(); i++)
         {
         if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
            {
            if(mag>0 && OrderSymbol()==Symbol())
               {
               if(OrderMagicNumber()==mag)    cP++;
               }
            }
         }
      }
   return(cP);
}
//+----------------------------------------------------------------------------+