Pre loader

How to customize Candle Stick Style


I want to customize the style of stick such that
1. Green and hollow stick if it is rising and open higher than close
2. Green and fill stick if it is rising and open lower than close
3. Red and hollow stick if it is falling and open higher than close
4. Red and fill stick if it is falling and open lower than close

How could i achieve that with only one candle series?

  • You must to post comments

Hi Tommy,

I believe you can do achieve this by using our PaletteProvider API.

I’m not sure what do you mean by ‘rising stick’ but you can use next code as base for your palette provider:

  private static class CandleStickPaletteProvider extends PaletteProviderBase<FastCandlestickRenderableSeries> implements IStrokePaletteProvider, IFillPaletteProvider {
    private final IntegerValues fillColors = new IntegerValues();
    private final IntegerValues strokeColors = new IntegerValues();

    public CandleStickPaletteProvider() {

    public IntegerValues getFillColors() {
        return fillColors;

    public IntegerValues getStrokeColors() {
        return strokeColors;

    public void update() {
        final OhlcRenderableSeriesBase renderableSeries = this.renderableSeries;
        final OhlcRenderPassData currentRenderPassData = (OhlcRenderPassData) renderableSeries.getCurrentRenderPassData();

        final int size = currentRenderPassData.pointsCount();

        final int[] fillColorsArray = fillColors.getItemsArray();
        final int[] strokeColorsArray = strokeColors.getItemsArray();

        final double[] openValues = currentRenderPassData.openValues.getItemsArray();
        final double[] closeValues = currentRenderPassData.closeValues.getItemsArray();
        final double[] highValues = currentRenderPassData.highValues.getItemsArray();
        final double[] lowValues = currentRenderPassData.lowValues.getItemsArray();

        for (int i = 0; i < size; i++) {
            final double closeValue = closeValues[i];
            final double openValue = openValues[i];

            final boolean up = closeValue >= openValue;
            final boolean isRising = closeValue >= openValue;

            strokeColorsArray[i] = up ? Color.GREEN : Color.RED;
            fillColorsArray[i] = isRising ? strokeColorsArray[i] : Color.TRANSPARENT;


Is this suitable for your needs?

Best regards,

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies