Author: mandorr@gmail.com
Diapazon
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
Diapazon
// Äèàïàçîí.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)+" ï.");
   }

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---