Navigation:Home > Content >

miller.mq4

Time: 2016-02-11 | Download file:miller.mq4

//+------------------------------------------------------------------+
//|                                                       miller.mq4 |
//|                                                                * |
//|                                                                * |
//+------------------------------------------------------------------+
#property copyright "Integer"
#property link      "for-good-letters@yandex.ru"

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Red
//---- input parameters
extern int iPeriodBars=64; 
extern int iPhazaDegrees=0; 
extern int iShift=0;

//---- buffers
double ExtMapBuffer1[];
double Cum[];
double f,twopi;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   IndicatorBuffers(2);
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexBuffer(1,Cum);
   SetIndexEmptyValue(1,0.0);
   SetIndexShift(0,iShift);
   f=6.28*iPhazaDegrees/360.0*iPeriodBars/iPeriodBars;
   twopi=8*MathArctan(1);
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start(){

         int limit=Bars-IndicatorCounted();

            for(int i=limit-1;i>=0;i--){
               Cum[i]=Cum[i+1]+1;
               ExtMapBuffer1[i]  =  (MathSin(twopi*(Cum[i]/iPeriodBars)+f)+MathSin(4.0*twopi*(Cum[i]/iPeriodBars)+f)/2+MathSin(16.0*twopi*(Cum[i]/iPeriodBars)+f)/4)/1.75;
            }
            
            
   return(0);
  }
//+------------------------------------------------------------------+

Recommend