Class CandleSeries


  • public class CandleSeries
    extends Series
    A Candle Series is typically used for plotting stock prices. Each date has an opening and closing price, as well as a daily high and low, which are plotted as "candles" on the graph. A good description of Candle graphs is at http://www.trade10.com/candlesticks.html.
    • Constructor Detail

      • CandleSeries

        public CandleSeries​(String name)
        Create a new CandleSeries
        Parameters:
        name - the name of the series
    • Method Detail

      • set

        public void set​(Date date,
                        double open,
                        double close,
                        double min,
                        double max)
        Add a candle to the series. Currently candles can only be plotted daily, so dates passed in to this method should have their time component set to 00:00:00
        Parameters:
        date - the date of the pricing information
        open - the opening price for that day
        close - the closing price for that day
        min - the minimum price for that day
        max - the maximum price for that day
        Throws:
        IllegalArgumentException - if min is not the lowest of the four values, or max is not the highest
      • setStyle

        public void setStyle​(Date date,
                             Style style)
        Set the style for a particular candle. If not set, the candle is the same style as all the others.
        Parameters:
        date - the date of the pricing information
        style - the style to paint that candle in
      • setBarWidth

        public void setBarWidth​(double width)
        Set the width of each candle. The default is 0.75, and valid values are 0 < val <= 1
        Parameters:
        width - the width of the box of each candle - must be 0 < val <=1