|
Peltier Tech
Buy me a coffee If this topic or the whole site has been helpful, please support further development by treating me to a cup of coffee. |
Excel Stock Charts with Added Series.
A common problem people have is adding an extra series to a stock chart. It would be very helpful to add a market index, for example, or another moving value to a stock chart to see how the stock price moves with respect to another factor. This can be done, but you need to follow a few extra steps. The extra series can be added to any of Excel's built-in stock chart subtypes. The High-Low-Close (HLC) and Open-High-Low-Close (OHLC) charts follow a straightforward procedure; the Volume-High-Low-Close (VHLC) and Volume-Open-High-Low-Close (VOHLC) charts are only slightly more complicated because the Volume series is plotted on the primary axes, and the other parameters on the secondary axes. This technique works for stock charts with either time-scale or category type X axes. Arrangement of the DataBefore constructing a stock chart, you must first arrange the data neatly in your worksheet, so Excel can readily construct the chart. (This is always a good idea, but especially for a stock chart.) It is easier if the columns are contiguous (without intervening gaps), but this is not necessary. To select discontiguous data, select one range, then hold down the Ctrl key while selecting each subsequent area.
If you remember what Excel calls each chart type, you can remember how to arrange the data. The HLC chart needs High, Low, and Closing prices in adjacent columns in that order; the OHLC chart needs Opening, High, Low, and Closing prices; VHLC and VOHLC need Volume before HLC and OHLC data. The column with Dates should come to the left of these, and the column with additional series should come to the right. The data can be arranged in rows if preferred; replace left-to-right order with top-to-bottom order. Instead of dates, you could use labels (e.g., company names) for category labels. If you leave out labels entirely, Excel will use integer values 1, 2, 3,....
Below is the data used in these examples. It consists of columns for Date, Volume, Open, High, Low, and Close, plus Index for the series to be added.
Construct the Stock Chart
The first step in our procedure is to construct a stock chart. With the mouse, select the chart's source data (not including the added series), then start the Chart Wizard to create the chart (Insert menu, Chart..., or use the Chart Wizard button). Select one of the stock chart types in the Chart Wizard. Excel will choose one for you based on the size of the range you'd selected, but you have a limited ability to override Excel.
The result, after a little format tweaking, is shown below for OHLC and VOHLC chart types. I will describe the complete procedure using just these two of the four stock chart types, but the types neglected here behave in the same way.
Add the Additional SeriesThe next step is to add the extra series to the chart. The Copy-and-Paste-Special procedure works most easily:
An alternative method to add a series to a chart is to right click on the chart and choose Source Data from the context menu that pops up.
The somewhat troubling result is shown below. It looks like we've mucked up our chart, and I think most people give up here. But we'll soon have it straight again.
Format the New SeriesNow select this new series you've added. It is most easily selected using the Chart Objects drop down box on the Chart command bar, which on my machine is docked at the bottom of the Excel window and really "drops up" (see below).
With this new series selected, go to the Chart menu, select Chart Type..., and choose an XY Scatter type from the dialog box. It is important to use the XY Scatter chart type, because a Line chart type interferes with the candlesticks and high-low lines of the stock chart. Select this new series again, right click and select Format Data Series... and on the Patterns tab, format it the way you like. In these examples I've used blue diamonds with a blue connecting line. The series may not yet fit where we want it, and there may even be some severe distortion. The steps needed to finish up depend on the chart subtype you've selected, on the X axis type (time scale or category), and on the method used to add the new series. Use the handy table below to determine the steps you need to fix the chart.
HLC and OHLC, Time Scale X Axis, New Series Pasted Onto the Chart
This chart is easy to fix:
Click here to see the finished result. HLC and OHLC, Category Type X Axis, New Series Pasted Onto the Chart
This chart is fairly easy to fix:
It looks like we've just completely trashed the chart, but Excel just got confused about the series' dueling category data:
Click here to see the finished result. HLC and OHLC, Time Scale X Axis, New Series Added via Source Data
Click here to see the finished result. VHLC and VOHLC, Time Scale X Axis, New Series Pasted Onto the Chart
This chart is easy to fix:
Click here to see the finished result. VHLC and VOHLC, Time Scale X Axis, New Series Added via Source Data
Click here to see the finished result. VHLC and VOHLC, Category X Axis, New Series Pasted Onto the Chart
Click here to see the finished result. VHLC and VOHLC, Category X Axis, New Series Added via Source Data
This chart is fairly easy to fix:
Click here to see the finished result. ConclusionYou're finished! The end result is magnificent, as promised.
|
Peltier Technical Services, Inc.Custom Solutions | Commercial Utilities | Training | Charts and Tutorials | PTS BlogPeltier Technical Services, Inc., Copyright © 2009. All rights reserved. |