Navigation:Home > Content >

FR-TrendLines.mq4

Time: 2015-03-19 | Download file:FR-TrendLines.mq4

/*
   Generated by EX4-TO-MQ4 decompiler LITE V4.0.406.1f [-]
   Website: https://purebeam.biz
   E-mail : [email protected]
*/
#property copyright "Copyright © 2011 ArtForexTrading"
#property link      "http://artforextrading.com"

#property indicator_chart_window
#property indicator_buffers 8
#property indicator_color1 White
#property indicator_color2 Blue
#property indicator_color3 Red
#property indicator_color4 White
#property indicator_color5 Blue
#property indicator_color6 Red
#property indicator_color7 Black
#property indicator_color8 Black

#import

extern int TPeriod = 34;
extern int TType = 3;
extern int TShift = 0;
double gda_88[];
double gda_92[];
double gda_96[];
double gda_100[];
double gda_104[];
double gda_108[];

int init() {
   SetIndexStyle(0, DRAW_LINE);
   SetIndexBuffer(0, gda_88);
   SetIndexStyle(1, DRAW_LINE);
   SetIndexBuffer(1, gda_92);
   SetIndexStyle(2, DRAW_LINE);
   SetIndexBuffer(2, gda_96);
   SetIndexEmptyValue(0, 0);
   SetIndexEmptyValue(1, 0);
   SetIndexEmptyValue(2, 0);
   SetIndexStyle(3, DRAW_LINE);
   SetIndexBuffer(3, gda_100);
   SetIndexStyle(4, DRAW_LINE);
   SetIndexBuffer(4, gda_104);
   SetIndexStyle(5, DRAW_LINE);
   SetIndexBuffer(5, gda_108);
   SetIndexEmptyValue(3, 0);
   SetIndexEmptyValue(4, 0);
   SetIndexEmptyValue(5, 0);
   return (0);
}

int deinit() {
   return (0);
}

int start() {
   double ld_0;
   double ld_8;
   double ld_16;
   double ld_24;
   double ld_32;
   double ld_40;
   int li_48 = IndicatorCounted();
   if (li_48 < 0) return (-1);
   if (li_48 > 0) li_48--;
   int li_52 = Bars - li_48;
   for (int li_56 = 0; li_56 < li_52; li_56++) {
      ld_0 = iMA(NULL, 0, TPeriod, TShift, TType, PRICE_HIGH, li_56);
      ld_8 = iMA(NULL, 0, TPeriod, TShift, TType, PRICE_HIGH, li_56 + 1);
      ld_16 = iMA(NULL, 0, TPeriod, TShift, TType, PRICE_LOW, li_56);
      ld_24 = iMA(NULL, 0, TPeriod, TShift, TType, PRICE_LOW, li_56 + 1);
      ld_32 = iMA(NULL, 0, TPeriod, TShift, TType, PRICE_MEDIAN, li_56);
      ld_40 = iMA(NULL, 0, TPeriod, TShift, TType, PRICE_MEDIAN, li_56 + 1);
      gda_88[li_56] = ld_0;
      gda_92[li_56] = ld_0;
      gda_96[li_56] = ld_0;
      gda_100[li_56] = ld_16;
      gda_104[li_56] = ld_16;
      gda_108[li_56] = ld_16;
      if (ld_0 > ld_8) {
         gda_96[li_56] = 0;
         gda_108[li_56] = 0;
      }
      if (ld_0 < ld_8) {
         gda_92[li_56] = 0;
         gda_104[li_56] = 0;
      }
   }
   return (0);
}

Recommend