Open Harmonics · Pattern guide

Gartley

The classic harmonic pattern, described by H.M. Gartley in 1935. After the XA leg, price pulls back to about 61.8% at B, bounces to C without passing A, then completes at D, a 78.6% retracement of XA, still above X.

XABCD

Idealised bullish shape. The strategy only trades bullish patterns.

The rule, exactly as coded

From classifyStrictSymmetrical in harmonic_master_ledger_quant.pine (commit adaa8cb). Ratios are distances between points; "≈" means within ±6% of the value. Patterns are checked in order and the first match wins (this is #1).

How it exits

D completes above X, so the stop sits 1% under X: a relatively wide stop. Half the position takes profit at 1.5R, the stop on the rest moves to entry, and it runs to 2R (3R if D sits on the monthly Camarilla S3). How the exits work, and what we tested →

Results by timeframe

Every Gartley the script found across about 500 stocks, no hand-picking and no filters. R is the gain or loss as a multiple of the amount risked; a setup is two equal halves, so its outcome is −1, +0.75, +1.75 or +2.25. The 95% range is clustered by instrument.

TimeframeSetupsShare of TFWin rateMean R (95% range)Profit factor−1 / +0.75 / +1.75 / +2.25
15-minute5123.1%41.0%+0.05 (-0.05 to +0.16)1.09292 / 42 / 162 / 2
1-hour4413.3%44.4%+0.14 (+0.02 to +0.25)1.25242 / 41 / 151 / 3
4-hour1253.1%56.8%+0.49 (+0.26 to +0.72)2.1752 / 10 / 52 / 7
Daily713.4%49.3%+0.31 (+0.00 to +0.63)1.6236 / 3 / 32 / 0

Year by year (mean R)

Year15-minute1-hour4-hourDaily
2016—+0.05 n=42+1.12 n=8+0.83 n=6
2017—+0.61 n=42+0.58 n=15+1.36 n=7
2018—-0.20 n=32-0.27 n=13-1.00 n=5
2019—+0.32 n=38+0.75 n=11+0.10 n=10
2020—-0.08 n=36+0.61 n=11+1.58 n=6
2021—-0.04 n=50+0.82 n=10-0.31 n=8
2022—+0.06 n=45+0.00 n=14-0.61 n=7
2023+0.21 n=69+0.01 n=40+1.19 n=9+1.28 n=8
2024+0.10 n=156+0.46 n=35+0.69 n=13+0.67 n=6
2025-0.04 n=165+0.27 n=51+0.42 n=9-0.54 n=6
2026+0.03 n=122-0.04 n=30+0.06 n=12-1.00 n=2

Backtests on today's Nasdaq-100 / S&P 500 members (survivorship bias), TradingView Strategy Tester, 0.01% commission, no slippage, all entry filters off. Education and research only — not financial advice.