A TradingView indicator that finds eight harmonic patterns (ABCD, Gartley, Bat, Alt Bat, Butterfly, Crab, Deep Crab, Cypher) from confirmed swing points, draws each one on the closed bar where price reached its reversal zone, shows forming patterns near their zone with an alert, an outcome statistics table for the chart, and a scanner table of up to 8 symbols in 2 timeframes.
This is a showcase repository: documentation and images only. There is no source code here. Harmonic Pro is a paid script, delivered to the buyer as source with a personal-use licence. The free three-pattern script it builds on has public source: allanninal/harmonic-signal-alerts-pine.
Website: allanninal.dev (product page coming soon) · MetaTrader editions: allanninal.dev/mql5 (indicators) · Contact: message me on LinkedIn.
- Eight patterns from confirmed swings, with commonly published Fibonacci ratios: the three of the free script
(ABCD, Gartley, Bat) plus Alternate Bat, Butterfly, Crab, Deep Crab and Cypher. Each completed pattern gets its XABCD
lines, a reversal zone box, point labels (
Dlists every pattern that completed there) and an arrow on the closed bar that reached the zone. - Forming patterns: when X, A, B and C are confirmed and the close is within a set share of XA (default 20%) of the zone, the pattern is drawn dashed with its projected zone, and an alert is sent once. It is redrawn on each closed bar, so a cancelled one disappears; it only counts as a pattern when a closed bar reaches the zone.
- Outcome statistics table for the chart's own history: per pattern, how many outcomes resolved, how often price reached T1 (38.2% of A-D back from D) before the stop, the stop first, and T2 (61.8%). The stop is an input (zone half-widths beyond the D level), because the numbers depend on it a lot.
- Scanner table: up to 8 symbols (any TradingView symbol) in 2 timeframes, each cell showing a pattern that just
completed, else a forming one near its zone (
~), else the latest one and how many closed bars ago. - Alerts: one alert per closed bar with everything it brought (completed, forming near the zone, scanner cells), plus separate bullish, bearish and forming conditions.
- Closed bars only. Swings are used once confirmed; a completed pattern, table cell or alert never changes after its bar has closed.
- Works on every TradingView plan, including the free Basic plan (it is added from source in the Pine Editor).
![]() |
![]() |
![]() |
![]() |
Image notes: the charts and tables are drawn from the script's Python reference on broker price history, which the script matches bar for bar; they are illustrations, not TradingView captures.
flowchart LR
A[Add to a chart] --> B[Confirmed swings]
B --> C[8 patterns: ratios,<br/>projected reversal zone]
C --> D{Close near the zone?}
D -- yes --> E[Forming: dashed lines,<br/>one alert]
C --> F{Closed bar reached the zone?}
F -- yes --> G[Completed: lines, zone,<br/>labels, arrow, alert]
G --> H[Outcome statistics table]
A --> I[Scanner table:<br/>8 symbols x 2 timeframes]
Run on the release code, with PineTS (a local Pine v6 runtime) against the script's Python reference, on the latest 5,000 closed bars of EURUSD, GBPJPY, XAUUSD and BTCUSD on M15, H1 and H4 (12 series, broker history):
| Check | Result |
|---|---|
| Compile (TradingView's Pine v6 compiler) | 0 errors, 0 warnings |
| Completed patterns, every bar, 2 input sets (defaults; swings 5/3 with the statistics stop at 4) | 0 mismatches: 317 and 610 completed patterns |
| Forming patterns, latest completion and the outcome counters of all 8 patterns | identical to the reference in the same runs |
| Repaint: re-run on the series cut at 3 points | 0 of 1,756,656 closed-bar values changed |
"Every bar" means the pattern masks, the bars of X, A, B, C and D, D's price and the zone edges of every pattern that completed on that bar. PineTS cannot load other symbols, so the scanner table is covered by the compile check and a check on a TradingView chart rather than by these numbers.
- A pattern is not a strategy. No stop-loss, sizing or exit rules are provided or implied. The statistics table is descriptive: on the author's data the counts per pattern are small and the shares move a lot with the stop setting. No edge is claimed.
- Past behaviour, not a forecast. The statistics cover the bars TradingView has loaded on your chart.
- Forming is not complete. A forming pattern can be cancelled by a move past C or a close beyond the zone.
- Drawing limits: TradingView keeps at most 500 lines, 500 labels and 500 boxes per script, so on a long chart the oldest drawings drop off; arrows, alerts and tables are not affected.
- Scanner limits: 8 symbols x 2 timeframes keeps within TradingView's limits on every plan. Use timeframes equal to or higher than the chart's.
- Source, not protection. Pine cannot protect code on the free plan, so the script is delivered as source under a personal-use licence. Please do not share or republish it.
| Free: Harmonic Signal Alerts | Paid: Harmonic Pro | |
|---|---|---|
| Patterns | ABCD, Gartley, Bat | 8 (+ Alt Bat, Butterfly, Crab, Deep Crab, Cypher) |
| XABCD lines, zone box, labels, arrow, alerts | yes | yes |
| Forming patterns near their zone, drawn and alerted | no | yes |
| Outcome statistics table, adjustable stop | no | yes |
| Scanner table, up to 8 symbols x 2 timeframes | no | yes |
| Confirmed swings, closed bars only | yes | yes |
| Source | public repository | delivered to the buyer |
| Price | free | one-time price, 12 months of updates |
No need to install the free script to use Harmonic Pro: it is standalone.
Documentation and images only, all rights reserved: see LICENSE. Trading involves risk; the software is
provided as is.
Website: allanninal.dev · MetaTrader editions · Questions: message me on LinkedIn.






