**Harmonic Pattern Recognition With Python — Transcript & Summary | SozAI**
Source: https://sozai.app/transcript/harmonic-pattern-recognition-python/

Python tutorial on detecting XABCD harmonic patterns (Gartley, Bat) using directional change segmentation, golden ratio analysis, and Bitcoin backtesting.

## Key Takeaways

- Harmonic pattern detection can be built from directional change segmentation and ratio matching in Python
- Evidence for golden-ratio retracements in Bitcoin price segments is weak and sensitive to the sigma parameter
- Backtest performance of harmonic patterns should be studied across different sigma and error thresholds
- A viewer needs a solid grasp of the directional change algorithm to follow the code

## What the video covers

- Introduces Python code for recognizing XABCD harmonic patterns such as the Gartley and Bat patterns
- Starts with the golden ratio (1.618 / 0.618) and its link to the Fibonacci sequence
- Expresses skepticism toward mystical claims about the golden ratio in trading
- Explains Fibonacci retracements and projections as core concepts in harmonic trading
- Uses the directional change (zigzag) algorithm, controlled by a sigma percentage parameter, to segment price into alternating tops and bottoms
- Presents a get\_extremes function that returns a combined, ordered data frame of tops and bottoms
- Computes retracement ratios between consecutive price segments, plus logarithmic ratios, and visualizes their distributions
- Shows a bimodal distribution of retracement ratios and applies kernel density estimation to test whether the golden ratio appears as a spike
- Finds only weak, statistically unrigorous evidence for Fibonacci levels, noting the 1.618 spike appears at some sigma values but not prominently
- Defines pattern classes for bullish and bearish XABCD patterns with acceptable ratio ranges and an error function for matching

## Chapters

1. 00:00 Introduction to Harmonic Patterns and the Golden Ratio
2. 01:54 Directional Change Segmentation Setup
3. 03:42 Computing Retracement Ratios and Extremes
4. 05:30 Kernel Density Estimation of the Golden Ratio
5. 07:28 Defining Harmonic Pattern Detection Logic
6. 10:14 Pattern Matching and Error Functions
7. 13:00 Backtesting Results Across Sigma Values
8. 16:00 Combining Pattern Signals

Answers

## Questions about this video

What is the golden ratio and how is it used in this video?

The golden ratio is approximately 1.618, and its reciprocal is 0.618. The video explains that it emerges when dividing consecutive Fibonacci numbers, and Fibonacci traders use it for retracement and projection levels in price.

What is the directional change algorithm?

It is a zigzag method that alternates between tops and bottoms by checking whether price has retraced by a set percentage, called sigma, from its recent high or low. It is used to segment price into swings for pattern analysis.

Does the video find strong evidence that the golden ratio appears in Bitcoin price retracements?

No. The presenter says the analysis is not statistically rigorous and finds only a small amount of evidence, with a spike near 1.618 at some sigma values that is not very prominent. He suggests testing other markets like forex or oil.

## Full Transcript — Download SRT & Markdown

00:00

Speaker A

in this video I'll explain and show Python code for the pattern recognition of many popular XABCD harmonic patterns, such as the Gartley pattern or Bat pattern. We will backtest the found patterns using Bitcoin data and study their performance. We will build up to the harmonic patterns throughout the video, but let's start with the golden ratio.

00:17

Speaker A

the harmonic patterns throughout the video but let's start with the golden ratio this is the golden ratio 1.618 this is the Fibonacci sequence if we divide one of the numbers in it by the previous number we get the golden r

00:30

Speaker A

This is the golden ratio, 1.618. This is the Fibonacci sequence. If we divide one of the numbers in it by the previous number, we get the golden ratio. The further into the sequence we get, the more it approaches the golden ratio. The reciprocal of the golden ratio is 0.618. The golden ratio has some interesting properties and occasionally shows up in mathematics and nature.

00:47

Speaker A

start feeding you some new age about how this number is sacred or unlocks the keys to the universe for this reason I've long been skeptical about this area of trading some of the stuff out there feels rather close to

00:58

Speaker A

At this point, a lot of trading content will start feeding you some new-age talk about how this number is sacred or unlocks the keys to the universe. For this reason, I've long been skeptical about this area of trading. Some of the stuff out there feels rather close to astrology or some other nonsense. Don't get me wrong, the golden ratio is a real thing, but I have my doubts about its role in the financial markets. Despite this, I'm going to try my best to provide an objective analysis on the topic.

01:12

Speaker A

core concept that Fibonacci Traders will talk about are Fibonacci retracements and projections it is said that financial markets will often retrace from a movement in price by 0.618 or 1.618 from the previous move these Fibonacci retracements are often

01:28

Speaker A

The core concepts that Fibonacci traders will talk about are Fibonacci retracements and projections. It is said that financial markets will often retrace from a movement in price by 0.618 or 1.618 from the previous move. These Fibonacci retracements are often components of harmonic patterns, which we will look at later. To get the retracement ratio between two segments in price, we find the vertical height of each of them, then divide them to get the ratio.

01:40

Speaker A

the directional change or zigzag algorithm to segment the price I explain and show code for this algorithm in my video about chart patterns I recommend watching or rewatching the part of the video about directional change first this video will be difficult to watch

01:54

Speaker A

Throughout this video, we will use the directional change, or zigzag, algorithm to segment the price. I explain and show code for this algorithm in my video about chart patterns. I recommend watching or rewatching the part of the video about directional change first. This video will be difficult to watch without a good understanding of the directional change algorithm.

02:09

Speaker A

quite a bit throughout this video here's some Candlestick data with the directional change drawn in white the sigma set to 1% now I'll add the directional change with the sigma set to 3% in blue you can see how the larger

02:21

Speaker A

The directional change algorithm always finds alternating tops and bottoms by checking if the price has retraced by a set percentage from its recent lowest or highest value. I call that percentage sigma. We will use the sigma parameter quite a bit throughout this video.

02:34

Speaker A

ratios to see if we can find the golden ratio we're currently in the file with the directional change function the code for this was went over in the chart pattern algorithms video I added a function to it that we'll use in this

02:46

Speaker A

Here's some candlestick data with the directional change drawn in white, the sigma set to 1%. Now I'll add the directional change with the sigma set to 3% in blue. You can see how the larger percentage causes the tops and bottoms to be found less frequently, and the price segments are larger.

03:01

Speaker A

frames we add a column specifying that they are a top or a bottom one for a top negative one for bottoms then we concatenate the two data frames and we sort the index so they are in order here

03:13

Speaker A

Let's look at code to compute the retracement ratios for each of the price segments found by the directional change algorithm, then look at the density of the retracement ratios to see if we can find the golden ratio.

03:28

Speaker A

top or bottom for many applications it's useful to have the tops and bottoms separate that's why the original function returns two lists but for studying retracements we want them together moving over to retracement ratios. Pi this script computes

03:42

Speaker A

We're currently in the file with the directional change function. The code for this was gone over in the chart pattern algorithms video. I added a function to it that we'll use in this video called get\_extremes. It takes a data frame of open, high, low, close data and the percentage value sigma. We call the directional change function, which returns two lists of the found tops and bottoms. We convert these lists to data frames. We add a column specifying whether they are a top or a bottom: one for a top, negative one for bottoms. Then we concatenate the two data frames and sort the index so they are in order.

03:56

Speaker A

of each price segment by finding the difference between each extreme price and the previous extreme price the pandas function shift will lag the column by the specified amounts we get the absolute value of the difference because we care about the height not the

04:10

Speaker A

Here is what the data frame looks like. The data frame index "confirm\_i" is the confirmation index of each top and bottom. I shortened "extreme" to "ext." "extreme\_i" is the index of the actual top or bottom extreme. "p" is the price of the top or bottom. For many applications it's useful to have the tops and bottoms separate, which is why the original function returns two lists, but for studying retracements we want them together.

04:23

Speaker A

column we also compute the logarithmic ratios here's a histogram of the actual ratios and here is the histogram of the logarithmic ratios the logarithmic ratios will be negative when the actual retracement ratio is below one note the bodal distribution price segments tend

04:40

Speaker A

Moving over to retracement\_ratios.py, this script computes retracement ratios for several values of the sigma parameter and plots their density. We load in hourly Bitcoin data from a CSV. Then we loop through several sigma values. We use the get\_extremes function. We compute the vertical height of each price segment by finding the difference between each extreme price and the previous extreme price. The pandas function shift will lag the column by the specified amount. We get the absolute value of the difference because we care about the height, not the direction. We save this to the column "seg\_height," short for segment height. We get the retracement ratio by dividing the current segment height by the previous segment height. We will look for occurrences of the golden ratio in this column. We also compute the logarithmic ratios.

04:54

Speaker A

logarithmic retracement ratios to the scipi function gosi and KDE to get our kernel we set the bandwidth to a very low number in most cases the bandwidth should be set to accurately model the distribution but we're not trying to

05:07

Speaker A

Here's a histogram of the actual ratios, and here is the histogram of the logarithmic ratios. The logarithmic ratios will be negative when the actual retracement ratio is below one. Note the bimodal distribution: price segments tend to be bigger or smaller than the previous segment more often than they are equal.

05:20

Speaker A

density estimate but I opted for a low value of the bandwidth to see if the spikes show up at the golden ratio the rest of the code finishes the density estimate we get a range of values run them

05:32

Speaker A

We're going to perform a kernel density estimation to find the most common retracement ratios. We will use the logarithmic ratios for the kernel density estimate. We pass the logarithmic retracement ratios to the SciPy function gaussian\_kde to get our kernel. We set the bandwidth to a very low number. In most cases the bandwidth should be set to accurately model the distribution, but we're not trying to model the distribution here.

05:47

Speaker A

golden ratio numbers here is the retracement density with a sigma of 1% I'll zoom in to the interesting part there is a mild Spike around the golden ratio here is the retracement density with a sigma of 2% neither of the ratios

06:01

Speaker A

Here's a plot of the density estimation with a bandwidth of 1 and 0.1. The small bandwidth value causes there to be a lot of spikes in the density estimate. This is not normally what you want from a density estimate, but I opted for a low value of the bandwidth to see if the spikes show up at the golden ratio.

06:13

Speaker A

can't say for sure why this increased density is there if I had to guess I would say there might be a self-fulfilling prophecy many Fibonacci enthusiastic Traders start reversing their position at a 1.618 retracement or it's just a coincidence but I don't

06:27

Speaker A

The rest of the code finishes the density estimate. We get a range of values, run them through the kernel, add the density values to a pandas series, and exponentiate the retracement values to return them to the normal scale. Then we plot the density estimate and plot vertical lines at 0.618 and 1.618, the golden ratio numbers.

06:43

Speaker A

the analysis I've done here isn't very statistically rigorous but if we're being generous we can say that there's a small amount of evidence for the Fibonacci stuff perhaps you could try running the script on some other markets maybe Forex or oil or something maybe

06:57

Speaker A

Here is the retracement density with a sigma of 1%. I'll zoom in to the interesting part. There is a mild spike around the golden ratio. Here is the retracement density with a sigma of 2%. Neither of the ratios really appear to stand out. Here is the retracement density with a sigma of 3%. Here we do see a pretty notable spike at the golden ratio. I find this quite interesting, as the density is only showing what is observed in the data. I can't say for sure why this increased density is there. If I had to guess, I would say there might be a self-fulfilling prophecy, with many Fibonacci-enthusiastic traders starting to reverse their positions at a 1.618 retracement. Or it's just a coincidence. But I don't think this is the footprint of human psychology, or planetary alignment, or whatever.

07:14

Speaker A

most popular the same algorithm will find all seven of these patterns all these patterns look at the ratios between multiple price segments the ratios in all these patterns are numbers derived from the golden ratio here is the gartly pattern which I believe is

07:28

Speaker A

Moving on, with sigma at 4% there's a spike at 1.618, but it's not very prominent. The 0.618 never really stuck out on any of these sigma values. The analysis I've done here isn't very statistically rigorous, but if we're being generous, we can say that there's a small amount of evidence for the Fibonacci stuff. Perhaps you could try running the script on some other markets, maybe forex or oil, and see if the golden ratio is more present there.

07:42

Speaker A

supposed to be between 0.382 and 0.886 the CD segment to BC segment ratio is supposed to be between 1.13 and 1.618 the final ratio is between the XA segment and the height between A and D which should be 0.7 86 the bearish

08:01

Speaker A

Let's move on to the harmonic patterns. I selected seven XABCD patterns for this video: the Gartley, Bat, Butterfly, Crab, Deep Crab, Cipher, and Shark patterns. I chose them because they seem to be the most popular. The same algorithm will find all seven of these patterns. All these patterns look at the ratios between multiple price segments, and the ratios in all these patterns are numbers derived from the golden ratio.

08:14

Speaker A

recognition algorithm finds that is very close to the idealized ratio in practice it is an unrealistic expectation to find exactly these ratios so we must allow some tolerance notice the error in the top left corner later we will experiment

08:30

Speaker A

Here is the Gartley pattern, which I believe is the most well-known of the harmonic patterns. The AB segment and the XA segment should have a ratio of 0.618. Many of these patterns provide an acceptable range of ratios. For example, the BC segment to AB segment ratio is supposed to be between 0.382 and 0.886. The CD segment to BC segment ratio is supposed to be between 1.13

08:45

Speaker A

identified using only the entry candle and previous candles at this entry candle the retracement ratio is conformed to the gartly pattern within the error threshold the trade is exited at the close of this candle the exit happens when the directional change

08:59

Speaker A

algorithm can confirms the next bottom let me explain again viewing what the directional change algorithm sees here's the same gartly pattern after it has formed with a little more context each of the white lines are the price segments the directional change

09:13

Speaker A

algorithm finds let's move backwards in time to show how the identification happens the directional change algorithm cannot confirm a top or bottom until the price has retraced by the given percentage the high of this candle will be the C point of the gartly pattern but

09:29

Speaker A

the high is not yet confirmed we wait until the price has retraced by a set percentage from the highest high since the last confirmed bottom at this point the price has retraced by enough to confirm what will be the C point and the

09:42

Speaker A

scarly once what will be the C point is confirmed the algorithm starts checking for bullish patterns it uses the lowest low since the confirmed C points as the D points in the pattern so here we check the ratios currently the ratios do not

09:58

Speaker A

align with any pattern so we move on to to the next candle we again use the most recent candle as the D point in the pattern and check the retracement ratios using this new candles low as the D

10:09

Speaker A

points in the pattern the ratios do align with the garly pattern so we take an entry at the close of this candle to exit these harmonic patterns I opted to wait until the directional change algorithm confirms the next bottom we

10:22

Speaker A

exit at the close of this green candle when a bottom is confirmed this same procedure is done for bearish patterns but reversed after the directional change algorithm confirms a top or bottom that would be the C points in a xabcd harmonic pattern

10:39

Speaker A

we start checking the ratios with the most recent candle as the D points bullish patterns are searched for after a top is confirmed and bearish patterns are searched for after a bottom is confirmed let's now go through the code

10:52

Speaker A

for the pattern recognition all the code for the harmonic pattern recognition can be found in harmonic patterns STP first we Define the patterns I made a data class xabcd to hold the ratios of the patterns each of the ratios can take on

11:08

Speaker A

three types a float a list or none we Define the gartly pattern here the first ratio of the gartly is set to 0.618 so we just pass in the float the second ratio of the gartly pattern the one

11:20

Speaker A

between segments ab and BC has a range of acceptable values to define a range of acceptable values we pass in a list of two numbers the lower and upper bounds of the acceptable ratios some patterns have a range of acceptable

11:34

Speaker A

values for a given segment While others have a set value for the same segment the pattern recognition can handle any combination of ranges single values or none none means the ratio is ignored for example the shark pattern does not care

11:48

Speaker A

about the xaab ratio so we pass on none if you want to experiment with other X ABCD patterns this is where you can add or remove them make sure all the patterns that you want want to use are

12:00

Speaker A

added to this list there is another data class xabcd found this holds the integer indices of the candle data for a found pattern the pattern recognition function will return lists of instances of this class for each of the patterns found you can pass

12:18

Speaker A

the found instances into this function to plot them here is the main procedure of these scripts we load in hourly Bitcoin data from a CSV we call get extremes which we already went over returning a data frame of the found tops

12:32

Speaker A

and bottoms by the directional change algorithm we'll start with a sigma of 2% but we'll utilize different values later on then we call the function find X ABCD passing in the open high low close data the extremes and an error threshold

12:46

Speaker A

we'll experiment with different values of the error threshold later but 0.2 is a reasonable default value here's the find xabcd function we start by getting the retracement ratios we saw this already when we were looking at the retracement ratio script then we prepare

13:03

Speaker A

the output dictionary for each pattern we create two signals concurrent with the candle data denoting the position at each candle for both bullish and bearish patterns we also create two lists for the instances of the xabcd founds data

13:18

Speaker A

class for bullish and bearish patterns first comp is the index of the first confirm directional change top or bottom we start the main loop at this index extreme I is the index of the most recent confirmed top or bottom the entry

13:33

Speaker A

taken variable and the pattern used variable control the trades entry taken is zero when no pattern was found and thus no trade is active if a bull pattern is found it is set to one if a bare pattern is found it is set to

13:44

Speaker A

negative one pattern used will be set to a string the name of the pattern that caused an entry we start the loop through the candle data we check if the next extreme is confirmed if it is we increment extreme I we also set entry

13:57

Speaker A

ticken to zero if there was the trade active we exit on this candle's close we check if there is an active trade if there is we set the bull or bare signal to the appropriate value for this candle

14:09

Speaker A

we can then continue on in the loop the exit is designed to have no overlapping trades we break out of the loop if we are at the end of the extremes data this is to prevent an outof bounds index for

14:21

Speaker A

extreme ey we continue if extreme I is less than three we need at least a few extremes to find the patterns if we made it this far in theop Loop without reaching a continued statement then we start looking at the ratios to find the

14:33

Speaker A

patterns we get the type of the last confirmed extreme this will be negative 1 if it's a bottom or one if it's a top we get the index of the candle data of the most recent confirmed extreme this

14:44

Speaker A

will be the C points in the xabcd pattern we get the price of the current high or low to service the D points and our xabcd pattern if the most recent extreme was a top we are checking for

14:55

Speaker A

bull patterns and vice versa we check that the current low or high is the highest or lowest since the last confirmed extreme if not we continue this is mainly an optimization but we need to ensure that we're using the

15:08

Speaker A

lowest or highest price for the D point now we can compute the ratios involving D with the current candle we compute the BC CD ratio and the XA a ratio we now have all the ratios of a xabcd pattern

15:22

Speaker A

we now check which pattern if any these ratios are similar to with this block of code we check all the patterns we defines whichever patterns ratios are closest to the ratios observed we will select we Loop through each of the

15:36

Speaker A

defined patterns we use a function get error to find the error attributed to each of the four ratios making up one of these patterns we pass it the ratio we observe in the data and the ideal ratio that the pattern specifies we'll look at

15:49

Speaker A

the get error function in a moment but no it returns a float we add up the error for each of the four ratios we then compare the error to the best error we've found so far if the current tested

16:00

Speaker A

pattern is better we update the best error and the type of pattern if the closest matching patterns error is below the threshold we defines we will save the pattern and enter a trade we save the indices of the candle data that make

16:12

Speaker A

up our pattern into an instance of xabcd founds we set the variable pattern used to the pattern founds if the most recent confirmed extreme was at top then this is a bullish pattern otherwise it's a bearish pattern if it's a bullish

16:26

Speaker A

pattern we set entry tick to one we append bold to the pattern name we set the bull signal for the found pattern to one for the current candle and we save the found pattern into the bull patterns list we do the same if it was a bearish

16:39

Speaker A

pattern let's look through the get error function the function is passed the actual ratio what we observe and the idealized ratio defined by the pattern the idealized ratio can be a set number a list defining a range of acceptable

16:53

Speaker A

values or none meaning ignore if the ideal ratio is none we just return zero we're comparing trement ratios we are going to find the difference between the observed ratios and the idealized ones but because they are ratios we need to

17:06

Speaker A

take the logarithm before we difference them we check if the patterns to find ratio is a list if it is we get the two ratio bounds and convert them to logarithmic ratios if the observed ratio is within the bounds we return zero no

17:19

Speaker A

error if the observed ratio is outside the bounds we find how much outside the bounds it is with this line I chose to multiply the air for range bounds by two because having a range of acceptable values is already pretty lenient so I

17:32

Speaker A

think it should be punished harder if it is outside the range if you want to not allow ratios outside the range at all you can uncomment this El statement here this way if it is outside the range it

17:42

Speaker A

returns a huge value for error that will be much larger than any reasonable error threshold in the case that the idealized ratio defined by the pattern is a single number we simply find the absolute difference between the observed ratio

17:55

Speaker A

and the defined ratio here's the accumulative log return for all the harmonic patterns combined with the directional change percentage set to 2% and the error threshold set to 0.2 I guess we can say it kind of worked it did pretty well in 2022 this harmonic

18:11

Speaker A

pattern strategy has two adjustable parameters the directional change percentage will adjust the size and scale of the patterns found and the error threshold will control how closely the patterns found match the idealized ratios let's first look at how the

18:26

Speaker A

patterns perform across different percentages for the direct change algorithm holding the error Threshold at 0.2 here is the cumulative log return for all the patterns combined with several values of the directional change Sigma here are the profit factors at

18:41

Speaker A

each Sigma some of course will do better than others and the lower values of the sigma parameter appear to do better these results are the combination of all the defined harmonic patterns let's look at the performance of each of the

18:55

Speaker A

patterns individually to see if some Stand Out here's the profit Factor of each of the patterns individually at different Sigma values a strategy is profitable when the profit factor is above one so I drew a white line at one

19:08

Speaker A

to easily visualize the only pattern that was profitable at every Sigma value was the shark pattern every other pattern worked on some values but not others the crab pattern has a few very high profit factors but if we look at

19:22

Speaker A

the number of times each pattern was found we can see that the crab is quite rare compared to the other patterns further testing of these patterns could could be done but I really don't think any pattern stands out as Superior so

19:33

Speaker A

I'll continue combining all the harmonic patterns into a single strategy back to the combined performance at different Sigma values Lux certainly played a role in the better performing Sigma values simply selecting the best is probably not the way to go instead I'm going to

19:49

Speaker A

average the signals at each Sigma parameter to create a single signal this way the strategy is trading every harmonic pattern on every scale let's look at the code for the this we create a signal for the combination of all

20:02

Speaker A

patterns and all scales we Loop through several values of the sigma parameter we use the G extremes function with the current value we find the xabcd patterns we create a signal for combining all the harmonic patterns with the current Sigma

20:17

Speaker A

parameter we Loop through each pattern and add each pattern's bullish and bearish Signal together to the combined signal the trade entries and exits were designed in a way so there's no overlapping trades so we can simply add these signals together we add this

20:31

Speaker A

signal to the all combined signal after looping through all the signal values we divide the signal by the number of parameters used we multiply this final signal by the next return to get our strategy returns we then compute the

20:44

Speaker A

profit Factor here is the signal we just computed combining all patterns on all scales notice it is bounded between -1 and 1 but takes on many different values because trades triggered by patterns on different scales can happen at the at

20:59

Speaker A

the same time we have to adjust the signal by dividing by the number of Sigma values used this signal essentially acts as a position sizing scheme when the signal is at 0.5 we take a half-sized long position and when it's

21:12

Speaker A

at NE .5 we take a half-sized short position here is the cumulative log return of that signal it's not very good it has a profit factor of 1.026 but we will use this method of combining all harmonic patterns on

21:26

Speaker A

multiple scales to compare different error thresholds by combining several Sigma values with equal weighting we essentially reduce the number of adjustable parameters to one that being the error threshold we know that the combined signal with an error threshold

21:39

Speaker A

of 0.2 yields a profit factor of 1.026 so let's try other error thresholds here are the profit factors across error thresholds with a higher tolerance of error there will be more instances of qualifying harmonic patterns in my opinion if harmonic patterns were truly

21:56

Speaker A

effective we would see higher profit factors at lower error tolerances and as the error tolerance increased the performance would dwindle but we see the opposite the lower values of air tolerance perform worse every value for air tolerance does have a profitable

22:11

Speaker A

profit Factor though the performance is weak but consistently positive which I suppose can be interpreted as evidence in favor of harmonic patterns the python implementation I provided took about 1 hour to compute this plot further research into this will require some

22:28

Speaker A

optimization here's the cumulative log return with an air threshold of 0.5 this is benefiting from a selection bias I chose the best error threshold from the previous graph but even with the benefit of selection bias it's not that great it does have periods of

22:43

Speaker A

pretty good performance though I wanted to show it because we went through the effort of finding the best error threshold overall we saw that these harmonic patterns have some positive performance but they are weak at least for Bitcoin perhaps they work better on

22:56

Speaker A

other markets the exits I use used are not typical for harmonic patterns they are quick to take a profit and perhaps they don't let the subsequent price move run its course my overall opinion is I do think there may be patterns in the

23:09

Speaker A

ratios between consecutive price movements that are predictive of price reversals and some harmonic patterns may be fairly close to some of those reversal patterns which might be why we saw better performance with a higher error tolerance but I think the target

23:23

Speaker A

ratios being derived from the Fibonacci sequence is essentially pseudo science I would like to make a sort of follow-up video to this one finding the optimal ratios from the data and not from sacred numbers if patterns in the retracement

23:38

Speaker A

ratios do exist I'd be curious to see what they are I imagine the optimal ratios would shift Through Time requiring a walk forward training process every successful price pattern data mining scheme I've worked with has this trade anyways that's it for this

23:52

Speaker A

one thank you for watching

Topics: harmonic patterns XABCD Gartley pattern Bat pattern golden ratio Fibonacci retracement directional change zigzag algorithm Python backtesting Bitcoin

Study this video

- [Flashcards from this video](https://sozai.app/tools/ai-flashcard-generator/?from=transcript&id=86313)
- [Quiz on this video](https://sozai.app/tools/quiz-generator/?from=transcript&id=86313)

Free, made by AI from this transcript. No signup.


---
This is the markdown twin of https://sozai.app/transcript/harmonic-pattern-recognition-python/ — the same content, without the markup.
Published by SozAI (https://sozai.app). Reuse and quotation are allowed with attribution and a link back.
Machine-readable index: https://sozai.app/llms.txt · data API: https://sozai.app/api/
