OPEN-SOURCE SCRIPT
已更新 Auto Harmonic Patterns - Open Source

I may not be able to spend much time on the harmonic patterns and realized that there are not much open source scripts on them either. Hence, decided to release open source version which can be used by other developers for reference and build things on top of it.
Original script is protected and can be found here:

Logical ratios of patterns are coded as below:
Notations:
ABCD Classic
AB=CD
ABCD Extension
Gartley
Crab
Deep Crab
Bat
Butterfly
Shark
Cypher
Three Drives
5-0
This script contains everything which original script has apart from stats. Use the original script if you are not developer looking for code reference and prefer having stats table.
I have also developed a strategy based on harmonic patterns which can be found here:

Original script is protected and can be found here:

Logical ratios of patterns are coded as below:
Notations:
- Lines XABCD forms the pattern in all cases. (OXABCD in case of Three drives )
- abc = BC retacement of AB, xab = AB retracement of XA and so on
ABCD Classic
- 0.618 <= abc <= 0.786
- 1.272 <= bcd <= 1.618
AB=CD
- Price difference between AB and CD are equal
- Time difference between AB and CD are equal
ABCD Extension
- 0.618 <= abc <= 0.786
- 1.272 <= AD/ BC (price) <= 1.618
Gartley
- xab = 0.618
- 0.382 <= abc <= 0.886
- 1.272 <= bcd <= 1.618 OR xad = 0.786
Crab
- 0.382 <= xab <= 0.618
- 0.382 <= abc <= 0.886
- 2.24 <= bcd <= 3.618 OR xad = 1.618
Deep Crab
- xab = 0.886
- 0.382 <= abc <= 0.886
- 2.0 <= bcd <= 3.618 OR xad = 1.618
Bat
- 0.382 <= xab <= 0.50
- 0.382 <= abc <= 0.886
- 1.618 <= bcd <= 2.618 OR xad = 0.886
Butterfly
- xab = 0.786
- 0.382 <= abc <= 0.886
- 1.618 <= bcd <= 2.618 OR 1.272 <= xad <= 2.618
Shark
- xab = 0.786
- 1.13 <= abc <= 1.618
- 1.618 <= bcd <= 2.24 OR 0.886 <= xad <= 1.13
Cypher
- 0.382 <= xab <= 0.618
- 1.13 <= abc <= 1.414
- 1.272 <= bcd <= 2.0 OR xad = 0.786
Three Drives
- oxa = 0.618
- 1.27 <= xab <= 1.618
- abc = 0.618
- 1.27 <= bcd <= 1.618
5-0
- 1.13 <= xab <= 1.618
- 1.618 <= abc <= 2.24
- bcd = 0.5
This script contains everything which original script has apart from stats. Use the original script if you are not developer looking for code reference and prefer having stats table.
I have also developed a strategy based on harmonic patterns which can be found here:

版本注释
- Removed deviation threshold and disable stats on load. (Can be enabled in settings)
- Default length is set to 5
版本注释
Update labels版本注释
update labels版本注释
Fix error版本注释
Remove stats again版本注释
Corrected errors in 3-Drive and 5-0 where B does not need to be in the middle.版本注释
Minor parameter adjustments.版本注释
Add labels.版本注释
No updates. But, just converted to pine 5 :)Trial - trendoscope.io/trial
Subscribe - trendoscope.io/pricing
Blog - docs.trendoscope.io
Subscribe - trendoscope.io/pricing
Blog - docs.trendoscope.io
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
Trial - trendoscope.io/trial
Subscribe - trendoscope.io/pricing
Blog - docs.trendoscope.io
Subscribe - trendoscope.io/pricing
Blog - docs.trendoscope.io
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。