TradingView
RozaniGhani-RG
Oct 3, 2021 1:23 AM

Auto AB=CD 1 to 1 Ratio Experimental 

Crude Palm Oil FuturesMYX

Description

This indicator was experimental based AB=CD, shows last AB=CD either Standard AB=CD or Reciprocal AB=CD which uses time instead of bar_index.
This build is based upon educational materials (refer below resources).
ABCD are based on 1 to 1 Ratio for price and time.

Features / Pros:
1. Show last AB=CD points and lines including table value.
2. Customize table position and size.
3. For desktop display only, not for mobile.

Cons:
1. Time for point D less accurate for intraday timeframe (minute, hour, etc) which may including holidays and depends on price volatility.
2. Label ratio not shown properly depends on timeframe especially for intraday timeframe and maybe for Daily and Weekly timeframe.
3. Experimental code, use at your own risk.

FAQ
1. Credits
Scott M Carney, Harmonic Trading: Volume One and Two.
LonesomeTheBlue for zigzag array source code.
HeWhoMustNotBeNamed for some guidance and advice.

2. Previous Build / Resources
Link 1
Link 2
Link 3
Link 4

3. Code Usage
Free to use for personal usage.

Left : Bullish AB=CD, Right : Bullish Reciprocal AB=CD


Left : Bearish AB=CD, Right : Bearish Reciprocal AB=CD

Release Notes

Code clean up.
1. Follow Pine Script Coding Conventions
2. Add dependencies comment
3. Remove fun_avg()
4. Add abs() to ratio_CD

Release Notes

Convert to Pine Script v5

Release Notes

Change Ternary function to switch

Release Notes

Code clean up
Comments
RedKTrader
memememira
Terima kasih, tumpung guna script awk.
RozaniGhani-RG
@memememira, terima kasih.
X-Algo
You can add this try and let me know

errorPercent = input(10, minval=5, step=5, maxval=20)
err_min = (100-errorPercent)/100
err_max = (100+errorPercent)/100

you need to incorporate it in your calcul 1 Ab and 2 CD
0.618 err_min, 0.786 err_max
1.272 err_min, 1.618 err_max
RozaniGhani-RG
@TheDragonTraderOfWallStreet, I will have new update based on pine script version 5, probably I will release on newer indicator, not including error min and max.
X-Algo
@RozaniGhani-RG, that's awesome bro you should try to add also a MTF multi time frames like a resolution and for the error try max_bars_back=500*5
max_labels_back=500
max_lines_count=500

I have did it and it works well
RedKTrader
great job! thank you for sharing.... love to see more of your work with various other concepts
JuliaOEZ
Great work! Exactly what iam looking for and looking forward to see much more from you. Thanks for all your efforts for this community! Thanks a lot for sharing.
RozaniGhani-RG
@JuliaOEZ, Thank you. I might able to convert them into array.
X-Algo
Pretty nice script bro, you should add a error percentage because your patterns move too fast...
Ex: if you a bullish pattern appears and the bars are have hit C and goes to D it change until a bearish pattern

i have test many times with the replay and its almost impossible to hit D if you dont input a error percentage of 5 or 10%

But great work...

i will try to add this error percentage and send you it
More