Share E-Book
Scan to open this page

Scan with your phone to open this page

AuthorSofien Kaabar

Candlesticks have become a key component of trading platforms and charting programs for financial trading. A candlestick is a financial chart that helps reveal underlying patterns for traders when interpreting price action history and forecasts. We are often taught how specific patterns behave in a certain way, but we have never really been taught how to trade or back-test them. This hands-on guide will teach you how to recognize, scan, trade, and back-test the profitability of candlestick patterns with Python. Furthermore, this book will introduce new patterns that have never been presented before, revealing the fruits of my research.Other topics discussed in the book include creating a candlestick scanner and indicator, as well as comparing the profitability of the patterns. We will also see a new type of charting system which is similar to candlesticks. This proposed book aims to be the A-Z guide to all candlestick patterns!

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
# Mastering Financial Pattern Recognition — Reading Guide ## 【One-Line Pitch】 A hands-on, Python-driven guide to candlestick pattern recognition that goes beyond theory—teaching you how to code, scan, back-test, and evaluate the real profitability of classic and newly discovered patterns. Ideal for quantitative traders, Python-savvy analysts, and anyone tired of pattern folklore without evidence. ## 【Book Arc】 - **Opening (~0%–10%)**: Sets up the book's core promise—moving from "what patterns look like" to "how to trade and back-test them"—and introduces the essential Python toolkit (pandas, numpy) with utility functions for data handling, including reading Excel files, adding/removing rows and columns, and preparing OHLC arrays for analysis. - **Early (~10%–27%)**: Establishes the analytical foundation: technical analysis pillars (charting, indicators, pattern recognition), trend-following vs. contrarian indicator logic, moving averages, and the relative strength index (RSI). Introduces the back-testing framework with performance metrics like hit ratio, profit factor, and risk-reward ratio, then begins pattern coverage with the Marubozu and Tasuki patterns. - **Early-to-Middle (~27%–40%)**: Dives deep into classic trend-following patterns (Three Candles, Hikkake) with full signal-function code, performance summary tables across multiple assets (EURUSD, USDCHF, etc.), and critical interpretation of results—emphasizing that hit ratio alone is meaningless without risk-reward context. Introduces volatility concepts (variance, standard deviation, ATR) as prerequisites for more complex patterns. - **Middle (~40%–50%)**: Continues with advanced patterns including Double Trouble, Bottle, Slingshot, and H patterns, showing how volatility-based conditions and multi-candle confirmations are coded. Discusses how pattern performance varies by market regime (trending vs. ranging) and asset class, with equities showing better results for trend-following configurations. - **Middle-to-Late (~50%–end)**: Shifts to contrarian patterns—Doji, Tweezers, Stick Sandwich, Piercing, Abandoned Baby, Spinning Top, and Inside Up/Down—each with signal logic, chart examples, and performance tables. Emphasizes that some theoretically beautiful patterns (like Abandoned Baby) underperform their reputation, reinforcing the book's evidence-based approach. ## 【Key Takeaways】 - **Pattern recognition is a quantitative discipline, not folklore** (Early): The book's central thesis is that candlestick patterns must be coded, back-tested, and statistically evaluated—not just visually identified. This separates it from traditional charting books. - **Hit ratio is meaningless without risk-reward context** (Early): A pattern can show a 47% hit ratio yet be unprofitable if the risk-reward ratio is too low (e.g., 0.53–0.66). Always evaluate hit ratio and profit factor together to judge real predictive value. - **Signal functions follow a consistent, reusable template** (Early): Every pattern is implemented as a `signal()` function that loops through OHLC data, applies conditional rules, and writes buy/sell signals (+1/-1) to designated columns—making patterns easy to scan, compare, and extend. - **Trend-following patterns perform best in trending markets** (Middle): The book repeatedly shows that patterns like the H pattern outperform on equity indices (which trend) versus ranging markets, confirming the theoretical expectation that regime matters for pattern efficacy. - **Volatility indicators are building blocks for advanced patterns** (Middle): Understanding variance, standard deviation, and ATR is prerequisite knowledge for patterns like Double Trouble that incorporate volatility conditions into their signal logic. - **New patterns are introduced with the same rigor as classics** (Middle): The author presents original configurations (e.g., Bottle, Slingshot) alongside traditional ones, subjecting them to identical back-testing standards—a rare contribution to the field. - **Contrarian patterns require confirmation candles** (Middle): Reversal patterns like Doji and Spinning Top are not standalone signals; they need a subsequent candle to confirm the expected direction change, which the signal functions encode explicitly. - **Performance varies dramatically across assets** (Middle): The same pattern can show a profit factor of 2.39 on BTCUSD but 0.70 on USDCAD (Stick Sandwich example), underscoring that pattern selection must be asset-aware and empirically validated. ## 【Reading Tips】 - **Skim the utility functions in the opening chapters** (~0–10%): The `add_column`, `add_row`, and `delete_column` functions are standard array manipulation—grasp the pattern once, then move on. Focus instead on understanding the OHLC data structure. - **Deep-read the back-testing methodology sections** (~10–20%): The performance metrics (hit ratio, profit factor, risk-reward ratio) and their interpretation are the analytical backbone of the entire book. Get comfortable with how to read the summary tables before diving into pattern chapters. - **Study the signal function templates carefully** (~20% onward): Each pattern chapter follows the same structure—intuition, signal code, chart examples, performance table. Once you understand one signal function, you understand them all; focus on the *conditions* that define each pattern rather than the code syntax. - **Pay attention to the "red flags" in performance interpretation** (throughout): The author frequently warns when a pattern's hit ratio looks decent but risk-reward makes it unprofitable. These interpretive comments are more valuable than the raw numbers. - **Use the performance tables as a reference, not a prescription**: Patterns that work on EURUSD may fail on GOLD or S&P500. Treat the tables as empirical evidence for your own asset-specific research rather than universal truths. ## 【Coverage Limits】 This guide covers the book's core arc—Python foundations, technical analysis basics, back-testing methodology, and pattern-by-pattern coverage with performance evaluation. The excerpts do not cover the book's final chapters on creating a candlestick scanner/indicator, the new charting system mentioned in the introduction, or the complete set of newly introduced patterns—these sections are beyond the sampled material. ##
Page 9
de does not require permission. Incorporating a significant amount of example code from this book into your product’s documentation does require permission.
View in text
Excerpt 2
the trade and is a forecast. The realized risk-reward ratio This is the average profit per trade divided by the average loss per trade, which gives an idea o...
View in text
Excerpt 3
at the end of December 2021. Turkish president Recep Tayyip Erdoğan shook the markets with his statements on inflation and interest rates, which caused huge ...
View in text
Excerpt 4
sometimes there can be many Tweezers around the same area. Figure 6-22. Signal chart on gold Table 6-4 summarizes the performance of the pattern. T a b l e
View in text
Excerpt 5
  data[i, high_column] == data[i - 1, high_column] and \                 data[i, high_column] == data[i - 2, high_column]:
View in text
Excerpt 6
s while the stochastic oscillator is below its signal line. The following code snippet shows how to code the signal function of the strategy: def signal(da...
View in text
Excerpt 7
a variety of information about how to better manage trades. Trading is a mind game, and you have the responsibility to overcome your emotional and cognitive
View in text
Excerpt 8
The Tasuki Pattern-The Tasuki Pattern, Detecting the Tasuki Pattern-Detecting the Tasuki Pattern, Detecting the Tasuki Pattern technical analysis, Introducin...
View in text
Tags
AI categories
PythonDataBackend
ISBN: 1098120477
Publisher: O'Reilly Media
Publish Year: 2023
Language: English
Pages: 300
File Format: PDF
File Size: 6.8 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…