ABCD 4-point uptrend chart pattern indicator

It exhibits three continued lines in a specific trend. The concept is to compare the retracement level between legs. For example, when leg BC makes a 0.382 or 38.2% Fibonacci retracement of the BA leg or AB, it means that the price difference from point C to B is equal to 38.2% of the price difference from point B to A.
Please note that this indicator is only for ABCD 4-point chart pattern in uptrend, in particular, it must be an uptrend from point A to point B.
There are many ways to define its formation, our unique algorithm is based on the following definition:
The point A, B and C are swing points and D does not have to be a swing point, but it must reach a given ratio of AB:CD.
The ratio of AB:CD is determined by comparing the price difference between C to D and A to B.
Here is the formula to calculate it: |Price of C - Price of D| / |Price of A - Price of B|.
Also, the price difference between B to C and A to B must reach a given ratio, BC:AB calculation is the same as AB:CD.
Point B must be higher than point A in a given percentage.
How it works?
The indicator will automatically detect the ABCD 4-point chart pattern based on the input values we use. It will draw three lines to connect point A, B, C and D once all four points satisfy the condition. It will also display the letter of A, B, C and D above or below in each corresponding bar. The indicator draws seven extension lines from point D as the support and resistance levels. The default levels are based on the Golden Ratio. You can change the ratios from input. The indicator will start to plot the lines as soon as the pattern is confirmed, the trend may continue to go up after the event.
It shows the Fibonacci retracement support and resistance levels for a given range and displays the corresponding ratio on the right side of the levels. The price range and levels are adjustable by user, you can easily identify the major and minor support/resistance levels from the chart with your desired inputs.
Features and Inputs:
No repaint, all drawing objects show up immediately right after the point D is detected.
Able to show patterns found in history data.
There is a Built-in alert function to easily set up an alert.
Works on all timeframes, including second, minute, hour, day, week, month.
Works on Renko, Heikin Ashi, Range, bar, candle chart types.
Strength, this input is used to define the minimum number of bars to the left and right side of the swing point.
B:A Ratio Min in %, this is the minimum price difference in percentage between point B and point A. If we enter 0.3 for this input, the indicator will check if B(swing high) was 0.3% higher than A(swing low).
B:A Ratio Max in %, this is the maximum price difference in percentage between point B and point A. If we enter 2.5 for this input, the indicator will check if the price difference between point B and point A was less than 2.5%.
BC:AB Ratio Min in %, this is the minimum ratio in percentage between section BC and AB. Here is the formula to calculate it: |Price of C - Price of B| / |Price of A - Price of B|.
BC:AB Ratio Max in %, this is the maximum ratio in percentage between section BC and AB. Here is the formula to calculate it: |Price of C - Price of B| / |Price of A - Price of B|.
CD:AB Ratio Min in %, this is the minimum ratio in percentage between section CD and AB. Here is the formula to calculate it: |Price of C - Price of D| / |Price of A - Price of B|.
CD:AB Ratio Max in %, this is the maximum ratio in percentage between section CD and AB. Here is the formula to calculate it: |Price of C - Price of D| / |Price of A - Price of B|.
Extension Range, this is the number of bars extend to the right side of the support and resistance lines, set it to 0 if you want to disable it.
ABCD letter COLOR, the color of the letter for point A, B, C and D. It's very useful when we use more than one instance of this indicator on the same chart with different input sets. We can easily distinguish them by different letter color.
ABCD Line COLOR, the color of the lines that connect point A, B, C and D. Similar functionality as the letter color.
Show Fibo Level labels, enable this input will show up the "0%" and "100%" as label on corresponding Fibonacci levels.
Level 1 to 5, are the support and resistance levels in percentage, please use negative value if you need a level below 0%, such as -61.8 means 61.8% below level 0%. The level 0% is the price level at Point A, and the level 100% is the price level at Point D, these two levels are fixed once the pattern formed.
You can change the color of each level line from the following colors: silver, gray, white, maroon, red, purple, fuchsia, green, lime, olive, yellow, navy, blue, teal, aqua and orange.
Line style: you can choose from: Solid, Dotted and Dashed.
1 is Solid like this: ______________________
2 is Dashed - - - - - - - - - - - - - - - - - - -
3 is dotted ............................................
Sometimes, we may need to focus on a particular pattern, which may require strict ratio parameters.
If we only want to detect an ABCD pattern, which qualify the following rules:
There must be at least 10 bars on both left and right sides of point A, B and C.
The price must raise around 0.8% from point A to point B
The ratio BC:AB must be around 70%
CD must have similar price difference of AB, in other words, price difference between point C and D should be similar to price difference between point A and B.
Then we can use the following inputs to detect such a pattern:
We need to enter 10 for the strength input value.
The price must raise around 0.8% from point A. We can use 0.75 for the min ratio of B:A and 0.85 for the max ratio of B:A, since 0.8 is between of 0.75 and 0.85. The value is in percentage, so 0.05 is only 0.05%, which is a very small amount of price change.
We should not simply use 100% for CD:AB ratio. The best way is to give a range from the min to the max percentage, since in real life we can hardly find any pattern has exact 100% as the CD:AB ratio.
Most of the time, the CD:AB ratio could be near 100%, such as 96%, 99% or 102%, so using 95% to 105% is a relatively reasonable range.
Please note that, only the latest found pattern will show the Fibonacci levels. The patterns found in history will only show the lines that connect the A, B, C and D points and the letters.
For more screenshots, videos and details about this indicator, please visit our website.
Invite-only script
Only users authorized by the author have access to this script, and this usually requires payment. You can add the script to your favorites, but you will only be able to use it after requesting permission and obtaining it from its author — learn more here. For more details, follow the author's instructions below or contact Patternsmart directly.
TradingView does NOT recommend paying for or using a script unless you fully trust its author and understand how it works. You may also find free, open-source alternatives in our community scripts.
Author's instructions
Warning: please read our guide for invite-only scripts before requesting access.
Disclaimer
Invite-only script
Only users authorized by the author have access to this script, and this usually requires payment. You can add the script to your favorites, but you will only be able to use it after requesting permission and obtaining it from its author — learn more here. For more details, follow the author's instructions below or contact Patternsmart directly.
TradingView does NOT recommend paying for or using a script unless you fully trust its author and understand how it works. You may also find free, open-source alternatives in our community scripts.
Author's instructions
Warning: please read our guide for invite-only scripts before requesting access.