//+------------------------------------------------------------------+ //| prusax_v8.mq4 //| //+------------------------------------------------------------------+ #property indicator_separate_window #property indicator_buffers 2 #property indicator_color1 White #property indicator_color2 Red #property indicator_width1 3 #property indicator_width2 3 //---- buffers double BufferUP[]; double BufferDN[]; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { string short_name; //---- indicator line IndicatorBuffers(2); SetIndexStyle(0,DRAW_HISTOGRAM); SetIndexBuffer(0,BufferUP); SetIndexStyle(1,DRAW_HISTOGRAM); SetIndexBuffer(1,BufferDN); SetIndexDrawBegin(0,10); SetIndexDrawBegin(1,10); //---- return(0); } //+------------------------------------------------------------------+ //| //+------------------------------------------------------------------+ int start() { int i,counted_bars=IndicatorCounted(); double UP,DN; //---- for(i=Bars-counted_bars-1;i>=0;i--) { UP = ((High[i]-Open[i])+(Close[i]-Low[i])); DN = ((Open[i]-Low[i])+(High[i]-Close[i])); if (UP > DN) { BufferUP[i] = UP-DN; BufferDN[i] = 0.0; } if (UP < DN) { BufferUP[i] = 0.0; BufferDN[i] = -1*(DN-UP); } } return(0); } //+------------------------------------------------------------------+
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
Series array that contains open prices of each bar
Indicator Curves created:
Implements a curve of type DRAW_HISTOGRAM
Indicators Used:
Custom Indicators Used:
Order Management characteristics:
Other Features: