User login

  

On Balance Volume (OBV)

On Balance Volume (OBV) measures buying and selling pressure as a cumulative indicator that adds volume on up days and subtracts volume on down days. OBV was developed by Joe Granville and introduced in his 1963 book, Granville's New Key to Stock Market Profits. It was one of the first indicators to measure positive and negative volume flow. Chartists can look for divergences between OBV and price to predict price movements or use OBV to confirm price trends.

Interpretation

OBV rises when volume on up days outpaces volume on down days. OBV falls when volume on down days is stronger. A rising OBV reflects positive volume pressure that can lead to higher prices. Conversely, falling OBV reflects negative volume pressure that can foreshadow lower prices. Granville noted in his research that OBV would often move before price. Expect prices to move higher if OBV is rising while prices are either flat or moving down. Expect prices to move lower if OBV is falling while prices are either flat or moving up.

The absolute value of OBV is not important. Chartists should instead focus on the characteristics of the OBV line. First define the trend for OBV. Second, determine if the current trend matches the trend for the underlying security. Third, look for potential support or resistance levels. Once broken, the trend for OBV will change and these breaks can be used to generate signals. Also notice that OBV is based on closing prices. Therefore, closing prices should be considered when looking for divergences or support/resistance breaks. And finally, volume spikes can sometimes throw off the indicator by causing a sharp move that will require a settling period.

Divergences

Bullish and bearish divergence signals can be used to anticipate a trend reversal. These signals are truly based on the theory that volume precedes prices. A bullish divergence forms when OBV moves higher or forms a higher low even as prices move lower or forge a lower low. A bearish divergence forms when OBV moves lower or forms a lower low even as prices move higher or forge a higher high. The divergence between OBV and price should alert chartists that a price reversal could be in the making.

Trend Confirmation

OBV can be used to confirm a price trend, upside breakout or downside break. The chart for Best Buy (BBY) shows three confirming signals as well as confirmation of the price trend. OBV and BBY moved lower in December-January, higher from March to April, lower from May to August and higher from September to October. The trends in OBV matched the trend in BBY.

OBV also confirmed trend reversals in BBY. Notice how BBY broke its down trendline in late February and OBV confirmed with a resistance breakout in March. BBY broke its up trendline in late April and OBV confirmed with a support break in early May. BBY broke its down trendline in early September and OBV confirmed with a trendline break a week later. These coincident signals indicated that positive and negative volume were in harmony with price.

Sometimes OBV moves step-for-step with the underlying security. In this case, OBV is confirming the strength of the underlying trend, be it down or up. The chart for Autozone (AZO) shows prices as a black line and OBV as a pink line. Both moved steadily higher from November 2009 until October 2010. Positive volume remained strong throughout the advance.

Conclusions

On Balance Volume (OBV) is a simple indicator that uses volume and price to measure buying pressure and selling pressure. Buying pressure is evident when positive volume exceeds negative volume and the OBV line rises. Selling pressure is present when negative volume exceeds positive volume and the OBV line falls. Chartists can use OBV to confirm the underlying trend or look for divergences that may foreshadow a price change. As with all indicators, it is important to use OBV in conjunction with other aspects of technical analysis. It is not a stand alone indicator. OBV can be combined with basic pattern analysis or to confirm signals from momentum oscillators.

 

Display/hide source code
//+------------------------------------------------------------------+
//|                                            On Balance Volume.mq4 |
//|                      Copyright © 2005, MetaQuotes Software Corp. |
//|                                       http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net/"
 
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 DodgerBlue
//---- input parameters
extern int ExtOBVAppliedPrice=0;
//---- buffers
double ExtOBVBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   string sShortName;
//---- indicator buffer mapping
   SetIndexBuffer(0,ExtOBVBuffer);
//---- indicator line
   SetIndexStyle(0,DRAW_LINE);
//---- sets default precision format for indicators visualization
   IndicatorDigits(0);     
//---- name for DataWindow and indicator subwindow label
   sShortName="OBV";
   IndicatorShortName(sShortName);
   SetIndexLabel(0,sShortName);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| On Balance Volume                                                |
//+------------------------------------------------------------------+
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-1;
//---- 
   for(i=nLimit; i>=0; i--)
     {
      if(i==Bars-1)
         ExtOBVBuffer[i]=Volume[i];
      else
        {
         double dCurrentPrice=GetAppliedPrice(ExtOBVAppliedPrice, i);
         double dPreviousPrice=GetAppliedPrice(ExtOBVAppliedPrice, i+1);
         if(dCurrentPrice==dPreviousPrice)
            ExtOBVBuffer[i]=ExtOBVBuffer[i+1];
         else
           {
            if(dCurrentPrice<dPreviousPrice)
               ExtOBVBuffer[i]=ExtOBVBuffer[i+1]-Volume[i];  
            else
               ExtOBVBuffer[i]=ExtOBVBuffer[i+1]+Volume[i]; 
           }
        }
     }
//----
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
double GetAppliedPrice(int nAppliedPrice, int nIndex)
  {
   double dPrice;
//----
   switch(nAppliedPrice)
     {
      case 0:  dPrice=Close[nIndex];                                  break;
      case 1:  dPrice=Open[nIndex];                                   break;
      case 2:  dPrice=High[nIndex];                                   break;
      case 3:  dPrice=Low[nIndex];                                    break;
      case 4:  dPrice=(High[nIndex]+Low[nIndex])/2.0;                 break;
      case 5:  dPrice=(High[nIndex]+Low[nIndex]+Close[nIndex])/3.0;   break;
      case 6:  dPrice=(High[nIndex]+Low[nIndex]+2*Close[nIndex])/4.0; break;
      default: dPrice=0.0;
     }
//----
   return(dPrice);
  }
//+------------------------------------------------------------------+
12345

Comments