Navigation:Home > Content >

TPS_IND2.mq4

Time: 2018-12-05 | Download file:TPS_IND2.mq4

/*
   Generated by EX4-TO-MQ4 decompiler V4.0.224.1 []
   Website: http://purebeam.biz
   E-mail : purebeam@gmail.com
*/
#property copyright "ServerUang"
#property link      "http://www.indofx-trader.net/"

#property indicator_chart_window

extern string Settings_n_1 = "--------------------------";
extern int Side = 1;
extern int MP_Y = 0;
extern int MP_X = 0;
extern string Settings_n_2 = "--------------------------";
extern string Colors_Setting = "Setting for Colors";
extern color Highest_Color = Blue;
extern color Distance_from_Highest_Color = DodgerBlue;
extern color Lowest_Color = Red;
extern color Distance_from_Lowest_Color = OrangeRed;
extern color Hi_to_Lo_Color = Peru;
extern color Daily_Av_Up_Color = Blue;
extern color Daily_Av_Dn_Color = Red;
extern color Time_n_Spread_Color = LimeGreen;
extern color PipsToOpen_Up_Color = Blue;
extern color PipsToOpen_Dn_Color = Red;
extern string Settings_n_3 = "--------------------------";
extern string Signals_Settings = "Settings for Signals";
extern bool Show_Signals = TRUE;
extern string BuySeLL_Settings = "--------------------------";
extern int MAFast_Period = 1;
extern int MAFast_Method = 0;
extern int MAFast_Apply_To = 0;
extern int MAFast_Shift = 0;
extern int MASlow_Period = 4;
extern int MASlow_Method = 0;
extern int MASlow_Apply_To = 1;
extern int MASlow_Shift = 0;
extern string TRend_Settings = "--------------------------";
extern int TMAFast_Period = 1;
extern int TMAFast_Method = 0;
extern int TMAFast_Apply_To = 0;
extern int TMAFast_Shift = 0;
extern int TMASlow_Period = 20;
extern int TMASlow_Method = 0;
extern int TMASlow_Apply_To = 0;
extern int TMASlow_Shift = 0;
extern string Strength_Settings = "--------------------------";
extern int RSI_Period = 5;
extern int RSI_PRICE_TYPE = 0;
extern int CCI_Period = 20;
extern int CCI_PRICE_TYPE = 0;
extern int STOCH_K_Period = 5;
extern int STOCH_D_Period = 3;
extern int STOCH_Slowing = 3;
extern int STOCH_MA_MODE = 0;
extern int STOCH_Price_Field = 0;
extern string Settings_n_4 = "--------------------------";
extern color LegendColor = Gainsboro;
extern color PriceColor_Up = Lime;
extern color PriceColor_Dn = Red;
extern color NeutralColor = LightGray;
extern color Arrow_Up = Lime;
extern color Arrow_Dn = Red;
extern color Arrow_Nt = White;
double gd_332;
double gd_340;
double gd_348;
double g_timeframe_356;
int g_timeframe_380;
int gi_384;
int gi_388;
int gi_392;
int gi_396;
int gi_400;
int gi_404;
int gi_408;
int gi_412;
int gi_416;
int gi_420;
string gs_424;
string gs_432;
string g_dbl2str_440;
string g_dbl2str_448;
string gs_456 = "с";
string gs_464 = "т";
string gs_472 = "«";
string gs_480;
int g_color_488;
int gi_492;
int gi_496;
int gi_500;
int gi_504;
int gi_508;
int gi_512;
int gi_516;
string g_dbl2str_520 = "";
string gs_528 = "";
int g_color_536;
double g_irsi_544;
double g_istochastic_552;
double g_icci_560;

int init() {
   return (0);
}

int deinit() {
   string l_name_4;
   for (int li_0 = ObjectsTotal() - 1; li_0 >= 0; li_0--) {
      l_name_4 = ObjectName(li_0);
      if (StringSubstr(l_name_4, 0, 4) == "MP14") ObjectDelete(l_name_4);
   }
   return (0);
}

int start() {
   int l_ind_counted_0 = IndicatorCounted();
   g_timeframe_380 = 15;
   gd_332 = iMA(Symbol(), 0, 1, 0, MODE_EMA, PRICE_CLOSE, 0);
   gd_340 = iMA(Symbol(), g_timeframe_380, MAFast_Period, MAFast_Shift, MAFast_Method, MAFast_Apply_To, 0);
   gd_348 = iMA(Symbol(), g_timeframe_380, MASlow_Period, MASlow_Shift, MASlow_Method, MASlow_Apply_To, 0);
   Write("MP14001", Side, MP_X + 9, MP_Y + 22, DoubleToStr(gd_332, Digits), 34, "Arial", CheckColor(gd_340, gd_348, PriceColor_Up, PriceColor_Dn));
   gd_340 = iHigh(NULL, PERIOD_D1, 0);
   gs_424 = DoubleToStr(gd_340, Digits);
   Write("MP14002", Side, MP_X + 100, MP_Y + 14, gs_424, 10, "Tahoma Bold", Highest_Color);
   gd_348 = iLow(NULL, PERIOD_D1, 0);
   gs_424 = DoubleToStr(gd_348, Digits);
   Write("MP14003", Side, MP_X + 100, MP_Y + 62, gs_424, 10, "Tahoma Bold", Lowest_Color);
   gs_424 = DoubleToStr((gd_332 - gd_340) / Point, 0);
   Write("MP14004", Side, MP_X + 56, MP_Y + 14, gs_424, 10, "Tahoma Bold", Distance_from_Highest_Color);
   gs_424 = DoubleToStr((gd_332 - gd_348) / Point, 0);
   Write("MP14005", Side, MP_X + 56, MP_Y + 62, gs_424, 10, "Tahoma Bold", Distance_from_Lowest_Color);
   gs_424 = DoubleToStr((gd_340 - gd_348) / Point, 0);
   Write("MP14006", Side, MP_X + 10, MP_Y + 14, gs_424, 10, "Tahoma Bold", Hi_to_Lo_Color);
   gi_492 = 0;
   gi_496 = 0;
   gi_500 = 0;
   gi_504 = 0;
   gi_508 = 0;
   gi_516 = 0;
   gi_492 = (iHigh(NULL, PERIOD_D1, 1) - iLow(NULL, PERIOD_D1, 1)) / Point;
   for (gi_516 = 1; gi_516 <= 5; gi_516++) gi_496 = gi_496 + (iHigh(NULL, PERIOD_D1, gi_516) - iLow(NULL, PERIOD_D1, gi_516)) / Point;
   for (gi_516 = 1; gi_516 <= 10; gi_516++) gi_500 = gi_500 + (iHigh(NULL, PERIOD_D1, gi_516) - iLow(NULL, PERIOD_D1, gi_516)) / Point;
   for (gi_516 = 1; gi_516 <= 20; gi_516++) gi_504 = gi_504 + (iHigh(NULL, PERIOD_D1, gi_516) - iLow(NULL, PERIOD_D1, gi_516)) / Point;
   gi_496 /= 5;
   gi_500 /= 10;
   gi_504 /= 20;
   gi_508 = (gi_492 + gi_496 + gi_500 + gi_504) / 4;
   g_dbl2str_520 = DoubleToStr(gi_508, Digits - 4);
   gs_528 = (iHigh(NULL, PERIOD_D1, 1) - iLow(NULL, PERIOD_D1, 1)) / Point;
   if (g_dbl2str_520 > gs_528) g_color_536 = Daily_Av_Up_Color;
   else g_color_536 = Daily_Av_Dn_Color;
   Write("MP14007", Side, MP_X + 10, MP_Y + 62, g_dbl2str_520, 10, "Tahoma Bold", g_color_536);
   gd_340 = Time[4] - Time[5] - MathMod(TimeCurrent(), Time[4] - Time[5]);
   gd_332 = gd_340 / 60.0;
   gd_340 = 60.0 * (gd_332 - MathFloor(gd_332));
   gd_332 = MathFloor(gd_332);
   g_dbl2str_440 = DoubleToStr(gd_332, 0);
   g_dbl2str_448 = DoubleToStr(gd_340, 0);
   gs_424 = g_dbl2str_440 + ":" + g_dbl2str_448;
   Write("MP14008", Side, MP_X + 100, MP_Y + 74, gs_424, 10, "Tahoma Bold", Time_n_Spread_Color);
   gd_332 = (Ask - Bid) / Point;
   gs_424 = DoubleToStr(gd_332, Digits - 4);
   Write("MP14009", Side, MP_X + 56, MP_Y + 74, gs_424, 10, "Tahoma Bold", Time_n_Spread_Color);
   gd_332 = iOpen(NULL, PERIOD_D1, 0);
   gd_340 = iClose(NULL, PERIOD_D1, 0);
   g_color_488 = CheckColor(gd_340, gd_332, PipsToOpen_Up_Color, PipsToOpen_Dn_Color);
   gs_424 = DoubleToStr((gd_340 - gd_332) / Point, 0);
   Write("MP14010", Side, MP_X + 10, MP_Y + 74, gs_424, 10, "Tahoma Bold", g_color_488);
   if (Show_Signals) {
      gi_404 = MP_X + 127;
      gi_408 = MP_X + 99;
      gi_412 = MP_X + 76;
      gi_416 = MP_X + 40;
      gi_420 = MP_X + 10;
      Write("MP14011", Side, MP_X + gi_404, MP_Y + 90, "TF", 10, "Arial", LegendColor);
      Write("MP14012", Side, MP_X + gi_408, MP_Y + 90, "CC", 10, "Arial", LegendColor);
      Write("MP14013", Side, MP_X + gi_412 - 5, MP_Y + 90, "BS", 10, "Arial", LegendColor);
      Write("MP14014", Side, MP_X + gi_416, MP_Y + 90, "Str", 10, "Arial", LegendColor);
      Write("MP14015", Side, MP_X + gi_420, MP_Y + 90, "TR", 10, "Arial", LegendColor);
      gi_384 = gi_404;
      gi_388 = MP_Y + 106;
      gi_392 = 12;
      gs_432 = "Arial";
      gi_400 = 8;
      Write("MP14016", Side, gi_384, gi_388 + 0 * gi_392, "MN", gi_400, gs_432, LegendColor);
      Write("MP14017", Side, gi_384, gi_388 + 1 * gi_392, "W1", gi_400, gs_432, LegendColor);
      Write("MP14018", Side, gi_384, gi_388 + gi_392 * 2, "D1", gi_400, gs_432, LegendColor);
      Write("MP14019", Side, gi_384, gi_388 + gi_392 << 2, "H4", gi_400, gs_432, LegendColor);
      Write("MP14020", Side, gi_384, gi_388 + 5 * gi_392, "H1", gi_400, gs_432, LegendColor);
      Write("MP14021", Side, gi_384, gi_388 + 6 * gi_392, "M30", gi_400, gs_432, LegendColor);
      Write("MP14022", Side, gi_384, gi_388 + gi_392 << 3, "M15", gi_400, gs_432, LegendColor);
      Write("MP14023", Side, gi_384, gi_388 + 9 * gi_392, "M5", gi_400, gs_432, LegendColor);
      Write("MP14024", Side, gi_384, gi_388 + 10 * gi_392, "M1", gi_400, gs_432, LegendColor);
      gi_512 = 1;
      gi_388 = MP_Y + 106;
      gi_392 = 12;
      while (gi_512 <= 9) {
         switch (gi_512) {
         case 1:
            g_timeframe_356 = 43200;
            gi_396 = 0;
            break;
         case 2:
            g_timeframe_356 = 10080;
            gi_396 = 1;
            break;
         case 3:
            g_timeframe_356 = 1440;
            gi_396 = 2;
            break;
         case 4:
            g_timeframe_356 = 240;
            gi_396 = 4;
            break;
         case 5:
            g_timeframe_356 = 60;
            gi_396 = 5;
            break;
         case 6:
            g_timeframe_356 = 30;
            gi_396 = 6;
            break;
         case 7:
            g_timeframe_356 = 15;
            gi_396 = 8;
            break;
         case 8:
            g_timeframe_356 = 5;
            gi_396 = 9;
            break;
         case 9:
            g_timeframe_356 = 1;
            gi_396 = 10;
         }
         gd_332 = iMA(Symbol(), g_timeframe_356, TMAFast_Period, TMAFast_Shift, TMAFast_Method, TMAFast_Apply_To, 0);
         gd_340 = iMA(Symbol(), g_timeframe_356, TMASlow_Period, TMASlow_Shift, TMASlow_Method, TMASlow_Apply_To, 0);
         if (gd_332 > gd_340) {
            gs_480 = gs_456;
            g_color_488 = Arrow_Up;
         } else {
            if (gd_332 < gd_340) {
               gs_480 = gs_464;
               g_color_488 = Arrow_Dn;
            } else {
               gs_480 = gs_472;
               g_color_488 = Arrow_Nt;
            }
         }
         Write("MP14025" + DoubleToStr(gi_512, 0), Side, gi_420, gi_388 + gi_396 * gi_392, gs_480, 10, "Wingdings", g_color_488);
         g_irsi_544 = iRSI(Symbol(), g_timeframe_356, RSI_Period, RSI_PRICE_TYPE, 0);
         g_istochastic_552 = iStochastic(Symbol(), g_timeframe_356, STOCH_K_Period, STOCH_D_Period, STOCH_Slowing, STOCH_MA_MODE, STOCH_Price_Field, MODE_MAIN, 0);
         g_icci_560 = iCCI(Symbol(), g_timeframe_356, CCI_Period, CCI_PRICE_TYPE, 0);
         if (g_irsi_544 > 50.0 && g_istochastic_552 > 40.0 && g_icci_560 > 0.0) {
            gs_480 = gs_456;
            g_color_488 = Arrow_Up;
         } else {
            if (g_irsi_544 < 50.0 && g_istochastic_552 < 60.0 && g_icci_560 < 0.0) {
               gs_480 = gs_464;
               g_color_488 = Arrow_Dn;
            } else {
               if (g_irsi_544 < 50.0 && g_istochastic_552 > 40.0 && g_icci_560 > 0.0) {
                  gs_480 = gs_472;
                  g_color_488 = Arrow_Nt;
               } else {
                  if (g_irsi_544 > 50.0 && g_istochastic_552 < 60.0 && g_icci_560 < 0.0) {
                     gs_480 = gs_472;
                     g_color_488 = Arrow_Nt;
                  } else {
                     if (g_irsi_544 < 50.0 && g_istochastic_552 > 40.0 && g_icci_560 < 0.0) {
                        gs_480 = gs_472;
                        g_color_488 = Arrow_Nt;
                     } else {
                        if (g_irsi_544 > 50.0 && g_istochastic_552 < 60.0 && g_icci_560 > 0.0) {
                           gs_480 = gs_472;
                           g_color_488 = Arrow_Nt;
                        } else {
                           if (g_irsi_544 > 50.0 && g_istochastic_552 > 40.0 && g_icci_560 < 0.0) {
                              gs_480 = gs_472;
                              g_color_488 = Arrow_Nt;
                           } else {
                              if (g_irsi_544 > 50.0 && g_istochastic_552 < 60.0 && g_icci_560 < 0.0) {
                                 gs_480 = gs_472;
                                 g_color_488 = Arrow_Nt;
                              }
                           }
                        }
                     }
                  }
               }
            }
         }
         Write("MP14026" + DoubleToStr(gi_512, 0), Side, gi_416, gi_388 + gi_396 * gi_392, gs_480, 10, "Wingdings", g_color_488);
         gd_340 = iMA(Symbol(), g_timeframe_356, MAFast_Period, MAFast_Shift, MAFast_Method, MAFast_Apply_To, 0);
         gd_348 = iMA(Symbol(), g_timeframe_356, MASlow_Period, MASlow_Shift, MASlow_Method, MASlow_Apply_To, 0);
         if (gd_340 > gd_348) {
            gs_480 = gs_456;
            g_color_488 = Arrow_Up;
         } else {
            gs_480 = gs_464;
            g_color_488 = Arrow_Dn;
         }
         Write("MP14027" + DoubleToStr(gi_512, 0), Side, gi_412 - 3, gi_388 + gi_396 * gi_392, gs_480, 10, "Wingdings", g_color_488);
         gd_348 = iClose(NULL, g_timeframe_356, 0) - iOpen(NULL, g_timeframe_356, 0);
         if (gd_348 > 0.0) {
            g_color_488 = PriceColor_Up;
            gs_480 = "n";
         } else {
            if (gd_348 < 0.0) {
               g_color_488 = PriceColor_Dn;
               gs_480 = "n";
            } else {
               g_color_488 = NeutralColor;
               gs_480 = "Є";
            }
         }
         Write("MP14028" + DoubleToStr(gi_512, 0), Side, gi_408 + 2, gi_388 + gi_396 * gi_392, gs_480, 10, "Wingdings", g_color_488);
         Write("MP14029", Side, gi_420, gi_388 + (gi_396 + 1) * gi_392, "Created by ServerUang", 7, "Tahoma Narrow", Gray);
         gi_512++;
      }
   } else Write("MP14030", Side, MP_X + 10, MP_Y + 90, "Created by ServerUang", 7, "Tahoma Narrow", Gray);
   return (0);
}

void Write(string a_name_0, double a_corner_8, int a_x_16, int a_y_20, string a_text_24, int a_fontsize_32, string a_fontname_36, color a_color_44 = -1) {
   ObjectCreate(a_name_0, OBJ_LABEL, 0, 0, 0);
   ObjectSetText(a_name_0, a_text_24, a_fontsize_32, a_fontname_36, a_color_44);
   ObjectSet(a_name_0, OBJPROP_CORNER, a_corner_8);
   ObjectSet(a_name_0, OBJPROP_XDISTANCE, a_x_16);
   ObjectSet(a_name_0, OBJPROP_YDISTANCE, a_y_20);
}

int CheckColor(double ad_0, double ad_8, int ai_16, int ai_20) {
   if (ad_0 > ad_8) return (ai_16);
   return (ai_20);
}

Recommend