Navigation´╝ÜHome > Content >

THV4_TzPivotsMW_(Black).mq4

Time: 2015-01-13 | Download file:THV4_TzPivotsMW_(Black).mq4

#property copyright "Domas4 and Traderathome - public domain code"
#property link      "n/a"

#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 CLR_NONE

extern bool Indicator_On = TRUE;
extern string Part_1 = "Enter numbers to shift Tz:";
extern int HrsServerTzFromGMT = 0;
extern int HrsChoiceTzFromGMT = 0;
extern string Part_2 = "Select Pivot(s) & Formula(s):";
extern bool ShowMonthlyPivots = TRUE;
extern bool M_use_Day_formula = TRUE;
extern bool ShowWeeklyPivots = TRUE;
extern bool W_use_Day_formula = TRUE;
extern string Part_3 = "Line Selection & Color Settings:";
extern color MainPivot_Color = C'0x1B,0x3F,0xAB';
extern color Pivot_Resistances_Color = Maroon;
extern color Pivot_Supports_Color = DarkGreen;
extern color MidPivots_Color = C'0x55,0x55,0x00';
extern bool Show_Monthly_MidPivots = TRUE;
extern bool Show_Weekly_MidPivots = TRUE;
extern string Part_4 = "Settings for Lines";
extern string Section4A = "Lines Prior to Today, and FullScreen:";
extern int Pivots_LineStyle_01234 = 0;
extern int Pivots_SolidLine_Thickness = 1;
extern string Section4B = "Lines in Today Zone Only:";
extern int LineStyle_Today_01234 = 2;
extern int SolidLine_Thickness_Today = 1;
extern string Section4C = "Additional Line Settings:";
extern bool Apply_FullScreen_Lines = FALSE;
extern bool Stop_lines_At_Current_Candle = FALSE;
extern string Part_6 = "Settings for Labels:";
extern color Pivotlabels_Color = DarkGray;
extern int Pivotlabels_Fontstyle_123 = 2;
extern int Pivotlabels_Fontsize_8_to_12 = 9;
extern bool Show_Price_in_Pivotlabels = FALSE;
extern string Note1 = "Right margin prices only work";
extern string Note2 = "when lines appear full screen wide.";
extern bool Show_RightMargin_Prices = TRUE;
extern int Shift_Pivotlabels_PerCent_Left = 100;
int Gi_unused_256;
int G_timeframe_260;
int Gi_264;
int Gi_268;
int G_datetime_272;
double Gd_276;
double Gd_284;
double Gd_292;
double Gd_300;
double Gd_308;
double Gd_316;
double Gd_324;
double Gd_332;
double Gd_340;
double Gd_348;
double Gd_356;
double Gd_364;
double Gd_372;
double Gd_380;
double Gd_388;

int init() {
   if (Ask > 10.0) Gi_unused_256 = 2;
   else Gi_unused_256 = 4;
   return (0);
}

int deinit() {
   string name_8;
   int Li_0 = ObjectsTotal();
   for (int objs_total_4 = Li_0; objs_total_4 >= 0; objs_total_4--) {
      name_8 = ObjectName(objs_total_4);
      if (StringSubstr(name_8, 0, 11) == "[TzPivotsMW") ObjectDelete(name_8);
   }
   return (0);
}

int start() {
   int Li_8;
   string Ls_16;
   string Ls_unused_24;
   string Ls_unused_32;
   string Ls_unused_40;
   string Ls_48;
   string Ls_unused_56;
   string Ls_unused_64;
   string Ls_72;
   string Ls_unused_80;
   string Ls_unused_88;
   string Ls_96;
   string Ls_unused_104;
   string Ls_unused_112;
   string Ls_120;
   string Ls_unused_128;
   string Ls_unused_136;
   string Ls_144;
   string Ls_unused_152;
   string Ls_unused_160;
   string Ls_168;
   string Ls_unused_176;
   string Ls_unused_184;
   string Ls_192;
   string Ls_unused_200;
   string Ls_unused_208;
   string Ls_216;
   string Ls_unused_224;
   string Ls_unused_232;
   string Ls_240;
   string Ls_unused_248;
   string Ls_unused_256;
   string Ls_264;
   string Ls_unused_272;
   string Ls_280;
   string Ls_292;
   string Ls_unused_300;
   string Ls_unused_308;
   string Ls_unused_316;
   string Ls_324;
   string Ls_unused_332;
   string Ls_unused_340;
   string Ls_348;
   string Ls_unused_356;
   string Ls_unused_364;
   string Ls_372;
   string Ls_unused_380;
   string Ls_unused_388;
   string Ls_396;
   string Ls_unused_404;
   string Ls_unused_412;
   string Ls_420;
   string Ls_unused_428;
   string Ls_unused_436;
   string Ls_444;
   string Ls_unused_452;
   string Ls_unused_460;
   string Ls_468;
   string Ls_unused_476;
   string Ls_unused_484;
   string Ls_492;
   string Ls_unused_500;
   string Ls_unused_508;
   string Ls_516;
   string Ls_unused_524;
   string Ls_unused_532;
   string Ls_540;
   string Ls_unused_548;
   string Ls_556;
   if (Indicator_On == FALSE) {
      deinit();
      return (0);
   }
   deinit();
   ComputeDayIndices(HrsServerTzFromGMT, HrsChoiceTzFromGMT, Li_8);
   int datetime_0 = iTime(NULL, PERIOD_H1, Li_8);
   int Li_4 = Time[1];
   if (Time[0] > iTime(NULL, PERIOD_H1, Li_8)) Li_4 = iTime(NULL, PERIOD_H1, Li_8);
   if (ShowWeeklyPivots) {
      if (W_use_Day_formula) {
         Ls_16 = "     WPV";
         Ls_48 = "     WS1";
         Ls_72 = "     WR1";
         Ls_96 = "     WS2";
         Ls_120 = "     WR2";
         Ls_144 = "     WS3";
         Ls_168 = "     WR3";
         Ls_280 = "  Wm";
      } else {
         Ls_16 = "WFPV";
         Ls_48 = "WFS1";
         Ls_72 = "WFR1";
         Ls_96 = "WFS2";
         Ls_120 = "WFR2";
         Ls_144 = "WFS3";
         Ls_168 = "WFR3";
         Ls_192 = "WFS4";
         Ls_216 = "WFR4";
         Ls_240 = "WFS5";
         Ls_264 = "WFR5";
         Ls_280 = "  Wm";
      }
      G_timeframe_260 = 10080;
      Gi_264 = iBarShift(NULL, G_timeframe_260, Time[0]) + 1;
      G_datetime_272 = iTime(NULL, G_timeframe_260, Gi_264);
      switch (Gi_268) {
      case 5: break;
      case 0:
         Gi_264 = iBarShift(NULL, G_timeframe_260, Time[0]) + 2;
      case 1: break;
      case 2: break;
      case 3: break;
      case 4: break;
      }
      Gd_300 = NormalizeDouble(iClose(NULL, G_timeframe_260, Gi_264), 4);
      Gd_276 = NormalizeDouble(iHigh(NULL, G_timeframe_260, Gi_264), 4);
      Gd_284 = NormalizeDouble(iLow(NULL, G_timeframe_260, Gi_264), 4);
      Gd_292 = Gd_276 - Gd_284;
      Gd_308 = NormalizeDouble((Gd_276 + Gd_284 + Gd_300) / 3.0, 4);
      if (W_use_Day_formula) {
         Gd_316 = 2.0 * Gd_308 - Gd_284;
         Gd_324 = 2.0 * Gd_308 - Gd_276;
         Gd_332 = Gd_308 + (Gd_316 - Gd_324);
         Gd_340 = Gd_308 - (Gd_316 - Gd_324);
         Gd_348 = 2.0 * Gd_308 + (Gd_276 - 2.0 * Gd_284);
         Gd_356 = 2.0 * Gd_308 - (2.0 * Gd_276 - Gd_284);
      } else {
         Gd_316 = Gd_308 + Gd_292 / 2.0;
         Gd_324 = Gd_308 - Gd_292 / 2.0;
         Gd_332 = Gd_308 + 0.618 * Gd_292;
         Gd_340 = Gd_308 - 0.618 * Gd_292;
         Gd_348 = Gd_308 + Gd_292;
         Gd_356 = Gd_308 - Gd_292;
         Gd_364 = Gd_308 + 1.618 * Gd_292;
         Gd_372 = Gd_308 - 1.618 * Gd_292;
         Gd_380 = Gd_308 + 2.618 * Gd_292;
         Gd_388 = Gd_308 - 2.618 * Gd_292;
      }
      drawLine("wR5", Gd_380, Pivot_Resistances_Color, datetime_0, Li_4);
      drawLabel(Ls_264, Gd_380, Pivotlabels_Color);
      drawLine("wR4", Gd_364, Pivot_Resistances_Color, datetime_0, Li_4);
      drawLabel(Ls_216, Gd_364, Pivotlabels_Color);
      drawLine("wR3", Gd_348, Pivot_Resistances_Color, datetime_0, Li_4);
      drawLabel(Ls_168, Gd_348, Pivotlabels_Color);
      drawLine("wR2", Gd_332, Pivot_Resistances_Color, datetime_0, Li_4);
      drawLabel(Ls_120, Gd_332, Pivotlabels_Color);
      drawLine("wR1", Gd_316, Pivot_Resistances_Color, datetime_0, Li_4);
      drawLabel(Ls_72, Gd_316, Pivotlabels_Color);
      drawLine("wPIVOT", Gd_308, MainPivot_Color, datetime_0, Li_4);
      drawLabel(Ls_16, Gd_308, Pivotlabels_Color);
      drawLine("wS1", Gd_324, Pivot_Supports_Color, datetime_0, Li_4);
      drawLabel(Ls_48, Gd_324, Pivotlabels_Color);
      drawLine("wS2", Gd_340, Pivot_Supports_Color, datetime_0, Li_4);
      drawLabel(Ls_96, Gd_340, Pivotlabels_Color);
      drawLine("wS3", Gd_356, Pivot_Supports_Color, datetime_0, Li_4);
      drawLabel(Ls_144, Gd_356, Pivotlabels_Color);
      drawLine("wS4", Gd_372, Pivot_Supports_Color, datetime_0, Li_4);
      drawLabel(Ls_192, Gd_372, Pivotlabels_Color);
      drawLine("wS5", Gd_388, Pivot_Supports_Color, datetime_0, Li_4);
      drawLabel(Ls_240, Gd_388, Pivotlabels_Color);
      if (Show_Weekly_MidPivots) {
         drawLine("wMR5", (Gd_364 + Gd_380) / 2.0, MidPivots_Color, datetime_0, Li_4);
         drawLabel(Ls_280 + "R5", (Gd_364 + Gd_380) / 2.0, Pivotlabels_Color);
         drawLine("wMR4", (Gd_348 + Gd_364) / 2.0, MidPivots_Color, datetime_0, Li_4);
         drawLabel(Ls_280 + "R4", (Gd_348 + Gd_364) / 2.0, Pivotlabels_Color);
         drawLine("wMR3", (Gd_332 + Gd_348) / 2.0, MidPivots_Color, datetime_0, Li_4);
         drawLabel(Ls_280 + "R3", (Gd_332 + Gd_348) / 2.0, Pivotlabels_Color);
         drawLine("wMR2", (Gd_316 + Gd_332) / 2.0, MidPivots_Color, datetime_0, Li_4);
         drawLabel(Ls_280 + "R2", (Gd_316 + Gd_332) / 2.0, Pivotlabels_Color);
         drawLine("wMR1", (Gd_308 + Gd_316) / 2.0, MidPivots_Color, datetime_0, Li_4);
         drawLabel(Ls_280 + "R1", (Gd_308 + Gd_316) / 2.0, Pivotlabels_Color);
         drawLine("wMS1", (Gd_308 + Gd_324) / 2.0, MidPivots_Color, datetime_0, Li_4);
         drawLabel(Ls_280 + "S1", (Gd_308 + Gd_324) / 2.0, Pivotlabels_Color);
         drawLine("wMS2", (Gd_324 + Gd_340) / 2.0, MidPivots_Color, datetime_0, Li_4);
         drawLabel(Ls_280 + "S2", (Gd_324 + Gd_340) / 2.0, Pivotlabels_Color);
         drawLine("wMS3", (Gd_340 + Gd_356) / 2.0, MidPivots_Color, datetime_0, Li_4);
         drawLabel(Ls_280 + "S3", (Gd_340 + Gd_356) / 2.0, Pivotlabels_Color);
         drawLine("wMS4", (Gd_356 + Gd_372) / 2.0, MidPivots_Color, datetime_0, Li_4);
         drawLabel(Ls_280 + "S4", (Gd_356 + Gd_372) / 2.0, Pivotlabels_Color);
         drawLine("wMS5", (Gd_372 + Gd_388) / 2.0, MidPivots_Color, datetime_0, Li_4);
         drawLabel(Ls_280 + "S5", (Gd_372 + Gd_388) / 2.0, Pivotlabels_Color);
      }
   }
   if (ShowMonthlyPivots) {
      if (M_use_Day_formula) {
         Ls_292 = "      MPV";
         Ls_324 = "      MS1";
         Ls_348 = "      MR1";
         Ls_372 = "      MS2";
         Ls_396 = "      MR2";
         Ls_420 = "      MS3";
         Ls_444 = "      MR3";
         Ls_556 = "  Mm";
      } else {
         Ls_292 = "MFPV";
         Ls_324 = "MFS1";
         Ls_348 = "MFR1";
         Ls_372 = "MFS2";
         Ls_396 = "MFR2";
         Ls_420 = "MFS3";
         Ls_444 = "MFR3";
         Ls_468 = "MFS4";
         Ls_492 = "MFR4";
         Ls_516 = "MFS5";
         Ls_540 = "MFR5";
         Ls_556 = "  Mm";
      }
      G_timeframe_260 = 43200;
      Gi_264 = iBarShift(NULL, G_timeframe_260, Time[0]) + 1;
      G_datetime_272 = iTime(NULL, G_timeframe_260, Gi_264);
      switch (Gi_268) {
      case 5: break;
      case 0:
         Gi_264 = iBarShift(NULL, G_timeframe_260, Time[0]) + 2;
      case 1: break;
      case 2: break;
      case 3: break;
      case 4: break;
      }
      Gd_300 = NormalizeDouble(iClose(NULL, G_timeframe_260, Gi_264), 4);
      Gd_276 = NormalizeDouble(iHigh(NULL, G_timeframe_260, Gi_264), 4);
      Gd_284 = NormalizeDouble(iLow(NULL, G_timeframe_260, Gi_264), 4);
      Gd_292 = Gd_276 - Gd_284;
      Gd_308 = NormalizeDouble((Gd_276 + Gd_284 + Gd_300) / 3.0, 4);
      if (M_use_Day_formula) {
         Gd_316 = 2.0 * Gd_308 - Gd_284;
         Gd_324 = 2.0 * Gd_308 - Gd_276;
         Gd_332 = Gd_308 + (Gd_316 - Gd_324);
         Gd_340 = Gd_308 - (Gd_316 - Gd_324);
         Gd_348 = 2.0 * Gd_308 + (Gd_276 - 2.0 * Gd_284);
         Gd_356 = 2.0 * Gd_308 - (2.0 * Gd_276 - Gd_284);
      } else {
         Gd_316 = Gd_308 + Gd_292 / 2.0;
         Gd_324 = Gd_308 - Gd_292 / 2.0;
         Gd_332 = Gd_308 + 0.618 * Gd_292;
         Gd_340 = Gd_308 - 0.618 * Gd_292;
         Gd_348 = Gd_308 + Gd_292;
         Gd_356 = Gd_308 - Gd_292;
         Gd_364 = Gd_308 + 1.618 * Gd_292;
         Gd_372 = Gd_308 - 1.618 * Gd_292;
         Gd_380 = Gd_308 + 2.618 * Gd_292;
         Gd_388 = Gd_308 - 2.618 * Gd_292;
      }
      drawLine("mR5", Gd_380, Pivot_Resistances_Color, datetime_0, Li_4);
      drawLabel(Ls_540, Gd_380, Pivotlabels_Color);
      drawLine("mR4", Gd_364, Pivot_Resistances_Color, datetime_0, Li_4);
      drawLabel(Ls_492, Gd_364, Pivotlabels_Color);
      drawLine("mR3", Gd_348, Pivot_Resistances_Color, datetime_0, Li_4);
      drawLabel(Ls_444, Gd_348, Pivotlabels_Color);
      drawLine("mR2", Gd_332, Pivot_Resistances_Color, datetime_0, Li_4);
      drawLabel(Ls_396, Gd_332, Pivotlabels_Color);
      drawLine("mR1", Gd_316, Pivot_Resistances_Color, datetime_0, Li_4);
      drawLabel(Ls_348, Gd_316, Pivotlabels_Color);
      drawLine("mPIVOT", Gd_308, MainPivot_Color, datetime_0, Li_4);
      drawLabel(Ls_292, Gd_308, Pivotlabels_Color);
      drawLine("mS1", Gd_324, Pivot_Supports_Color, datetime_0, Li_4);
      drawLabel(Ls_324, Gd_324, Pivotlabels_Color);
      drawLine("mS2", Gd_340, Pivot_Supports_Color, datetime_0, Li_4);
      drawLabel(Ls_372, Gd_340, Pivotlabels_Color);
      drawLine("mS3", Gd_356, Pivot_Supports_Color, datetime_0, Li_4);
      drawLabel(Ls_420, Gd_356, Pivotlabels_Color);
      drawLine("mS4", Gd_372, Pivot_Supports_Color, datetime_0, Li_4);
      drawLabel(Ls_468, Gd_372, Pivotlabels_Color);
      drawLine("mS5", Gd_388, Pivot_Supports_Color, datetime_0, Li_4);
      drawLabel(Ls_516, Gd_388, Pivotlabels_Color);
      if (Show_Monthly_MidPivots) {
         drawLine("mMR5", (Gd_364 + Gd_380) / 2.0, MidPivots_Color, datetime_0, Li_4);
         drawLabel(Ls_556 + "R5", (Gd_364 + Gd_380) / 2.0, Pivotlabels_Color);
         drawLine("mMR4", (Gd_348 + Gd_364) / 2.0, MidPivots_Color, datetime_0, Li_4);
         drawLabel(Ls_556 + "R4", (Gd_348 + Gd_364) / 2.0, Pivotlabels_Color);
         drawLine("mMR3", (Gd_332 + Gd_348) / 2.0, MidPivots_Color, datetime_0, Li_4);
         drawLabel(Ls_556 + "R3", (Gd_332 + Gd_348) / 2.0, Pivotlabels_Color);
         drawLine("mMR2", (Gd_316 + Gd_332) / 2.0, MidPivots_Color, datetime_0, Li_4);
         drawLabel(Ls_556 + "R2", (Gd_316 + Gd_332) / 2.0, Pivotlabels_Color);
         drawLine("mMR1", (Gd_308 + Gd_316) / 2.0, MidPivots_Color, datetime_0, Li_4);
         drawLabel(Ls_556 + "R1", (Gd_308 + Gd_316) / 2.0, Pivotlabels_Color);
         drawLine("mMS1", (Gd_308 + Gd_324) / 2.0, MidPivots_Color, datetime_0, Li_4);
         drawLabel(Ls_556 + "S1", (Gd_308 + Gd_324) / 2.0, Pivotlabels_Color);
         drawLine("mMS2", (Gd_324 + Gd_340) / 2.0, MidPivots_Color, datetime_0, Li_4);
         drawLabel(Ls_556 + "S2", (Gd_324 + Gd_340) / 2.0, Pivotlabels_Color);
         drawLine("mMS3", (Gd_340 + Gd_356) / 2.0, MidPivots_Color, datetime_0, Li_4);
         drawLabel(Ls_556 + "S3", (Gd_340 + Gd_356) / 2.0, Pivotlabels_Color);
         drawLine("mMS4", (Gd_356 + Gd_372) / 2.0, MidPivots_Color, datetime_0, Li_4);
         drawLabel(Ls_556 + "S4", (Gd_356 + Gd_372) / 2.0, Pivotlabels_Color);
         drawLine("mMS5", (Gd_372 + Gd_388) / 2.0, MidPivots_Color, datetime_0, Li_4);
         drawLabel(Ls_556 + "S5", (Gd_372 + Gd_388) / 2.0, Pivotlabels_Color);
      }
   }
   return (0);
}

void ComputeDayIndices(int Ai_0, int Ai_4, int &Ai_8) {
   int Li_36;
   int Li_12 = Ai_0 - Ai_4;
   int Li_16 = 3600 * Li_12;
   int day_of_week_20 = TimeDayOfWeek(iTime(NULL, PERIOD_H1, 0) - Li_16);
   int Li_24 = -1;
   Ai_8 = 0;
   switch (day_of_week_20) {
   case 6:
   case 0:
   case 1:
      Li_24 = 5;
      break;
   default:
      Li_24 = day_of_week_20 - 1;
   }
   for (int Li_32 = 1; Li_32 <= 24; Li_32++) {
      Li_36 = iTime(NULL, PERIOD_H1, Li_32) - Li_16;
      if (TimeDayOfWeek(Li_36) != day_of_week_20) {
         Ai_8 = Li_32 - 1;
         return;
      }
   }
}

void drawLabel(string A_text_0, double A_price_8, color A_color_16) {
   if (Shift_Pivotlabels_PerCent_Left <= 0) Shift_Pivotlabels_PerCent_Left = 0;
   if (Shift_Pivotlabels_PerCent_Left >= 100) Shift_Pivotlabels_PerCent_Left = 100;
   int Li_20 = WindowFirstVisibleBar();
   int Li_24 = Li_20 * Shift_Pivotlabels_PerCent_Left / 100;
   string name_28 = "[TzPivotsMW] " + A_text_0 + " Label";
   int digits_36 = Digits;
   string Ls_40 = StringSubstr(Symbol(), 3, 3);
   if (Ls_40 == "JPY") digits_36 = 2;
   else digits_36 = 4;
   string dbl2str_48 = DoubleToStr(A_price_8, digits_36);
   if (Show_Price_in_Pivotlabels && StrToInteger(A_text_0) == 0) A_text_0 = A_text_0 + ":  " + dbl2str_48;
   string fontname_56 = "Arial";
   if (Pivotlabels_Fontstyle_123 == 2) fontname_56 = "Arial Bold";
   if (Pivotlabels_Fontstyle_123 == 3) fontname_56 = "Arial Black";
   if (Shift_Pivotlabels_PerCent_Left == 0) A_text_0 = "                                             " + A_text_0;
   if (Shift_Pivotlabels_PerCent_Left == 100) {
      if (Show_Price_in_Pivotlabels) A_text_0 = "                              " + A_text_0;
      if (Show_Price_in_Pivotlabels == FALSE) A_text_0 = "                " + A_text_0;
   }
   if (ObjectFind(name_28) != 0) {
      ObjectCreate(name_28, OBJ_TEXT, 0, Time[Li_24], A_price_8);
      ObjectSetText(name_28, A_text_0, Pivotlabels_Fontsize_8_to_12, fontname_56, A_color_16);
      ObjectSet(name_28, OBJPROP_BACK, FALSE);
      return;
   }
   ObjectMove(name_28, 0, Time[Li_24], A_price_8);
}

void drawLine(string As_0, double A_price_8, color A_color_16, int A_datetime_20, int A_datetime_24) {
   bool Li_76;
   int style_28 = Pivots_LineStyle_01234;
   int Li_32 = Pivots_SolidLine_Thickness;
   int width_36 = 1;
   if (style_28 == STYLE_SOLID) width_36 = Li_32;
   int style_40 = LineStyle_Today_01234;
   int width_44 = SolidLine_Thickness_Today;
   int Li_unused_48 = 1;
   if (style_40 == STYLE_SOLID) Li_unused_48 = width_44;
   string name_52 = "[TzPivotsMW] " + As_0 + " Line historic";
   string name_60 = "[TzPivotsMW] " + As_0 + " Line today";
   string name_68 = "[TzPivotsMW] " + As_0 + " Line";
   int Li_80 = 2;
   bool bool_84 = TRUE;
   if (Apply_FullScreen_Lines) {
      Li_76 = TRUE;
      Li_80 = 1;
      if (Show_RightMargin_Prices == FALSE || Stop_lines_At_Current_Candle) Li_80 = 2;
   }
   if (Stop_lines_At_Current_Candle) bool_84 = FALSE;
   if (ObjectFind(name_52) != 0) {
      if (Li_76 != TRUE) {
         ObjectCreate(name_52, Li_80, 0, A_datetime_20, A_price_8, WindowFirstVisibleBar(), A_price_8);
         ObjectSet(name_52, OBJPROP_STYLE, style_28);
         ObjectSet(name_52, OBJPROP_WIDTH, width_36);
         ObjectSet(name_52, OBJPROP_COLOR, A_color_16);
         ObjectSet(name_52, OBJPROP_BACK, FALSE);
      }
      if (Li_76 != TRUE) {
         ObjectCreate(name_60, Li_80, 0, A_datetime_24, A_price_8, Time[0], A_price_8);
         ObjectSet(name_60, OBJPROP_STYLE, style_40);
         ObjectSet(name_60, OBJPROP_WIDTH, width_44);
         ObjectSet(name_60, OBJPROP_COLOR, A_color_16);
         ObjectSet(name_60, OBJPROP_BACK, FALSE);
         ObjectSet(name_60, OBJPROP_RAY, bool_84);
      }
      if (Li_76 == TRUE) {
         ObjectCreate(name_68, Li_80, 0, WindowFirstVisibleBar(), A_price_8, Time[0], A_price_8);
         ObjectSet(name_68, OBJPROP_STYLE, style_28);
         ObjectSet(name_68, OBJPROP_WIDTH, width_36);
         ObjectSet(name_68, OBJPROP_COLOR, A_color_16);
         ObjectSet(name_68, OBJPROP_BACK, FALSE);
         ObjectSet(name_68, OBJPROP_RAY, bool_84);
      }
   } else {
      if (Li_76 != TRUE) {
         ObjectMove(name_52, 1, WindowFirstVisibleBar(), A_price_8);
         ObjectMove(name_52, 0, A_datetime_20, A_price_8);
      }
      if (Li_76 != TRUE) {
         ObjectMove(name_60, 1, Time[0], A_price_8);
         ObjectMove(name_60, 0, A_datetime_24, A_price_8);
      }
      if (Li_76 == TRUE) {
         ObjectMove(name_68, 0, WindowFirstVisibleBar(), A_price_8);
         ObjectMove(name_68, 1, Time[0], A_price_8);
      }
   }
}

Recommend