Navigation:Home > Content >

Triggerlines_-_Pip.mq4

Time: 2014-07-03 | Download file:Triggerlines_-_Pip.mq4

/*
   Generated by EX4-TO-MQ4 decompiler V4.0.438.3 [-]
   Website: https://purebeam.biz
   E-mail : purebeam@gmail.com
*/
#property copyright "Copyright © 2005 dwt5 and adoleh2000 "
#property link      "http://www.metaquotes.net/"

#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Fuchsia
#property indicator_color2 Fuchsia
#property indicator_color3 Lime
#property indicator_color4 Lime

double g_ibuf_76[];
double g_ibuf_80[];
double g_ibuf_84[];
double g_ibuf_88[];
extern int Rperiod = 21;
extern int LSMA_Period = 5;
extern int BarstoDraw = 500;
int gi_108;
int gi_112;
int gi_116;
int gi_120;
int gi_124;
double gd_128;
double g_ibuf_136[];
double g_ibuf_140[];

int init() {
   IndicatorBuffers(6);
   SetIndexBuffer(0, g_ibuf_76);
   SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 2);
   SetIndexBuffer(1, g_ibuf_80);
   SetIndexStyle(1, DRAW_LINE, STYLE_SOLID, 2);
   SetIndexBuffer(2, g_ibuf_84);
   SetIndexStyle(2, DRAW_LINE, STYLE_SOLID, 2);
   SetIndexBuffer(3, g_ibuf_88);
   SetIndexStyle(3, DRAW_LINE, STYLE_SOLID, 2);
   SetIndexBuffer(4, g_ibuf_136);
   SetIndexBuffer(5, g_ibuf_140);
   return (0);
}

int start() {
   double ld_0;
   double ld_8;
   gi_108 = BarstoDraw + 50 - Rperiod - 5;
   gi_120 = Rperiod;
   gi_124 = LSMA_Period;
   gi_116 = gi_108 - gi_120 - 1;
   for (gi_112 = gi_116; gi_112 >= 0; gi_112--) {
      ld_0 = 0;
      for (int li_16 = gi_120; li_16 >= 1; li_16--) {
         gd_128 = gi_120 + 1;
         gd_128 /= 3.0;
         ld_8 = 0;
         ld_8 = (li_16 - gd_128) * (Close[gi_120 - li_16 + gi_112]);
         ld_0 += ld_8;
      }
      g_ibuf_136[gi_112] = 6.0 * ld_0 / (gi_120 * (gi_120 + 1));
   }
   double ld_20 = 2.0 / (gi_124 + 1);
   for (int li_28 = gi_116 - 2; li_28 >= 0; li_28--) {
      if (li_28 == gi_116 - 2) g_ibuf_140[li_28 + 1] = g_ibuf_136[li_28 + 1];
      g_ibuf_140[li_28] = g_ibuf_136[li_28] * ld_20 + (g_ibuf_140[li_28 + 1]) * (1 - ld_20);
   }
   for (gi_112 = gi_116; gi_112 >= 0; gi_112--) {
      g_ibuf_76[gi_112] = g_ibuf_136[gi_112];
      g_ibuf_80[gi_112] = g_ibuf_140[gi_112];
      g_ibuf_84[gi_112] = g_ibuf_136[gi_112];
      g_ibuf_88[gi_112] = g_ibuf_140[gi_112];
      if (g_ibuf_136[gi_112] < g_ibuf_140[gi_112]) {
         g_ibuf_88[gi_112] = EMPTY_VALUE;
         g_ibuf_84[gi_112] = EMPTY_VALUE;
      }
   }
   return (0);
}

Recommend