Diapazon_v1





//+------------------------------------------------------------------+
//|                                                                  |
//|                 Copyright © 2000-2007, MetaQuotes Software Corp. |
//|                                         http://www.metaquotes.ru |
//+------------------------------------------------------------------+
// Äèàïàçîí.mq4
// Èíäèêàòîð
#property copyright "mandorr@gmail.com"
#property indicator_chart_window
#property indicator_buffers 3
#property indicator_color1 SkyBlue
#property indicator_color2 SkyBlue
#property indicator_color3 SkyBlue
//----
extern int period=24;        // Ïåðèîä (êîëè÷åñòâî áàðîâ äèàïàçîíà)
extern int CountBars=1000;   // Êîëè÷åñòâî îòîáðàæàåìûõ áàðîâ
//----
double buffer0[];
double buffer1[];
double buffer2[];
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void init()
  {
   SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2);
   SetIndexBuffer(0,buffer0);
   SetIndexLabel(0,"Âåðõíÿÿ ãðàíèöà");
   SetIndexDrawBegin(0,0);
   SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,2);
   SetIndexBuffer(1,buffer1);
   SetIndexLabel(1,"Íèæíÿÿ ãðàíèöà");
   SetIndexDrawBegin(1,0);
   SetIndexStyle(2,DRAW_LINE,STYLE_DOT,1);
   SetIndexBuffer(2,buffer2);
   SetIndexLabel(2,"Ìåäèàíà");
   SetIndexDrawBegin(2,0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void deinit()
  {
   Comment("");
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void start()
  {
   for(int i=0;i<=CountBars-1;i++)
     {
      buffer0[i]=High[Highest(NULL,0,MODE_HIGH,period,i)];
      buffer1[i]=Low [Lowest (NULL,0,MODE_LOW ,period,i)];
      buffer2[i]=(buffer0[i]+buffer1[i])/2;
     }
   double range=(buffer0[0]-buffer1[0])/Point;
   Comment("Äèàïàçîí: "+DoubleToStr(range,0)+" ï.");
  }
//+------------------------------------------------------------------+



Sample





Analysis



Market Information Used:

Series array that contains the highest prices of each bar


Indicator Curves created:

Implements a curve of type DRAW_LINE


Indicators Used:



Custom Indicators Used:

Order Management characteristics:

Other Features: