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
cumsum
Running total from start of data
cumsum(source)
Parameters
| Name | Type | Description |
|---|---|---|
source |
field | Data series to accumulate |
Formula
cumsum[n] = source[0] + source[1] + source[2] + ... + source[n]
Examples
// lifetime volume exceeds 1 billion shares
cumsum(volume) > 1B;
// more lifetime gains than losses (long-term uptrend)
cumsum(gain(close)) > cumsum(loss(close));
// stocks with at least 100 bullish days in history
cumsum(cond(close > open, 1, 0)) >= 100;
// net change from first recorded price
cumsum(change(close, 1)) > 0;
Returns
float
Notes
Scans the entire price history for each symbol, so use additional filters to limit the universe or the scan may time out; unlike sum(source, n)'s rolling window of N bars, cumsum() has no period parameter and always accumulates from the start of data; the result grows continuously, always increasing for a monotonic series like volume