private static TimeSeriesCollection createAdditionalDataset(TimeSeries series) {
        ClosePriceIndicator indicator = new ClosePriceIndicator(series);
        TimeSeriesCollection dataset = new TimeSeriesCollection();
        org.jfree.data.time.TimeSeries chartTimeSeries = new org.jfree.data.time.TimeSeries("Btc price");
        for (int i = 0; i < series.getTickCount(); i++) {
            Tick tick = series.getTick(i);
            chartTimeSeries.add(new Second(new Date(tick.getEndTime().toEpochSecond() * 1000)), indicator.getValue(i).toDouble());
        }
        dataset.addSeries(chartTimeSeries);
        return dataset;
    }
private static TimeSeriesCollection createAdditionalDataset(TimeSeries series) {
        ClosePriceIndicator indicator = new ClosePriceIndicator(series);
        TimeSeriesCollection dataset = new TimeSeriesCollection();
        org.jfree.data.time.TimeSeries chartTimeSeries = new org.jfree.data.time.TimeSeries("Btc price");
        for (int i = 0; i < series.getTickCount(); i++) {
            Tick tick = series.getTick(i);
            chartTimeSeries.add(new Second(new Date(tick.getEndTime().toEpochSecond() * 1000)), indicator.getValue(i).toDouble());
        }
        dataset.addSeries(chartTimeSeries);
        return dataset;
    }
private static TimeSeriesCollection createAdditionalDataset ( TimeSeries series ) { ClosePriceIndicator indicator = new ClosePriceIndicator ( series ) ; TimeSeriesCollection dataset = new TimeSeriesCollection ( ) ; org . jfree . data . time . TimeSeries chartTimeSeries = new org . jfree . data . time . TimeSeries ( "Btc price" ) ; for ( int i = 0 ; i < series . getTickCount ( ) ; i ++ ) { Tick tick = series . getTick ( i ) ; chartTimeSeries . add ( new Second ( new Date ( tick . getEndTime ( ) . toEpochSecond ( ) * 1000 ) ) , indicator . getValue ( i ) . toDouble ( ) ) ; } dataset . addSeries ( chartTimeSeries ) ; return dataset ; }
Builds an additional JFreeChart dataset from a ta4j time series.
@param series a time series
@return an additional dataset
Builds an additional JFreeChart dataset from a ta4j time series .