Navigation:  Menu Commands > Options Menu >

OHLC Chart command (Options menu)

JR   Viewer

Print this Topic Previous pageReturn to chapter overviewNext page

An open-high-low-close (OHLC) chart is typically used to show variations in stock prices. Each vertical line on the chart shows the price range (the highest and lowest prices) over one unit of time (normally one day). Tick marks project from each side of the line indicating the opening price on the left, and the closing price for the time period on the right. In DPlot, the high, low, and close values are taken from the Y values of three other curves. DPlot ignores the X (normally date) values for the source curves; e.g. the nth point of the high source curve is used as the high value for nth point of the selected curve, regardless of whether the X values match up. This command is disabled if fewer than 4 curves are present in the plot.

Individual entries may be drawn in the color specified for the given curve, or may be based upon whether the close price is greater than or equal to the open price or vice versa.

Tick mark length is always 0.5 in data units (1/2 day).

Example:

Retrieve stock market data. This example uses data from http://finance.yahoo.com/, though there are of course others. In this case we'll import data for Google (symbol=GOOG). Click "Historical Prices", then scroll to the bottom of the page and click "Download to Spreadsheet". If given the option by your browser, save the file to disk rather than opening it. Open this file in DPlot. If you have associated CSV files with DPlot, right-click on the file in Explorer, select "Open with", then DPlot. You can of course also open the file by starting DPlot and selecting File>Open, file type D, then the file. Or you can open DPlot then drag the file to an empty DPlot document window (first select File>New if the active document contains a plot).

Deleting or not importing the Volume and Adj Close columns you should see a plot similar to this after zooming in to the year 2012:

Select "OHLC Chart" on the Options menu and make these selections:

These selections should result in a plot similar to this:

You'll note that the Open and Close tick marks aren't visible in this case. That's due to a combination of the line width used and the extents of the plot. Tick marks are always drawn 1/2 unit (normally 1/2 day) long, so if the days are spaced too closely and the line width is too large, the tick marks won't be visible. If you zoom in or use Options>Extents/Intervals/Size to isolate on the last 2 months of 2012, you should get something similar to this:

Tick mark length (and visibility) are a function of line width, extents, and plot size.

Note that the legend entry still refers to the first curve rather than the data source. You can easily change the legend entry (if desired) by double-clicking on it or by selecting the Legend/Labels command on the Text menu. You can also hide the legend by right-clicking on it and selecting "Hide Legend".

If instead you would prefer a candlestick chart, select OHLC chart on the Options menu and check the "Candlestick chart" box. The last month of 2012 with the above data will look something like this:

Hollow boxes indicate a closing price greater than or equal to the opening price. Conversely, solid-filled boxes indicate an opening price greater than the closing price. In DPlot, the box width is always 2/3 of an X unit - 2/3 of a day in this example.

If you are curious about the date scale, this plot uses "ddd M/d" date format for the Number Format on the X axis.

 

 

Related macro commands

OHLC

 

 


Page url: https://www.dplot.com/help/index.htm?helpid_ohlc.htm