gsEasyScript Worker v2
Source-checked language reference for gsSignalWorker_v2, audited on 30 September 2026. The catalog contains 158 accepted and dispatched names, including aliases and two compatibility calls without effects. Three additional names are unavailable as described below. This reference describes the local source contract; it does not certify the deployed worker or database.
Open the concise function compendium
Syntax and execution
One condition per line; consecutive lines and semicolon-separated statements apply AND by progressively reducing the ticker set. OR alternatives belong to one statement and are evaluated against the same incoming set. Use function names with exact capitalization.
FilterTickers("country = 'IT'")
QuoteAge("d") < 5
AvgCounterValue(20, "d") > 1mln
RSI(14, "d") < 30 OR ChangePerc(5, "d") < -10
Supported comparisons are > < >= <= == !=. A single = is not a working numeric equality operator. Equality uses a tolerance of 0.0001. A bare numeric call generally keeps any non-null result, including zero. Use explicit comparisons when you need a boolean test.
Use a dot for decimals in argument lists: a comma separates arguments. Numeric thresholds support K, mln and bln, spaces and underscores. Use one numeric literal as the threshold; function-to-function comparisons, arithmetic expressions and nested calls are not supported.
Constants use name = literal, optionally with a trailing semicolon, on their own line. They are text substitutions resolved before execution, not runtime variables containing per-ticker indicator values. Variable names are case-insensitive. Use distinct names that cannot be confused with function names or string values.
liquidity = 1mln
AvgCounterValue(20, "d") > liquidity
// starts a comment. Metadata such as // @StrategyName: My scanner is ignored by this parser; authoritative scan metadata comes from the stored script record. A scan produces results without needing AddSignal.
No explicit AND keyword, grouped boolean parentheses, loops or arbitrary SQL. Limits: 100 condition groups, 10 OR branches per group, 2000 characters per condition, numeric arguments finite with absolute value ≤ 10000, and five minutes of execution time. Use positive periods unless a parameter explicitly permits another value.
Timeframes and defaults
d / 1d: daily; w / 1w: weekly; m: monthly; 1h, 4h, 15m, 30m, 5m, 1m: intraday. In particular, m means month while 1m means minute. Availability depends on database history. Unknown codes fall back to daily in QuoteRepository; use the listed codes explicitly.
Unless a function says otherwise, an omitted timeframe uses the stored script timeframe. Defaults shown below are dispatcher defaults. Optional arguments must be omitted from the end: empty comma-separated arguments are discarded and cannot reserve a position. Missing data or an unavailable indicator normally excludes a ticker.
Universe and data
Restricts the current enabled ticker universe using whitelisted predicates joined by AND.
| Parameter | Type | Default | Meaning |
whereClause | string | required | One quoted clause containing supported AND predicates. |
Value / effect: ticker filter
Text fields: country, area, exchange, sector, currency, datasource, industry, partof, marketing_group, watchlist, category. Text predicates accept = or LIKE. Numeric fields marketcap and ipoyear accept =, >, <, >=, <=. enabled = 1 and 1 = 1 are allowed. Arbitrary SQL, OR, IN, functions, type and ticker predicates are not supported through this language. Use one quoted clause without embedded parentheses or commas. Put this filter first; it intersects the initial universe and does not bypass its enabled status or plan limit.
Example
FilterTickers("country = 'IT' AND marketcap > 100000000")
Reads open, high, low, close, volume or countervalue at a candle offset.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
field | string | required | open, high, low, close, volume or countervalue. |
offset | int | required | 0 for latest candle; negative for earlier candles. |
Value / effect: field value
offset = 0 selects the latest bar; negative offsets select older bars (-1 is the preceding bar). Positive offsets exclude the ticker. Missing bars or an invalid field exclude the ticker. Countervalue comes from the full quote record; a table without that column supplies zero.
Example
GetValue("d", "close", 0) > 10
Reads an exact daily quote date; there is no timeframe parameter.
| Parameter | Type | Default | Meaning |
date | string | required | Exact daily quote date. |
field | string | required | open, high, low, close, volume or countervalue. |
Value / effect: daily field value
Dates accept yyyy-MM-dd or dd-MM-yyyy. Fields are open, high, low, close, volume and countervalue. No quote on that exact date means exclusion; the engine does not substitute the closest session.
Example
GetValueAtDate("2026-09-01", "close") > 10
Calendar-day age of the latest quote relative to UTC now.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: calendar days
The metric uses the latest quote through IndicatorCacheRepository. Allow a buffer for weekends and local holidays. It measures elapsed calendar time, not trading sessions.
Price and returns
Percentage change from the preceding close to the latest close.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: percent
Example
LastPercClose("d") > 2
Percentage close change over period bars: (latest / earlier - 1) × 100.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: percent
PercClose is an alias of ChangePerc. Both use the close period bars before the latest close.
Example
ChangePerc(20, "d") > 5
Percentage close change over period bars: (latest / earlier - 1) × 100.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: percent
PercClose is an alias of ChangePerc. Both use the close period bars before the latest close.
Example
PercClose(20, "d") > 5
Rate of change over period bars; same percentage formula as ChangePerc.
| Parameter | Type | Default | Meaning |
period | int | 10 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: percent
Percentage change from the first available daily close in the current calendar interval.
| Parameter | Type | Default | Meaning |
No parameters. The function fixes its timeframe internally or uses the script timeframe as described above.
Value / effect: percent
Always uses daily quotes. Year begins January 1, month begins on its first day, and the implemented week begins Sunday. Uses server-local calendar dates. It does not compare with the close preceding the interval.
Example
ChangePercStartYear() > 5
Percentage change from the first available daily close in the current calendar interval.
| Parameter | Type | Default | Meaning |
No parameters. The function fixes its timeframe internally or uses the script timeframe as described above.
Value / effect: percent
Always uses daily quotes. Year begins January 1, month begins on its first day, and the implemented week begins Sunday. Uses server-local calendar dates. It does not compare with the close preceding the interval.
Example
ChangePercStartMonth() > 5
Percentage change from the first available daily close in the current calendar interval.
| Parameter | Type | Default | Meaning |
No parameters. The function fixes its timeframe internally or uses the script timeframe as described above.
Value / effect: percent
Always uses daily quotes. Year begins January 1, month begins on its first day, and the implemented week begins Sunday. Uses server-local calendar dates. It does not compare with the close preceding the interval.
Example
ChangePercStartWeek() > 5
Short-period return scaled to the long period, divided by long-period return.
| Parameter | Type | Default | Meaning |
shortPeriod | int | 5 | Short return window in bars. |
longPeriod | int | 20 | Long return window in bars. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: ratio
Formula: (shortReturn × longPeriod / shortPeriod) / longReturn. A zero long return excludes the ticker. Use positive periods with shortPeriod ≤ longPeriod. This is a ratio, not a percentage difference.
Example
ChangePercAcceleration(5, 20, "d") > 1.5
Distance from the highest high in the latest 500 available bars of the script timeframe.
| Parameter | Type | Default | Meaning |
No parameters. The function fixes its timeframe internally or uses the script timeframe as described above.
Value / effect: signed percent
Formula: (latest close - high) / high × 100. AllTimeMax is an accepted alias. Despite the name, this is a 500-bar window, not the entire database history; any supplied timeframe argument is ignored.
Example
DistancePercFromAllTimeHigh() > -10
Distance from the highest high in the latest 500 available bars of the script timeframe.
| Parameter | Type | Default | Meaning |
No parameters. The function fixes its timeframe internally or uses the script timeframe as described above.
Value / effect: signed percent
Formula: (latest close - high) / high × 100. AllTimeMax is an accepted alias. Despite the name, this is a 500-bar window, not the entire database history; any supplied timeframe argument is ignored.
Example
DistancePercFromAllTimeMax() > -10
Distance from the lowest low in the latest 500 available bars.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: signed percent
Formula: (latest close - low) / low × 100. DistancePercFromAllTimeMin is listed in the validator but has no dispatcher implementation; do not use that name.
Example
DistancePercFromAllTimeLow("d") < 10
Ticker percentage return minus benchmark percentage return across the fetched quote window.
| Parameter | Type | Default | Meaning |
period | int | 20 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
benchmarkTicker | string | SPY | Benchmark symbol as stored in the database. |
Value / effect: percentage points
Loads period + 5 bars and uses the first and last fetched closes, so the effective window can exceed period. Both series use their own available endpoints rather than matched dates. If benchmark data cannot be read, benchmark return defaults to zero.
Example
RelativePerformance(20, "d", "SPY") > 5
Ticker close ratio divided by the benchmark close ratio; values above 1 indicate outperformance.
| Parameter | Type | Default | Meaning |
benchmarkTicker | string | SPY | Benchmark symbol as stored in the database. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
period | int | 20 | Lookback or indicator period in bars; see function-specific rules. |
Value / effect: ratio
Parameter order is benchmarkTicker, timeframe, period. Loads period + 5 bars and uses first/last closes in each fetched series without date alignment. If benchmark retrieval fails or has insufficient data, benchmark ratio defaults to 1.
Example
RelativeStrength("SPY", "d", 20) > 1.05
Volume and liquidity
Average recorded countervalue over the latest period available bars.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: countervalue
Uses the cached metric backed by full quotes. It reads the stored countervalue, not an invented close × volume value; missing countervalue columns supply zero. Fewer than period bars can be averaged when history is incomplete.
Example
AvgCounterValue(20, "d") > 1mln
Latest volume change relative to the average of up to period preceding bars.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: percent
The latest bar is excluded from the reference average. Zero average volume excludes the ticker.
Example
VolumeChangeVsAvg(20, "d") > 50
Volume change from period bars ago to the latest bar.
| Parameter | Type | Default | Meaning |
period | int | 20 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: percent
If history is shorter, the function compares the first and last available bars. It requires at least two bars and a nonzero initial volume.
Example
VolumeChangePerc(20, "d") > 50
Percentage of preceding volumes strictly below the latest volume.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: percentile 0–100
Compares the latest bar against up to period preceding bars. This is a volume percentile, not a volume-by-price histogram or point of control.
Example
VolumeProfile(20, "d") > 90
Moving averages and crossovers
Signed percentage distance of the latest close from the selected moving average.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: signed percent
Formula: (close - average) / average × 100. DistPercFromSMA and DistPercFromEMA are aliases. Current moving averages are read through the indicator cache; missing values exclude the ticker.
Example
DistancePercFromSMA(50, "d") > 0
Signed percentage distance of the latest close from the selected moving average.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: signed percent
Formula: (close - average) / average × 100. DistPercFromSMA and DistPercFromEMA are aliases. Current moving averages are read through the indicator cache; missing values exclude the ticker.
Example
DistPercFromSMA(50, "d") > 0
Signed percentage distance of the latest close from the selected moving average.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: signed percent
Formula: (close - average) / average × 100. DistPercFromSMA and DistPercFromEMA are aliases. Current moving averages are read through the indicator cache; missing values exclude the ticker.
Example
DistancePercFromEMA(50, "d") > 0
Signed percentage distance of the latest close from the selected moving average.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: signed percent
Formula: (close - average) / average × 100. DistPercFromSMA and DistPercFromEMA are aliases. Current moving averages are read through the indicator cache; missing values exclude the ticker.
Example
DistPercFromEMA(50, "d") > 0
Keeps a ticker when the absolute close-to-average distance is within distancePerc percent.
| Parameter | Type | Default | Meaning |
period | int | 50 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
distancePerc | number | 1.5 | Maximum absolute percentage distance. |
Value / effect: 1 or excluded
The distance tolerance is absolute. Returns 1 on a match, not the distance. Can also be used without a comparison operator.
Example
PriceNearEMA(50, "d", 1.5) == 1
Keeps a ticker when the absolute close-to-average distance is within distancePerc percent.
| Parameter | Type | Default | Meaning |
period | int | 50 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
distancePerc | number | 1.5 | Maximum absolute percentage distance. |
Value / effect: 1 or excluded
The distance tolerance is absolute. Returns 1 on a match, not the distance. Can also be used without a comparison operator.
Example
PriceNearSMA(50, "d", 1.5) == 1
Keeps a ticker near at least one of the supplied moving-average periods.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
distancePerc | number | 1.5 | Maximum absolute percentage distance. |
periods | int... | required | One or more positive moving-average periods, as separate arguments. |
Value / effect: 1 or excluded
At least one positive integer period must be provided after the tolerance. Invalid/nonpositive periods are discarded, and duplicate periods are deduplicated. Without a valid period the result is empty.
Example
PriceNearAnyEMA("d", 1.5, 50, 100, 200) == 1
Keeps a ticker near at least one of the supplied moving-average periods.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
distancePerc | number | 1.5 | Maximum absolute percentage distance. |
periods | int... | required | One or more positive moving-average periods, as separate arguments. |
Value / effect: 1 or excluded
At least one positive integer period must be provided after the tolerance. Invalid/nonpositive periods are discarded, and duplicate periods are deduplicated. Without a valid period the result is empty.
Example
PriceNearAnySMA("d", 1.5, 50, 100, 200) == 1
Latest close crosses the moving average in the selected direction.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
direction | string | Up | Direction selector; accepted values depend on the function. |
Value / effect: ticker filter
Use Up or Down explicitly. This dedicated filter ignores any comparison operator and threshold; it is not a general numeric indicator.
Example
CrossEMA(50, "d", "Up")
Latest close crosses the moving average in the selected direction.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
direction | string | Up | Direction selector; accepted values depend on the function. |
Value / effect: ticker filter
Use Up or Down explicitly. This dedicated filter ignores any comparison operator and threshold; it is not a general numeric indicator.
Example
CrossSMA(50, "d", "Up")
The fast EMA crosses the slow EMA on the latest bar.
| Parameter | Type | Default | Meaning |
fast | int | 20 | Fast moving-average period. |
slow | int | 50 | Slow moving-average period. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
direction | string | Up | Direction selector; accepted values depend on the function. |
Value / effect: 1 or excluded
The previous fast/slow pair and the current fast/slow pair are compared. Use positive fast < slow.
Example
CrossEMAEMA(20, 50, "d", "Up") == 1
Checks for a close-to-moving-average crossover within the latest bars.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
direction | string | Down | Direction selector; accepted values depend on the function. |
bars | int | 5 | Number of recent bars in the crossover window. |
Value / effect: 1 or 0
Uses the crossover cache. Up must be explicitly supplied for an upward cross; an omitted direction defaults to Down. Use positive bars.
Example
CrossedEMAWithin(50, "d", "Up", 5) == 1
Checks for a close-to-moving-average crossover within the latest bars.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
direction | string | Down | Direction selector; accepted values depend on the function. |
bars | int | 5 | Number of recent bars in the crossover window. |
Value / effect: 1 or 0
Uses the crossover cache. Up must be explicitly supplied for an upward cross; an omitted direction defaults to Down. Use positive bars.
Example
CrossedSMAWithin(50, "d", "Up", 5) == 1
Checks recent fast-EMA crossings against the preceding slow-EMA value.
| Parameter | Type | Default | Meaning |
fast | int | 20 | Fast moving-average period. |
slow | int | 50 | Slow moving-average period. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
direction | string | Down | Direction selector; accepted values depend on the function. |
bars | int | 5 | Number of recent bars in the crossover window. |
Value / effect: 1 or 0
Implementation detail: the current fast EMA is compared against the previous slow EMA, not the current slow EMA. This can differ from CrossEMAEMA. Supply Up or Down explicitly; omitted direction defaults to Down.
Example
CrossedEMAEMAWithin(20, 50, "d", "Up", 5) == 1
Normalized regression slope over the latest five moving-average values.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: percent per bar
The regression window is fixed at five values. Slope is divided by their mean and multiplied by 100. EMASlope requires at least period × 10 quotes; SMASlope requires at least period × 2 quotes.
Example
EMASlope(50, "d") > 0.1
Normalized regression slope over the latest five moving-average values.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: percent per bar
The regression window is fixed at five values. Slope is divided by their mean and multiplied by 100. EMASlope requires at least period × 10 quotes; SMASlope requires at least period × 2 quotes.
Example
SMASlope(50, "d") > 0.1
Indicators and volatility
Latest Relative Strength Index computed with the requested period.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 0–100
Latest MACD line, histogram or signal line, according to the function name.
| Parameter | Type | Default | Meaning |
fast | int | 12 | Fast moving-average period. |
slow | int | 26 | Slow moving-average period. |
signal | int | 9 | MACD signal smoothing period. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: price units
Uses Skender indicators on 60 fetched bars. These values are in price units, not percentages. Long periods can leave insufficient warmup history.
Example
MACD(12, 26, 9, "d") > 0
Latest MACD line, histogram or signal line, according to the function name.
| Parameter | Type | Default | Meaning |
fast | int | 12 | Fast moving-average period. |
slow | int | 26 | Slow moving-average period. |
signal | int | 9 | MACD signal smoothing period. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: price units
Uses Skender indicators on 60 fetched bars. These values are in price units, not percentages. Long periods can leave insufficient warmup history.
Example
MACDHistogram(12, 26, 9, "d") > 0
Latest MACD line, histogram or signal line, according to the function name.
| Parameter | Type | Default | Meaning |
fast | int | 12 | Fast moving-average period. |
slow | int | 26 | Slow moving-average period. |
signal | int | 9 | MACD signal smoothing period. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: price units
Uses Skender indicators on 60 fetched bars. These values are in price units, not percentages. Long periods can leave insufficient warmup history.
Example
MACDSignal(12, 26, 9, "d") > 0
Average True Range; ATRPerc normalizes ATR by the latest close.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: ATR: price units; ATRPerc: percent
ATRPerc = ATR / close × 100. ATR itself is an absolute price range. Missing indicator values exclude the ticker.
Average True Range; ATRPerc normalizes ATR by the latest close.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: ATR: price units; ATRPerc: percent
ATRPerc = ATR / close × 100. ATR itself is an absolute price range. Missing indicator values exclude the ticker.
Example
ATRPerc(14, "d") > 2
BollingerPosition locates the close between the bands; BollingerWidth measures their normalized width.
| Parameter | Type | Default | Meaning |
period | int | 20 | Lookback or indicator period in bars; see function-specific rules. |
stdDev | number | 2 | Bollinger band standard-deviation multiplier. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: percent
Position = (close - lower) / (upper - lower) × 100; values can be below 0 or above 100. Width = (upper - lower) / middle SMA × 100.
Example
BollingerPosition(20, 2, "d") < 20
BollingerPosition locates the close between the bands; BollingerWidth measures their normalized width.
| Parameter | Type | Default | Meaning |
period | int | 20 | Lookback or indicator period in bars; see function-specific rules. |
stdDev | number | 2 | Bollinger band standard-deviation multiplier. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: percent
Position = (close - lower) / (upper - lower) × 100; values can be below 0 or above 100. Width = (upper - lower) / middle SMA × 100.
Example
BollingerWidth(20, 2, "d") < 20
Latest stochastic oscillator (%K) or %D line.
| Parameter | Type | Default | Meaning |
kPeriod | int | 14 | Stochastic lookback period. |
dPeriod | int | 3 | Stochastic signal period. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 0–100
The script accepts two numeric periods followed by timeframe. There is no additional smoothing argument. StochasticD loads kPeriod × 3 + dPeriod bars.
Example
Stochastic(14, 3, "d") < 20
Latest stochastic oscillator (%K) or %D line.
| Parameter | Type | Default | Meaning |
kPeriod | int | 14 | Stochastic lookback period. |
dPeriod | int | 3 | Stochastic signal period. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 0–100
The script accepts two numeric periods followed by timeframe. There is no additional smoothing argument. StochasticD loads kPeriod × 3 + dPeriod bars.
Example
StochasticD(14, 3, "d") < 20
Population standard deviation of logarithmic close returns in the latest period bars, multiplied by 100.
| Parameter | Type | Default | Meaning |
period | int | 4 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: percent
Not annualized and not an average high-low range. period bars produce at most period - 1 log returns. At least two bars are required.
Example
AvgVolatility(20, "d") > 1
Unnormalized linear-regression slope of the latest period closes.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: price units per bar
Unlike EMASlope and SMASlope, this slope is not divided by average price. Thresholds are therefore sensitive to the instrument price scale.
Example
MomentumSlope(20, "d") > 0
Candle values and price structure
Latest opening price.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: price units
Latest high.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: price units
Latest low.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: price units
Latest high minus low.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: price units
Absolute latest close minus open.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: price units
High minus max(open, close).
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: price units
Example
UpperWick("d") > 1
min(open, close) minus low.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: price units
Example
LowerWick("d") > 1
Tests latest close > open (bullish) or close < open (bearish).
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 1 or 0
A doji with close = open returns 0 in both functions. To select bullish/bearish candles, use == 1 explicitly; a bare call also admits numeric zero.
Example
IsBullishCandle("d") == 1
Tests latest close > open (bullish) or close < open (bearish).
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 1 or 0
A doji with close = open returns 0 in both functions. To select bullish/bearish candles, use == 1 explicitly; a bare call also admits numeric zero.
Example
IsBearishCandle("d") == 1
Highest high or lowest low over the latest period bars, including the current bar.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: price units
Example
HighestHigh(20, "d") > 10
Highest high or lowest low over the latest period bars, including the current bar.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: price units
Example
LowestLow(20, "d") > 10
Signed close distance from the high/low extreme over the latest period bars.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: signed percent
Formula: (close - extreme) / extreme × 100. The current bar is included in the extreme search.
Example
DistancePercFromHigh(20, "d") > -5
Signed close distance from the high/low extreme over the latest period bars.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: signed percent
Formula: (close - extreme) / extreme × 100. The current bar is included in the extreme search.
Example
DistancePercFromLow(20, "d") > -5
Latest close is above the preceding period highs or below the preceding period lows.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 1 or excluded
The current bar is excluded from the reference high/low. A match returns 1, otherwise no value. This checks the current close relative to the level; it does not require the previous close to be on the other side.
Example
BreakoutHigh(20, "d") == 1
Latest close is above the preceding period highs or below the preceding period lows.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 1 or excluded
The current bar is excluded from the reference high/low. A match returns 1, otherwise no value. This checks the current close relative to the level; it does not require the previous close to be on the other side.
Example
BreakdownLow(20, "d") == 1
Counts the uninterrupted latest run of green/red candles with body at least 25% of range.
| Parameter | Type | Default | Meaning |
n | int | 3 | History request/count setting; compare the actual count explicitly. |
direction | string | green | Direction selector; accepted values depend on the function. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: count
The engine loads n + 5 bars, then counts backwards until color or body/range fails. n controls the loaded window and is not itself a minimum match count; compare the result with n explicitly.
Example
ConsecutiveCandles(3, "green", "d") >= 3
Tests whether recent lows/highs lie within the specified percentage spread.
| Parameter | Type | Default | Meaning |
bars | int | 3 | Number of recent bars in the crossover window. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
tolerancePerc | number | 1 | Maximum high/low spread in percent. |
Value / effect: 1 or excluded
Spread = (maximum - minimum) / minimum × 100 over the latest bars values. At least two bars and a positive minimum are required.
Example
HasEqualLows(3, "d", 1) == 1
Tests whether recent lows/highs lie within the specified percentage spread.
| Parameter | Type | Default | Meaning |
bars | int | 3 | Number of recent bars in the crossover window. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
tolerancePerc | number | 1 | Maximum high/low spread in percent. |
Value / effect: 1 or excluded
Spread = (maximum - minimum) / minimum × 100 over the latest bars values. At least two bars and a positive minimum are required.
Example
HasEqualHighs(3, "d", 1) == 1
Tests the last period local swing highs/lows for strictly increasing/decreasing values.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 1 or excluded
period means the number of swing points, not consecutive candles. A pivot must exceed both adjacent highs (or be below both adjacent lows). The engine loads period × 10 + 20 bars.
Example
HigherHighs(3, "d") == 1
Tests the last period local swing highs/lows for strictly increasing/decreasing values.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 1 or excluded
period means the number of swing points, not consecutive candles. A pivot must exceed both adjacent highs (or be below both adjacent lows). The engine loads period × 10 + 20 bars.
Example
LowerLows(3, "d") == 1
Latest range is the smallest of the latest nrBars ranges; returns latest range / average lookback range × 100.
| Parameter | Type | Default | Meaning |
nrBars | int | 7 | Number of ranges compared for the narrowest latest range. |
lookback | int | 20 | History window in bars. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: range ratio percent
Use 1 ≤ nrBars ≤ lookback. The ratio uses absolute high-low ranges and is not a quality score.
Example
NarrowRangeBar(7, 20, "d") < 70
Keeps a daily close within distancePerc percent of an absolute positive price level.
| Parameter | Type | Default | Meaning |
price | number | 0 | Absolute price level; must be positive. |
distancePerc | number | 2 | Maximum absolute percentage distance. |
Value / effect: distance percent
Always uses daily quotes. Returns absolute distance percent, not 1. The tolerance is a precondition applied before the comparison.
Example
PriceNearLevel(100, 2) < 1.5
Full candle-range gap on the latest bar, beyond the chosen minimum.
| Parameter | Type | Default | Meaning |
minGapPercent | number | 1 | Minimum magnitude of the full candle-range gap. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: signed gap percent
An upward gap measures (current low - previous high) / previous high × 100. A downward gap measures (current high - previous low) / previous low × 100 and is negative. Overlapping ranges are not gaps. This is not simply open-to-previous-close change.
Full candle-range gap on the latest bar, beyond the chosen minimum.
| Parameter | Type | Default | Meaning |
minGapPercent | number | 1 | Minimum magnitude of the full candle-range gap. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: signed gap percent
An upward gap measures (current low - previous high) / previous high × 100. A downward gap measures (current high - previous low) / previous low × 100 and is negative. Overlapping ranges are not gaps. This is not simply open-to-previous-close change.
Trend and price lock
Confirmed trend combining regression slope sign, close position versus EMA(period), and regression R² ≥ 0.3.
| Parameter | Type | Default | Meaning |
period | int | 30 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: signed slope percent per bar
On a valid trend the value is the normalized close regression slope: positive for IsUpTrend, negative for IsDownTrend. Use a bare call or a signed slope threshold; == 1 is not a boolean test for these functions. Only the numeric slope is stored by these filters; the old desktop grid columns are not generated here.
Example
IsUpTrend(30, "d")
Confirmed trend combining regression slope sign, close position versus EMA(period), and regression R² ≥ 0.3.
| Parameter | Type | Default | Meaning |
period | int | 30 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: signed slope percent per bar
On a valid trend the value is the normalized close regression slope: positive for IsUpTrend, negative for IsDownTrend. Use a bare call or a signed slope threshold; == 1 is not a boolean test for these functions. Only the numeric slope is stored by these filters; the old desktop grid columns are not generated here.
Example
IsDownTrend(30, "d")
Applies the trend criteria to a period-bar window ending barsAgo bars before the latest bar.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
barsAgo | int | 5 | Historical endpoint offset in bars. |
Value / effect: 1 or excluded
Uses slope sign, close versus EMA(period) at that historical endpoint, and R² ≥ 0.3. Unlike the current trend functions, a match returns 1. Use nonnegative barsAgo and enough warmup history.
Example
WasUpTrend(30, "d", 5) == 1
Applies the trend criteria to a period-bar window ending barsAgo bars before the latest bar.
| Parameter | Type | Default | Meaning |
period | int | 14 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
barsAgo | int | 5 | Historical endpoint offset in bars. |
Value / effect: 1 or excluded
Uses slope sign, close versus EMA(period) at that historical endpoint, and R² ≥ 0.3. Unlike the current trend functions, a match returns 1. Use nonnegative barsAgo and enough warmup history.
Example
WasDownTrend(30, "d", 5) == 1
Percentage range of recent closing prices: (maximum - minimum) / minimum × 100.
| Parameter | Type | Default | Meaning |
period | int | 20 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: range percent
IsOPALocked is an alias. A low range can indicate frozen prices, but does not prove a takeover or suspension. Reads the price_range cache; at least five history bars are required.
Example
IsPriceLocked(20, "d") < 0.5
Percentage range of recent closing prices: (maximum - minimum) / minimum × 100.
| Parameter | Type | Default | Meaning |
period | int | 20 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: range percent
IsOPALocked is an alias. A low range can indicate frozen prices, but does not prove a takeover or suspension. Reads the price_range cache; at least five history bars are required.
Example
IsOPALocked(20, "d") < 0.5
Keeps tickers whose closing-price range is at least 0.5%.
| Parameter | Type | Default | Meaning |
period | int | 20 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 1 or excluded
The boundary is inclusive (range ≥ 0.5), with a fixed threshold. Use IsPriceLocked for a custom percentage threshold.
Example
IsNotPriceLocked(20, "d") == 1
Flags and triangles
Finds a continuation flag; the Bull/Bear variants select its direction.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
The detector evaluates pole, retracement, flag geometry and volume. An absent or invalid pattern excludes the ticker; the comparison is applied to quality, not price distance. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Extra data: FlagQuality · FlagType · FlagStrength · FlagPolePct · FlagChannelHeightPct · FlagRetracementPct · FlagBreakoutLevel · FlagTargetPrice · FlagDistancePct · FlagRiskReward · FlagPoleVolumeRatio · FlagVolumeRatio · FlagUpperTouches · FlagLowerTouches · FlagUpperSlopePctBar · FlagLowerSlopePctBar · FlagUpperR2 · FlagLowerR2 · FlagBreakoutConfirmed · FlagBreakoutTolerancePct · FlagPatternLength
Example
LookForFlag(80, "d") > 60
Finds a continuation flag; the Bull/Bear variants select its direction.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
The detector evaluates pole, retracement, flag geometry and volume. An absent or invalid pattern excludes the ticker; the comparison is applied to quality, not price distance. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForBullFlag(80, "d") > 60
Finds a continuation flag; the Bull/Bear variants select its direction.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
The detector evaluates pole, retracement, flag geometry and volume. An absent or invalid pattern excludes the ticker; the comparison is applied to quality, not price distance. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForBearFlag(80, "d") > 60
Finds a confirmed flag breakout; Bull/Bear variants restrict direction.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
tolerancePercent | number | 0.5 | Allowed distance/deviation in percent. |
Value / effect: quality score 0–100
Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForFlagBreakout(80, "d", 0.5) > 60
Finds a confirmed flag breakout; Bull/Bear variants restrict direction.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
tolerancePercent | number | 0.5 | Allowed distance/deviation in percent. |
Value / effect: quality score 0–100
Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForBullFlagBreakout(80, "d", 0.5) > 60
Finds a confirmed flag breakout; Bull/Bear variants restrict direction.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
tolerancePercent | number | 0.5 | Allowed distance/deviation in percent. |
Value / effect: quality score 0–100
Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForBearFlagBreakout(80, "d", 0.5) > 60
Detects ascending, descending or symmetrical triangle geometry.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
The comparison is on pattern quality. These calls do not expose separate breakout-only or last-signal-candle switches. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForAscendingTriangle(80, "d") > 60
Detects ascending, descending or symmetrical triangle geometry.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
The comparison is on pattern quality. These calls do not expose separate breakout-only or last-signal-candle switches. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForDescendingTriangle(80, "d") > 60
Detects ascending, descending or symmetrical triangle geometry.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
The comparison is on pattern quality. These calls do not expose separate breakout-only or last-signal-candle switches. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForSymmetricTriangle(80, "d") > 60
Legacy triangle entry point with inconsistent timeframe handling; it does not enforce a breakout-only condition.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
showOnlyBreakout | legacy | required | Legacy argument ignored by this implementation. |
nrLastCandleSignal | legacy | required | Legacy argument ignored by this implementation. |
Value / effect: quality score 0–100; legacy limitations
Do not use for confirmed breakout scans. showOnlyBreakout and nrLastCandleSignal are ignored. Filtering uses argument 2 as a timeframe and tries argument 1 as a numeric period (fallback 80); result metadata instead uses argument 1 as timeframe. The initial detection tries an ascending triangle before FindAny. Use the explicit directional triangle functions for dependable timeframe and period selection. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForAscendingTriangle(80, "d") > 60
Trendlines and channels
Compatibility wrapper for a rising trendline built from lows.
| Parameter | Type | Default | Meaning |
nrCandles | int | 120 | Trendline history request in bars. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
tolerancePercent | number | 2 | Allowed distance/deviation in percent. |
Value / effect: quality score 0–100
Uses at least three touches, maxAge = 15, minimum tolerance = 0.5%. The third argument is a percentage tolerance, not a discrete precision-level selector. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForAscendingTrendLine(120, "d", 2) > 60
Finds a recent valid trendline near the current close.
| Parameter | Type | Default | Meaning |
source | string | Low | Low, High or Close. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
lookback | int | 120 | History window in bars. |
minTouches | int | 3 | Minimum aligned touches. |
maxAge | int | 15 | Maximum bars since the latest touch. |
tolerancePercent | number | 1.5 | Allowed distance/deviation in percent. |
direction | string | Any | Direction selector; accepted values depend on the function. |
Value / effect: quality score 0–100
source: Low for support, High for resistance, Close for either. direction: Any, Bull/Rising/Up, Bear/Falling/Down. Requires enough recent touches, acceptable fit, no invalidating break, and current proximity to the projected line. maxAge is the maximum bars since the last touch. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Extra data: TrendlineQuality · TrendlineLine · TrendlineDistance · TrendlineTouches · TrendlineLastTouchBarsAgo · TrendlineSlopePctBar · TrendlineR2 · TrendlineSource · TrendlineKind · TrendlineDirection
Example
LookForTrendline("Low", "d", 120, 3, 15, 1.5, "Bull") > 70
Finds a valid support/resistance channel near the latest price; variants select its direction.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
lookback | int | 120 | History window in bars. |
minTouches | int | 3 | Minimum aligned touches. |
maxAge | int | 20 | Maximum bars since the latest touch. |
tolerancePercent | number | 1.5 | Allowed distance/deviation in percent. |
maxWidthPercent | number | 18 | Maximum channel width in percent. |
Value / effect: quality score 0–100
Fits support on lows and resistance on highs. Requires recent touches, approximate parallelism, acceptable width and containment, and useful current proximity. The timeframe is the first argument, unlike most pattern functions. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Extra data: ChannelQuality · ChannelType · ChannelSupport · ChannelResistance · ChannelWidthPct · ChannelDistanceToSupport · ChannelDistanceToResistance · ChannelSupportTouches · ChannelResistanceTouches · ChannelSupportSlopePctBar · ChannelResistanceSlopePctBar
Example
LookForChannel("d", 120, 3, 20, 1.5, 18) > 65
Finds a valid support/resistance channel near the latest price; variants select its direction.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
lookback | int | 120 | History window in bars. |
minTouches | int | 3 | Minimum aligned touches. |
maxAge | int | 20 | Maximum bars since the latest touch. |
tolerancePercent | number | 1.5 | Allowed distance/deviation in percent. |
maxWidthPercent | number | 18 | Maximum channel width in percent. |
Value / effect: quality score 0–100
Fits support on lows and resistance on highs. Requires recent touches, approximate parallelism, acceptable width and containment, and useful current proximity. The timeframe is the first argument, unlike most pattern functions. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForRisingChannel("d", 120, 3, 20, 1.5, 18) > 65
Finds a valid support/resistance channel near the latest price; variants select its direction.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
lookback | int | 120 | History window in bars. |
minTouches | int | 3 | Minimum aligned touches. |
maxAge | int | 20 | Maximum bars since the latest touch. |
tolerancePercent | number | 1.5 | Allowed distance/deviation in percent. |
maxWidthPercent | number | 18 | Maximum channel width in percent. |
Value / effect: quality score 0–100
Fits support on lows and resistance on highs. Requires recent touches, approximate parallelism, acceptable width and containment, and useful current proximity. The timeframe is the first argument, unlike most pattern functions. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForFallingChannel("d", 120, 3, 20, 1.5, 18) > 65
Finds a valid support/resistance channel near the latest price; variants select its direction.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
lookback | int | 120 | History window in bars. |
minTouches | int | 3 | Minimum aligned touches. |
maxAge | int | 20 | Maximum bars since the latest touch. |
tolerancePercent | number | 1.5 | Allowed distance/deviation in percent. |
maxWidthPercent | number | 18 | Maximum channel width in percent. |
Value / effect: quality score 0–100
Fits support on lows and resistance on highs. Requires recent touches, approximate parallelism, acceptable width and containment, and useful current proximity. The timeframe is the first argument, unlike most pattern functions. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForHorizontalChannel("d", 120, 3, 20, 1.5, 18) > 65
Fibonacci
Finds a retracement and compares absolute current distance to the requested Fibonacci level.
| Parameter | Type | Default | Meaning |
period | int | 63 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
level | number | 61.8 | Fibonacci retracement level in percent. |
tolerancePercent | number | 2 | Allowed distance/deviation in percent. |
Value / effect: distance percent
Only patterns within tolerancePercent survive; the comparison then uses DistancePercent. It does not return the pattern quality. Use level as a percentage (61.8, not 0.618). Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
FiboNearLevel(63, "d", 61.8, 2) < 1.5
Finds a Fibonacci retracement near the selected level; directional variants filter bullish or bearish structures.
| Parameter | Type | Default | Meaning |
period | int | 63 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
level | number | 61.8 | Fibonacci retracement level in percent. |
tolerancePercent | number | 2 | Allowed distance/deviation in percent. |
Value / effect: quality score 0–100
The detector identifies a directional impulse and a subsequent retracement. These functions compare quality rather than distance. Level and tolerance are percentages. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Extra data: FibonacciQuality · FibonacciDirection · FibonacciStrength · FibonacciLevel · FibonacciLevelPrice · FibonacciDistancePct · FibonacciSwingLow · FibonacciSwingHigh · FibonacciSwingPct · FibonacciTolerancePct · FibonacciSwingStartBarsAgo · FibonacciSwingEndBarsAgo · FibonacciSwingStartPrice · FibonacciSwingEndPrice · FibonacciLookback
Example
LookForFibonacci(63, "d", 61.8, 2) > 60
Finds a Fibonacci retracement near the selected level; directional variants filter bullish or bearish structures.
| Parameter | Type | Default | Meaning |
period | int | 63 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
level | number | 61.8 | Fibonacci retracement level in percent. |
tolerancePercent | number | 2 | Allowed distance/deviation in percent. |
Value / effect: quality score 0–100
The detector identifies a directional impulse and a subsequent retracement. These functions compare quality rather than distance. Level and tolerance are percentages. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForBullishFibonacci(63, "d", 61.8, 2) > 60
Finds a Fibonacci retracement near the selected level; directional variants filter bullish or bearish structures.
| Parameter | Type | Default | Meaning |
period | int | 63 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
level | number | 61.8 | Fibonacci retracement level in percent. |
tolerancePercent | number | 2 | Allowed distance/deviation in percent. |
Value / effect: quality score 0–100
The detector identifies a directional impulse and a subsequent retracement. These functions compare quality rather than distance. Level and tolerance are percentages. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForBearishFibonacci(63, "d", 61.8, 2) > 60
Reversal and base patterns
Detects a double top using separated peaks.
| Parameter | Type | Default | Meaning |
period | int | 3000 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
minBarsBetweenPeaks | int | 10 | Minimum double-top peak separation in bars. |
Value / effect: quality score 0–100
Minimum peak separation is clamped to at least 10 bars. period sets the maximum separation and the history request, whose default is 3000. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForDoubleTop(120, "d", 15) > 60
Searches a double bottom with the latest candle as the second-bottom candidate.
| Parameter | Type | Default | Meaning |
period | int | 3000 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
period is a recent window, clamped to at least two bars. Minimum separation is derived internally as min(10, max(2, period / 3)); there is no third separation parameter for this variant. At least 30 quotes are loaded/required. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForDoubleBottom(120, "d") > 60
Detects a bearish head-and-shoulders top or bullish inverse structure.
| Parameter | Type | Default | Meaning |
period | int | 120 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
LookForInverseHeadAndShoulders is an alias of LookForInverseHS. Quality considers shoulders, head prominence, timing and neckline structure. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForHeadAndShoulders(120, "d") > 65
Detects a bearish head-and-shoulders top or bullish inverse structure.
| Parameter | Type | Default | Meaning |
period | int | 120 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
LookForInverseHeadAndShoulders is an alias of LookForInverseHS. Quality considers shoulders, head prominence, timing and neckline structure. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForInverseHS(120, "d") > 65
Detects a bearish head-and-shoulders top or bullish inverse structure.
| Parameter | Type | Default | Meaning |
period | int | 120 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
LookForInverseHeadAndShoulders is an alias of LookForInverseHS. Quality considers shoulders, head prominence, timing and neckline structure. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForInverseHeadAndShoulders(120, "d") > 65
Detects a rounded bottom/top still approaching its breakout level.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
maxDistancePct | number | 7 | Maximum pre-breakout distance in percent, clamped 1–25. |
Value / effect: quality score 0–100
The detector clamps period to 30–220 and maxDistancePct to 1–25 (default 7). Bottoms must remain below the breakout level and tops above it. A breakout crossing inside the analyzed pattern window rejects the pattern. Quality considers curvature fit, depth, symmetry, smoothness and recovery. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForRoundedBottom(100, "d", 10) > 65
Detects a rounded bottom/top still approaching its breakout level.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
maxDistancePct | number | 7 | Maximum pre-breakout distance in percent, clamped 1–25. |
Value / effect: quality score 0–100
The detector clamps period to 30–220 and maxDistancePct to 1–25 (default 7). Bottoms must remain below the breakout level and tops above it. A breakout crossing inside the analyzed pattern window rejects the pattern. Quality considers curvature fit, depth, symmetry, smoothness and recovery. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForRoundedTop(100, "d", 10) > 65
Detects an accelerating parabolic price run.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
Use it as structural context and combine with volatility/liquidity filters. It is a quality detector, not a forecast of continuation. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Extra data: ParabolicRunQuality · ParabolicRunType · ParabolicRunStrength · ParabolicRunAccelerationScore · ParabolicRunCurvature · ParabolicRunQuadraticR2 · ParabolicRunLinearR2 · ParabolicRunFirstHalfSlopePctBar · ParabolicRunSecondHalfSlopePctBar · ParabolicRunPullbackDepthPct · ParabolicRunDistanceFromHighPct · ParabolicRunDistanceFromEma20Pct · ParabolicRunDistanceFromEma50Pct · ParabolicRunVolumeExpansionRatio · ParabolicRunPct · ParabolicRunPatternLength
Example
LookForParabolicRun(80, "d") > 65
Detects converging wedge geometry; directional variants select rising or falling wedges.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
Both boundaries slope in the same direction while the structure narrows. Quality is independent of a guaranteed subsequent breakout. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Extra data: WedgeQuality · WedgeType · WedgeSupport · WedgeResistance · WedgeWidthStartPct · WedgeWidthEndPct · WedgeCompressionPct · WedgeDistanceToSupportPct · WedgeDistanceToResistancePct · WedgeSupportTouches · WedgeResistanceTouches · WedgeSupportSlopePctBar · WedgeResistanceSlopePctBar · WedgeSupportR2 · WedgeResistanceR2 · WedgeDaysToApex · WedgeTolerancePct · WedgeLookback
Example
LookForWedge(80, "d") > 65
Detects converging wedge geometry; directional variants select rising or falling wedges.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
Both boundaries slope in the same direction while the structure narrows. Quality is independent of a guaranteed subsequent breakout. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForRisingWedge(80, "d") > 65
Detects converging wedge geometry; directional variants select rising or falling wedges.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
Both boundaries slope in the same direction while the structure narrows. Quality is independent of a guaranteed subsequent breakout. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForFallingWedge(80, "d") > 65
Rounded bullish cup followed by a shallow handle.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForCupWithHandle(100, "d") > 65
Bearish mirror of cup with handle.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForInvertedCupWithHandle(100, "d") > 65
Progressive range and volume contraction.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForVCP(100, "d") > 65
Alias of LookForVCP.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForVolatilityContraction(100, "d") > 65
Horizontal range bounded by repeated support and resistance.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForRectangle(100, "d") > 65
Tight horizontal base using the rectangle detector with tighter width settings.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForFlatBase(100, "d") > 65
Darvas-style horizontal price box.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForDarvasBox(100, "d") > 65
Three aligned upper pivots.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForTripleTop(100, "d") > 65
Three aligned lower pivots.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForTripleBottom(100, "d") > 65
Expanding megaphone structure.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForBroadening(100, "d") > 65
Price-volume patterns
Price extreme accompanied by contracting average volume.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
Returns a detected structure quality; it is not a directional forecast or a guarantee of a reversal. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForVolumePriceDivergence(80, "d") > 65
Wide high-volume candle closing against the preceding move.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
Returns a detected structure quality; it is not a directional forecast or a guarantee of a reversal. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForVolumeClimaxReversal(80, "d") > 65
Range contraction followed by current-bar expansion.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
Returns a detected structure quality; it is not a directional forecast or a guarantee of a reversal. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForVolatilitySqueeze(80, "d") > 65
Recent local-level break followed by a controlled retest.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
Returns a detected structure quality; it is not a directional forecast or a guarantee of a reversal. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForBreakoutRetest(80, "d") > 65
False break back into a recent range.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
Returns a detected structure quality; it is not a directional forecast or a guarantee of a reversal. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForFailedBreakout(80, "d") > 65
Downside false-break variant.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
Returns a detected structure quality; it is not a directional forecast or a guarantee of a reversal. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForWyckoffSpring(80, "d") > 65
Upside false-break variant.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
Returns a detected structure quality; it is not a directional forecast or a guarantee of a reversal. Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForWyckoffUpthrust(80, "d") > 65
Structural reversals
Three-point reversal with a break of point 2. Point 1 is its invalidation level.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForOneTwoThreeReversal(100, "d") > 65
Simplified Quasimodo / Over-and-Under swing reversal.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForQuasimodo(100, "d") > 65
Isolated bar or cluster separated by full gaps on both sides.
| Parameter | Type | Default | Meaning |
period | int | 80 | Lookback or indicator period in bars; see function-specific rules. |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: quality score 0–100
Supply an explicit comparison: detector paths that compare directly do not match when the operator is omitted.
Example
LookForIslandReversal(100, "d") > 65
Candlestick patterns
Body strictly smaller than 10% of a positive total range.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 1 or excluded
These filters return 1 only when the pattern is present; absence returns no value and excludes the ticker. Consequently == 0 does not select the complementary set. Geometry uses fixed internal thresholds, with no extra script parameters.
Small body with a dominant lower wick.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 1 or excluded
These filters return 1 only when the pattern is present; absence returns no value and excludes the ticker. Consequently == 0 does not select the complementary set. Geometry uses fixed internal thresholds, with no extra script parameters.
Example
IsHammer("d") == 1
Small body with a dominant upper wick.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 1 or excluded
These filters return 1 only when the pattern is present; absence returns no value and excludes the ticker. Consequently == 0 does not select the complementary set. Geometry uses fixed internal thresholds, with no extra script parameters.
Example
IsShootingStar("d") == 1
Alias of IsShootingStar in this worker; no separate bullish trend-context test.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 1 or excluded
These filters return 1 only when the pattern is present; absence returns no value and excludes the ticker. Consequently == 0 does not select the complementary set. Geometry uses fixed internal thresholds, with no extra script parameters.
Example
IsInvertedHammer("d") == 1
Bullish candle with very short wicks.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 1 or excluded
These filters return 1 only when the pattern is present; absence returns no value and excludes the ticker. Consequently == 0 does not select the complementary set. Geometry uses fixed internal thresholds, with no extra script parameters. Body must occupy at least 95% of the full range.
Example
IsBullishMarubozu("d") == 1
Bearish candle with very short wicks.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 1 or excluded
These filters return 1 only when the pattern is present; absence returns no value and excludes the ticker. Consequently == 0 does not select the complementary set. Geometry uses fixed internal thresholds, with no extra script parameters. Body must occupy at least 95% of the full range.
Example
IsBearishMarubozu("d") == 1
Bullish current body engulfs the previous bearish body.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 1 or excluded
These filters return 1 only when the pattern is present; absence returns no value and excludes the ticker. Consequently == 0 does not select the complementary set. Geometry uses fixed internal thresholds, with no extra script parameters.
Example
IsBullishEngulfing("d") == 1
Bearish current body engulfs the previous bullish body.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 1 or excluded
These filters return 1 only when the pattern is present; absence returns no value and excludes the ticker. Consequently == 0 does not select the complementary set. Geometry uses fixed internal thresholds, with no extra script parameters.
Example
IsBearishEngulfing("d") == 1
Small bullish body within the previous bearish body.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 1 or excluded
These filters return 1 only when the pattern is present; absence returns no value and excludes the ticker. Consequently == 0 does not select the complementary set. Geometry uses fixed internal thresholds, with no extra script parameters.
Example
IsBullishHarami("d") == 1
Small bearish body within the previous bullish body.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 1 or excluded
These filters return 1 only when the pattern is present; absence returns no value and excludes the ticker. Consequently == 0 does not select the complementary set. Geometry uses fixed internal thresholds, with no extra script parameters.
Example
IsBearishHarami("d") == 1
Bullish recovery through the preceding bearish body midpoint.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 1 or excluded
These filters return 1 only when the pattern is present; absence returns no value and excludes the ticker. Consequently == 0 does not select the complementary set. Geometry uses fixed internal thresholds, with no extra script parameters.
Example
IsPiercingLine("d") == 1
Bearish reversal through the preceding bullish body midpoint.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 1 or excluded
These filters return 1 only when the pattern is present; absence returns no value and excludes the ticker. Consequently == 0 does not select the complementary set. Geometry uses fixed internal thresholds, with no extra script parameters.
Example
IsDarkCloudCover("d") == 1
Bullish reversal with approximately aligned lows.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 1 or excluded
These filters return 1 only when the pattern is present; absence returns no value and excludes the ticker. Consequently == 0 does not select the complementary set. Geometry uses fixed internal thresholds, with no extra script parameters.
Example
IsBullishTweezer("d") == 1
Bearish reversal with approximately aligned highs.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 1 or excluded
These filters return 1 only when the pattern is present; absence returns no value and excludes the ticker. Consequently == 0 does not select the complementary set. Geometry uses fixed internal thresholds, with no extra script parameters.
Example
IsBearishTweezer("d") == 1
Latest high-low range is strictly smaller than each of the preceding six ranges.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 1 or excluded
These filters return 1 only when the pattern is present; absence returns no value and excludes the ticker. Consequently == 0 does not select the complementary set. Geometry uses fixed internal thresholds, with no extra script parameters.
Bullish hammer geometry.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 1 or excluded
These filters return 1 only when the pattern is present; absence returns no value and excludes the ticker. Consequently == 0 does not select the complementary set. Geometry uses fixed internal thresholds, with no extra script parameters.
Example
IsBullishPinBar("d") == 1
Bearish shooting-star geometry.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 1 or excluded
These filters return 1 only when the pattern is present; absence returns no value and excludes the ticker. Consequently == 0 does not select the complementary set. Geometry uses fixed internal thresholds, with no extra script parameters.
Example
IsBearishPinBar("d") == 1
Current bar fills the full gap that separates its opening from the previous range.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 1 or excluded
These filters return 1 only when the pattern is present; absence returns no value and excludes the ticker. Consequently == 0 does not select the complementary set. Geometry uses fixed internal thresholds, with no extra script parameters.
Example
IsGapFilled("d") == 1
Three-candle bullish star reversal.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 1 or excluded
These filters return 1 only when the pattern is present; absence returns no value and excludes the ticker. Consequently == 0 does not select the complementary set. Geometry uses fixed internal thresholds, with no extra script parameters.
Example
IsMorningStar("d") == 1
Three-candle bearish star reversal.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
Value / effect: 1 or excluded
These filters return 1 only when the pattern is present; absence returns no value and excludes the ticker. Consequently == 0 does not select the complementary set. Geometry uses fixed internal thresholds, with no extra script parameters.
Example
IsEveningStar("d") == 1
Finds at least one full upward/downward range gap of 0.5% or more in the latest lookback bars.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
lookback | int | 1 | History window in bars. |
Value / effect: 1 or excluded
lookback is clamped to at least one; the earliest bar in the window is compared with the preceding bar. Unlike GapUp/GapDown, this is a predicate with a fixed 0.5% threshold, not the gap percentage.
Example
IsGapUp("d", 3) == 1
Finds at least one full upward/downward range gap of 0.5% or more in the latest lookback bars.
| Parameter | Type | Default | Meaning |
timeframe | string | script timeframe | Quote interval; defaults to the stored script timeframe. |
lookback | int | 1 | History window in bars. |
Value / effect: 1 or excluded
lookback is clamped to at least one; the earliest bar in the window is compared with the preceding bar. Unlike GapUp/GapDown, this is a predicate with a fixed 0.5% threshold, not the gap percentage.
Example
IsGapDown("d", 3) == 1
Compatibility calls without effects
Accepted compatibility placeholder; does not write a custom signal or change the result set.
| Parameter | Type | Default | Meaning |
text | string | required | Compatibility text; ignored. |
Value / effect: no effect
The dispatch case is empty. Normal scan results are built from the ScriptRecord at the end of execution and are published by the worker workflow; this call does not trigger that publication.
Example
AddSignal("candidate")
Accepted compatibility placeholder; does not update ticker filters.
| Parameter | Type | Default | Meaning |
label | string | required | Compatibility label; ignored. |
Value / effect: no effect
The dispatch case is empty. It performs no database mutation.
Example
SetFilter("candidate")
Unavailable names and implementation limits
| Name / signature | Worker v2 behavior |
DistancePercFromAllTimeMin(timeframe) | Accepted by validator, but absent from dispatcher. Skipped without filtering; use DistancePercFromAllTimeLow instead. |
IsThreeWhiteSoldiers(timeframe) | Implemented in dispatcher but rejected as unknown by the validator before a scan starts. |
IsThreeBlackCrows(timeframe) | Implemented in dispatcher but rejected as unknown by the validator before a scan starts. |
These names are excluded from the working-function catalog. AddSignal and SetFilter are accepted but have no effect; LookForTriangleBreakOut is accepted with the limitations documented in its entry.
Desktop/manual-study APIs are outside this worker reference: AddToWatchlist, AvgClose, AvgVolatilityIntraday, CandleType, Close, DistanceFromFibo, EvaluateIfStrongClose, EvaluateIfWeakClose, FiboPosition, LastClose, PrevClose, PriceNearFibonacci, PriceNearManualStudy, PriceNearPivotPoint, PriceNearTrendline, QuantMetric, RemoveFromWatchlist, SetTickerField, TrendlineBreakout, VolumeChangeVsAvgAtTime. They must not be used in worker scans.
Complete scanner examples
Liquid uptrend with a pullback
Confirm trend first, then look for a close near the EMA while momentum has cooled.
FilterTickers("country = 'IT'")
QuoteAge("d") < 5
AvgCounterValue(20, "d") > 1mln
IsNotPriceLocked(20, "d") == 1
IsUpTrend(50, "d")
PriceNearEMA(50, "d", 1.5) == 1
RSI(14, "d") < 50
Rounded base before breakout
Keep an unbroken rounded base close to its right rim; the distance remains configurable.
QuoteAge("d") < 5
AvgCounterValue(20, "d") > 500K
LookForRoundedBottom(100, "d", 10) > 65
IsBullishCandle("d") == 1
Recent crossover with confirmation
QuoteAge("d") < 5
AvgCounterValue(20, "d") > 500K
CrossedEMAWithin(50, "d", "Up", 5) == 1
ChangePerc(5, "d") > 0
VolumeChangeVsAvg(20, "d") > 20
Alternative reversal candidates
OR combines alternative matches from the same incoming universe; subsequent lines refine their union.
QuoteAge("d") < 5
AvgCounterValue(20, "d") > 500K
IsHammer("d") == 1 OR IsBullishEngulfing("d") == 1
RSI(14, "d") < 45