Can Candlestick Patterns Help You in Trading?

Suparjo Tamin
3 min readSep 28, 2020

--

Source: https://academy.binance.com/

Candlestick pattern is one of many methods to analyze (predict) the movement of the stock price. Many stock traders and investors invented unique patterns that they believe can indicate the movement whether it will go up or otherwise. So, here comes a new question in mind, is it for real? Let’s check it out.

I created a package that can extract the candlestick pattern, I call it Stockie. It has more than 50 patterns inside. Let’s try this package. First of all, install the package using this code in your python. Then, import it.

!pip install stockie
from Stockie.stockie import stockie

To load in the data of stock, we use the yfinance package which already included inside Stockie. We just need to type in the ticker code of the stock.

a = stockie(['UNVR.JK','AAPL','C6L.SI'])

If you want to analyze or create a model based on the candlestick pattern, you can use this in-class function of Stockie to give you the table of stock historical data with the columns with boolean value with respective candlestick pattern. The columns will be true if the pattern has been formed at the respective time.

df = a.find_pattern()#find_pattern function give you a dictionary with the key and value is the ticker and table respectivelydf['AAPL']

Here is the sample output :

Sample output of find_pattern function

We also provide a function to present a report of the stock. The report includes an overview and the happening stock pattern. In the overview, there will be an interactive candlestick chart with a sign which indicates a pattern has been formed. Other than that, you can also change the time-gap.

While in the happening part, there will be a table that shows the latest pattern with their up rate and the number of occurrences.

a.get_candlestick_report()

If you have the interactive can’t be displayed, you can download the HTML file and view it in your browser.

a.get_candlestick_report(create_HTML_file=True, location = ‘/content/file.html’)

It is all for Stockie 1.0.0. Simply comment or send me an email, if there is a bug or update recommendation for this package. There will be an update for this package about machine learning to predict stock price movement. So stay tuned!

About me

Hello! My name is Suparjo. Here is my Linkedin. I am a data enthusiast, since 2017, in finance especially stock. I am a mathematic graduate at Bandung Institute of Technology. I am open to full-time opportunity in the data scientist or analyst position based in Indonesia.

--

--

Suparjo Tamin

Mathematics Graduate at Bandung Institute of Technology |Looking for a full-time job | Passionate with Data and AI | Interested in stock trading