Candle scanner Api

This is one stop entry point for automatic identification of candle stick patterns using candle pattern
identification libraries.

To know about dhelm candle identification libraries visit here.

The goal behind the apis designed in this dhelm-candlescanner package is to automate the identification
process of any candle pattern generated in a particular stock OHCL data during a time period.

In brief three apis have been provided:
At FIRST

public  CandleTypeBasic getBasicCandleType(List<Double> open,List<Double> high,List<Double>low,List<Double>close,Map<String,Object> scanParams)throws DataException{
.............
}

The goal of this api is to find out, if the latest OHLC data forms any of the below basic candle form:

enum CandleTypeBasic{
  /**
   * Long White Candle
   */
  LONG_WHITE_CANDLE,
  /**
   * Short White Candle
   */
  SHORT_WHITE_CANDLE,
  /**
   * White Candle
   */
  WHITE_CANDLE,
  /**
   * White Marubozu Candle
   */
  WHITE_MARUBOZU,
  /**
   * Closing White Marubozu Candle
   */
  CLOSING_WHITE_MARUBOZU,
  /**
   * Opening White Marubozu Candle
   */
  OPENING_WHITE_MARUBOZU,
  /**
   * White Spinning Top
   */
  WHITE_SPINNING_TOP,
  /**
   * Long Black Candle
   */
  LONG_BLACK_CANDLE,
  /**
   * Short Black Candle
   */
  SHORT_BLACK_CANDLE,
  /**
   * Black Candle
   */
  BLACK_CANDLE,
  /**
   * Black Marubozu Candle 
   */
  BLACK_MARUBOZU,
  /**
   * Closing Black Marubozu Candle
   */   
  CLOSING_BLACK_MARUBOZU,
  /**
   * Opening Black Marubozu Candle
   */
  OPENING_BLACK_MARUBOZU,
  /**
   * Black Spinning Top Candle
   */
  BLACK_SPINNING_TOP,
  /**
   * Doji Candle
   */
  DOJI,
  /**
   * Long Legged Doji Candle
   */
  LONG_LEGGED_DOJI,
  /**
   * Gravestone Doji Candle
   */
  GRAVESTONE_DOJI,
  /**
   * Dragonfly Doji Candle
   */
  DRAGONFLY_DOJI,
  /**
   * Four Price Doji Candle
   */
  FOUR_PRICE_DOJI,
  /**
   * Highwave Candle
   */
  HIGHWAVE,
  /**
   * If None from the Above
   */
  NOT_SPECIFIC
}

The last one signifies that none from the basic patterns is formed.
The above list is actually a set of enum constants. The names are identical to the patterns themselves.
In other words, those who are well familiar with stock market, surely know the meaning of the terms listed above.

The above api will automatically identify the pattern if any thing is generated given proper input.

Another important point is that, the above patterns again can be divided into two broad categories, viz. Long candle and Short candle.

To get this fact, there is:

 public CandleBasicLength getCandleBasicLength(){
 ...
 }

which returns one value from

enum CandleBasicLength {
  /**
   * A long candlestick.
   */
  LONG,
  /**
   * A short candlestick
   */
  SHORT,
  /**
   * Where long or short property is not applicable.
   */
  NOT_APPLICABLE;
}

Again the terms are significant.

At SECOND

  public CandlePatternSingleLine getSingleLinePattern(List<Double> open,List<Double>   high,List<Double>low,List<Double>close,Map<String,Object> scanParams)throws DataException{
  ..........
  }

The goal of this api is to find out, if the latest OHLC data forms any single line pattern from the below one line patterns:

   enum CandlePatternSingleLine{
  /**
  * Bullish belthold pattern.
  */
 BullishBeltHold,
 /**
  * Bearish bethold pattern
  */
 BearishBeltHold,
 /**
  * Hammer pattern
  */
 Hammer,
 /**
  * Hanging man pattern
  */
 HangingMan,
 /**
  * Southern doji pattern
  */
 SouthernDoji,
 /**
  * Northern doji pattern
  */
 NorthernDoji,
 /**
  * Gapping up doji
  */
 GappingUpDoji,
 /**
  * Gapping down doji
  */
 GappingDownDoji,
 /**
  * Takuri line pattern
  */
 TakuriLine,
 /**
  * One candle shooting star pattern
  */
 OneCandleShootingStar,
 /**
  * Bullish strong line pattern
  */
 BullishStrongLine,
 /**
  * Bearish strong line pattern
  */
 BearishStrongLine,
 /**
  * If no single line pattern is generated from above.
  */
 NotApplicable;
 }
 

At THIRD
There is,

  public  CandlePatternDoubleLine getDoubleLinePattern(List<Double> open,List<Double> high,List<Double>low,List<Double>close,Map<String,Object> scanParams)throws DataException{
  ...
  }

to identify the double line pattern from:

  enum CandlePatternDoubleLine{
  /**
 * Bullish harami pattern
 */
BullishHarami,
/**
 * Bearish harami pattern
 */
BearishHarami,
/**
 * Bullish engulfing pattern
 */
BullishEngulfing,
/**
 * Bearish engulfing pattern
 */
BearishEngulfing,
/**
 * Bullish kicking pattern
 */
BullishKicking,
/**
 * Bearish kicking pattern
 */
BearishKicking,
/**
 * Matching low pattern
 */
MatchingLow,
/**
 * Matching high pattern
 */
MatchingHigh,
/**
 * Bullish harami cross pattern
 */
BullishHaramiCross,
/**
 * Bearish harami cross pattern
 */
BearishHaramiCross,
/**
 * Bullish doji start pattern
 */
BullishDojiStar,
/**
 * Bearish doji star pattern
 */
BearishDojiStar,
/**
 * Dark cloud cover pattern
 */
DarkCloudCover,
/**
 * Piercing line pattern
 */
PiercingLine,
/**
 * Descending hawk pattern
 */
DescendingHawk,
/**
 * Homing pigeon pattern
 */
HomingPigeon,
/**
 * If none of the above
 */
NotApplicable;
}

At FOURTH
there is,

 public  CandlePatternMultiLine getMultiLinePattern(List<Double> open,List<Double> high,List<Double>low,List<Double>close,Map<String,Object> scanParams)throws DataException{
 ....
 }

to identify multiline pattern from:

 enum CandlePatternMultiLine{
 /**
  * Bullish abandoned baby pattern
  */
 BullishAbandonedBaby,
 /**
  * Bearish abandoned baby pattern
  */
 BearishAbandonedBaby,
 /**
  * Three inside up pattern
  */
 ThreeInsideUp,
 /**
  * Three inside down pattern
  */
 ThreeInsideDown,
 /**
  * Three outside up pattern
  */
 ThreeOutsideUp,
 /**
  * Three outside down pattern
  */
 ThreeOutsideDown,
 /**
  * Three white soldiers pattern
  */
 ThreeWhiteSoldiers,
 /**
  * Three Black crows pattern
  */
 ThreeBlackCrows,
 /**
  * Morning doji star pattern
  */
 MorningDojiStar,
 /**
  * Evening doji star pattern
  */
 EveningDojiStar,
 /**
  * Morning star pattern
  */
 MorningStar,
 /**
  * Evening star pattern
  */
 EveningStar,
 /**
  * Upside tasuki gap pattern
  */
 UpsideTasukiGap,
 /**
  * Down side tasuki gap pattern
  */
 DownsideTasukiGap,
 /**
  * Bullish side by side white lines pattern
  */
 BullishSidebySideWhiteLines,
 /**
  * Bearish side by side white lines pattern
  */
 BearishSidebySideWhiteLines,
 /**
  * Rising three pattern
  */
 RisingThreeMethod,
 /**
  * If none of the above
  */
 NotApplicable;
 }
 

Some patterns are bullish and some patterns are bearish. From the identified patterns this thing can also be identified using:

 public CandleSignalType getCandleSignalType(){
    ...
  }

where return value will be from:

   enum CandleSignalType{
/**
 * Bullish pattern
 */
BULLISH,
/**
 * Bearish pattern
 */
BEARISH,
/**
 * Unsure about the pattern or pattern type cannot be applied.
 */
NOT_APPLICABLE;
}

Leave a Reply

Your email address will not be published. Required fields are marked *