Navigation:Home > Content >

33_M3.mq4

Time: 2013-04-20 | Download file:33_M3.mq4

//+------------------------------------------------------------------+
//|                                                        33_M3.mq4 |
//|                      Copyright © 2006, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 LimeGreen
#property indicator_color2 Orange

extern int CountBars=500;
extern int t3_period=14;
extern int mom=10;

double buf1[];
double buf2[];

double value1=0;
int AccountedBars=0,numBars=0;
double value2=0; 
double t3=0,t30=0,X1=0,X10=0,e10=0,e20=0,e30=0,e40=0,e50=0,e60=0; 
double e1=0,e2=0,e3=0,e4=0,e5=0,e6=0,c1=0,c2=0,c3=0,c4=0; 
double n=0,w1=0,w2=0,b=0,b2=0,b3=0; 

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_HISTOGRAM);
   SetIndexBuffer(0,buf1);
   SetIndexStyle(1,DRAW_HISTOGRAM);
   SetIndexBuffer(1,buf2);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int shift,cnt;
//----
b=0.7; 
b2=b*b; 
b3=b2*b; 
c1=-b3; 
c2=(3*(b2+b3)); 
c3=-3*(2*b2+b+b3); 
c4=(1+3*b+b3+3*b2); 
n=t3_period; 

if(n<1) n=1; 
n = 1 + 0.5*(n-1); 
w1 = 2 / (n + 1); 
w2 = 1 - w1; 

if(AccountedBars==0) AccountedBars = Bars-CountBars; 

for(cnt=AccountedBars;cntX10) buf1[shift]=X1; 
   if(X1        

Recommend