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

FilterTickers(whereClause)

Restricts the current enabled ticker universe using whitelisted predicates joined by AND.

ParameterTypeDefaultMeaning
whereClausestringrequiredOne 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")
GetValue(timeframe, field, offset)

Reads open, high, low, close, volume or countervalue at a candle offset.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
fieldstringrequiredopen, high, low, close, volume or countervalue.
offsetintrequired0 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
GetValueAtDate(date, field)

Reads an exact daily quote date; there is no timeframe parameter.

ParameterTypeDefaultMeaning
datestringrequiredExact daily quote date.
fieldstringrequiredopen, 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
QuoteAge(timeframe)

Calendar-day age of the latest quote relative to UTC now.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote 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.

Example

QuoteAge("d") < 5

Price and returns

LastPercClose(timeframe)

Percentage change from the preceding close to the latest close.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
Value / effect: percent

Example

LastPercClose("d") > 2
ChangePerc(period, timeframe)

Percentage close change over period bars: (latest / earlier - 1) × 100.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
PercClose(period, timeframe)

Percentage close change over period bars: (latest / earlier - 1) × 100.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
ROC(period, timeframe)

Rate of change over period bars; same percentage formula as ChangePerc.

ParameterTypeDefaultMeaning
periodint10Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
Value / effect: percent

Example

ROC(10, "d") > 3
ChangePercStartYear()

Percentage change from the first available daily close in the current calendar interval.

ParameterTypeDefaultMeaning

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
ChangePercStartMonth()

Percentage change from the first available daily close in the current calendar interval.

ParameterTypeDefaultMeaning

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
ChangePercStartWeek()

Percentage change from the first available daily close in the current calendar interval.

ParameterTypeDefaultMeaning

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
ChangePercAcceleration(shortPeriod, longPeriod, timeframe)

Short-period return scaled to the long period, divided by long-period return.

ParameterTypeDefaultMeaning
shortPeriodint5Short return window in bars.
longPeriodint20Long return window in bars.
timeframestringscript timeframeQuote 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
DistancePercFromAllTimeHigh()

Distance from the highest high in the latest 500 available bars of the script timeframe.

ParameterTypeDefaultMeaning

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
DistancePercFromAllTimeMax()

Distance from the highest high in the latest 500 available bars of the script timeframe.

ParameterTypeDefaultMeaning

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
DistancePercFromAllTimeLow(timeframe)

Distance from the lowest low in the latest 500 available bars.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote 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
RelativePerformance(period, timeframe, benchmarkTicker)

Ticker percentage return minus benchmark percentage return across the fetched quote window.

ParameterTypeDefaultMeaning
periodint20Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
benchmarkTickerstringSPYBenchmark 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
RelativeStrength(benchmarkTicker, timeframe, period)

Ticker close ratio divided by the benchmark close ratio; values above 1 indicate outperformance.

ParameterTypeDefaultMeaning
benchmarkTickerstringSPYBenchmark symbol as stored in the database.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
periodint20Lookback 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

AvgCounterValue(period, timeframe)

Average recorded countervalue over the latest period available bars.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
VolumeChangeVsAvg(period, timeframe)

Latest volume change relative to the average of up to period preceding bars.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
VolumeChangePerc(period, timeframe)

Volume change from period bars ago to the latest bar.

ParameterTypeDefaultMeaning
periodint20Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
VolumeProfile(period, timeframe)

Percentage of preceding volumes strictly below the latest volume.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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

DistancePercFromSMA(period, timeframe)

Signed percentage distance of the latest close from the selected moving average.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
DistPercFromSMA(period, timeframe)

Signed percentage distance of the latest close from the selected moving average.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
DistancePercFromEMA(period, timeframe)

Signed percentage distance of the latest close from the selected moving average.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
DistPercFromEMA(period, timeframe)

Signed percentage distance of the latest close from the selected moving average.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
PriceNearEMA(period, timeframe, distancePerc)

Keeps a ticker when the absolute close-to-average distance is within distancePerc percent.

ParameterTypeDefaultMeaning
periodint50Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
distancePercnumber1.5Maximum 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
PriceNearSMA(period, timeframe, distancePerc)

Keeps a ticker when the absolute close-to-average distance is within distancePerc percent.

ParameterTypeDefaultMeaning
periodint50Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
distancePercnumber1.5Maximum 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
PriceNearAnyEMA(timeframe, distancePerc, periods...)

Keeps a ticker near at least one of the supplied moving-average periods.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
distancePercnumber1.5Maximum absolute percentage distance.
periodsint...requiredOne 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
PriceNearAnySMA(timeframe, distancePerc, periods...)

Keeps a ticker near at least one of the supplied moving-average periods.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
distancePercnumber1.5Maximum absolute percentage distance.
periodsint...requiredOne 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
CrossEMA(period, timeframe, direction)

Latest close crosses the moving average in the selected direction.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
directionstringUpDirection 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")
CrossSMA(period, timeframe, direction)

Latest close crosses the moving average in the selected direction.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
directionstringUpDirection 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")
CrossEMAEMA(fast, slow, timeframe, direction)

The fast EMA crosses the slow EMA on the latest bar.

ParameterTypeDefaultMeaning
fastint20Fast moving-average period.
slowint50Slow moving-average period.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
directionstringUpDirection 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
CrossedEMAWithin(period, timeframe, direction, bars)

Checks for a close-to-moving-average crossover within the latest bars.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
directionstringDownDirection selector; accepted values depend on the function.
barsint5Number 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
CrossedSMAWithin(period, timeframe, direction, bars)

Checks for a close-to-moving-average crossover within the latest bars.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
directionstringDownDirection selector; accepted values depend on the function.
barsint5Number 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
CrossedEMAEMAWithin(fast, slow, timeframe, direction, bars)

Checks recent fast-EMA crossings against the preceding slow-EMA value.

ParameterTypeDefaultMeaning
fastint20Fast moving-average period.
slowint50Slow moving-average period.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
directionstringDownDirection selector; accepted values depend on the function.
barsint5Number 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
EMASlope(period, timeframe)

Normalized regression slope over the latest five moving-average values.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
SMASlope(period, timeframe)

Normalized regression slope over the latest five moving-average values.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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

RSI(period, timeframe)

Latest Relative Strength Index computed with the requested period.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
Value / effect: 0–100

Example

RSI(14, "d") < 30
MACD(fast, slow, signal, timeframe)

Latest MACD line, histogram or signal line, according to the function name.

ParameterTypeDefaultMeaning
fastint12Fast moving-average period.
slowint26Slow moving-average period.
signalint9MACD signal smoothing period.
timeframestringscript timeframeQuote 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
MACDHistogram(fast, slow, signal, timeframe)

Latest MACD line, histogram or signal line, according to the function name.

ParameterTypeDefaultMeaning
fastint12Fast moving-average period.
slowint26Slow moving-average period.
signalint9MACD signal smoothing period.
timeframestringscript timeframeQuote 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
MACDSignal(fast, slow, signal, timeframe)

Latest MACD line, histogram or signal line, according to the function name.

ParameterTypeDefaultMeaning
fastint12Fast moving-average period.
slowint26Slow moving-average period.
signalint9MACD signal smoothing period.
timeframestringscript timeframeQuote 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
ATR(period, timeframe)

Average True Range; ATRPerc normalizes ATR by the latest close.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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

ATR(14, "d") > 2
ATRPerc(period, timeframe)

Average True Range; ATRPerc normalizes ATR by the latest close.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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(period, stdDev, timeframe)

BollingerPosition locates the close between the bands; BollingerWidth measures their normalized width.

ParameterTypeDefaultMeaning
periodint20Lookback or indicator period in bars; see function-specific rules.
stdDevnumber2Bollinger band standard-deviation multiplier.
timeframestringscript timeframeQuote 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
BollingerWidth(period, stdDev, timeframe)

BollingerPosition locates the close between the bands; BollingerWidth measures their normalized width.

ParameterTypeDefaultMeaning
periodint20Lookback or indicator period in bars; see function-specific rules.
stdDevnumber2Bollinger band standard-deviation multiplier.
timeframestringscript timeframeQuote 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
Stochastic(kPeriod, dPeriod, timeframe)

Latest stochastic oscillator (%K) or %D line.

ParameterTypeDefaultMeaning
kPeriodint14Stochastic lookback period.
dPeriodint3Stochastic signal period.
timeframestringscript timeframeQuote 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
StochasticD(kPeriod, dPeriod, timeframe)

Latest stochastic oscillator (%K) or %D line.

ParameterTypeDefaultMeaning
kPeriodint14Stochastic lookback period.
dPeriodint3Stochastic signal period.
timeframestringscript timeframeQuote 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
AvgVolatility(period, timeframe)

Population standard deviation of logarithmic close returns in the latest period bars, multiplied by 100.

ParameterTypeDefaultMeaning
periodint4Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
MomentumSlope(period, timeframe)

Unnormalized linear-regression slope of the latest period closes.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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

Open(timeframe)

Latest opening price.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
Value / effect: price units

Example

Open("d") > 1
High(timeframe)

Latest high.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
Value / effect: price units

Example

High("d") > 1
Low(timeframe)

Latest low.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
Value / effect: price units

Example

Low("d") > 1
Range(timeframe)

Latest high minus low.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
Value / effect: price units

Example

Range("d") > 1
BodySize(timeframe)

Absolute latest close minus open.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
Value / effect: price units

Example

BodySize("d") > 1
UpperWick(timeframe)

High minus max(open, close).

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
Value / effect: price units

Example

UpperWick("d") > 1
LowerWick(timeframe)

min(open, close) minus low.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
Value / effect: price units

Example

LowerWick("d") > 1
IsBullishCandle(timeframe)

Tests latest close > open (bullish) or close < open (bearish).

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote 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
IsBearishCandle(timeframe)

Tests latest close > open (bullish) or close < open (bearish).

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote 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
HighestHigh(period, timeframe)

Highest high or lowest low over the latest period bars, including the current bar.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
Value / effect: price units

Example

HighestHigh(20, "d") > 10
LowestLow(period, timeframe)

Highest high or lowest low over the latest period bars, including the current bar.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
Value / effect: price units

Example

LowestLow(20, "d") > 10
DistancePercFromHigh(period, timeframe)

Signed close distance from the high/low extreme over the latest period bars.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
DistancePercFromLow(period, timeframe)

Signed close distance from the high/low extreme over the latest period bars.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
BreakoutHigh(period, timeframe)

Latest close is above the preceding period highs or below the preceding period lows.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
BreakdownLow(period, timeframe)

Latest close is above the preceding period highs or below the preceding period lows.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
ConsecutiveCandles(n, direction, timeframe)

Counts the uninterrupted latest run of green/red candles with body at least 25% of range.

ParameterTypeDefaultMeaning
nint3History request/count setting; compare the actual count explicitly.
directionstringgreenDirection selector; accepted values depend on the function.
timeframestringscript timeframeQuote 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
HasEqualLows(bars, timeframe, tolerancePerc)

Tests whether recent lows/highs lie within the specified percentage spread.

ParameterTypeDefaultMeaning
barsint3Number of recent bars in the crossover window.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
tolerancePercnumber1Maximum 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
HasEqualHighs(bars, timeframe, tolerancePerc)

Tests whether recent lows/highs lie within the specified percentage spread.

ParameterTypeDefaultMeaning
barsint3Number of recent bars in the crossover window.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
tolerancePercnumber1Maximum 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
HigherHighs(period, timeframe)

Tests the last period local swing highs/lows for strictly increasing/decreasing values.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LowerLows(period, timeframe)

Tests the last period local swing highs/lows for strictly increasing/decreasing values.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
InsideBar(timeframe)

Latest candle lies within the previous candle; returns the previous high-low range divided by its high × 100.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
Value / effect: previous range percent

This is not a 1/0 predicate. Use IsInsideBar(timeframe) == 1 for the boolean candlestick variant.

Example

InsideBar("d") < 3
NarrowRangeBar(nrBars, lookback, timeframe)

Latest range is the smallest of the latest nrBars ranges; returns latest range / average lookback range × 100.

ParameterTypeDefaultMeaning
nrBarsint7Number of ranges compared for the narrowest latest range.
lookbackint20History window in bars.
timeframestringscript timeframeQuote 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
PriceNearLevel(price, distancePerc)

Keeps a daily close within distancePerc percent of an absolute positive price level.

ParameterTypeDefaultMeaning
pricenumber0Absolute price level; must be positive.
distancePercnumber2Maximum 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
GapUp(minGapPercent, timeframe)

Full candle-range gap on the latest bar, beyond the chosen minimum.

ParameterTypeDefaultMeaning
minGapPercentnumber1Minimum magnitude of the full candle-range gap.
timeframestringscript timeframeQuote 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.

Example

GapUp(1, "d")
GapDown(minGapPercent, timeframe)

Full candle-range gap on the latest bar, beyond the chosen minimum.

ParameterTypeDefaultMeaning
minGapPercentnumber1Minimum magnitude of the full candle-range gap.
timeframestringscript timeframeQuote 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.

Example

GapDown(1, "d")

Trend and price lock

IsUpTrend(period, timeframe)

Confirmed trend combining regression slope sign, close position versus EMA(period), and regression R² ≥ 0.3.

ParameterTypeDefaultMeaning
periodint30Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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")
IsDownTrend(period, timeframe)

Confirmed trend combining regression slope sign, close position versus EMA(period), and regression R² ≥ 0.3.

ParameterTypeDefaultMeaning
periodint30Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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")
WasUpTrend(period, timeframe, barsAgo)

Applies the trend criteria to a period-bar window ending barsAgo bars before the latest bar.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
barsAgoint5Historical 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
WasDownTrend(period, timeframe, barsAgo)

Applies the trend criteria to a period-bar window ending barsAgo bars before the latest bar.

ParameterTypeDefaultMeaning
periodint14Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
barsAgoint5Historical 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
IsPriceLocked(period, timeframe)

Percentage range of recent closing prices: (maximum - minimum) / minimum × 100.

ParameterTypeDefaultMeaning
periodint20Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
IsOPALocked(period, timeframe)

Percentage range of recent closing prices: (maximum - minimum) / minimum × 100.

ParameterTypeDefaultMeaning
periodint20Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
IsNotPriceLocked(period, timeframe)

Keeps tickers whose closing-price range is at least 0.5%.

ParameterTypeDefaultMeaning
periodint20Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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

LookForFlag(period, timeframe)

Finds a continuation flag; the Bull/Bear variants select its direction.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForBullFlag(period, timeframe)

Finds a continuation flag; the Bull/Bear variants select its direction.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForBearFlag(period, timeframe)

Finds a continuation flag; the Bull/Bear variants select its direction.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForFlagBreakout(period, timeframe, tolerancePercent)

Finds a confirmed flag breakout; Bull/Bear variants restrict direction.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
tolerancePercentnumber0.5Allowed 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
LookForBullFlagBreakout(period, timeframe, tolerancePercent)

Finds a confirmed flag breakout; Bull/Bear variants restrict direction.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
tolerancePercentnumber0.5Allowed 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
LookForBearFlagBreakout(period, timeframe, tolerancePercent)

Finds a confirmed flag breakout; Bull/Bear variants restrict direction.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
tolerancePercentnumber0.5Allowed 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
LookForAscendingTriangle(period, timeframe)

Detects ascending, descending or symmetrical triangle geometry.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForDescendingTriangle(period, timeframe)

Detects ascending, descending or symmetrical triangle geometry.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForSymmetricTriangle(period, timeframe)

Detects ascending, descending or symmetrical triangle geometry.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForTriangleBreakOut(timeframe, showOnlyBreakout, nrLastCandleSignal)

Legacy triangle entry point with inconsistent timeframe handling; it does not enforce a breakout-only condition.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
showOnlyBreakoutlegacyrequiredLegacy argument ignored by this implementation.
nrLastCandleSignallegacyrequiredLegacy 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

LookForAscendingTrendLine(nrCandles, timeframe, tolerancePercent)

Compatibility wrapper for a rising trendline built from lows.

ParameterTypeDefaultMeaning
nrCandlesint120Trendline history request in bars.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
tolerancePercentnumber2Allowed 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
LookForTrendline(source, timeframe, lookback, minTouches, maxAge, tolerancePercent, direction)

Finds a recent valid trendline near the current close.

ParameterTypeDefaultMeaning
sourcestringLowLow, High or Close.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
lookbackint120History window in bars.
minTouchesint3Minimum aligned touches.
maxAgeint15Maximum bars since the latest touch.
tolerancePercentnumber1.5Allowed distance/deviation in percent.
directionstringAnyDirection 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
LookForChannel(timeframe, lookback, minTouches, maxAge, tolerancePercent, maxWidthPercent)

Finds a valid support/resistance channel near the latest price; variants select its direction.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
lookbackint120History window in bars.
minTouchesint3Minimum aligned touches.
maxAgeint20Maximum bars since the latest touch.
tolerancePercentnumber1.5Allowed distance/deviation in percent.
maxWidthPercentnumber18Maximum 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
LookForRisingChannel(timeframe, lookback, minTouches, maxAge, tolerancePercent, maxWidthPercent)

Finds a valid support/resistance channel near the latest price; variants select its direction.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
lookbackint120History window in bars.
minTouchesint3Minimum aligned touches.
maxAgeint20Maximum bars since the latest touch.
tolerancePercentnumber1.5Allowed distance/deviation in percent.
maxWidthPercentnumber18Maximum 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
LookForFallingChannel(timeframe, lookback, minTouches, maxAge, tolerancePercent, maxWidthPercent)

Finds a valid support/resistance channel near the latest price; variants select its direction.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
lookbackint120History window in bars.
minTouchesint3Minimum aligned touches.
maxAgeint20Maximum bars since the latest touch.
tolerancePercentnumber1.5Allowed distance/deviation in percent.
maxWidthPercentnumber18Maximum 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
LookForHorizontalChannel(timeframe, lookback, minTouches, maxAge, tolerancePercent, maxWidthPercent)

Finds a valid support/resistance channel near the latest price; variants select its direction.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
lookbackint120History window in bars.
minTouchesint3Minimum aligned touches.
maxAgeint20Maximum bars since the latest touch.
tolerancePercentnumber1.5Allowed distance/deviation in percent.
maxWidthPercentnumber18Maximum 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

FiboNearLevel(period, timeframe, level, tolerancePercent)

Finds a retracement and compares absolute current distance to the requested Fibonacci level.

ParameterTypeDefaultMeaning
periodint63Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
levelnumber61.8Fibonacci retracement level in percent.
tolerancePercentnumber2Allowed 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
LookForFibonacci(period, timeframe, level, tolerancePercent)

Finds a Fibonacci retracement near the selected level; directional variants filter bullish or bearish structures.

ParameterTypeDefaultMeaning
periodint63Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
levelnumber61.8Fibonacci retracement level in percent.
tolerancePercentnumber2Allowed 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
LookForBullishFibonacci(period, timeframe, level, tolerancePercent)

Finds a Fibonacci retracement near the selected level; directional variants filter bullish or bearish structures.

ParameterTypeDefaultMeaning
periodint63Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
levelnumber61.8Fibonacci retracement level in percent.
tolerancePercentnumber2Allowed 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
LookForBearishFibonacci(period, timeframe, level, tolerancePercent)

Finds a Fibonacci retracement near the selected level; directional variants filter bullish or bearish structures.

ParameterTypeDefaultMeaning
periodint63Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
levelnumber61.8Fibonacci retracement level in percent.
tolerancePercentnumber2Allowed 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

LookForDoubleTop(period, timeframe, minBarsBetweenPeaks)

Detects a double top using separated peaks.

ParameterTypeDefaultMeaning
periodint3000Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
minBarsBetweenPeaksint10Minimum 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
LookForDoubleBottom(period, timeframe)

Searches a double bottom with the latest candle as the second-bottom candidate.

ParameterTypeDefaultMeaning
periodint3000Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForHeadAndShoulders(period, timeframe)

Detects a bearish head-and-shoulders top or bullish inverse structure.

ParameterTypeDefaultMeaning
periodint120Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForInverseHS(period, timeframe)

Detects a bearish head-and-shoulders top or bullish inverse structure.

ParameterTypeDefaultMeaning
periodint120Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForInverseHeadAndShoulders(period, timeframe)

Detects a bearish head-and-shoulders top or bullish inverse structure.

ParameterTypeDefaultMeaning
periodint120Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForRoundedBottom(period, timeframe, maxDistancePct)

Detects a rounded bottom/top still approaching its breakout level.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
maxDistancePctnumber7Maximum 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
LookForRoundedTop(period, timeframe, maxDistancePct)

Detects a rounded bottom/top still approaching its breakout level.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
maxDistancePctnumber7Maximum 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
LookForParabolicRun(period, timeframe)

Detects an accelerating parabolic price run.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForWedge(period, timeframe)

Detects converging wedge geometry; directional variants select rising or falling wedges.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForRisingWedge(period, timeframe)

Detects converging wedge geometry; directional variants select rising or falling wedges.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForFallingWedge(period, timeframe)

Detects converging wedge geometry; directional variants select rising or falling wedges.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForCupWithHandle(period, timeframe)

Rounded bullish cup followed by a shallow handle.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForInvertedCupWithHandle(period, timeframe)

Bearish mirror of cup with handle.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForVCP(period, timeframe)

Progressive range and volume contraction.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForVolatilityContraction(period, timeframe)

Alias of LookForVCP.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForRectangle(period, timeframe)

Horizontal range bounded by repeated support and resistance.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForFlatBase(period, timeframe)

Tight horizontal base using the rectangle detector with tighter width settings.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForDarvasBox(period, timeframe)

Darvas-style horizontal price box.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForTripleTop(period, timeframe)

Three aligned upper pivots.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForTripleBottom(period, timeframe)

Three aligned lower pivots.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForBroadening(period, timeframe)

Expanding megaphone structure.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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

LookForVolumePriceDivergence(period, timeframe)

Price extreme accompanied by contracting average volume.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForVolumeClimaxReversal(period, timeframe)

Wide high-volume candle closing against the preceding move.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForVolatilitySqueeze(period, timeframe)

Range contraction followed by current-bar expansion.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForBreakoutRetest(period, timeframe)

Recent local-level break followed by a controlled retest.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForFailedBreakout(period, timeframe)

False break back into a recent range.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForWyckoffSpring(period, timeframe)

Downside false-break variant.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForWyckoffUpthrust(period, timeframe)

Upside false-break variant.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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

LookForOneTwoThreeReversal(period, timeframe)

Three-point reversal with a break of point 2. Point 1 is its invalidation level.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForQuasimodo(period, timeframe)

Simplified Quasimodo / Over-and-Under swing reversal.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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
LookForIslandReversal(period, timeframe)

Isolated bar or cluster separated by full gaps on both sides.

ParameterTypeDefaultMeaning
periodint80Lookback or indicator period in bars; see function-specific rules.
timeframestringscript timeframeQuote 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

IsDoji(timeframe)

Body strictly smaller than 10% of a positive total range.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote 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

IsDoji("d") == 1
IsHammer(timeframe)

Small body with a dominant lower wick.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote 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
IsShootingStar(timeframe)

Small body with a dominant upper wick.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote 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
IsInvertedHammer(timeframe)

Alias of IsShootingStar in this worker; no separate bullish trend-context test.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote 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
IsBullishMarubozu(timeframe)

Bullish candle with very short wicks.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote 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
IsBearishMarubozu(timeframe)

Bearish candle with very short wicks.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote 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
IsBullishEngulfing(timeframe)

Bullish current body engulfs the previous bearish body.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote 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
IsBearishEngulfing(timeframe)

Bearish current body engulfs the previous bullish body.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote 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
IsInsideBar(timeframe)

Current high/low range is contained in the preceding range.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote 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

IsInsideBar("d") == 1
IsBullishHarami(timeframe)

Small bullish body within the previous bearish body.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote 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
IsBearishHarami(timeframe)

Small bearish body within the previous bullish body.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote 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
IsPiercingLine(timeframe)

Bullish recovery through the preceding bearish body midpoint.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote 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
IsDarkCloudCover(timeframe)

Bearish reversal through the preceding bullish body midpoint.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote 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
IsBullishTweezer(timeframe)

Bullish reversal with approximately aligned lows.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote 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
IsBearishTweezer(timeframe)

Bearish reversal with approximately aligned highs.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote 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
IsOutsideBar(timeframe)

Current range contains the preceding range.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote 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

IsOutsideBar("d") == 1
IsNR7(timeframe)

Latest high-low range is strictly smaller than each of the preceding six ranges.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote 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

IsNR7("d") == 1
IsBullishPinBar(timeframe)

Bullish hammer geometry.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote 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
IsBearishPinBar(timeframe)

Bearish shooting-star geometry.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote 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
IsGapFilled(timeframe)

Current bar fills the full gap that separates its opening from the previous range.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote 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
IsMorningStar(timeframe)

Three-candle bullish star reversal.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote 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
IsEveningStar(timeframe)

Three-candle bearish star reversal.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote 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
IsGapUp(timeframe, lookback)

Finds at least one full upward/downward range gap of 0.5% or more in the latest lookback bars.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
lookbackint1History 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
IsGapDown(timeframe, lookback)

Finds at least one full upward/downward range gap of 0.5% or more in the latest lookback bars.

ParameterTypeDefaultMeaning
timeframestringscript timeframeQuote interval; defaults to the stored script timeframe.
lookbackint1History 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

AddSignal(text)

Accepted compatibility placeholder; does not write a custom signal or change the result set.

ParameterTypeDefaultMeaning
textstringrequiredCompatibility 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")
SetFilter(label)

Accepted compatibility placeholder; does not update ticker filters.

ParameterTypeDefaultMeaning
labelstringrequiredCompatibility 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 / signatureWorker 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