0
Views
0
Downloads
0
Favorites
line_Volum
// Ëèíåéíûé îáúåì.mq4
// Èíäèêàòîð
// Ïðåïðîöåññîð
#property copyright "mandorr@gmail.com"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_width1 2
#property indicator_style1 0
#property indicator_color1 SkyBlue
#property indicator_minimum 0
// Ïàðàìåòðû
extern int period=5; // Ïåðèîä (êîëè÷åñòâî áàðîâ äèàïàçîíà)
extern int CountBars=10000; // Êîëè÷åñòâî îòîáðàæàåìûõ áàðîâ
// Ïåðåìåííûå
double buffer[];
void init() {
IndicatorShortName("Ëèíåéíûé îáúåì ("+period+")");
IndicatorDigits(0);
SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,2,SkyBlue);
SetIndexBuffer(0,buffer);
SetIndexLabel(0,"Value");
SetIndexDrawBegin(0,0);
SetIndexEmptyValue(0,0);
}
void deinit() {
}
void start() {
ArrayInitialize(buffer,0);
int p=period; if (period<1) p=1;
for (int i=0;i<=CountBars-1;i++) {
int length=0;
for (int j=0;j<=p-1;j++) {
if (Low[i+j]>Close[i+j+1]) length+=MathRound((High[i+j]-Close[i+j+1])/Point);
else if (High[i+j]<Close[i+j+1]) length+=MathRound((Close[i+j+1]-Low[i+j])/Point);
else length+=MathRound((High[i+j]-Low[i+j])/Point);
}
buffer[i]=length/p;
}
}
Comments
Markdown Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---