Rule-Based Candlestick Recognition with Python and MQL5
Summary
This article describes a hand-built candlestick pattern recognizer split between MQL5 and Python. The proposed system extracts open, high, low, and close data, applies geometric rules to candles, and labels formations such as hammers, shooting stars, engulfing patterns, dojis, harami, and multi-candle reversals. The examples use ratios between candle bodies and wicks, plus comparisons between adjacent candles, to define pattern conditions. The article also outlines communication between an MQL5 Expert Advisor and a Python service, with results logged and displayed for analysis.
The evidence presented is an implementation walkthrough and illustrative system behavior, not a measured test of whether these labels predict profitable trades. Pattern definitions depend on chosen thresholds, and the excerpt does not establish how signals perform across markets, timeframes, or regimes. Candlestick names indicate possible interpretations of price action, but the article does not validate them as standalone entry or exit rules. It points toward later work using recognition libraries, which may broaden pattern coverage but would still require independent evaluation.
Key ideas
- The recognizer derives candle bodies and shadows from open, high, low, and close values.
- Single-candle patterns are identified with threshold rules on body and wick sizes.
- Multi-candle patterns compare the direction and relative body ranges of neighboring candles.
- MQL5 and Python share work through a service pipeline that processes bars and returns pattern labels.
- The article demonstrates implementation logic but does not provide evidence of trading profitability.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.