[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Chip's Tips - Tutorial: OBV for the NYSE Composite



PureBytes Links

Trading Reference Links

(This is another in a series of tips that I hope will improve
everyone's use of MetaStock 6.x.  Feel free to comment and/or send
additional tips!)

Tutorial: Plotting "On Balance Volume" for the NYSE Composite
=============================================================

Ever tried plotting the "On Balance Volume" indicator for the NYSE
Composite?  Depending on how your data provider formats their index
data, you may just see a straight line for this indicator and all the
other indicators that use price and volume in their calculations.  Why
does this happen and how can we fix it?

I get my End-of-Day data from Reuters Trend Data Link.  They provide
the value of the NYSE Composite in one "security" (ticker: .NYA) and
the Total Volume for the NYSE in a different one (ticker: X-NYSE.V). 
Reuters provides data in a similar way for NASDAQ and other major
markets.  This is the root of the problem.

You can clearly see what I'm talking about if you open up the NYSE
Composite security (ticker symbol: .NYA) in the Downloader and look at
its datasheet.  The "Volume" column contains zeros.  If you open this
index in MetaStock and plot the "Volume" indicator, you get a straight
line.

(Note: If your data provider provides this information in a sensible,
combined manner, you won't see the problem I'm talking about.  Even
so, you should follow along using the data from the Reuters Data CD
that came with MetaStock.  You might accidently learn something!)

When I first approached this problem, I thought of two approaches for
fixing it:

Approach #1: Somehow replace the volume column in the .NYA security
with the volume column from the X-NYSE.V security.

Approach #2: Plot both the NYSE Composite and the Total Volume on the
same chart and somehow change the "On Balance Volume" indicator so
that it uses X-NYSE.V's volume column instead of .NYA's volume column.

The bad news is that I've looked and looked - I even experimented with
exotic Excel OLE links, but I was unable to come up with a way to get
Approach #1 to work in an automatically updatable way.  Anyone else
want to take a stab at it?

The good news is that by taking advantage of a powerful MS feature, I
was able to get Approach #2 to work.  Here are the steps:

1. In MetaStock, choose "File/New/Chart..." and select the "NYSE
COMPOSITE" as the base security.

2. (Optional) Remove all of the line studies and indicators that your
default template adds to the chart.  This will make dragging and
dropping easier later.

3. Repeat steps 1 and 2 for the "NYSE Total Volume" security.

4. (Optional) Use the "Window/Stack" command so you can see both charts.

5. Drag the "Volume" indicator from the Quick List onto the "NYSE
Total Volume" chart to create the familiar volume histogram.  (If
asked, choose "Create new scale on left")

6. Drag the just created volume histogram from the "NYSE Total Volume"
chart to the "NYSE COMPOSITE" chart and drop it on the X-axis so that
it creates a new inner window at the very bottom on the chart.

7. (Optional) Close the "NYSE Total Volume" chart (you don't need to
save it) and maximize the "NYSE COMPOSITE" chart.

8. (Optional) Drag the built-in "On Balance Volume" indicator from the
Quick List to the very top of the chart window.  Notice that it is a
straight line at zero.  This is what we need to fix with a new version
of OBV.  Close the OBV inner window you just created.

9. Use the "Tools/Indicator Builder" command and then press the
"New..." button to get to the "Indicator Editor" window.

10. Enter "On Balance Volume 2" as the indicator name.  Now enter the
following in the "Formula" field:

    Cum(If( C, >, Ref(C,-1), +P, 
        If( C, <, Ref(C,-1), -P, 0) ))

This is the formula for OBV only I've replaced the volume variable
("V") with the "dropped-upon" variable ("P").

11. Now press "OK" to save the new indicator and "Close" the Indicator
Builder.

12. Carefully drag the "On Balance Volume 2" from the Quick List down
to the volume histogram bars.  Don't release the mouse button until
the volume bars change colors.  This means that their value will be
used for "P" in the custom formula we entered in step 10.  

Do you now see how this is going to work?  The "P" variable is a very
powerful feature of MS - make sure you understand it.  See p.213 in
the manual for more info.

Important Note:  If you drop our new indicator without first dragging
it over the volume bars, the NYSE's Closing value ("C") will be used
for "P" in our formula.  The resulting graph looks convincing, but it
is _not_ OBV!  Make sure you drop this indicator on the volume bars.

13. (Optional) Drag the new indicator line up to the top of the chart
window so that it sits in a new inner window.

14. (This is just to avoid having 13 steps! ;-)

That's it!  Kinda convoluted but effective.  Note that to use this for
other indicators, you do need to know the formula for the indicator
ahead of time.  That's probably a good idea anyway, I always try to
understand an indicator fully before I rely on it for making trading
decisions.

If you've followed this tutorial, hopefully you are now more familiar
with the power of MetaStock's "P" variable.

Hope this helps.  Feel free to send questions, comments or additional
tips to the list.

Chip
http://coolhistory.com/ChipsCharts




_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com