// Ëèíåéíûé îáúåì.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; } }
Sample
Analysis
Market Information Used:
Series array that contains close prices for each bar
Series array that contains the highest prices of each bar
Series array that contains the lowest prices of each bar
Indicator Curves created:
Implements a curve of type DRAW_HISTOGRAM
Indicators Used:
Custom Indicators Used:
Order Management characteristics:
Other Features: