Scenario OHLC table
A scenario OHLC table contains Open, High, Low, and Close values for a scenario variable as calculated for a specified time interval. As a dashboard or dashboard server receives update events for a scenario instance it will calculate the Open, High, Low, and Close values for the variable and add a row to an OHLC table at each time interval. The calculated values added will be for the preceding time interval.
OHLC tables allow dashboards to automatically create data suitable for display in a Candlestick or OHLC chart for any scenario variable and time interval. When you create an attachment to an OHLC table you specify the variable and time interval desired. An example would be selecting a Price variable and a time interval of 5 seconds.
A separate OHLC table is used for each scenario instance and each variable and interval pair. If for the Price variable you wanted OHLC data at both 5 and 30 second intervals; two OHLC tables would be created for each instance of the scenario.
The following table illustrates the contents of a scenario OHLC table.
apama. timestamp | Open | High | Low | Close |
T0 | 28.5 | 29.1 | 28.3 | 28.4 |
T0 + interval | 28.4 | 28.6 | 28.4 | 28.5 |
T0 + (interval* 2) | 28.5 | 29.0 | 28.3 | 28.7 |
Each row in an OHLC table contains a timestamp indicating when the row was added to the table. This is the end time of each interval.
OHLC tables are limited in size; by default they will hold 1000 rows. The maximum row count is a configurable option. When a data table is full each new Update event will result in the oldest row being removed and a new row being added.
OHLC tables are for use with stock charts to display candlestick or OHLC graphs of a scenario variable over time. The benefit of OHLC tables is that they allow you to use the stock chart without modifying your scenario to generate OHLC values; Apama can do it for you.