public RsiPaneModel(SciChartBuilder builder, PriceSeries prices) { super(builder, RSI, "0.0", false); final XyDataSeries<Date, Double> rsiSeries = builder.newXyDataSeries(Date.class, Double.class).withSeriesName("RSI").build(); rsiSeries.append(prices.getDateData(), MovingAverage.rsi(prices, 14)); addRenderableSeries(builder.newLineSeries().withDataSeries(rsiSeries).withYAxisId(RSI).build()); Collections.addAll(annotations, builder.newAxisMarkerAnnotation().withY1(rsiSeries.getYValues().get(rsiSeries.getCount() - 1)).withYAxisId(RSI).build()); } }
public RsiPaneModel(SciChartBuilder builder, PriceSeries prices) { super(builder, RSI, "0.0", false); final XyDataSeries<Date, Double> rsiSeries = builder.newXyDataSeries(Date.class, Double.class).withSeriesName("RSI").build(); rsiSeries.append(prices.getDateData(), MovingAverage.rsi(prices, 14)); addRenderableSeries(builder.newLineSeries().withDataSeries(rsiSeries).withStrokeStyle(0xFFC6E6FF, 1f).withYAxisId(RSI).build()); Collections.addAll(annotations, builder.newAxisMarkerAnnotation().withY1(rsiSeries.getYValues().get(rsiSeries.getCount() - 1)).withYAxisId(RSI).build()); } }
public VolumePaneModel(SciChartBuilder builder, PriceSeries prices) { super(builder, VOLUME, "###E+0", false); final XyDataSeries<Date, Double> volumePrices = builder.newXyDataSeries(Date.class, Double.class).withSeriesName("Volume").build(); volumePrices.append(prices.getDateData(), ListUtil.select(prices.getVolumeData(), new Func1<Long, Double>() { @Override public Double func(Long arg) { return arg.doubleValue(); } })); addRenderableSeries(builder.newColumnSeries().withDataSeries(volumePrices).withYAxisId(VOLUME).build()); Collections.addAll(annotations, builder.newAxisMarkerAnnotation().withY1(volumePrices.getYValues().get(volumePrices.getCount() - 1)).withYAxisId(VOLUME).build()); } }
public VolumePaneModel(SciChartBuilder builder, PriceSeries prices) { super(builder, VOLUME, "###E+0", false); final XyDataSeries<Date, Double> volumePrices = builder.newXyDataSeries(Date.class, Double.class).withSeriesName("Volume").build(); volumePrices.append(prices.getDateData(), ListUtil.select(prices.getVolumeData(), new Func1<Long, Double>() { @Override public Double func(Long arg) { return arg.doubleValue(); } })); addRenderableSeries(builder.newColumnSeries().withDataSeries(volumePrices).withYAxisId(VOLUME).build()); Collections.addAll(annotations, builder.newAxisMarkerAnnotation().withY1(volumePrices.getYValues().get(volumePrices.getCount() - 1)).withYAxisId(VOLUME).build()); } }
public MacdPaneModel(SciChartBuilder builder, PriceSeries prices) { super(builder, MACD, "0.00", false); final MovingAverage.MacdPoints macdPoints = MovingAverage.macd(prices.getCloseData(), 12, 25, 9); final XyDataSeries<Date, Double> histogramDataSeries = builder.newXyDataSeries(Date.class, Double.class).withSeriesName("Histogram").build(); histogramDataSeries.append(prices.getDateData(), macdPoints.divergenceValues); addRenderableSeries(builder.newColumnSeries().withDataSeries(histogramDataSeries).withYAxisId(MACD).build()); final XyyDataSeries<Date, Double> macdDataSeries = builder.newXyyDataSeries(Date.class, Double.class).withSeriesName("MACD").build(); macdDataSeries.append(prices.getDateData(), macdPoints.macdValues, macdPoints.signalValues); addRenderableSeries(builder.newBandSeries().withDataSeries(macdDataSeries).withYAxisId(MACD).build()); Collections.addAll(annotations, builder.newAxisMarkerAnnotation().withY1(histogramDataSeries.getYValues().get(histogramDataSeries.getCount() - 1)).withYAxisId(MACD).build(), builder.newAxisMarkerAnnotation().withY1(macdDataSeries.getYValues().get(macdDataSeries.getCount() - 1)).withYAxisId(MACD).build()); } }
public MacdPaneModel(SciChartBuilder builder, PriceSeries prices) { super(builder, MACD, "0.00", false); final MovingAverage.MacdPoints macdPoints = MovingAverage.macd(prices.getCloseData(), 12, 25, 9); final XyDataSeries<Date, Double> histogramDataSeries = builder.newXyDataSeries(Date.class, Double.class).withSeriesName("Histogram").build(); histogramDataSeries.append(prices.getDateData(), macdPoints.divergenceValues); addRenderableSeries(builder.newColumnSeries().withDataSeries(histogramDataSeries).withYAxisId(MACD).build()); final XyyDataSeries<Date, Double> macdDataSeries = builder.newXyyDataSeries(Date.class, Double.class).withSeriesName("MACD").build(); macdDataSeries.append(prices.getDateData(), macdPoints.macdValues, macdPoints.signalValues); addRenderableSeries(builder.newBandSeries().withDataSeries(macdDataSeries).withYAxisId(MACD).build()); Collections.addAll(annotations, builder.newAxisMarkerAnnotation().withY1(histogramDataSeries.getYValues().get(histogramDataSeries.getCount() - 1)).withYAxisId(MACD).build(), builder.newAxisMarkerAnnotation().withY1(macdDataSeries.getYValues().get(macdDataSeries.getCount() - 1)).withYAxisId(MACD).build()); } }
.withStroke(2, ColorUtil.DarkRed) .build(), sciChartBuilder.newAxisMarkerAnnotation() .withY1(2.8d) .withIsEditable(true)
public PricePaneModel(SciChartBuilder builder, PriceSeries prices) { super(builder, PRICES, "$0.0000", true); // Add the main OHLC chart final OhlcDataSeries<Date, Double> stockPrices = builder.newOhlcDataSeries(Date.class, Double.class).withSeriesName("OHLC").build(); stockPrices.append(prices.getDateData(), prices.getOpenData(), prices.getHighData(), prices.getLowData(), prices.getCloseData()); addRenderableSeries(builder.newCandlestickSeries().withDataSeries(stockPrices).withYAxisId(PRICES).build()); final XyDataSeries<Date, Double> maLow = builder.newXyDataSeries(Date.class, Double.class).withSeriesName("Low Line").build(); maLow.append(prices.getDateData(), MovingAverage.movingAverage(prices.getCloseData(), 50)); addRenderableSeries(builder.newLineSeries().withDataSeries(maLow).withStrokeStyle(0xFFFF3333, 2f).withYAxisId(PRICES).build()); final XyDataSeries<Date, Double> maHigh = builder.newXyDataSeries(Date.class, Double.class).withSeriesName("High Line").build(); maHigh.append(prices.getDateData(), MovingAverage.movingAverage(prices.getCloseData(), 200)); addRenderableSeries(builder.newLineSeries().withDataSeries(maHigh).withStrokeStyle(0xFF33DD33, 2f).withYAxisId(PRICES).build()); Collections.addAll(annotations, builder.newAxisMarkerAnnotation().withY1(stockPrices.getYValues().get(stockPrices.getCount() - 1)).withBackgroundColor(0xFFFF3333).withYAxisId(PRICES).build(), builder.newAxisMarkerAnnotation().withY1(maLow.getYValues().get(maLow.getCount() - 1)).withBackgroundColor(0xFFFF3333).withYAxisId(PRICES).build(), builder.newAxisMarkerAnnotation().withY1(maHigh.getYValues().get(maHigh.getCount() - 1)).withBackgroundColor(0xFF33DD33).withYAxisId(PRICES).build()); } }
public PricePaneModel(SciChartBuilder builder, PriceSeries prices) { super(builder, PRICES, "$0.0000", true); // Add the main OHLC chart final OhlcDataSeries<Date, Double> stockPrices = builder.newOhlcDataSeries(Date.class, Double.class).withSeriesName("EUR/USD").build(); stockPrices.append(prices.getDateData(), prices.getOpenData(), prices.getHighData(), prices.getLowData(), prices.getCloseData()); addRenderableSeries(builder.newCandlestickSeries().withDataSeries(stockPrices).withYAxisId(PRICES).build()); final XyDataSeries<Date, Double> maLow = builder.newXyDataSeries(Date.class, Double.class).withSeriesName("Low Line").build(); maLow.append(prices.getDateData(), MovingAverage.movingAverage(prices.getCloseData(), 50)); addRenderableSeries(builder.newLineSeries().withDataSeries(maLow).withStrokeStyle(0xFFFF3333, 1f).withYAxisId(PRICES).build()); final XyDataSeries<Date, Double> maHigh = builder.newXyDataSeries(Date.class, Double.class).withSeriesName("High Line").build(); maHigh.append(prices.getDateData(), MovingAverage.movingAverage(prices.getCloseData(), 200)); addRenderableSeries(builder.newLineSeries().withDataSeries(maHigh).withStrokeStyle(0xFF33DD33, 1f).withYAxisId(PRICES).build()); Collections.addAll(annotations, builder.newAxisMarkerAnnotation().withY1(stockPrices.getYValues().get(stockPrices.getCount() - 1)).withBackgroundColor(0xFFFF3333).withYAxisId(PRICES).build(), builder.newAxisMarkerAnnotation().withY1(maLow.getYValues().get(maLow.getCount() - 1)).withBackgroundColor(0xFFFF3333).withYAxisId(PRICES).build(), builder.newAxisMarkerAnnotation().withY1(maHigh.getYValues().get(maHigh.getCount() - 1)).withBackgroundColor(0xFF33DD33).withYAxisId(PRICES).build()); } }
.withPosition(50, 35d, 80, 31.4d) .build(), sciChartBuilder.newAxisMarkerAnnotation() .withIsEditable(true) .withY1(32.7d) .build(), sciChartBuilder.newAxisMarkerAnnotation() .withAnnotationSurface(AnnotationSurfaceEnum.XAxis) .withFormattedValue("Horizontal")