Navigation:Home > Content >

SSRC_MTF~.mq4

Time: 2010-05-13 | Download file:SSRC_MTF~.mq4

/*
   G e n e r a t e d  by ex4-to-mq4 decompiler FREEWARE 4.0.509.5
   Website: Http: //w w w .M e tA q UOt ES .NEt
   E-mail :  S uP pO rT @ METAQUOTES.N eT
*/

#property indicator_separate_window
#property indicator_minimum -1.3
#property indicator_maximum 1.3
#property indicator_buffers 3
#property indicator_color1 Lime
#property indicator_color2 Red
#property indicator_color3 Blue
#property indicator_level1 0.9
#property indicator_level2 -0.9
#property indicator_level3 0.75
#property indicator_level4 -0.75

extern int TimeFrame = 5;
extern string w1 = "Имя обьектов на графике";
extern string name = "OBJ";
extern string g1 = "Отоброжать сигнал на графике?";
extern bool vis = TRUE;
extern string c1 = "Показать историю сигналов?";
extern bool his = FALSE;
extern string a1 = "Звуковой сигнал?";
extern bool sou = FALSE;
extern color Buy = Blue;
extern color Sell = Red;
extern int SnakeRange = 3;
extern int FilterPeriod = 21;
extern double MartFiltr = 2.0;
extern int PriceConst = 6;
double G_ibuf_160[];
double G_ibuf_164[];
double Gd_unused_168;
double G_ibuf_176[];

// E37F0136AA3FFAF149B351F6A4C948E9
int init() {
   if (TimeFrame != 0) {
      if (TimeFrame < Period()) {
         Alert("Настраиваемый таймфрейм должен быть больше текущего или равен 0");
         return (0);
      }
   }
   bool Li_0 = FALSE;
   switch (TimeFrame) {
   case 0:
      Li_0 = TRUE;
      break;
   case 1:
      Li_0 = TRUE;
      break;
   case 5:
      Li_0 = TRUE;
      break;
   case 15:
      Li_0 = TRUE;
      break;
   case 30:
      Li_0 = TRUE;
      break;
   case 60:
      Li_0 = TRUE;
      break;
   case 240:
      Li_0 = TRUE;
      break;
   case 1440:
      Li_0 = TRUE;
      break;
   case 10080:
      Li_0 = TRUE;
      break;
   case 43200:
      Li_0 = TRUE;
   }
   if (Li_0 == FALSE) {
      Alert("Вы ввели некорректную цифру таймфрейма");
      return (0);
   }
   SetIndexBuffer(0, G_ibuf_160);
   SetIndexStyle(0, DRAW_LINE);
   if (Digits == 5 || Digits == 3) Gd_unused_168 = 10;
   else Gd_unused_168 = 1;
   SetIndexStyle(1, DRAW_ARROW, EMPTY, 0);
   SetIndexArrow(1, 234);
   SetIndexBuffer(1, G_ibuf_164);
   SetIndexStyle(2, DRAW_ARROW, EMPTY, 0);
   SetIndexArrow(2, 233);
   SetIndexBuffer(2, G_ibuf_176);
   return (0);
}

// 52D46093050F38C27267BCE42543EF60
int deinit() {
   f0_1();
   return (0);
}

// EA2B2676C28C0DB26D39331A336C6B92
int start() {
   int Li_4;
   datetime time_8;
   int shift_12;
   bool Li_20;
   int ind_counted_0 = IndicatorCounted();
   if (TimeFrame > 0) Li_4 = Bars - ind_counted_0 + TimeFrame / Period();
   else Li_4 = Bars - ind_counted_0 - 1;
   if (Li_4 == 0) return (0);
   for (int Li_16 = Li_4; Li_16 >= 0; Li_16--) {
      Li_20 = Li_16;
      time_8 = Time[Li_16];
      shift_12 = iBarShift(NULL, TimeFrame, time_8, FALSE);
      G_ibuf_160[Li_16] = iCustom(NULL, TimeFrame, "SSRC", SnakeRange, FilterPeriod, MartFiltr, PriceConst, 0, shift_12);
      if (vis == TRUE && G_ibuf_160[Li_16 + 1] > -0.9 && G_ibuf_160[Li_16 + 2] < -0.9) {
         G_ibuf_176[Li_16] = G_ibuf_160[Li_16];
         if (his == FALSE) Li_20 = FALSE;
         f0_0(Li_20 + name, 0, Time[Li_16], Low[Li_16] - 5.0 * Point, 233, Buy, 1);
         if (ObjectFind(Li_20 + name) == 0 && sou == TRUE) PlaySound("expert");
      }
      if (vis == TRUE && G_ibuf_160[Li_16] < 0.9 && G_ibuf_160[Li_16 + 1] > 0.9) {
         G_ibuf_164[Li_16] = G_ibuf_160[Li_16];
         if (his == FALSE) Li_20 = FALSE;
         f0_0(Li_20 + name + 1, 0, Time[Li_16], High[Li_16] + 5.0 * Point, 234, Sell, 1);
         if (ObjectFind(Li_20 + name + 1) == 0 && sou == TRUE) PlaySound("expert");
      }
      if (vis == TRUE && G_ibuf_160[Li_16 + 1] > -0.75 && G_ibuf_160[Li_16 + 2] < -0.75) {
         G_ibuf_176[Li_16] = G_ibuf_160[Li_16];
         if (his == FALSE) Li_20 = FALSE;
         f0_0(Li_20 + name + 2, 0, Time[Li_16], Low[Li_16] - 5.0 * Point, 233, Buy, 1);
         if (ObjectFind(Li_20 + name + 2) == 0 && sou == TRUE) PlaySound("expert");
      }
      if (vis == TRUE && G_ibuf_160[Li_16] < 0.75 && G_ibuf_160[Li_16 + 1] > 0.75) {
         G_ibuf_164[Li_16] = G_ibuf_160[Li_16];
         if (his == FALSE) Li_20 = FALSE;
         f0_0(Li_20 + name + 3, 0, Time[Li_16], High[Li_16] + 5.0 * Point, 234, Sell, 1);
         if (ObjectFind(Li_20 + name + 3) == 0 && sou == TRUE) PlaySound("expert");
      }
      if (vis == FALSE && G_ibuf_160[Li_16 + 1] > -0.9 && G_ibuf_160[Li_16 + 2] < -0.9) {
         G_ibuf_176[Li_16] = G_ibuf_160[Li_16];
         if (sou == TRUE) PlaySound("expert");
      }
      if (vis == FALSE && G_ibuf_160[Li_16] < 0.9 && G_ibuf_160[Li_16 + 1] > 0.9) {
         G_ibuf_164[Li_16] = G_ibuf_160[Li_16];
         if (sou == TRUE) PlaySound("expert");
      }
      if (vis == FALSE && G_ibuf_160[Li_16 + 1] > -0.75 && G_ibuf_160[Li_16 + 2] < -0.75) {
         G_ibuf_176[Li_16] = G_ibuf_160[Li_16];
         if (sou == TRUE) PlaySound("expert");
      }
      if (vis == FALSE && G_ibuf_160[Li_16] < 0.75 && G_ibuf_160[Li_16 + 1] > 0.75) {
         G_ibuf_164[Li_16] = G_ibuf_160[Li_16];
         if (sou == TRUE) PlaySound("expert");
      }
   }
   return (0);
}

// 4E7250142D3FA193160201293FF7C9B5
void f0_0(string A_name_0, int A_window_8, int A_datetime_12, double Ad_16, int Ai_24, color A_color_28, int A_width_32 = 1) {
   ObjectCreate(A_name_0, OBJ_ARROW, A_window_8, 0, 0);
   ObjectSet(A_name_0, OBJPROP_TIME1, A_datetime_12);
   ObjectSet(A_name_0, OBJPROP_PRICE1, Ad_16);
   ObjectSet(A_name_0, OBJPROP_ARROWCODE, Ai_24);
   ObjectSet(A_name_0, OBJPROP_COLOR, A_color_28);
   ObjectSet(A_name_0, OBJPROP_WIDTH, A_width_32);
}

// 5FD0582B1A3046B997A40BB597A61B62
void f0_1() {
   for (int Li_0 = 15000; Li_0 >= -1; Li_0--) {
      ObjectDelete(Li_0 + "OBGECT");
      ObjectDelete(Li_0 + "OBGEC");
      ObjectDelete(Li_0 + "OBGE");
      ObjectDelete(Li_0 + "OBG");
      ObjectDelete(Li_0 + name);
      ObjectDelete(Li_0 + name + 1);
      ObjectDelete(Li_0 + name + 2);
      ObjectDelete(Li_0 + name + 3);
   }
}

Recommend