When comparing two stocks, it is often useful to display both stocks directly on top of each other on the same chart. Here are the steps you can do to overlay one stock chart on top of another in our SharpCharts Workbench.
First, we'll create a simple overlapping comparison chart based on prices, then we'll convert that into a Price Performance comparison chart.
For these examples, we'll be comparing the Dow Jones Industrial Average ($INDU) with the S&P 500 Large Caps ($SPX).
The Dow ($INDU) will be the main symbol on our SharpChart. There are several ways to create a new SharpChart, but the easiest is to just enter the symbol in the Create-a-Chart box at the top of the page, then click “Go”.
To make the chart simpler, let's remove any Indicators and Overlays on our default chart. The quickest way to do that is to click the “Clear All” link in the Overlays section, then repeat the process with the “Clear All” link in the Indicators section. Once that's done, click one of the “Update” buttons to update the chart.
Note: you may want to make other changes to the chart, such as changing the size or the color scheme. We're using the “Spruce” color scheme in this example.
You can use the “Price” indicator to add additional ticker symbols to your chart. In this example, we're going to add $SPX to the chart.
Select “Price” from one of the empty indicator dropdowns, and then enter the ticker symbol you want to chart in the “Parameters” box. In this case, we will use $SPX for the S&P 500. Make sure the Position dropdown is set to “Behind Price”, so that the $SPX data will appear on the same chart panel as the main $INDU data. Finally, click on one of the “Update” buttons to update the chart.
Once these changes have been made, your chart should look something like this:
Notice that $INDU is charted using candlesticks, and $SPX is charted using a line. This is like comparing apples to oranges. Usually, people use line charts for both ticker symbols, to make comparing the data easier.
To change the $INDU candlesticks to a line, simply change the Type dropdown to “Line (thin)”.
Let's also remove the volume bars from the chart by changing the Volume dropdown to “Off”. This makes for a less cluttered chart, but even more importantly, it allows the vertical scale on the left side of the chart to display the $SPX values instead of the volume values.
Once these changes have been made, click the “Update” button to update the chart.
The final overlaid comparison chart should look something like this:
This style of chart allows us to visually compare the behavior of the Dow and the S&P 500 indexes. It should come as no surprise that they move in very similar ways. Subscribers can change the color and style of the lines for more clarity.
SharpCharts can also be used to create overlaid Price Performance comparison charts. These charts allow you to directly compare the percent gain/loss of each index. Here are the easy steps to convert this chart into a Price Performance comparison chart.
Change the Type dropdown for the main ticker symbol to “Performance”. Then change the Indicator from “Price” to “Price - Performance”. Once these changes have been made, click the “Update” button to update the chart.
The final overlaid Price Performance chart should look something like this:
Now both lines start at 0% and move up and down based on the percentage change rather than the price. In this case, we can see that the Dow has outperformed the S&P 500 over the time period covered by the chart.