Speed4_001





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

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 LightSeaGreen
#property indicator_color2 Red
extern int pips_min=10;
extern int pips_max=300;
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   IndicatorShortName("Speed4(C0-C1)");
//---- indicators
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,ExtMapBuffer2);

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Accumulation/Distribution                                        |
//+------------------------------------------------------------------+
int start()
  {
   int i,n,Bars1,counted_bars=IndicatorCounted();
   RefreshRates();
//----
   //i=0;
   //n=Bars-counted_bars-1;
   //while(i<=n)
   Bars1=Bars/2;
   i=Bars1;//Bars-counted_bars-1;
   while(i>=0)   
   {
      double high0 =High[i];
      double low0  =Low[i];
      double open0 =Open[i];
      double close0=Close[i];
      double pips0=close0/Point;
      double vol0=Volume[i];
      
      double high1 =High[i+1];
      double low1  =Low[i+1];
      double open1 =Open[i+1];
      double close1=Close[i+1];
      double pips1=close1/Point;
      double vol1=Volume[i+1];
      
      double high2 =High[i+2];
      double low2  =Low[i+2];
      double open2 =Open[i+2];
      double close2=Close[i+2];
      double pips2=close2/Point;
      double vol2=Volume[i+2];    
      
      
      
      double vit1=(close0-close1)/(vol0-vol1);  
      double vit2=(close1-close2)/(vol1-vol2);  
      
      double vit3=(high0-low0)/(vol0-vol1);  
      double vit4=(high1-low1)/(vol1-vol2); 
      //ExtMapBuffer1[i]=ExtMapBuffer1[i+1]+Volume[i];             
      ExtMapBuffer1[i]=(close0-close1);//iMACD(NULL,0,14,26,9,PRICE_CLOSE,MODE_MAIN,0)-iMACD(NULL,0,14,26,9,PRICE_CLOSE,MODE_MAIN,1);//buy //-vit4;  //(close-low)-(high-close);
      ExtMapBuffer2[i]=vit1*100;//-(iMACD(NULL,0,14,26,9,PRICE_CLOSE,MODE_MAIN,0)-iMACD(NULL,0,14,26,9,PRICE_CLOSE,MODE_MAIN,1));//sell
      /*
      if(ExtMapBuffer1[i]!=0)
      {
         double diff=high-low;
         if(0==diff)
            ExtMapBuffer1[i]=0;
         else
         {
            ExtMapBuffer1[i]/=diff;
            ExtMapBuffer1[i]*=Volume[i];
         }
      }*/
      if(i<Bars1-1) 
      {
        ExtMapBuffer1[i]-=ExtMapBuffer1[i+1];
        ExtMapBuffer2[i]-=ExtMapBuffer2[i+1];
      }  
      
      
      i--;
     }
//----
   return(0);
  }
//+------------------------------------------------------------------+



Sample





Analysis



Market Information Used:

Series array that contains the highest prices of each bar
Series array that contains the lowest prices of each bar
Series array that contains open prices of each bar
Series array that contains close prices for each bar
Series array that contains tick volumes of each bar


Indicator Curves created:

Implements a curve of type DRAW_LINE


Indicators Used:



Custom Indicators Used:

Order Management characteristics:

Other Features: