Navigation´╝ÜHome > Content >

TrendStrikerExtreme_(4).mq4

Time: 2014-07-14 | Download file:TrendStrikerExtreme_(4).mq4

#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 Blue
#property indicator_color2 Yellow
#property indicator_color3 Red

string Gs_unused_76 = "Where do you want the box?";
bool Gi_unused_84 = FALSE;
int Gi_88 = 0;
int Gi_92 = 0;
string Gs_unused_96 = "=== Your 1st indicator settings ===";
int Gi_unused_104 = 5;
int Gi_unused_108 = 13;
int Gi_unused_112 = 1;
string Gs_unused_116 = "=== Your 2nd indicator settings ===";
int Gi_unused_124 = 20;
int Gi_unused_128 = 2;
int Gi_unused_132 = 2;
string Gs_unused_136 = "=== Your Colors settings ===";
int Gi_unused_144 = 42495;
int Gi_unused_148 = 12632256;
int Gi_unused_152 = 6908265;
int Gi_unused_156 = 0;
string Gs_unused_160 = "Pop up or/and email alert";
bool Gi_unused_168 = FALSE;
bool Gi_unused_172 = FALSE;
int Gi_unused_176 = 75;
int Gi_unused_180 = 0;
extern int Take_Profit = 48;
extern int Stop_Loss = 38;
extern int period = 45;
extern bool Alerts = TRUE;
extern bool EmailOn = FALSE;
bool Gi_204 = FALSE;
bool Gi_208 = FALSE;
double G_ibuf_212[];
double G_ibuf_216[];
double G_ibuf_220[];
double G_ibuf_224[];
int Gi_228;
bool Gi_unused_232 = FALSE;
bool Gi_unused_236 = FALSE;
int Gi_unused_240 = 2;
int Gi_244 = 0;
string Gs_unused_248 = "qq";
int Gi_unused_256 = 1;
int Gi_unused_260 = -1;
double Gda_unused_264[10000];
double Gda_unused_268[10000];
double Gda_unused_272[10000];
string Gs_dummy_324;
int Gi_unused_332 = 0;
string Gs_unused_336 = "";
string Gs_unused_352 = "=== Moving Average Settings ===";
int Gi_unused_360 = 20;
int Gi_unused_364 = 50;
int Gi_unused_368 = 100;
int Gi_unused_372 = 1;
int Gi_unused_376 = 0;
string Gs_unused_380 = "=== CCI Settings ===";
int Gi_unused_388 = 14;
int Gi_unused_392 = 0;
string Gs_unused_396 = "=== MACD Settings ===";
int Gi_unused_404 = 12;
int Gi_unused_408 = 26;
int Gi_unused_412 = 9;
string Gs_unused_416 = "=== ADX Settings ===";
int Gi_unused_424 = 14;
int Gi_unused_428 = 0;
string Gs_unused_432 = "=== BULLS Settings ===";
int Gi_unused_440 = 13;
int Gi_unused_444 = 0;
string Gs_unused_448 = "=== BEARS Settings ===";
int Gi_unused_456 = 13;
int Gi_unused_460 = 0;
string Gs_unused_464 = "=== STOCHASTIC Settings ===";
int Gi_unused_472 = 5;
int Gi_unused_476 = 3;
int Gi_unused_480 = 3;
string Gs_unused_484 = "=== RSI Settings ===";
int Gi_unused_492 = 14;
string Gs_unused_496 = "=== FORCE INDEX Settings ===";
int Gi_unused_504 = 14;
int Gi_unused_508 = 0;
int Gi_unused_512 = 0;
string Gs_unused_516 = "=== MOMENTUM INDEX Settings ===";
int Gi_unused_524 = 14;
int Gi_unused_528 = 0;
string Gs_unused_532 = "=== DeMARKER Settings ===";
int Gi_unused_540 = 14;
string Gsa_544[19] = {"EURUSD", "GBPUSD", "AUDUSD", "USDJPY", "USDCHF", "USDCAD", "EURJPY", "EURGBP", "EURCHF", "EURAUD", "GBPJPY", "GBPCHF", "AUDJPY", "NZDUSD", "NZDJPY", "AUDNZD", "CHFJPY",
      "EURCAD", "AUDCAD"};
string Gsa_548[8] = {"USD", "EUR", "GBP", "CHF", "CAD", "AUD", "JPY", "NZD"};
string Gs_dummy_552;
string Gs_dummy_564;
string Gs_dummy_624;
datetime G_time_632;
int Gi_636 = 0;


int init() {
   IndicatorBuffers(4);
   if ((!SetIndexBuffer(0, G_ibuf_212)) && (!SetIndexBuffer(1, G_ibuf_216)) && (!SetIndexBuffer(2, G_ibuf_220)) && (!SetIndexBuffer(3, G_ibuf_224))) Print("cannot set indicator buffers!");
   SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 0, CLR_NONE);
   SetIndexStyle(1, DRAW_LINE, STYLE_SOLID, 0, CLR_NONE);
   SetIndexStyle(2, DRAW_LINE, STYLE_SOLID, 0, CLR_NONE);
   Gi_228 = period + MathFloor(MathSqrt(period));
   SetIndexDrawBegin(0, Gi_228);
   SetIndexDrawBegin(1, Gi_228);
   SetIndexDrawBegin(2, Gi_228);
   IndicatorDigits(MarketInfo(Symbol(), MODE_DIGITS) + 1.0);
   G_time_632 = Time[55];
   return (0);
}


int deinit() {
   ObjectsDeleteAll();
   return (0);
}


int start() {

   double Lda_unused_2784[8];
   double Lda_unused_2788[19];
   double Lda_unused_2792[19];
   double Lda_unused_2796[19];
   double Lda_unused_2800[19];
   double Lda_unused_2804[19];
   double Lda_unused_2808[19];
   double Lda_unused_2812[19];
   double Lda_unused_2816[19];
   double Lda_unused_2820[19];
 
   int Li_unused_3012;
   double ima_on_arr_3036;
   string Ls_3044;
   if (Digits == 3 || Digits == 5) Li_unused_3012 = 10;
   else Li_unused_3012 = 1;
   int Li_3024 = IndicatorCounted();
   if (Li_3024 > 0) Li_3024--;
   int Li_3016 = 5000;
   if (Li_3024 < 1) {
      for (int Li_3020 = 1; Li_3020 <= Gi_228; Li_3020++) G_ibuf_224[Li_3016 - Li_3020] = 0;
      for (Li_3020 = 1; Li_3020 <= period; Li_3020++) {
         G_ibuf_212[Li_3016 - Li_3020] = 0;
         G_ibuf_216[Li_3016 - Li_3020] = 0;
         G_ibuf_220[Li_3016 - Li_3020] = 0;
      }
   }
   for (Li_3020 = 0; Li_3020 < Li_3016; Li_3020++) G_ibuf_224[Li_3020] = 2.0 * iMA(NULL, 0, MathFloor(period / 1.5), 0, MODE_LWMA, PRICE_CLOSE, Li_3020) - iMA(NULL, 0, period, 0, MODE_LWMA, PRICE_CLOSE, Li_3020);
   double ima_on_arr_3028 = iMAOnArray(G_ibuf_224, 0, MathFloor(MathSqrt(period)), 0, MODE_LWMA, 0);
   if (Gi_244 == 0) {
      Gi_244++;
      for (Li_3020 = 1; Li_3020 < Li_3016; Li_3020++) {
         ima_on_arr_3036 = iMAOnArray(G_ibuf_224, 0, MathFloor(MathSqrt(period)), 0, MODE_LWMA, Li_3020);
         if (ima_on_arr_3036 > ima_on_arr_3028) {
            G_ibuf_212[Li_3020] = EMPTY_VALUE;
            G_ibuf_216[Li_3020] = EMPTY_VALUE;
            G_ibuf_220[Li_3020] = ima_on_arr_3036;
            G_ibuf_220[Li_3020 - 1] = ima_on_arr_3028;
         } else {
            if (ima_on_arr_3036 < ima_on_arr_3028) {
               G_ibuf_212[Li_3020] = ima_on_arr_3036;
               G_ibuf_212[Li_3020 - 1] = ima_on_arr_3028;
               G_ibuf_216[Li_3020] = EMPTY_VALUE;
               G_ibuf_220[Li_3020] = EMPTY_VALUE;
            } else {
               G_ibuf_212[Li_3020] = -1;
               G_ibuf_216[Li_3020] = ima_on_arr_3036;
               G_ibuf_220[Li_3020 - 1] = ima_on_arr_3028;
               G_ibuf_220[Li_3020] = -1;
            }
         }
         ima_on_arr_3028 = ima_on_arr_3036;
      }
      for (Li_3020 = 0; Li_3020 < Li_3016; Li_3020++) {
         if (G_ibuf_212[Li_3020] > 0.0 && G_ibuf_212[Li_3020] < 1000.0) {
            ObjectCreate("text_object" + DoubleToStr(3 * Li_3020 + 2.2, 1), OBJ_TREND, 0, iTime(NULL, 0, Li_3020), Low[Li_3020], iTime(NULL, 0, Li_3020), 0);
            ObjectSet("text_object" + DoubleToStr(3 * Li_3020 + 2.2, 1), OBJPROP_COLOR, Blue);
            ObjectSet("text_object" + DoubleToStr(3 * Li_3020 + 2.2, 1), OBJPROP_STYLE, STYLE_SOLID);
         }
      }
      for (Li_3020 = 0; Li_3020 < Li_3016; Li_3020++) {
         if (G_ibuf_220[Li_3020] > 0.0 && G_ibuf_220[Li_3020] < 1000.0) {
            ObjectCreate("text_object" + DoubleToStr(3 * Li_3020 + 2.2, 1), OBJ_TREND, 0, iTime(NULL, 0, Li_3020), Low[Li_3020], iTime(NULL, 0, Li_3020), 0);
            ObjectSet("text_object" + DoubleToStr(3 * Li_3020 + 2.2, 1), OBJPROP_COLOR, Red);
            ObjectSet("text_object" + DoubleToStr(3 * Li_3020 + 2.2, 1), OBJPROP_STYLE, STYLE_SOLID);
         }
      }
   } else {
      if (G_time_632 != Time[0]) {
         G_time_632 = Time[0];
         for (Li_3020 = 1; Li_3020 < 2; Li_3020++) {
            ima_on_arr_3036 = iMAOnArray(G_ibuf_224, 0, MathFloor(MathSqrt(period)), 0, MODE_LWMA, Li_3020);
            if (ima_on_arr_3036 > ima_on_arr_3028) {
               G_ibuf_212[Li_3020] = EMPTY_VALUE;
               G_ibuf_216[Li_3020] = EMPTY_VALUE;
               G_ibuf_220[Li_3020] = ima_on_arr_3036;
               G_ibuf_220[Li_3020 - 1] = ima_on_arr_3028;
               ObjectCreate("text_objlect" + DoubleToStr(Gi_636 + 2.2, 1), OBJ_TREND, 0, iTime(NULL, 0, 0), Low[0], iTime(NULL, 0, 0), 0);
               ObjectSet("text_objlect" + DoubleToStr(Gi_636 + 2.2, 1), OBJPROP_COLOR, Red);
               ObjectSet("text_objlect" + DoubleToStr(Gi_636 + 2.2, 1), OBJPROP_STYLE, STYLE_SOLID);
               Gi_636++;
            } else {
               if (ima_on_arr_3036 < ima_on_arr_3028) {
                  G_ibuf_212[Li_3020] = ima_on_arr_3036;
                  G_ibuf_212[Li_3020 - 1] = ima_on_arr_3028;
                  G_ibuf_216[Li_3020] = EMPTY_VALUE;
                  G_ibuf_220[Li_3020] = EMPTY_VALUE;
                  ObjectCreate("text_objlect" + DoubleToStr(Gi_636 + 2.2, 1), OBJ_TREND, 0, iTime(NULL, 0, 0), Low[0], iTime(NULL, 0, 0), 0);
                  ObjectSet("text_objlect" + DoubleToStr(Gi_636 + 2.2, 1), OBJPROP_COLOR, Blue);
                  ObjectSet("text_objlect" + DoubleToStr(Gi_636 + 2.2, 1), OBJPROP_STYLE, STYLE_SOLID);
                  Gi_636++;
               } else {
                  G_ibuf_212[Li_3020] = -1;
                  G_ibuf_216[Li_3020] = ima_on_arr_3036;
                  G_ibuf_220[Li_3020 - 1] = ima_on_arr_3028;
                  G_ibuf_220[Li_3020] = -1;
               }
            }
            switch (Period()) {
            case PERIOD_M1:
               Ls_3044 = "M1";
               break;
            case PERIOD_M5:
               Ls_3044 = "M5";
               break;
            case PERIOD_M15:
               Ls_3044 = "M15";
               break;
            case PERIOD_M30:
               Ls_3044 = "M30";
               break;
            case PERIOD_H1:
               Ls_3044 = "H1";
               break;
            case PERIOD_H4:
               Ls_3044 = "H4";
               break;
            case PERIOD_D1:
               Ls_3044 = "D1";
               break;
            default:
               Ls_3044 = "W";
            }
            if (ima_on_arr_3036 < ima_on_arr_3028) {
               if (!Gi_204) {
                  if (Alerts) Alert(" Up signal on currency pair ", Symbol(), " Period :", Ls_3044);
                  if (EmailOn) SendMail("Indicators Signal", " Up signal on currency pair " + Symbol() + " Period :" + Ls_3044);
                  Gi_204 = TRUE;
                  Gi_208 = FALSE;
               }
            }
            if (ima_on_arr_3036 > ima_on_arr_3028) {
               if (!Gi_208) {
                  if (Alerts) Alert(" Down signal on currency pair ", Symbol(), " Period :", Ls_3044);
                  if (EmailOn) SendMail("Indicators Signal", " Down signal on currency pair " + Symbol() + " Period :" + Ls_3044);
                  Gi_208 = TRUE;
                  Gi_204 = FALSE;
               }
            }
            ima_on_arr_3028 = ima_on_arr_3036;
         }
      }
   }
   string Ls_3056 = "";
   color color_3064 = CLR_NONE;
   if (G_ibuf_212[0] > 0.0 && G_ibuf_212[0] < 1000.0) {
      Ls_3056 = "UP";
      color_3064 = PaleGreen;
   }
   if (G_ibuf_220[0] > 0.0 && G_ibuf_220[0] < 1000.0) {
      Ls_3056 = "DOWN";
      color_3064 = Red;
   }
   int corner_3068 = 1;
   double Ld_3072 = 0;
   ObjectCreate("_szymbol" + DoubleToStr(Ld_3072, 0), OBJ_LABEL, 0, 0, 0);
   ObjectSetText("_szymbol" + DoubleToStr(Ld_3072, 0), "Current date : " + Year() + "." + Day() + "." + Month(), 13, "Arial", Orange);
   ObjectSet("_szymbol" + DoubleToStr(Ld_3072, 0), OBJPROP_CORNER, corner_3068);
   ObjectSet("_szymbol" + DoubleToStr(Ld_3072, 0), OBJPROP_XDISTANCE, Gi_88 + 30);
   ObjectSet("_szymbol" + DoubleToStr(Ld_3072, 0), OBJPROP_YDISTANCE, Gi_92 + 20);
   Ld_3072++;
   double Ld_3080 = Ask - Bid;
   if (Digits == 2 || Digits == 3) Ld_3080 = NormalizeDouble(100.0 * Ld_3080, 0);
   else Ld_3080 = NormalizeDouble(10000.0 * Ld_3080, 0);
   ObjectCreate("_szymbol" + DoubleToStr(Ld_3072, 0), OBJ_LABEL, 0, 0, 0);
   ObjectSetText("_szymbol" + DoubleToStr(Ld_3072, 0), "Current spread : " + DoubleToStr(Ld_3080, 0) + " Point(s)", 13, "Arial", Orange);
   ObjectSet("_szymbol" + DoubleToStr(Ld_3072, 0), OBJPROP_CORNER, corner_3068);
   ObjectSet("_szymbol" + DoubleToStr(Ld_3072, 0), OBJPROP_XDISTANCE, Gi_88 + 30);
   ObjectSet("_szymbol" + DoubleToStr(Ld_3072, 0), OBJPROP_YDISTANCE, Gi_92 + 40);
   Ld_3072++;
   ObjectCreate("_szymbol" + DoubleToStr(Ld_3072, 0), OBJ_LABEL, 0, 0, 0);
   ObjectSetText("_szymbol" + DoubleToStr(Ld_3072, 0), "Strength: " + DoubleToStr(NormalizeDouble(50.0 * (MathAbs(40 - iRSI(NULL, 0, period, PRICE_CLOSE, 0)) / 40.0) +
      50.0, 0), 0) + "%", 13, "Arial", color_3064);
   ObjectSet("_szymbol" + DoubleToStr(Ld_3072, 0), OBJPROP_CORNER, corner_3068);
   ObjectSet("_szymbol" + DoubleToStr(Ld_3072, 0), OBJPROP_XDISTANCE, Gi_88 + 30);
   ObjectSet("_szymbol" + DoubleToStr(Ld_3072, 0), OBJPROP_YDISTANCE, Gi_92 + 85);
   Ld_3072++;
   ObjectCreate("_szymbol" + DoubleToStr(Ld_3072, 0), OBJ_LABEL, 0, 0, 0);
   ObjectSetText("_szymbol" + DoubleToStr(Ld_3072, 0), "Signal: " + Ls_3056, 13, "Arial", color_3064);
   ObjectSet("_szymbol" + DoubleToStr(Ld_3072, 0), OBJPROP_CORNER, corner_3068);
   ObjectSet("_szymbol" + DoubleToStr(Ld_3072, 0), OBJPROP_XDISTANCE, Gi_88 + 30);
   ObjectSet("_szymbol" + DoubleToStr(Ld_3072, 0), OBJPROP_YDISTANCE, Gi_92 + 60);
   return (0);
}

Recommend