An open-high-low-close stock graph with volume is the same as an open-high-low-close graph, except that it also displays the volume of shares traded in a separate area of the graph. Each stock marker displays four separate values. The bars in the lower part of the graph show trading volume.
The constant for this graph type is STOCK_VOLUME
.
You use stock graphs to show more than one stock price for a stock.
The following figure shows the data structure of a STOCK_VOLUME
stock graph.
The data structure for open-high-low-close stock graphs that show volume is as follows:
A group is a five-column set or, if data columns are shown as series, then a five-row set of data. It is represented by a single stock marker. If you show more than one group of data, then the values for opening, high, low, closing and trading volume should vary faster than the Time values. That is, the order of the columns (or rows) should be Monday Open, Monday High, Monday Low, Monday Close, Monday Volume, Tuesday Open, Tuesday High, Tuesday Low, Tuesday Close, Tuesday Volume, and so on. A group is labeled by an O1 tick label, such as Fri.
Each group in an open-high-low-close stock graph with volume has five values:
The first value is the opening price. It determines the left arm of the stock marker.
The second value is the high price. It determines the top of the stock marker.
The third value is the low price, which defines the bottom of the stock marker.
The fourth value is the closing price, which defines the right arm of the stock marker.
The fifth value is the trading volume, which defines the bar in the lower half of the graph.
Data for this kind of stock graph has the following guidelines:
All graphs show numeric data only.
The open-high-low-close stock graph that shows volume must have at least five columns of data (or rows, if columns are series), in this order:
Open
High
Low
Close
Volume
If the data has fewer than five columns (or rows) of data, then the Graph bean displays a message about insufficient data, instead of displaying a graph.
If the closing price lies outside the high and low range, then the graph
sends an AlertEvent
to any registered AlertListeners
.
The ID for the AlertEvent
is DATA_STOCK_OPEN_OR_CLOSE_OUT_OF_RANGE
.
If the opening or closing price lies outside the high and low range, then
the graph sends an AlertEvent
to any registered AlertListeners
.
The ID for the AlertEvent
is DATA_STOCK_OPEN_OR_CLOSE_OUT_OF_RANGE
.
To display stock data for more than one time period, the data must be in
multiples of five, such as five columns (or rows) for Monday, then five
for Tuesday, and so on. If the last group of data does not have five columns
(or rows), then the graph does not display that group. The graph notifies
any registered AlertListeners
of this problem by sending an
AlertEvent
, with DATA_PARTIAL_GROUP
as its ID.
Open-high-low-close stock graphs that also show volume can have only one series of data. If you have more than one series of data, then only the first series appears in the graph. The series value should be the name of the stock whose prices you show in the graph.
Time axis data must be regular, complete, and in ascending order. If it is not, then the graph displays a regular ordinal axis rather than a time axis. The graph recognizes time data that skips days when stocks are not traded.
The following graph shows the stock data for one stock for two different days.
The following table shows the structure of the data that the stock graph displays.
This example assumes that Graph.isDataRowShownAsASeries
returns
true
.
Mon Open | Mon High | Mon Low | Mon Close | Mon Volume | Tues Open | Tues High | Tues Low | Tues Close | Tues Volume |
---|---|---|---|---|---|---|---|---|---|
22.25 | 27.63 | 21.88 | 26.13 | 22336 | 26.75 | 35.13 | 21.75 | 23.13 | 26374 |
Stock Graphs
Handling Problems
in Graph Data
Specifying Data for a Graph
Example: Setting Data from
a File on a High-Low-Close Stock Graph