Class Candlestick

    • Field Detail

      • DEFAULT_HAMMER_MIN_LOWER_WICK_LENGTH_RATIO

        public static final double DEFAULT_HAMMER_MIN_LOWER_WICK_LENGTH_RATIO
        See Also:
        Constant Field Values
      • DEFAULT_INVERTED_HAMMER_MIN_UPPER_WICK_LENGT_RATIO

        public static final double DEFAULT_INVERTED_HAMMER_MIN_UPPER_WICK_LENGT_RATIO
        See Also:
        Constant Field Values
    • Method Detail

      • withAttributes

        public static Candlestick withAttributes​(java.lang.Iterable<Node> attributes)
        Parameters:
        attributes -
        Returns:
        a new Candlestick with the given attributes
      • bodyIsAboveBodyOf

        public final boolean bodyIsAboveBodyOf​(Candlestick candleStick)
        The body of a candlestick is the area between its opening price and its closing price.
        Parameters:
        candleStick -
        Returns:
        true if the body of the current Candlestick is above the body of the given candlestick.
      • bodyIsBelowBodyOf

        public final boolean bodyIsBelowBodyOf​(Candlestick candleStick)
        The body of a candlestick is the area between its opening price and its closing price.
        Parameters:
        candleStick -
        Returns:
        true if the body of the current Candlestick is below the body of the given candlestick.
      • getBodyLength

        public final double getBodyLength()
        The body of a candlestick is the area between its opening price and its closing price.
        Returns:
        the length of the body of the current Candlestick.
      • getChange

        public final double getChange()
        Returns:
        the difference of the closing price and the opening price of the current Candlestick.
      • getChangeRatio

        public final double getChangeRatio()
        Returns:
        the ratio of the change to the opening price of the current Candlestick.
      • getClosingPrice

        public final double getClosingPrice()
        Returns:
        the closing price of the current Candlestick.
      • getHighestPrice

        public final double getHighestPrice()
        Returns:
        the highest price of the current Candlestick.
      • getLength

        public final double getLength()
        Returns:
        the length of the current Candlestick.
      • getLowestPrice

        public final double getLowestPrice()
        Returns:
        the lowest price of the current Candlestick.
      • getLowerWick

        public final double getLowerWick()
        Returns:
        the length of the lower wick of the current Candlestick.
      • getOpeningPrice

        public final double getOpeningPrice()
        Returns:
        the opening price of the current Candlestick.
      • getRefTime

        public final Time getRefTime()
        Returns:
        the time of the current Candlestick.
      • getTrend

        public final double getTrend()
        This method returns a norm n that indicates the trend of the current Candlestick. nϵ[-1,-1] n=-1 ↔ perfect fall n=0 ↔ perfect immobility n=1 ↔ perfect raise
        Returns:
        a norm that indicates the trend of the current Candlestick.
      • getUpperWick

        public final double getUpperWick()
        Returns:
        the length of the upper wick of the current Candlestick.
      • isBearish

        public final boolean isBearish()
        A bearish candlestick is bearish if its closing price is smaller than its opening price.
        Returns:
        true if the current Candlestick is bearish.
      • isBullish

        public final boolean isBullish()
        A candlestick is bullish if its closing price is higher than its opening price.
        Returns:
        true if the current Candlestick is bullish.
      • isDoji

        public final boolean isDoji()
        A candlestick is a doji when its opening price and closing price are the same.
        Returns:
        true if the current Candlestick is a doji.
      • isHammer

        public final boolean isHammer()
        A candlestick is a hammer if: -The length of the candlestick is positive. That means the highest price is bigger than the lowest price. -The lower wick of the candlestick is bigger than its upper wick. -The lower wick to length ratio of the candlestick is bigger than or equal to a default value.
        Returns:
        true if the current Candlestick is a hammer.
      • isHammer

        public final boolean isHammer​(double minLowerWickLengthRatio)
        A candlestick is a hammer if: -The length of the candlestick is positive. (That means the highest price is bigger than the lowest price.) -The lower wick of the candlestick is bigger than its upper wick. -The lower wick to length ratio of the candlestick is bigger than a given value.
        Parameters:
        minLowerWickLengthRatio -
        Returns:
        true if the current Candlestick is a hammer whose lower wick to length ratio is bigger than or equal to the given min lower wick length ratio.
        Throws:
        NegativeArgumentException - if the given min lower wick length ratio is negative.
      • isInvertedHammer

        public final boolean isInvertedHammer()
        A candlestick is an inverted hammer if: -The length of the candlestick is positive. That means the highest price is bigger than the lowest price. -The upper wick of the candlestick is bigger than its lower wick. -The upper wick to length ratio of the candlestick is bigger than or equal to a default value.
        Returns:
        true if the current Candlestick is an inverted a hammer.
      • isInvertedHammer

        public final boolean isInvertedHammer​(double minUpperWickLengthRatio)
        A candlestick is an inverted hammer if: -The length of the candlestick is positive. That means the highest price is bigger than the lowest price. -The upper wick of the candlestick is bigger than its lower wick. -The upper wick to length ratio of the candlestick is bigger than a given value. An inverted hammer is also called a shooting star.
        Parameters:
        minUpperWickLengthRatio -
        Returns:
        trueif the current Candlestick is a hammer whose upper wick to length ratio is bigger than or equal to the given min upper wick length ratio.
        Throws:
        NegativeArgumentException - if the given min upper wick length ratio is negative.
      • isMarubozu

        public final boolean isMarubozu()
        A candlestick is a marubozu if its body is as long as its whole length.
        Returns:
        true if the current Candlestick is a marubozu.