Harmonic Patterns Scanner — Panel FxMath_Harmonic_Hunter_Scanner_Panel(MT5)

The Panel version of the Scanner. Same detection engine and settings as the classic Scanner, but the result table is a scrollable + sortable + filterable panel: mouse-wheel / ▲▼ scrolling, click-to-sort on any data column, and a filter toolbar (Type / Pattern / Time Frame / Acc / Age). Use this when there are more patterns than fit on screen.

File: FxMath_Harmonic_Hunter_Scanner_Panel(MT5).mq5/.ex5 10 visible rows 12 sortable columns Filter without re-scan

#Overview

Unlike the classic Scanner (which draws one edit-box row per signal and can run out of screen space), the Panel version stores every found signal as a row in memory (g_rows[]) and draws only the visible slice inside a scroll window. Filters and sorting operate on the stored results instantly — no re-scan needed — and combine with scrolling.

The scan loop runs from OnTimer() on a minutes-based interval with a g_scanBusy re-entry guard, so the timer and the Scan Market button never overlap — and it works with zero ticks.

#Classic Scanner vs Panel

FeatureClassic ScannerPanel Scanner
Row storageFixed edit boxes, one per signalRows stored in memory, visible slice drawn
More signals than screenRows overlap / get overwrittenScroll through all results
SortingClick any column header (asc/desc toggle)
FilteringType / Pattern / TF / Acc / Age toolbar
Scan triggerOnTick + OnTimerPure OnTimer (minutes) + button
Header redrawEvery tick (slower)Once on init + inside run()
View buttonsName per pair+tfUnique per row (view,<idx>,<pair>,<tf>)
Settings / engineIdentical (see Scanner docs)

#The signal table

The table has 12 columns, 10 of which are data columns + an "Open Chart" action column:

#ColumnSortNotes
0PairAlphabeticale.g. EURUSD
1Time FrameBy minutesStored as minutes ("60","240"…), sorted numerically → M5 < H1 < H4
2PatternAlphabetical"Bullish Bat", "Bearish Crab"…
3Order TypeAlphabeticalBUY (blue) / SELL (red)
4Open PriceNumericEntry at 23.8% of CD
5StopLossNumeric5% beyond CD (or ATR × mult)
6TakeProfit 1Numeric38% of XA (or ATR × mult)
7TakeProfit 2Numeric61.8% of XA
8TakeProfit 3Numeric78.6% of XA
9AccNumericAccuracy % (0–100), graded vs unscaled bounds
10AgeNumericBars since the D point
11Open ChartView button per row

Row cells are named pnl_row<slot>_<col> with fixed slots 0–9, so scrolling and filtering update text in place instead of recreating ~110 edit objects every time.

#Sorting

#Scrolling

#Filter toolbar

The filter bar sits above the table (FILTER_Y = 175) and has four rows:

RowControlBehaviour
1Type — ALL / BUY / SELLSingle select. Active button is highlighted (dodger blue).
2Pattern — Bat, Gartley, Crab, Butterfly, Cypher, Shark, ABCDMulti-select toggle. Any ON base name matches (the "Bullish/Bearish" prefix is ignored via Panel_BasePat). Wolfe is disabled, so it's not listed.
3Time Frame — ALL + distinct scanned TFsMulti-select of the TFs actually scanned (normalized to minute labels, e.g. "60", "240").
4Acc ≥ / Age ≤ edit boxes + Apply / ClearNumeric limits. Press Enter in the box or click Apply. Clear resets everything.
💡 Instant Filters apply to the stored scan results — no re-scan is needed. They combine with sorting + scrolling and the Sleep(100) was removed from every filter/sort/scroll click so the panel feels instant.

#Filter logic details

Every row passes through Panel_Matches(r):

The Clear button resets: g_fType="ALL", empty pattern/TF sets, AccMin=0, AgeMax=0. Filters are kept across scans (Panel_Reset only clears the sort), so your view persists after an auto-update.

ℹ️ Enter key The Acc/Age edits are handled by CHARTEVENT_OBJECT_ENDEDIT: pressing Enter (or losing focus) applies the value immediately — no need to click Apply.

#Timer-driven scanning

This version fixes the classic Scanner's tick-driven behaviour:

#Settings (identical to the Scanner)

All inputs are the same as the classic Scanner (47 inputs), with one rename: Uodate_Interval_MinuteUpdate_Interval_Minutes (correct spelling). The same 14-entry pattern table, accuracy grading, SL/TP modes, trading mode, notifications and .Pouya writing apply. A quick reference:

GroupKey inputsDefaults
Scanner SettingsPairs, Read_MarketWatch_Pairs, TFs, Auto_Update, Update_Interval_Minutes, TakeProfit_Level30 pairs / 18 TFs / false / 15 / 2
Trading ModeClose_Partial_Trade, Close_Partial_Ratio, Breakeven_Enable, BE_Ratio_Distancetrue / 0.6 / true / 0.6
SL/TP ModeSLTP_Use_ATR, SLTP_ATR_Period, SLTP_ATR_SL_Mult, SLTP_TP1_Mult, SLTP_TP2_Mult, SLTP_TP3_Multfalse / 14 / 2.0 / 4.0 / 6.0 / 9.0
Pattern SettingsPattern_Accuracy, Maximum_Market_Bar_Scan, Minimum_Market_Depth, Maximun_Market_Depth, ExpirationTime_Candle, Maximum_Pattern_Age + 7 toggles80 / 20 / 25 / 50 / 15 / 15 / all true
NotificationsAlert_Enable, Email_Enable, PushNotification_Enable, Telegram_Enable, Telegram_Bot_Token, Telegram_Chat_IDall false
OtherMagicNumber, TradeComment, Helper_Text_Color, Pattern_Body_Color, ZigZag_Window_Bars3017 / FxMath_Harmonic_Hunter / white / yellow / 1000

#View / Open All Charts

#Panel internals

Constant / varValuePurpose
PANEL_ROW_H25Row pitch (px)
PANEL_ROW_VIS10Visible rows without scrolling
PANEL_TOP307Y of the first row
PANEL_COL_X[12]{40,121,207,338,419,500,581,662,743,824,905,986}Column X positions
PANEL_COL_W[12]{72,77,117,67,67,67,67,67,67,67,32,117}Column widths
STATUS_Y152"Scanning…" status line (below Open All Charts)
FILTER_Y175Top of the filter toolbar
g_rows[] / g_rowCountdynamicStored signal rows
g_scrollOff / g_sortCol / g_sortAsc0 / -1 / trueScroll + sort state
g_fType / g_fPats[] / g_fTfs[] / g_fAccMin / g_fAgeMax"ALL" / [] / [] / 0 / 0Filter state
g_scanBusyfalseRe-entry guard for run()
g_mouseOverPanelfalseHover flag for wheel scrolling

#FAQ & troubleshooting

Why is a pattern not in the filter list?

Wolfe Waves are disabled (code kept, default false), so they're intentionally not listed. The other 7 families cover all 14 built-in table entries.

My filter buttons did nothing in an old version — is that fixed?

Yes. There were off-by-one bugs parsing the Pattern (pnl_f_pat_ = 10 chars) and Time Frame (pnl_f_tf_ = 9 chars) button names which silently made those two filters no-ops. Fixed in the current code.

The table rows overlap / look wrong after sorting

Rows are drawn into fixed slots 0–9; sorting only changes which stored row index each slot shows. If you see stale text, re-run a scan (Scan Market) — the reset clears the sort and redraws cleanly.

Scans are slow

Trim Pairs / TFs, reduce ZigZag_Window_Bars, or narrow the depth range. The panel redraws only the visible 10 rows, so UI cost is constant regardless of result count.

Does the panel still write the .Pouya file?

Yes — identical to the classic Scanner, so either version can feed the Helper.