Flag and Pennant Pattern Recognition in Python | Algorithmic Trading Strategy

neurotrader · Advanced ·⚡ Algorithms & Data Structures ·3y ago

About this lesson

We automate the flag and pennant chart patterns with python and show the code. Then backtest the performance of the patterns. We use the algorithms shown in my previous videos to build rule based pattern recognition. The pattern recognition is rather lenient to detect many patterns. Both of the chart patterns describe a brief interruption in a trend before continuing. A continuation pattern they call it. I show two different identification algorithms. The size of the patterns found can be controlled with a single parameter. Both pattern recognition systems share similar results. The identified bear and bull flags performed quite well as an entry point for trades using hourly bitcoin data. While the bull and bear pennants are not very consistent. The pennants are found more rarely than the flags. The win rates of the bear and bull flags are above 60% on many of the parameter values and are consistent across parameter values suggesting robustness of the pattern. I do not cover the rolling window, perceptually important point, or trend line algorithms used in this video. But I do in these videos: Chart Pattern Algorithms: https://www.youtube.com/watch?v=X31hyMhB-3s Trend Line Algorithm: https://www.youtube.com/watch?v=wbFoefnidTU Full Code: https://github.com/neurotrader888/TechnicalAnalysisAutomation The content covered on this channel is NOT to be considered as any financial or investment advice. Past results are not necessarily indicative of future results. This content is purely for education/entertainment.

Original Description

We automate the flag and pennant chart patterns with python and show the code. Then backtest the performance of the patterns. We use the algorithms shown in my previous videos to build rule based pattern recognition. The pattern recognition is rather lenient to detect many patterns. Both of the chart patterns describe a brief interruption in a trend before continuing. A continuation pattern they call it. I show two different identification algorithms. The size of the patterns found can be controlled with a single parameter. Both pattern recognition systems share similar results. The identified bear and bull flags performed quite well as an entry point for trades using hourly bitcoin data. While the bull and bear pennants are not very consistent. The pennants are found more rarely than the flags. The win rates of the bear and bull flags are above 60% on many of the parameter values and are consistent across parameter values suggesting robustness of the pattern. I do not cover the rolling window, perceptually important point, or trend line algorithms used in this video. But I do in these videos: Chart Pattern Algorithms: https://www.youtube.com/watch?v=X31hyMhB-3s Trend Line Algorithm: https://www.youtube.com/watch?v=wbFoefnidTU Full Code: https://github.com/neurotrader888/TechnicalAnalysisAutomation The content covered on this channel is NOT to be considered as any financial or investment advice. Past results are not necessarily indicative of future results. This content is purely for education/entertainment.
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Related AI Lessons

Bloom Filters, Explained Properly
Learn how Bloom filters work and their benefits, including tiny memory and blazing speed, in exchange for potential false positives.
Dev.to · Daksh Gargas
Prefix Sums: The Preprocessing Trick That Makes Range Queries Instant
Learn how prefix sums enable instant range queries in arrays, boosting performance in various applications
Medium · Programming
I Thought I Was Ready for the Interview — Then One Simple Math Question Destroyed Me
A simple math question can destroy a developer's interview, highlighting the importance of being prepared for unexpected questions
Medium · Programming
Week 2(Day 10): LeetCode Two Pointers(slow & fast): Remove Duplicates from Sorted Array (Brute…
Learn to remove duplicates from a sorted array using the two pointers technique, improving from brute force to optimized solutions
Medium · Python
Up next
Stump Grinder Carbide Wheel Grinds Hardwood To Chips
Innoforge Studio
Watch →