Scan Examples Library

Browse our comprehensive collection of scan patterns and strategies. Copy any example to the scanner and customize it for your needs.

13
Categories
95
Total Examples

Beginner

Simple patterns to get started with scanning

Bullish Candle

Simple bullish signal: today closed higher than it opened (green candle)

close > open;

Bearish Candle

Simple bearish signal: today closed lower than it opened (red candle)

close < open;

Higher High

Current high is greater than previous high

high > high[1];

Lower Low

Current low is less than previous low

low < low[1];

Volume Above Average

Today's volume exceeds the 20-day average (indicates increased interest)

volume > sma(volume, 20);

Price Above MA(20)

Close price is above the 20-period simple moving average

close > sma(close, 20);

Quick Picks

Common pre-built scans for daily market analysis

New 52-Week High Close

Stocks hitting new 52-week price highs

high_52w = highest(high, 252)[1];
close > high_52w;

New 52-Week Low Close

Stocks hitting new 52-week price lows

low_52w = lowest(low, 252)[1];
close < low_52w;

Day Gainers (>5%)

Stocks up more than 5% today

pct_change(close, close[1]) > 5; // >5% gain today

Day Losers (>5%)

Stocks down more than 5% today

pct_change(close, close[1]) < -5; // >5% loss today

Big Volume (2x average)

Volume at least 2x the 20-day average

pct_change(volume, sma(volume, 20)) > 100; // 2x average = 100%+ increase

Gap Up (>2%)

Opened 2%+ above previous close

pct_change(open, close[1]) > 2; // 2%+ gap up

Gap Down (>2%)

Opened 2%+ below previous close

pct_change(open, close[1]) < -2; // 2%+ gap down

Wide Range Bars (>3%)

Bars with high-to-low range exceeding 3% (high volatility)

bar_range_pct > 3; // bar range > 3% of low

Strong Bullish Bars (>2%)

Bullish bars with body exceeding 2% of open price

bar_change_pct > 2; // close > open by 2%+

Recent IPOs

Find newly listed stocks by IPO date

IPO < 6 Months

Stocks that started trading less than 6 months ago

months_since(first_trade_date) < 6;

IPO < 1 Year

Stocks that started trading less than 1 year ago

months_since(first_trade_date) < 12;

IPO < 30 Days

Very recent IPOs trading less than 30 days

days_since(first_trade_date) < 30;

New IPO Gainers

Recent IPOs (< 6 months) up more than 20% from first trade

months_since(first_trade_date) < 6;
close > open[1] * 1.2; // up 20%+ from yesterday's open

Recent IPO Momentum

IPOs < 1 year old with strong upward momentum

months_since(first_trade_date) < 12;
close > sma(close, 20);
volume > sma(volume, 20);

Seasoned IPOs

Stocks between 1-2 years old

years_since(first_trade_date) >= 1;
years_since(first_trade_date) < 2;

The Strat

Rob Smith's timeframe continuity patterns

2d-1-2u Reversal

2-down, inside bar, 2-up reversal

// 2-down
high[2] <= high[3];
low[2] < low[3];

// Inside bar
high[1] <= high[2];
low[1] >= low[2];

// Break above inside bar high, but not an outside bar
high > high[1];
low >= low[1];

2-1-2 Down Reversal

2-up, inside bar, 2-down

// 2-up bar
low[2] >= low[3];
high[2] > high[3];

// Inside bar
high[1] <= high[2];
low[1] >= low[2];

// 2-down below inside bar's low
low < low[1];
high <= high[1];

3-1-2u Reversal

Outside bar, inside bar, 2-up reversal

// Outside bar
high[2] > high[3];
low[2] < low[3];

// Inside bar
high[1] <= high[2];
low[1] >= low[2];

// 2-up above inside bar's high
high > high[1];
low >= low[1];

3-1-2 Down Reversal

Outside bar, inside bar, 2-down reversal

// Outside bar
high[2] > high[3];
low[2] < low[3];

// Inside bar
high[1] <= high[2];
low[1] >= low[2];

// 2-down below inside bar's low
low < low[1];
high <= high[1];

3-2d-2u Revstrat

Outside bar, break down, break up

// Outside bar
high[2] > high[3];
low[2] < low[3];

// 2-down below outside bar low
low[1] < low[2];
high[1] <= high[2];

// 2-up above 2-down high
high > high[1];
low >= low[1];

3-2u-2d Revstrat

Outside bar, break up, break down

// Outside bar
high[2] > high[3];
low[2] < low[3];

// 2-up above outside bar high
high[1] > high[2];
low[1] >= low[2];

// 2-down
low < low[1];
high <= high[1];

1-2d-2u Revstrat

Inside bar, break down, then break up

// Inside bar
high[2] <= high[3];
low[2] >= low[3];

// 2-down below inside bar low
low[1] < low[2];
high[1] <= high[2];

// 2-up
high > high[1];
low >= low[1];

1-2u-2d Revstrat

Inside bar, break up, then break down

// Inside bar
high[2] <= high[3];
low[2] >= low[3];

// 2-up above inside bar high
high[1] > high[2];
low[1] >= low[2];

// 2-down
low < low[1];
high <= high[1];

Pivot Machine Gun Up

Four or more consecutive higher lows

// 4+ consecutive higher lows
rising(low, 4);

/* --- functionally equivalent to:
low > low[1];
low[1] > low[2];
low[2] > low[3];
low[3] > low[4];
*/

Pivot Machine Gun Down

Four or more consecutive lower highs

// 4+ consecutive lower highs
falling(high, 4);

/* --- functionally equivalent to:
high < high[1];
high[1] < high[2];
high[2] < high[3];
high[3] < high[4];
*/

2u-2d-2u Randy Jackson

Break up, break down, break up again

// 2-up
high[2] > high[3];
low[2] >= low[3];

// 2-down
low[1] < low[2];
high[1] <= high[2];

// 2-up
high > high[1];
low >= low[1];

2d-2u-2d Randy Jackson

Break down, break up, break down again

// 2-down
low[2] < low[3];
high[2] <= high[3];

// 2-up
high[1] > high[2];
low[1] >= low[2];

// 2-down
low < low[1];
high <= high[1];

In-force Up

Price closes above previous bar high

/* Run this on higher timeframes to narrow stock selection
    e.g. 12M -> 6M -> 3M -> 1M for full higher timerame continuity.
*/

close > high[1]; // this timeframe is in-force down

In-force Down

Price closes below previous bar low (in-force)

/* Run this on higher timeframes to narrow stock selection
    e.g. 12M -> 6M -> 3M -> 1M for full higher timerame continuity.
*/

close < low[1]; // this timeframe is in-force down

Moving Averages

SMA and EMA crossovers and relationships

MA 50/200 Golden Cross

50-day MA crosses above 200-day MA (classic bullish signal)

ma50 = sma(close, 50);
ma200 = sma(close, 200);
crossover(ma50, ma200);

MA 50/200 Death Cross

50-day MA crosses below 200-day MA (classic bearish signal)

ma50 = sma(close, 50);
ma200 = sma(close, 200);
crossunder(ma50, ma200);

Price Above MA(50)

Trading above 50-day moving average

close > sma(close, 50);

Price Below MA(50)

Trading below 50-day moving average

close < sma(close, 50);

EMA(8/21) Bullish Cross

8-day EMA crosses above 21-day EMA (short-term momentum shift)

ema8 = ema(close, 8);
ema21 = ema(close, 21);
crossover(ema8, ema21);

Above All Moving Averages

Price is above 20, 50, and 200-day SMAs (strong trend confirmation)

close > sma(close, 20);
close > sma(close, 50);
close > sma(close, 200);

MACD

MACD line and signal crossovers

MACD Bullish Crossover

MACD line crosses above signal line (bullish momentum)

macd_l = macd_line(close, 12, 26, 9);
macd_s = macd_signal(close, 12, 26, 9);
crossover(macd_l, macd_s);

MACD Bearish Crossover

MACD line crosses below signal line (bearish momentum)

macd_l = macd_line(close, 12, 26, 9);
macd_s = macd_signal(close, 12, 26, 9);
crossunder(macd_l, macd_s);

MACD Above Zero

MACD line in positive territory

macd_line(close, 12, 26, 9) > 0;

MACD Below Zero

MACD line in negative territory

macd_line(close, 12, 26, 9) < 0;

RSI

Relative Strength Index patterns

RSI Oversold (<30)

RSI below 30 (potential bounce zone)

rsi(close, 14) < 30;

RSI Overbought (>70)

RSI above 70 (potential pullback zone)

rsi(close, 14) > 70;

RSI Cross Above 50

RSI crosses above neutral 50 level

rsi_val = rsi(close, 14);
crossover(rsi_val, 50);

RSI Bullish Divergence Setup

Price down but RSI up (potential reversal signal)

close < close[10];
rsi(close, 14) > rsi(close, 14)[10]; // price down, RSI up

Volume

Volume analysis and price-volume patterns

Up on Big Volume

Rising price with above-average volume

close > close[1];
volume > sma(volume, 20) * 1.5;

Down on Big Volume

Falling price with above-average volume

close < close[1];
volume > sma(volume, 20) * 1.5;

3 Consecutive Up Days

Three consecutive higher closes

close > close[1];
close[1] > close[2];
close[2] > close[3];

3 Consecutive Down Days

Three consecutive lower closes

close < close[1];
close[1] < close[2];
close[2] < close[3];

High Volume Stocks

Stocks with consistent high volume (> 1M avg). Better for day trading and liquid positions.

sma(volume, 20) > 1000000;

Frequent High Volume

At least 3 high-volume days (1.5x average) in the last 5 sessions - indicates sustained interest

count(volume > sma(volume, 20) * 1.5, 5) >= 3;

Momentum

Momentum oscillators and indicators

Historical Range Position

Price in upper 20% of all-time range (strong relative position)

ath = all_time_high(high);
atl = all_time_low(low);
position = (close - atl) / (ath - atl);
position > 0.80;

Rate of Change > 5%

10-period rate of change above 5%

roc(close, 10) > 5;

RSI Momentum Surge

RSI increased by more than 10 points in last 5 periods

rsi_now = rsi(close, 14);
rsi_prev = rsi(close, 14)[5];
rsi_now - rsi_prev > 10;

Weekly Momentum (>10%)

Stocks up more than 10% over the past 5 trading days

pct_change(close, close[5]) > 10; // 5-day gain > 10%

Price vs 20-Day MA (>5%)

Price is 5%+ above its 20-day moving average

pct_change(close, sma(close, 20)) > 5;

Volume Explosion (3x)

Today's volume is 3x or more the 20-day average

pct_change(volume, sma(volume, 20)) > 200; // 3x = 200%+ increase

Expanding Volatility

Today's bar range exceeds yesterday's bar range

bar_range > bar_range[1];

Consecutive Up Days (3+)

At least 3 consecutive days with bullish candles (close > open)

streak(close > open, 5) >= 3;

Sustained Above MA

Price has stayed above 50-day MA for at least 7 consecutive days

streak(close > sma(close, 50), 10) >= 7;

Bullish RSI Streak

RSI above 50 for 5+ consecutive days (sustained bullish momentum)

streak(rsi(close, 14) > 50, 10) >= 5;

High Volume Streak

Volume above average for 3+ consecutive days (accumulation pattern)

streak(volume > sma(volume, 20), 7) >= 3;

Trend

Trend identification and confirmation

Strong Uptrend

Close above all major moving averages with rising slope

ma20 = sma(close, 20);
ma50 = sma(close, 50);
ma200 = sma(close, 200);
close > ma20;
ma20 > ma50;
ma50 > ma200;

Higher High & Higher Low

Both high and low are higher than previous period (indicates strong uptrend)

high > high[1];
low > low[1];

Lower High & Lower Low

Both high and low are lower than previous period (indicates strong downtrend)

high < high[1];
low < low[1];

Frequent Up Days

At least 3 bullish days in the last 5 trading sessions

count(close > open, 5) >= 3;

Mostly Above MA

Stock traded above 50-day MA for at least 7 of the last 10 days

count(close > sma(close, 50), 10) >= 7;

Consistent Momentum

Strong RSI readings (>60) on at least half of last 10 days

count(rsi(close, 14) > 60, 10) >= 5;

Breakout

Range breakouts and new highs/lows

All-Time High Breakout

Stock making a new all-time high (ultimate breakout)

high > all_time_high(high);

Near All-Time High

Stock within 5% of all-time high (strong momentum)

close > all_time_high(high) * 0.95;

52-Week High Breakout

Stock closed at a new 52-week high (signals strong momentum)

close ~= highest(close, 252);

Volume Surge Breakout

Volume is 2x the 20-day average (indicates unusual activity)

volume > 2 * sma(volume, 20);

Gap Up Breakout

Today's low is higher than yesterday's high (strong bullish gap)

low > high[1];

Gap Down Breakdown

Today's high is lower than yesterday's low (strong bearish gap)

high < low[1];

Volatility Expansion Breakout

True range expanding beyond 2x its 20-day average (potential breakout from compression)

tr = true_range();
tr > sma(tr, 20) * 2;

Gap Detection with True Range

Detect stocks that gapped (true range exceeds simple range by 50%)

true_range() > (high - low) * 1.5;

Reversal

Candlestick reversal patterns

Near All-Time Low

Stock within 10% of all-time low (potential value/reversal)

close < all_time_low(low) * 1.10;

Recovery from All-Time Low

Stock up 50%+ from all-time low (strong reversal)

close > all_time_low(low) * 1.50;

Bullish Engulfing

Today's green candle fully engulfs yesterday's red candle (classic reversal)

close > open;
close[1] < open[1];
open < close[1];
close > open[1];

Bearish Engulfing

Today's red candle fully engulfs yesterday's green candle (classic reversal)

close < open;
close[1] > open[1];
open > close[1];
close < open[1];

Hammer at Support

Long lower shadow with close near high (potential bullish reversal)

// Hammer: small body, long lower wick, close in upper 25%
(high - low) > 0;
abs(close - open) < (high - low) * 0.3;  // Small body (< 30% of range)
close > open;  // Bullish close
close > (high - (high - low) * 0.25);  // Close in upper 25%

Multi-Timeframe

Combine conditions across daily, weekly, and monthly timeframes

Weekly Green Candle Filter

Daily scan filtered to only show stocks with a bullish weekly candle

// Daily conditions
close > sma(close, 20);

// Weekly filter: must be green
mtf("1W") {
    close > open;
};

Monthly Uptrend Filter

Daily scan filtered to stocks in a monthly uptrend (above 3-month MA)

// Daily: above short-term MA
close > ema(close, 8);

// Monthly: uptrend
mtf("1M") {
    close > sma(close, 3);
};

Weekly High Breakout

Daily close above the previous week's high (weekly breakout on daily chart)

// Extract previous week's high
prev_weekly_high = mtf("1W") { high[1]; };

// Daily breakout
close > prev_weekly_high;

Multi-TF Trend Alignment

All timeframes aligned bullish: daily, weekly, and monthly uptrends

// Daily: above 20-day MA
close > sma(close, 20);

// Weekly: above 10-week MA
mtf("1W") {
    close > sma(close, 10);
};

// Monthly: above 3-month MA
mtf("1M") {
    close > sma(close, 3);
};

Weekly RSI Momentum Filter

Daily scan filtered to stocks with weekly RSI above 50 (weekly momentum)

// Daily: bullish candle with volume
close > open;
volume > sma(volume, 20);

// Weekly: RSI shows momentum
mtf("1W") {
    rsi(close, 14) > 50;
};

Monthly Support Bounce

Daily reversal near the previous month's low (potential support)

// Extract previous month's low
prev_monthly_low = mtf("1M") { low[1]; };

// Daily: close near monthly support (within 2%)
pct_diff = pct_change(close, prev_monthly_low);
pct_diff > -2;
pct_diff < 2;

// Daily: bullish candle
close > open;

Weekly Momentum Surge

Daily scan for stocks where daily RSI exceeds last week's RSI

// Extract last week's RSI
prev_weekly_rsi = mtf("1W") { rsi(close, 14)[1]; };

// Daily RSI stronger than weekly
rsi(close, 14) > prev_weekly_rsi;
rsi(close, 14) > 50;

Triple Timeframe RSI

Daily RSI stronger than both weekly and monthly RSI (momentum alignment)

// Extract higher timeframe RSI values
prev_weekly_rsi = mtf("1W") { rsi(close, 14)[1]; };
prev_monthly_rsi = mtf("1M") { rsi(close, 14)[1]; };

// Daily RSI beats both
daily_rsi = rsi(close, 14);
daily_rsi > prev_weekly_rsi;
daily_rsi > prev_monthly_rsi;

Weekly MACD Bullish + Daily Entry

Weekly MACD bullish crossover with daily pullback entry

// Weekly: MACD bullish (line above signal)
mtf("1W") {
    macd_l = macd_line(close, 12, 26, 9);
    macd_s = macd_signal(close, 12, 26, 9);
    macd_l > macd_s;
};

// Daily: pullback to 8 EMA
close ~= ema(close, 8);

Monthly Breakout Confirmation

Daily scan for stocks breaking above their 12-month high

// Extract previous month's 12-month high
prev_yearly_high = mtf("1M") { highest(high, 12)[1]; };

// Daily: breaking out
close > prev_yearly_high;
volume > sma(volume, 20) * 1.5;

Ready to create your own scans?

Head to the scanner to build custom scans or start with one of these examples.