OPEN-SOURCE SCRIPT

Vanilla ABCD Pattern

Patterns makes parts of the many predictive tools available to technical analysts, the most simples ones can be easily detected by using scripts. The proposed tool detect the simple (vanilla) form of the ABCD pattern, a pattern aiming to detect potential price swings. The script can use an additional confirmation condition that aim to filter potential false signals.

ABCD PATTERN

The ABCD pattern is not meant to be detected by analyzing individuals closing price observations but by analyzing longer term movements, this is done by using tools such as zig-zag. Like any pattern the ABCD one comes in different flavors, the simplest being based on the following structures:

snapshot

Once price reach D we can expect a reversal. The classical pattern has the following conditions : BC = 0.618*AB and CD = 1.618*AB, as you can see this condition is based on 0.618 which is a ratio in the Fibonacci sequence. Other conditions are for AB to equal to CD or for CD to be 161.8% longer than AB. Why these conditions ? Cause Fibonacci of course.

The ABCD pattern that the proposed tool aim to detect is not based on the zig-zag but only on individual price observations and don't make use of any of the previously described conditions, thus becoming more like a candle pattern.

snapshot

When the label is blue it means that the tool has detected a bullish ABCD pattern, while a red label means that the tool has detected a bearish ABCD pattern.

We can't expect patterns based on the analysis of 1,2,3 or 4 closing price observations to predict the reversal of mid/long term movements, this can be seen on the above chart, but we can see some signals predicting short term movements.

Since the pattern is based on a noisy variation, using smoother input can result in less signals.

snapshot

Above the tool on BTCUSD using closing price as input. Below the tool using ohlc4 as input:

snapshot

TOOL OPTIONS

Being to early can be as devastating as being to late, therefore a confirmation point can be beneficial, the tool allow you to wait for confirmation thus having a potentially better timing. Below is a chart of AMD with no confirmation:

snapshot

As we can see there are many signals with some of them occurring to early, we can fix this by checking the confirmation option:

snapshot

The confirmation is simply based on the candle color, for example if a bearish ABCD pattern has been detected in the past and the closing price is greater than the opening price then the tool return a buy signal. The same apply with a bearish ABCD pattern.

The "last bar repaint" option is true by default, this in order to show the bar where the D point of the pattern has been detected, since the closing price of the last bar is constantly changing the signals on the last bar can be constantly appearing/disappearing, unchecking the option will fix this but will no longer the bar where the D point of the pattern has been detected.

SUMMARY

The pattern is simple and can sometimes be accurate when predicting the direction of future short terms movements. The tool was a request, as it seems i don't post many pattern detectors, well thats true, and the reason is that for me patterns are not super significant, and their detection can be extremely subjective, this is why simple patterns are certainly the only ones worth a look.

Don't expect me to post many pattern related indicators in the future ^^'
AB=CDcandleCandlestick AnalysispatternTrend Analysis

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?


Check out the indicators we are making at luxalgo: tradingview.com/u/LuxAlgo/
Also on:

Disclaimer