Navigation:Home > Content >

TereshSuperMegaWinner.mq4

Time: 2016-05-13 | Download file:TereshSuperMegaWinner.mq4

//+------------------------------------------------------------------------------------------------------------------+
//|                                                                                  TereshSuperMegaWinner Like.mq4  |
//|                                                                   Copyright ? 2008-2010, TradingSystemForex.Com  |
//|                                                                              http://www.tradingsystemforex.com/  |
//+------------------------------------------------------------------------------------------------------------------+

#property copyright "Copyright ? 2008-2010, TradingSystemForex.Com"
#property link "http://www.tradingsystemforex.com/"

#property indicator_separate_window
#property  indicator_buffers 9
#property indicator_color1 C'0,0,0'
#property indicator_color2 C'0,0,0'
#property indicator_color3 Red
#property indicator_color4 DeepSkyBlue
#property indicator_color5 Lime
#property indicator_color6 Red

#property indicator_level1 0.76
#property indicator_level2 0.5
#property indicator_level3 -0.5
#property indicator_level4 -0.76

#property indicator_maximum 1.1
#property indicator_minimum -1.1

extern int bar1=15;
extern int bar2=13;
extern int period1=6;
extern int period2=5;
extern double factorx=-1.5;

extern string pair1="EURUSD";
extern string pair2="EURUSD";

double extmapbuffer0[];
double extmapbuffer1[];
double extmapbuffer3[];
double extmapbuffer4[];
double extmapbuffer6[];
double extmapbuffer7[];

int j;
double val0,val1;

int init(){

   for(int i=3;i<6;i++){
      SetIndexStyle(i,DRAW_LINE);
      SetIndexDrawBegin(i,MathMax(bar1,bar2)+period1);
   }

   SetIndexBuffer(0,extmapbuffer0);
   SetIndexStyle(0,DRAW_NONE);
   SetIndexBuffer(1,extmapbuffer1);
   SetIndexStyle(1,DRAW_NONE);
   SetIndexBuffer(2,extmapbuffer3);
   SetIndexStyle(2,DRAW_LINE,0,2);
   SetIndexBuffer(3,extmapbuffer4);
   SetIndexStyle(3,DRAW_LINE,0,2);

   SetIndexStyle(4,DRAW_ARROW);
   SetIndexBuffer(4,extmapbuffer6);
   SetIndexEmptyValue(4,EMPTY_VALUE);
   SetIndexArrow(4,159);
   SetIndexStyle(5,DRAW_ARROW);
   SetIndexBuffer(5,extmapbuffer7);
   SetIndexEmptyValue(5,EMPTY_VALUE);
   SetIndexArrow(5,159);

   IndicatorShortName("TereshSuperMegaWinner Like");

   return(0);
}

int start(){

   int limit;
   int counted_bars=IndicatorCounted();
   int i;

   if(counted_bars<0)return(-1);
   if(counted_bars>0)counted_bars--;
   limit=Bars-counted_bars;
   if(limit>1440)limit=14400;
   for(i=limit;i>=0;i--){
      extmapbuffer0[i]=value(pair1,bar1,i);
      extmapbuffer1[i]=value(pair2,bar2,i);
   }
   for(i=limit;i>=0;i--){
      val0=0;
      for(j=0;j<=period1;j++){
         val0=val0+extmapbuffer0[i+j];
      }
      val1=0;
      for(j=0;j<=period2;j++){
         val1=val1+extmapbuffer1[i+j];
      }
      extmapbuffer3[i]=val0/period1;//iMAOnArray(extmapbuffer0,0,period1,0,MODE_SMA,i);
      extmapbuffer4[i]=val1/period2*factorx;//iMAOnArray(extmapbuffer1,0,period2,0,MODE_SMA,i)*factorx;

      extmapbuffer6[i]=EMPTY_VALUE;
      extmapbuffer7[i]=EMPTY_VALUE;
      if(extmapbuffer3[i]>extmapbuffer4[i])extmapbuffer6[i]=1;
      if(extmapbuffer3[i]low)val=((iClose(pair,0,pos)-low)/(high-low)*2.0-1);
   return(val);
}
//+------------------------------------------------------------------+

Recommend