charting 8.0.1-1186-d5c663d9 API

The Charting DataSource API allows you to respond to requests for historic charting data.

When using the CaplinTrader charting component, each plot element (usually a candlestick) represents a summary of the price movements over a particular period of time. The information plotted is the open (the first price in the period), the high (maximum price in the period), the low (minimum price in the period) and the close (the last price in the period).

The CaplinTrader charting component requests the chart data from the IntraDay Module, running in the transformer. This requests live pricing data from a Pricing DataSource and past data from the Charting DataSource.

This API allows you to easily create a Charting DataSource to provide historic charting data to the Charting component in CaplinTrader.

To use it, create a class that has access to your historic data and implements com.caplin.charting.HistoricChartDataProvider. Instantiate this class, along with a DataSource, and pass them both into the constructor of a com.caplin.charting.ChartingDataSource.

        DataSource dataSource = new DataSource(new FileInputStream("conf/DataSource.xml"), new FileInputStream("conf/Fields.xml"));
        HistoricChartDataProvider dataProvider = new YourClassThatImplementsHistoricChartDataProvider();
        
        ChartingDataSource chartingDS = new ChartingDataSource(dataSource, dataProvider);
        chartingDS.start();     
        

The class that implements HistoricChartDataProvider will be informed of a request by the call back requestHistoricChartData. It should retrieve the data associated with the request, construct it into a list of OhlcvData objects, and then send the data by calling dataReceived on the HistoricChartDataListener that it was passed in the request call.

Packages
Package
Description