Navigation:Home > Content >

Buy_Sell_Volume_v1.0.mq4

Time: 2015-09-03 | Download file:Buy_Sell_Volume_v1.0.mq4

//+-------------------------------------------------------------------+
//|                                        Buy_Sell_Volumes_v1.0.mq4  |
//|                                            Copyright © 2013, Pip  |
//|                                    http://www.pricemasterpro.com  |
//| This indicator is for personal use only.                          |
//| Please respect the intellectual rights of the original programmer |
//| and the work of others that contributed to this indicator         |
//| under no circumstances is this indicator to be sold for money or  |
//| to be repackged into a commercial package or to be distributed as |
//| original work by anyone else.                                     |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2013, Pip; admin@pricemasterpro.com"
#property link      "http://www.pricemasterpro.com/"
//---- indicator settings
#property  indicator_separate_window
#property indicator_minimum 0
#property indicator_buffers 6
#property indicator_color1  White
#property indicator_color2  White
#property indicator_color3  Red
#property indicator_color4  Red
#property indicator_color5  Green
#property indicator_color6  Green
#property indicator_width1  1
#property indicator_width2  1
#property indicator_width3  1
#property indicator_width4  1
#property indicator_width5  1
#property indicator_width6  1
//---- indicator buffers
double ExtVolumesBufferHisto[];
double ExtVolumesBufferLine[];
double ExtVolumesUpBufferHisto[];
double ExtVolumesUpBufferLine[];
double ExtVolumesDownBufferHisto[];
double ExtVolumesDownBufferLine[];
 
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicator buffers mapping
   SetIndexBuffer(0,ExtVolumesBufferHisto);       
   SetIndexBuffer(1,ExtVolumesBufferLine);
   SetIndexBuffer(2,ExtVolumesUpBufferHisto);
   SetIndexBuffer(3,ExtVolumesUpBufferLine);       
   SetIndexBuffer(4,ExtVolumesDownBufferHisto);
   SetIndexBuffer(5,ExtVolumesDownBufferLine);
//---- drawing settings
   SetIndexStyle(0,DRAW_HISTOGRAM);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexStyle(2,DRAW_HISTOGRAM);
   SetIndexStyle(3,DRAW_LINE);
   SetIndexStyle(4,DRAW_HISTOGRAM);
   SetIndexStyle(5,DRAW_LINE);
//---- sets default precision format for indicators visualization
   IndicatorDigits(0);   
//---- name for DataWindow and indicator subwindow label
   IndicatorShortName("Buy_Sell Volume Pressure");
   SetIndexLabel(0,"Total Volume");      
   SetIndexLabel(1,"Buy Volume");
   SetIndexLabel(2,"Sell Volume");
//---- sets drawing line empty value
   SetIndexEmptyValue(1,0.0);
   SetIndexEmptyValue(3,0.0); 
   SetIndexEmptyValue(5,0.0);      
//---- initialization done
   return(0);
  }
//+------------------------------------------------------------------+
//| Volumes                                                          |
//+------------------------------------------------------------------+
int start()
  {
   int    i,nLimit,nCountedBars;
//---- bars count that does not changed after last indicator launch.
   nCountedBars=IndicatorCounted();
//---- last counted bar will be recounted
   if(nCountedBars>0) nCountedBars--;
   nLimit=Bars-nCountedBars;
//----
   for(i=0; i        

Recommend