Pylint pytest

japanese-candlestick-pattern

Install

pip install japanese-candlestick

Usage

Assuming having a pandas DataFrame candles with the following columns:

  • 'Open'
  • 'High
  • 'Low'
  • 'Close'

One can compute the japanese candlestick pattern Engulfing as follow:

from patterns import Engulfing

# Instantiate the pattern, with the candles dataframe as arg
engulfing = Engulfing(candles)

# Perform pattern detection
output_df = engulfing.compute_pattern()

The pattern detection value (a bool) is stored in a column having the same name as the pattern (lower case). In above example, the results would be in output_df['engulfing'].

Available patterns

The patterns are computed based on the book 'Japanese Candlestick Charting Techniques', by Steve Nison.

The currently available patterns are the following:

  • Doji
  • DragonflyDoji
  • Engulfing
  • GraveswtoneDoji
  • Hammer
  • HangingMan
  • Harami
  • InvertedHammer
  • LongleggedDoji
  • ShootingStar
  • ThreeWhiteSoldiers
  • ThreeBlackCrows

They are all to be imported from patterns, and all with the same usage (and sometimes parameters), i.e.:

# First import
from patterns import Hammer
# Then instantiate
hammer = Hammer(candles)
# Finally compute detection
output_df = hammer.compute_pattern()

Additional

One can make a telegram bot and configure telegram-send using this tuto.