Pattern recognition examples

October 5, 2020

You may already know that you can use TAAPI.IO to not only get the most popular TA indicators like RSI, MACD, etc., but also to scan for patterns. Finding valuable candlestick patterns like the Evening and Morning Star, Doji, Hammer and many others is easy with TAAPI.IO. Here are a few examples to explain how you can use the pattern recognition yourself.

These pattern-recognition indicators look for a specific candle type / pattern and return either a “0” value (no match) or “100” (match – found the pattern). So let’s say you want to look for a Doji candle on a 1h timeframe for a BTC/USDT symbol on Binance.

You can set up a script that runs every hour and checks the returning value of a call like this:

If you get a value of 100, there’s a Doji candle formed right now on the hourly timeframe. If you get a 0, there is not.

You can also look back and analyze the past candles. Let’s say you want to check for the Doji, but always on the previous closed candle. Then you need to use the backtrack parameter and set it to how many candles you want to look back → let’s say 1 candle back, so you set backtrack=1 like this:

We’ve also implemented a new feature that allows you to easily get multiple indicator values back in time – the backtracks parameter. Using backtracks you scan past candles for a candlestick pattern very effectively. By the way, this parameter works for all indicators, not just the patterns. Let’s say you want to scan the last 100 candles to see if there was a hammer pattern in there somewhere. All you need is to make a call like this:

This way, you can, for example, scan for all Dojis in the past 100 candles in one effective API query.

Do you have any questions regarding pattern recognition? Get in touch, we’re here to help.