Navigation:Home > Content >

Speed_Kharko.mq4

Time: 2018-11-19 | Download file:Speed_Kharko.mq4

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

//---- indicator settings
#property  indicator_chart_window
#property  indicator_buffers 4
#property  indicator_color1  Yellow
#property  indicator_color2  Yellow
#property  indicator_style2  STYLE_DOT
#property  indicator_color3  Aqua
#property  indicator_color4  Aqua
#property  indicator_style4  STYLE_DOT

//---- indicator parameters
extern int    Bar          = 24;       // Период
extern int    Cena         = 0;        // Цена: 1 - открытия; 2 - закрытия; 3 - максимум; 4 - минимум;
                                       //       5 - (H + L)/2; 6 - (H+L+C)/3; 7 - (H+L+C+O)/4;
                                       //       0 - (H+L+C+O)/4
extern bool   Sp_vis        = true;    // показать/спрятать график скорости
extern bool   SpOf_vis      = true;    // показать/спрятать график скорости со сдвигом внутрь истории

//---- indicator buffers
double     ExtBuffer0[];
double     ExtBuffer1[];
double     ExtBuffer2[];
double     ExtBuffer3[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- drawing settings
   SetIndexStyle(0,DRAW_LINE);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexStyle(2,DRAW_LINE);
   SetIndexStyle(3,DRAW_LINE);
//---- 4 indicator buffers mapping
   SetIndexBuffer(0,ExtBuffer0);
   SetIndexBuffer(1,ExtBuffer1);
   SetIndexBuffer(2,ExtBuffer2);
   SetIndexBuffer(3,ExtBuffer3);
//---- name for DataWindow and indicator subwindow label
   IndicatorShortName("Speed");
   SetIndexLabel(0,"Speed");
   SetIndexLabel(1,"SpeedNULL");
   SetIndexLabel(2,"Speed+Offset");
   SetIndexLabel(3,"SpeedNULL+Offset");
//---- initialization done

   return(0);
  }
//+------------------------------------------------------------------+
//| Accelerator/Decelerator Oscillator                               |
//+------------------------------------------------------------------+
int start()
  {
   int    limit,Error;
//---- last counted bar will be recounted
   int counted_bars=IndicatorCounted();
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars-Bar;
   if(limit<1)limit=1;
//---- 
   if(ExtBuffer0[0]!=0)ExtBuffer0[0]=0;
   if(ExtBuffer2[Bar]!=0)ExtBuffer2[Bar]=0;
   for(int i=0; i        

Recommend