Contents
- abs
- add
- all_time_high
- all_time_low
- and
- approx
- aroon_down
- aroon_osc
- aroon_up
- atr
- bb_lower
- bb_upper
- bb_width
- cci
- change
- cond
- count
- cross
- crossover
- crossunder
- cumsum
- days_since
- dev
- deviation
- div
- ema
- eq
- falling
- floordiv
- gain
- gt
- gte
- highest
- highest_bars_ago
- hma
- kc_lower
- kc_middle
- kc_upper
- kcw
- loss
- lowest
- lowest_bars_ago
- lt
- lte
- macd_histogram
- macd_line
- macd_signal
- max
- mean
- median
- mfi
- min
- mod
- mom
- months_since
- mul
- ne
- obv
- offset
- or
- pct_change
- percentrank
- pivothigh
- pivotlow
- pow
- range
- rising
- roc
- rsi
- sma
- sqrt
- stdev
- stoch_d
- stoch_k
- streak
- sub
- sum
- swma
- true_range
- universe_percentile
- variance
- vwma
- weeks_since
- wilderma
- williams_r
- wma
- years_since
No matches
pct_change
Percent Change between two values
pct_change(current, base)
Parameters
| Name | Type | Description |
|---|---|---|
current |
field | Current/new value (numerator difference component) |
base |
field | Base/reference value (denominator) |
Formula
pct_change = ((current - base) / base) * 100
Examples
// Daily change: close vs previous close
pct_change(close, close[1]) > 5; // Up more than 5% from yesterday
// Gap percentage: open vs previous close
pct_change(open, close[1]) > 2; // Gapped up more than 2%
// Intraday range: high vs low
pct_change(high, low) > 3; // Bar range exceeds 3%
// Weekly momentum
pct_change(close, close[5]) > 10; // Up more than 10% over 5 bars
// Compare to moving average
pct_change(close, sma(close, 20)) > 5; // 5%+ above 20-day SMA
// Volume surge vs average
pct_change(volume, sma(volume, 20)) > 100; // Volume 2x+ average
// Find big losers
pct_change(close, close[1]) < -5; // Down more than 5% today
// Compare high to previous high
pct_change(high, high[1]) > 0; // Higher high (any amount)
Returns
float
Notes
Returns NULL when base = 0 (division guarded via NULLIF); stocks with a NULL result are excluded from scan results. Unlike roc(), accepts two independent values instead of an implicit lag.