Coding the Kangaroo Tail Candlestick Pattern Scanner in TradingView
Candlestick patterns are a great addition to market analysis. Some may even consider them vital in research and trading. This article presents the Kangaroo Tail pattern and shows how to code a scanner in TradingView that detects it.
Candlestick charts are among the most famous ways to analyze the time series visually. They contain more information than a simple line chart and have more visual interpretability than bar charts.
The Kangaroo Tail pattern (as presented by Alex Nekritin and Walter Peters) is a one-candlestick reversal configuration that has roots in classic candlestick patterns (namely the hammer and Doji patterns), therefore, it may resemble them but with a few extra conditions to filter false signals.
The bullish Kangaroo Tail is composed of a very long wick where the open and close price are in the upper two thirds of the candle’s range (the high minus the low). Similarly, it must be in a down trend with a range that is superior to the prior candlesticks (to avoid what is known as a runaway). Some minor conditions are in the code.
The bearish Kangaroo Tail is composed of a very long wick where the open and close price are in the lower two thirds of the candle’s range (the high minus the low). Similarly, it must be in an up trend with a range that is superior to the prior candlesticks (to avoid what is known as a runaway). Some minor conditions are in the code.
The conditions of the pattern are relatively easy to code especially in a straightforward and simple coding language such as Pine Script, TradingView’s native language.
The aim of the scanner is to detect the Kangaroo Tail patterns using the following…