Market Scanner Workshop: scan examples and bucket files

Market Scanner Workshop: scan examples and bucket files

21 November 2026, 16:27
George Ciprian Mandache
0
7

This is the cookbook to Market Scanner Workshop: user guide for MT5 and MT4: ready-to-use scans, each a signal file you save once and load into any bucket, and the bucket file format. The guide explains the screen, the editor and the alerts. Every name and number the rules below use is explained in Multi Timeframe Signal Workshop: rule language and indicator reference.

Contents

  1. How to use the examples
  2. How a scan runs
  3. Scan examples
  4. Bucket files
  5. Signals from Multi Timeframe Signal Workshop

1. How to use the examples

Each example below is a signal file: an optional # comment, a marker line and the rule. Several of them are among the ready-made signals the scanner writes on its first start, and for those you only pick them in Load from file. For the others, save the text as a file once:

  1. In the terminal, open File, Open Data Folder, then MQL5\Files\MarketScannerWorkshop\Signals\ (MQL4\... on MT4).
  2. Open Notepad and paste the example's text.
  3. Click File, Save As. Go to that Signals directory, set Save as type to All files, type the file name the example gives, ending in .txt, and click Save. With Save as type left on Text Documents, Notepad can add a second .txt.
  4. Back in the terminal, open a bucket with New bucket or Edit, click Add signal, and pick the file in Load from file. Its rule appears as condition cards, which you can change like any other.
  5. Click Save in the signal editor, then Save in the bucket dialog.

To check a file's real name, turn on File name extensions in the Windows file explorer's View menu.

2. How a scan runs

A few rules decide what a scan shows. They matter when you write your own.

Every part names its timeframe. A scanner has no chart timeframe, so a rule reads H4.rsi.value, never Chart.rsi.value.

A signal is checked at every close of its fastest timeframe. within_bars(M5.stoch.is_cross_up, 2) and H1.ema200.is_above is checked every five minutes on every symbol of its buckets. The H1 part comes from the last closed hour, never the hour still forming, and is fetched again only after an hour has closed.

Scan time depends on the rules and symbols. In the RSI and moving-average benchmark described in the guide (section 13), reading a symbol took about 0.3 ms on MT5 and 1.2 ms on MT4, and the scanner targets a 50 ms scan budget per timer pass, spreading a longer round over later passes. It checks the budget between symbols, so one symbol can take longer. What the terminal feels is the number of symbols it keeps history for, which is why the symbol picker warns past 100.

A state holds, an event lasts one bar. H4.rsi.is_oversold(30) is a state, true on every bar it holds, so its row stays while the RSI stays under 30. M5.stoch.is_cross_up is an event, true only on the bar of the cross, so a signal of events alone shows for one bar. Wrap the event in within_bars(event, N) and the row stays for N bars, the event's own bar included: on M5, within_bars(..., 2) covers two M5 bars; on H4, within_bars(..., 5) covers five H4 bars. These are normally 10 minutes and 20 hours during continuous trading; session gaps extend the elapsed time. The rule language post says which flags are events.

Alerts come once per start. An alert goes out on the bar close where a signal starts firing on a symbol, and not again while it keeps firing (guide, section 7). A state signal alerts when it turns true. A signal already firing when the scanner first reads a symbol (at its start, or when a signal change starts its timeframe over) shows without an alert, and alerts at its next start. A rule containing within_bars(event, N) alerts when the whole rule changes from false to true; another condition can make that happen after the event, while it is still within the window. For an event-only rule, a new event while the last one is still within its N bars does not alert again, which keeps a choppy M5 signal from alerting every few bars.

3. Scan examples

H4 RSI under 30 and over 70

Shipped as H4 RSI under 30 and H4 RSI over 70, in the example bucket RSI extremes.

# The H4 RSI(14) under 30, oversold.
marker: bullish

H4.rsi.is_oversold(30)
# The H4 RSI(14) over 70, overbought.
marker: bearish

H4.rsi.is_overbought(70)

Both are states: a symbol stays listed while its H4 RSI is beyond the level, and the alert comes at the H4 close that takes it there (not for a symbol already there when the scanner first read it). On a long list they show a lot of symbols. They tell you what is stretched; they are not entries.

H4 price above or below the 21 SMA

These are shipped as H4 price above 21 SMA and H4 price under 21 SMA. The video loads the second into Forex pullbacks. Each compares the last H4 close with its 21-period simple moving average.

# The H4 close above its 21 SMA.
marker: bullish

H4.sma21.is_above
# The H4 close under its 21 SMA.
marker: bearish

H4.sma21.is_below

They are states. The row stays while the close is on that side of the average; a close equal to the average satisfies neither rule. A price below an average alone does not establish that the broader trend is up.

H4 MACD cross

Shipped as H4 MACD cross up and H4 MACD cross down. These compare the MACD line with its signal line, keeping a cross valid for three H4 bars, including the cross bar.

# The H4 MACD line crossed above its signal line in the last 3 bars.
marker: bullish

within_bars(H4.macd.is_cross_up, 3)
# The H4 MACD line crossed below its signal line in the last 3 bars.
marker: bearish

within_bars(H4.macd.is_cross_down, 3)

A new cross inside the same window keeps the rule true without another alert. It must stop firing before a new start can alert.

M5 stochastic cross inside the H1 trend

The intraday entry: the M5 stochastic's %K crosses above %D within the last 2 M5 bars, while the last closed hour is above its 200 EMA. Save as M5 stochastic cross up in H1 uptrend.txt.

# M5 stochastic crosses up within 2 bars, H1 close above the EMA 200.
marker: bullish

within_bars(M5.stoch.is_cross_up, 2)
and H1.ema200.is_above

The mirror for selling, saved as M5 stochastic cross down in H1 downtrend.txt:

# M5 stochastic crosses down within 2 bars, H1 close below the EMA 200.
marker: bearish

within_bars(M5.stoch.is_cross_down, 2)
and H1.ema200.is_below

Both run every five minutes. A cross stays valid for two M5 bars, including its own bar, while the H1 condition must also hold. A later cross can extend the window. The video uses 10 bars for its stochastic example and later changes that to 20 in Notepad; these examples use a shorter two-bar window. A click on the symbol opens its M5 chart. Put them on the pairs and indices you trade intraday.

H4 dip in a daily uptrend

Shipped as H4 RSI pullback in daily uptrend. The H4 RSI under 30 counts only while the daily close holds above its 50 SMA, so only symbols whose daily close is above that average can appear.

# The H4 RSI(14) under 30 while the daily close holds above its 50 SMA.
marker: bullish

H4.rsi.is_oversold(30)
and D1.sma50.is_above

The mirror for selling rallies in a daily downtrend, saved as H4 RSI rally in daily downtrend.txt:

# The H4 RSI(14) over 70 while the daily close holds below its 50 SMA.
marker: bearish

H4.rsi.is_overbought(70)
and D1.sma50.is_below

Both run every four hours. The daily part is read at the daily close.

RSI(2) dip on daily bars

A 2-period RSI under 5 while the close is above the 200-day average. The scanner ships it as RSI dip in uptrend, set to H4 like every starter signal; this example uses daily bars. Save as D1 RSI2 dip above SMA 200.txt.

# RSI(2) under 5 above the 200-day SMA, on daily bars.
marker: bullish

D1.rsi(2).is_oversold(5)
and D1.sma200.is_above

It runs once a day on each symbol in the bucket.

Supertrend flip with the daily trend

The Supertrend (ATR 10, multiplier 3) flipping up on H1 while the daily close is above its 200 EMA. The flip is an event. within_bars keeps the latest flip valid for 3 H1 bars, while the daily EMA condition must also hold. Save as H1 Supertrend flip in daily uptrend.txt.

# H1 Supertrend flips up within 3 bars, daily close above the EMA 200.
marker: bullish

within_bars(H1.supertrend.is_flip_up, 3)
and D1.ema200.is_above

It runs every hour. Without within_bars the rule can fire only on the flip bar, and only if the daily EMA condition also holds.

Bollinger squeeze breakout

Shipped as Bollinger squeeze breakout: the close breaks above the upper band within 5 bars of the band width being its lowest of the last 125 bars.

# Breakout above the upper band right after a squeeze, on H4.
marker: bullish

H4.bb.is_break_up
and within_bars(H4.bb.is_squeeze, 5)

The breakout is an event, so the row shows for one H4 bar and the alert is the useful part. A real squeeze is rare, so expect few rows.

Break of structure with the daily trend behind it

A break of structure up on H4 within the last 5 bars, while at least 4 of the Trend indicator's eight daily methods agree the trend is up. The methods are structure, MA stack, Donchian, ADX, Supertrend, Parabolic SAR, Ichimoku and VWAP; the rule language post gives each one's numbers. Save as H4 break of structure in daily uptrend.txt.

# H4 break of structure up within 5 bars, daily trend bullish by 4 or more methods.
marker: bullish

within_bars(H4.structure.is_bos_up, 5)
and D1.trend.is_bullish(4)

Stochastic dip on M15 inside an H4 uptrend

All four stochastics of the Quad Stoch oversold on M15 while the H4 close is above its 200 EMA. Save as M15 Quad Stoch oversold in H4 uptrend.txt.

# All four M15 stochastics oversold, H4 close above the EMA 200.
marker: bullish

M15.quad_stoch.is_oversold
and H4.ema200.is_above

It runs every 15 minutes, with the H4 part read every four hours, and a click opens the M15 chart.

Demand zone touch with RSI oversold

Shipped as Strong demand with RSI oversold: price touches a demand zone of strength 4 or more while the RSI is oversold, both on H4.

# Price touches a strong H4 demand zone while the H4 RSI is oversold.
marker: bullish

H4.sd.is_touched_demand(4)
and H4.rsi.is_oversold

4. Bucket files

A bucket is one file in MQL5\Files\MarketScannerWorkshop\Buckets\ (MQL4\Files\... on MT4), named after the bucket. The bucket dialog writes it, and it is the easier way: Choose symbols lists your broker's own names. The file is plain JSON you can also write or copy by hand:

{
  "name": "Majors swing",
  "symbols": ["EURUSD", "GBPUSD", "USDJPY", "AUDUSD", "XAUUSD"],
  "signals": [
    {"signal": "H4 RSI pullback in daily uptrend"},
    {"signal": "H1 Supertrend flip in daily uptrend"},
    {"signal": "H4 break of structure in daily uptrend"}
  ]
}
  • name: the bucket's name. The file's name wins when the two differ, and name can be left out. The bucket dialog's Save allows at most 64 characters, none of \ / : * ? " < > |, no leading dot, and no name another bucket has in any mix of capitals; use the same rules for a file you write.
  • symbols: the only key a bucket file must have. The symbols the bucket scans, by name, exactly as your broker writes them. There is no symbol cap; the picker warns above 100 and asks before saving that selection. Many brokers add a suffix, such as EURUSD.m or XAUUSDr; the Market Watch window shows the real names. A name the broker does not have is left out without a message, so after writing a file, open the bucket with Edit and check the Symbols line.
  • signals: the signal files the bucket checks, by file name without .txt, up to 20. Left out, the bucket has no signal. A name with no file in Signals, or whose file does not read (no rule, a wrong marker: value, a wrong encoding), shows as missing in the bucket dialog, and that signal never fires.

Save a bucket file the same way as a signal file (section 1), with Save as type set to All files and a name ending in .json. The scanner picks it up within a few seconds, once none of its dialogs is open, and the bucket appears in the dropdown.

A file the scanner cannot read shows at the end of the dropdown with "(does not read)"; picking it puts the reason in the status line. The reasons are broken JSON (a missing comma or quote), a file not saved as UTF-8 (in Notepad's Save As, set Encoding to UTF-8), symbols missing or not a list of names, more than 20 signals, the same signal listed twice, a signal entry without "signal", or a file the terminal could not read. Fix the file in the text editor; the scanner cannot edit or delete it.

5. Signals from Multi Timeframe Signal Workshop

Multi Timeframe Signal Workshop uses the same signal files, with one difference: it can read Chart, the timeframe of the chart it is on, and the scanner cannot.

  • Workshop to scanner: copy the file from the Workshop's Signals directory (MQL5\Files\MTFSignalWorkshop\Signals\) to the scanner's, and replace every Chart. with the timeframe you want, so Chart.rsi.value < 30 becomes H4.rsi.value < 30. A file that still reads Chart never runs in the scanner, and the editor refuses to save one.
  • Scanner to Workshop: a scanner file works in the Workshop as it is, on any chart.

A good way to build a scan: try the signal on a few charts in the Workshop first, where every firing is an arrow with the indicator drawn under it, then give it to the scanner to watch every symbol you trade.