pond-ts 0.66.0 → 0.68.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +244 -0
- package/API.md +146 -123
- package/CHANGELOG.md +188 -1
- package/README.md +20 -0
- package/dist/batch/partitioned-time-series.d.ts +37 -19
- package/dist/batch/time-series.d.ts +2 -2
- package/package.json +29 -4
package/API.md
CHANGED
|
@@ -30,7 +30,7 @@ next door is the point.
|
|
|
30
30
|
| `packages/core` | `pond-ts` | `.` and `./types` (zero-runtime schema contract) | `website/docs/pond-ts/` |
|
|
31
31
|
| `packages/react` | `@pond-ts/react` | `.` | `website/docs/react/` |
|
|
32
32
|
| `packages/charts` | `@pond-ts/charts` | `.` | `website/docs/charts/` |
|
|
33
|
-
| `packages/financial` | `@pond-ts/financial` |
|
|
33
|
+
| `packages/financial` | `@pond-ts/financial` | `.`, `./fluent` (prototype augmentation), `./catalog` | `website/docs/financial/` |
|
|
34
34
|
| `packages/fit` | `@pond-ts/fit` | `.` | `website/docs/fit/` |
|
|
35
35
|
| `packages/process` | `@pond-ts/process` | `.` and `./pool` (Node worker pool) — **experimental** | `website/docs/process/` |
|
|
36
36
|
|
|
@@ -40,13 +40,13 @@ next door is the point.
|
|
|
40
40
|
|
|
41
41
|
### Series classes & construction
|
|
42
42
|
|
|
43
|
-
| Export | Purpose
|
|
44
|
-
| ----------------------- |
|
|
45
|
-
| `TimeSeries` | Immutable time-indexed collection, columnar storage
|
|
46
|
-
| `ValueSeries` | Series keyed by a monotonic non-time value axis
|
|
47
|
-
| `PartitionedTimeSeries` | Scoped view for per-partition stateful transforms
|
|
48
|
-
| `Sequence` | Infinite grid of time buckets (daily, hourly, every N)
|
|
49
|
-
| `BoundedSequence` | Finite ordered list of explicit interval buckets
|
|
43
|
+
| Export | Purpose | Source |
|
|
44
|
+
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
|
|
45
|
+
| `TimeSeries` | Immutable time-indexed collection, columnar storage | `packages/core/src/batch/time-series.ts` |
|
|
46
|
+
| `ValueSeries` | Series keyed by a monotonic non-time value axis | `packages/core/src/batch/value-series.ts` |
|
|
47
|
+
| `PartitionedTimeSeries` | Scoped view for per-partition stateful transforms; `<S, K, By>` — `By` is the partition column names, carried into `aggregate` / `rolling` result types | `packages/core/src/batch/partitioned-time-series.ts` |
|
|
48
|
+
| `Sequence` | Infinite grid of time buckets (daily, hourly, every N) | `packages/core/src/sequence/sequence.ts` |
|
|
49
|
+
| `BoundedSequence` | Finite ordered list of explicit interval buckets | `packages/core/src/sequence/bounded-sequence.ts` |
|
|
50
50
|
|
|
51
51
|
Static constructors on `TimeSeries`: `fromJSON()` (row tuples/objects),
|
|
52
52
|
`fromColumns()` (struct-of-arrays; `number` + `string` value columns),
|
|
@@ -125,10 +125,11 @@ Value-axis wire types
|
|
|
125
125
|
`arrayContainsAny()`, `arrayAggregate()`, `arrayExplode()`
|
|
126
126
|
- **Gap fill / dedupe**: `fill()`, `materialize()`, `dedupe()`
|
|
127
127
|
- **Aggregate/group**: `aggregate(sequence, spec)`, `reduce()`, `groupBy()`,
|
|
128
|
-
`partitionBy()`, `byColumn()` (
|
|
128
|
+
`partitionBy()`, `byColumn(col, bins, mapping)` (numeric binning of a column into
|
|
129
|
+
fixed-`width` or explicit-`edges` bins, then reduce per bin — histograms),
|
|
129
130
|
`rollingByColumn()`, `byValue(axis)` (project onto a `ValueSeries`)
|
|
130
131
|
- **Windowing/smoothing**: `rolling(window, spec, opts)`, `smooth(column,
|
|
131
|
-
method)` (
|
|
132
|
+
method, opts)` (`'ema'` / `'movingAverage'` / `'loess'`), `align(method, opts)`
|
|
132
133
|
- **Differential/statistical**: `diff()`, `rate()`, `pctChange()`,
|
|
133
134
|
`cumulative()`, `scan()` (custom stateful reducer), `shift()`, `baseline()`
|
|
134
135
|
(rolling avg/sd/bands), `outliers()` (deviation from baseline)
|
|
@@ -441,112 +442,117 @@ study whose centre line is the caller's own field
|
|
|
441
442
|
appends only the bands (`atrBands`: no `Middle`), since the middle is already
|
|
442
443
|
on the series.
|
|
443
444
|
|
|
444
|
-
| Study | Output column(s) | Options gist
|
|
445
|
-
| --------------------------- | -------------------------------------------------------------------------- |
|
|
446
|
-
| `sma` | `sma` | `{ period, column?, output? }`
|
|
447
|
-
| `ema` | `ema` | `{ period, column?, output? }` (α = 2/(period+1))
|
|
448
|
-
| `movingAverage` | `ma` | `{ period, type?, column?, output? }` — the shared `MaType` menu (default `'sma'`)
|
|
449
|
-
| `bollinger` | `bbMiddle`, `bbUpper`, `bbLower` | `{ period, stdDev?, column?, prefix? }`
|
|
450
|
-
| `envelope` | `envMiddle`, `envUpper`, `envLower` | `{ period, percent?, maType?, column?, prefix? }`
|
|
451
|
-
| `rollingStdev` | `stdev` | `{ period, column?, output? }` (population, ddof=0)
|
|
452
|
-
| `rollingMin` / `rollingMax` | `min` / `max` | `{ period, column?, output? }` (one edge; `donchian` gives the channel)
|
|
453
|
-
| `rollingPercentile` | `p{q}` (e.g. `p90`) | `{ period, q, column?, output? }`
|
|
454
|
-
| `zScore` | `zscore` | `{ period, column?, output? }`
|
|
455
|
-
| `percentChange` | `pctChange` | `{ periods?, column?, output? }` (= ROC; TA-Lib-verified)
|
|
456
|
-
| `rsi` | `rsi` | `{ period?, column?, output? }` (Wilder, default 14)
|
|
457
|
-
| `macd` | `macdLine`, `macdSignal`, `macdHist` | `{ fastPeriod?, slowPeriod?, signalPeriod?, column?, prefix? }` (12/26/9)
|
|
458
|
-
| `atr` | `atr` | `{ period?, high?, low?, close?, output? }` (Wilder, default 14)
|
|
459
|
-
| `momentum` | `momentum` | `{ period?, column?, output? }` (`v − v[−period]`, default 10)
|
|
460
|
-
| `historicalVolatility` | `hv` | `{ period?, annualize?, column?, output? }` (σ of log returns, ×√252)
|
|
461
|
-
| `stochastic` | `stochK`, `stochD` | `{ kPeriod?, slowing?, dPeriod?, high?, low?, close?, prefix? }` (14/3/3; `slowing: 1` = fast)
|
|
462
|
-
| `williamsR` | `williamsR` | `{ period?, high?, low?, close?, output? }` (default 14, bounded −100..0)
|
|
463
|
-
| `donchian` | `dcUpper`, `dcLower`, `dcMiddle` | `{ period?, high?, low?, prefix? }` (default 20)
|
|
464
|
-
| `obv` | `obv` | `{ close?, volume?, output? }` (no period; TA-Lib seed `volume[0]`)
|
|
465
|
-
| `vwap` | `vwap` | `{ period, high?, low?, close?, volume?, output? }` (rolling, typical px)
|
|
466
|
-
| `keltner` | `kcMiddle`, `kcUpper`, `kcLower` | `{ period?, atrPeriod?, multiplier?, maType?, high?, low?, close?, prefix? }` (modern variant: EMA(20) of typical price ± 2·ATR(10))
|
|
467
|
-
| `atrBands` | `atrbUpper`, `atrbLower` | `{ period?, multiplier?, column?, high?, low?, close?, prefix? }` (14/2; **no middle** — it is `column`)
|
|
468
|
-
| `qstick` | `qstick` | `{ period?, maType?, open?, close?, output? }` (MA of `close − open`, default 8/sma)
|
|
469
|
-
| `trix` | `trix`, `trixSignal` | `{ period?, signalPeriod?, column?, prefix? }` (1-bar % ROC of EMA³, 15/9; the line takes the prefix itself)
|
|
470
|
-
| `coppock` | `coppock` | `{ longPeriod?, shortPeriod?, wmaPeriod?, column?, output? }` (WMA of ROC₁₄+ROC₁₁, 14/11/10 — monthly by convention)
|
|
471
|
-
| `priceOscillator` | `priceOsc` | `{ fastPeriod?, slowPeriod?, maType?, mode?, column?, output? }` (12/26/ema, percent = PPO, `mode: 'absolute'` = APO)
|
|
472
|
-
| `disparityIndex` | `disparity` | `{ period?, maType?, column?, output? }` (`100·(price − MA)/MA`, default 14/sma)
|
|
473
|
-
| `detrendedPriceOscillator` | `dpo` | `{ period?, maType?, column?, output? }` (`price − MA[i − ⌊period/2⌋−1]`, default 20/sma)
|
|
474
|
-
| `elderRay` | `elderBull`, `elderBear` | `{ period?, high?, low?, close?, prefix? }` (`high/low − EMA(close)`, default 13)
|
|
475
|
-
| `awesomeOscillator` | `ao` | `{ fastPeriod?, slowPeriod?, high?, low?, output? }` (SMA 5 − SMA 34 of `(high+low)/2`)
|
|
476
|
-
| `accumulationDistribution` | `ad` | `{ high?, low?, close?, volume?, output? }` (no period; cumulative CLV·volume, = TA-Lib `AD`)
|
|
477
|
-
| `chaikinOscillator` | `chaikinOsc` | `{ fastPeriod?, slowPeriod?, high?, low?, close?, volume?, output? }` (EMA 3 − EMA 10 of A/D, = TA-Lib `ADOSC`)
|
|
478
|
-
| `priceVolumeTrend` | `pvt` | `{ close?, volume?, output? }` (no period; cumulative fractional-change·volume; bar 0 undefined)
|
|
479
|
-
| `chaikinMoneyFlow` | `cmf` | `{ period?, high?, low?, close?, volume?, output? }` (Σ CLV·vol / Σ vol over 20, bounded −1..+1)
|
|
480
|
-
| `moneyFlowIndex` | `mfi` | `{ period?, high?, low?, close?, volume?, output? }` (RSI form on typical-price·volume, default 14, = TA-Lib `MFI`)
|
|
481
|
-
| `forceIndex` | `force` | `{ period?, close?, volume?, output? }` (EMA of Δclose·volume, Elder's 13; `period: 1` is the raw force)
|
|
482
|
-
| `easeOfMovement` | `eom` | `{ period?, maType?, scale?, high?, low?, volume?, output? }` (Arms' box ratio, 14/sma/1e8; quadratic in price)
|
|
483
|
-
| `volumeOscillator` | `volOsc` | `{ fastPeriod?, slowPeriod?, maType?, volume?, output? }` (5/10/sma; `priceOscillator` percent-mode over volume)
|
|
484
|
-
| `chandeMomentum` | `cmo` | `{ period?, column?, output? }` (Chande's **unsmoothed** up/down sums, default 14 — _not_ TA-Lib's CMO, which is `2·rsi − 100`)
|
|
485
|
-
| `ultimateOscillator` | `uo` | `{ shortPeriod?, mediumPeriod?, longPeriod?, high?, low?, close?, output? }` (7/14/28 weighted 4/2/1; TA-Lib `ULTOSC`)
|
|
486
|
-
| `commodityChannelIndex` | `cci` | `{ period?, high?, low?, close?, output? }` (`(tp − SMA)/(0.015 · meanAbsDev)`, default 20; TA-Lib `CCI`)
|
|
487
|
-
| `intradayMomentumIndex` | `imi` | `{ period?, open?, close?, output? }` (RSI's form over `close − open`, **plain** sums, default 14)
|
|
488
|
-
| `relativeVigorIndex` | `rvi`, `rviSignal` | `{ period?, open?, high?, low?, close?, prefix? }` (SWMA `(1,2,2,1)/6` body/range sums + SWMA signal, default 10)
|
|
489
|
-
| `psychologicalLine` | `psy` | `{ period?, column?, output? }` (percent of **up** closes, strict `>`, default 12)
|
|
490
|
-
| `directionalMovement` | `dmiPlusDi`, `dmiMinusDi`, `dmiDx`, `dmiAdx`, `dmiAdxr` | `{ period?, high?, low?, close?, prefix? }` (Wilder's DMS — `+DI`/`−DI`/`DX`/`ADX`/`ADXR`, default 14; per-column warm-up; Wilder's seed, so a decaying transient vs TA-Lib)
|
|
491
|
-
| `aroon` | `aroonUp`, `aroonDown`, `aroonOsc` | `{ period?, high?, low?, prefix? }` (`100·(period − bars since extreme)/period` over a **`period + 1`**-bar window, default 25; = TA-Lib `AROON`/`AROONOSC`)
|
|
492
|
-
| `vortex` | `viPlus`, `viMinus` | `{ period?, high?, low?, close?, prefix? }` (`Σ\|H − prevL\| / Σ TR` and `Σ\|L − prevH\| / Σ TR`, default 14; positive, not bounded by 1)
|
|
493
|
-
| `chaikinVolatility` | `chaikinVol` | `{ period?, rocPeriod?, high?, low?, output? }` (percent ROC of EMA(`high − low`), 10/10; **plain** range)
|
|
494
|
-
| `massIndex` | `mass` | `{ emaPeriod?, sumPeriod?, high?, low?, output? }` (Σ EMA(range)/EMA² over 25, Dorsey's 9/25; a **sum**, reads ≈ `sumPeriod`)
|
|
495
|
-
| `choppinessIndex` | `chop` | `{ period?, high?, low?, close?, output? }` (`100·log10(ΣTR/(HH−LL))/log10(period)`, default 14, bounded 0..100; `period ≥ 2`)
|
|
496
|
-
| `ulcerIndex` | `ulcer` | `{ period?, column?, output? }` (RMS % drawdown from the rolling peak, StockCharts' rolling form, default 14; warm-up `2·period−2`)
|
|
497
|
-
| `verticalHorizontalFilter` | `vhf` | `{ period?, column?, output? }` ((HH−LL)/Σ\|Δcolumn\| over 28, Adam White's; a **fraction** in (0, 1], warm-up `period`)
|
|
498
|
-
| `gopalakrishnanRangeIndex` | `gapo` | `{ period?, high?, low?, output? }` (`ln(HH−LL)/ln(period)` = log base `period` of the range, default 10; `period ≥ 2`)
|
|
499
|
-
| `relativeVolatilityIndex` | `relVol` | `{ period?, stdevPeriod?, column?, output? }` (RSI's form on σ, Wilder-smoothed, Dorsey's 14/10 — **not** `rvi`, see below)
|
|
500
|
-
| `linearRegression` | `linregValue`, `linregSlope`, `linregIntercept`, `linregAngle`, `linregR2` | `{ period?, column?, prefix? }` (one rolling OLS fit against the bar index, default 14, `period ≥ 2`; `Value` = TA-Lib `LINEARREG`, `Intercept` = the fit at the window's **first** bar, `Angle` = degrees and **scale-dependent**)
|
|
501
|
-
| `timeSeriesForecast` | `tsf` | `{ period?, column?, output? }` (the same fit one bar **past** the window, default 14; = TA-Lib `TSF`; deliberately not a `MaType`)
|
|
502
|
-
| `chandeForecastOscillator` | `cfo` | `{ period?, column?, output? }` (`100·(price − TSF)/price`, default 14; scale-invariant, **not** shift-invariant)
|
|
503
|
-
| `centerOfGravity` | `cog` | `{ period?, column?, output? }` (Ehlers' position-weighted balance point, default 10; **negative**, in `[−period, −1]` on positive prices, flat reads `−(period+1)/2` — TradingView's uncentred convention)
|
|
504
|
-
| `correlation` | `corr` | `{ period?, column?, benchmark, output? }` (Pearson r of two columns over 30 bars, = TA-Lib `CORREL`; `benchmark` is a **column on the same joined series**, required)
|
|
505
|
-
| `beta` | `beta` | `{ period?, column?, benchmark, output? }` (slope of `column`'s 1-bar returns on `benchmark`'s over 5 bars, = TA-Lib `BETA(benchmark, column)`; pass **prices**, returns taken inside)
|
|
506
|
-
| `priceRelative` | `priceRel` | `{ column?, benchmark, output? }` (`column / benchmark`, no period — ChartIQ's Price Relative / Relative Strength **comparative**; not `rsi`)
|
|
507
|
-
| `performanceIndex` | `perf` | `{ period?, column?, benchmark, output? }` (each side's own `period`-bar growth, divided; 1 = parity, default 20; `(x−1)·100` == `percentChange(priceRelative)`)
|
|
508
|
-
| `guppy` | `gmmaS3`…`gmmaS15`, `gmmaL30`…`gmmaL60` | `{ column?, type?, prefix? }` (Guppy's GMMA — the **fixed** twelve averages, short 3/5/8/10/12/15, long 30/35/40/45/50/60, default `ema`; the lists ship as `GUPPY_SHORT_PERIODS` / `GUPPY_LONG_PERIODS`)
|
|
509
|
-
| `rainbow` | `rainbow1`…`rainbow10` | `{ column?, period?, type?, prefix? }` (Widner's Rainbow — ten **recursive** averages, each smoothing the previous; default period 2 / `sma`; stage `k` warms up at `k·(period−1)`)
|
|
510
|
-
| `rainbowOscillator` | `rbo`, `rboUpper`, `rboLower` | `{ column?, period?, lookback?, type?, prefix? }` (ChartIQ's — `100·(price − mean of the ten)/(HH−LL)` with the stack's own width as mirrored bands; default 2 / 10)
|
|
511
|
-
| `kst` | `kst`, `kstSignal` | `{ column?, signalPeriod?, prefix? }` (Pring's Know Sure Thing — ROC 10/15/20/30 smoothed 10/10/10/15, weighted 1/2/3/4; the twelve numbers are **not** options, only the signal SMA is, default 9)
|
|
512
|
-
| `priceMomentumOscillator` | `pmo`, `pmoSignal` | `{ column?, prefix? }` (DecisionPoint's PMO — two stages of **custom** `α = 2/n` smoothing over a 1-bar percent ROC, ×10, with a **span** EMA(10) signal; no period options)
|
|
513
|
-
| `stochasticRsi` | `stochRsiK`, `stochRsiD` | `{ column?, rsiPeriod?, stochPeriod?, kPeriod?, dPeriod?, prefix? }` (the stochastic construction over the RSI, 14/14/3/3; `stochRsiK` == TA-Lib `STOCHRSI`'s **fastd**, `stochRsiD` has no TA-Lib counterpart)
|
|
514
|
-
| `trueStrengthIndex` | `tsi`, `tsiSignal` | `{ column?, longPeriod?, shortPeriod?, signalPeriod?, prefix? }` (Blau's TSI — `100·EMA(EMA(Δ,long),short)/EMA(EMA(\|Δ\|,long),short)`, 25/13/7; bounded −100…100, long applied **first**)
|
|
515
|
-
| `movingAverageDeviation` | `maDev` | `{ period?, maType?, column?, output? }` (`price − MA`, in **price units**, default 20/sma — the points half of the pair whose percent half IS `disparityIndex`; no `mode` flag)
|
|
516
|
-
| `parabolicSar` | `psar`, `psarTrend` | `{ step?, maxStep?, high?, low?, prefix? }` (Wilder's stop-and-reverse, defaults 0.02 / 0.2; **= TA-Lib `SAR` exactly**; `Trend` is `+1` long / `−1` short — the stop can print ON an extreme, so the side is not derivable from the value)
|
|
517
|
-
| `superTrend` | `st`, `stTrend` | `{ period?, multiplier?, high?, low?, close?, prefix? }` (Seban's ratcheting ATR band as TradingView's `ta.supertrend`, defaults 10 / 3; `st` **is** the live band, so the bands are not emitted; the seed side is DOWN)
|
|
518
|
-
| `atrTrailingStop` | `ats`, `atsTrend` | `{ period?, multiplier?, high?, low?, close?, prefix? }` (close-anchored ratcheting stop, Vervoort's, defaults 14 / 3; a close exactly ON the stop flips **short**; the Chandelier anchor is `donchian` + `atr`, not a knob)
|
|
519
|
-
| `negativeVolumeIndex` | `nvi` | `{ column?, volume?, output?, start? }` (Fosback: compound the close return only on a **lower**-volume bar, base 1000; no period, no warm-up; a **flat** volume holds on both indices)
|
|
520
|
-
| `positiveVolumeIndex` | `pvi` | `{ column?, volume?, output?, start? }` (the same on a **higher**-volume bar)
|
|
521
|
-
| `klinger` | `kvo`, `kvoSignal` | `{ fastPeriod?, slowPeriod?, signalPeriod?, high?, low?, close?, volume?, prefix? }` (Klinger's ORIGINAL volume force through an EMA pair, defaults 34 / 55 / 13; **F-AMBIG** — TradingView's simplified `ta.kvo` is a different indicator)
|
|
522
|
-
| `typicalPrice` | `typicalPrice` | `{ high?, low?, close?, output? }` (`(h+l+c)/3` = TA-Lib `TYPPRICE`, exact; **no warm-up**)
|
|
523
|
-
| `medianPrice` | `medianPrice` | `{ high?, low?, output? }` (`(h+l)/2` = `MEDPRICE`, exact; `close` on the shared options type is ignored)
|
|
524
|
-
| `weightedClose` | `weightedClose` | `{ high?, low?, close?, output? }` (`(h+l+2c)/4` = `WCLPRICE`, exact)
|
|
525
|
-
| `averagePrice` | `averagePrice` | `{ open?, high?, low?, close?, output? }` (`(o+h+l+c)/4` = `AVGPRICE`, exact — the only transform that reads the open)
|
|
526
|
-
| `balanceOfPower` | `bop` | `{ period?, maType?, open?, high?, low?, close?, output? }` (`(c−o)/(h−l)`, bounded −1…1; **raw by default** = TA-Lib `BOP` exact, `period` gives ChartIQ's smoothed form; a flat bar is `0`; `maType` without `period` throws)
|
|
527
|
-
| `starcBands` | `starcMiddle`, `starcUpper`, `starcLower` | `{ period?, atrPeriod?, multiplier?, maType?, high?, low?, close?, prefix? }` (Stoller: MA(**close**) ± mult·ATR, 20 / 15 / 2 / sma — the close-centred sibling of `keltner`'s typical-price centre)
|
|
528
|
-
| `highLowBands` | `hlbMiddle`, `hlbUpper`, `hlbLower` | `{ period?, percent?, maType?, high?, low?, prefix? }` (MA(**median price**) × (1 ± percent%), 10 / 1% / trima; it **is** `envelope` over a `medianPrice` column — same `percent`, same units; ChartIQ labels the knob "shift")
|
|
529
|
-
| `bollingerBandwidth` | `bbWidth` | `{ period?, stdDev?, column?, output? }` (`100·(upper − lower)/middle`, 20 / 2 — the **×100** StockCharts form; a flat window is `0`, not missing; a zero-centre window — flat at zero or zero-mean — is missing)
|
|
530
|
-
| `bollingerPercentB` | `percentB` | `{ period?, stdDev?, column?, output? }` (`(price − lower)/(upper − lower)`, 20 / 2 — the **decimal** form, unbounded; a flat window is a genuine `0/0` → missing)
|
|
531
|
-
| `primeNumberBands` | `pnbUpper`, `pnbLower` | `{ high?, low?, prefix? }` (smallest prime ≥ high / largest ≤ low — a step function of the price LEVEL, no warm-up; a price below 2 is outside the domain; cost grows with price magnitude)
|
|
532
|
-
| `primeNumberOscillator` | `pno` | `{ column?, output? }` (`price − nearestPrime(price)`, signed; a tie goes to the **lower** prime; no warm-up; neither scale- nor shift-invariant)
|
|
533
|
-
| `marketFacilitationIndex` | `bwmfi` | `{ high?, low?, volume?, output? }` (Bill Williams' `(h−l)/volume`, raw — **`bwmfi`, not `mfi`**, which `moneyFlowIndex` owns; zero volume → missing, flat bar → `0`)
|
|
534
|
-
| `twiggsMoneyFlow` | `tmf` | `{ period?, high?, low?, close?, volume?, output? }` (Twiggs: CMF rebuilt on the **true** range and Wilder-smoothed, default 21; bounded −1…1; **F-AMBIG** — the window-sum form is 0.0706 away; warm-up `period`, and an interior gap ends it)
|
|
535
|
-
| `tradeVolumeIndex` | `tvi` | `{ minTick, column?, volume?, output? }` (tick-direction accumulation; `minTick` — the instrument's minimum tick — is **required**; an undecided bar keeps the LAST direction, no first direction is invented, base 0, no warm-up; an interior gap **ends** the level, `obv`'s rule)
|
|
536
|
-
| `shinoharaIntensityRatio` | `sirStrong`, `sirWeak` | `{ period?, open?, high?, low?, close?, prefix? }` (Shinohara's A and B ratios, `100·Σup/Σdown` over 26 bars — A against the bar's own open, B against the previous close; **F-AMBIG** on which is charted "strong"; neither is bounded and B inverts on a gappy tape; per-column warm-up 25 / 26)
|
|
537
|
-
| `elderImpulse` | `impulse` | `{ emaPeriod?, fastPeriod?, slowPeriod?, signalPeriod?, column?, output? }` (Elder: `+1` when EMA(13) **and** the MACD histogram both rise, `−1` when both fall, `0` otherwise — a **numeric** column, `withColumn` has no string door; ties are `0`; warm-up 34)
|
|
538
|
-
| `movingAverageCross` | `maCross` | `{ fastPeriod?, slowPeriod?, maType?, column?, output? }` (a **signal** column: `+1` on the bar the fast MA crosses above the slow, `−1` below, `0` otherwise — the averages themselves are `movingAverage`'s; an exact tie is no cross and a touch-and-retreat is no cross; `maType`, not `type`; warm-up `slowPeriod`)
|
|
539
|
-
| `anchoredVwap` | `avwap` | `{ anchor, high?, low?, close?, volume?, output? }` (cumulative `Σ tp·vol / Σ vol` from the first bar **at or after** `anchor` — a `Date` or epoch ms, **required**; earlier bars `undefined`; an interior gap ends the line, `obv`'s rule; the session-reset form
|
|
540
|
-
| `
|
|
541
|
-
| `
|
|
542
|
-
| `
|
|
543
|
-
| `
|
|
544
|
-
| `
|
|
545
|
-
| `
|
|
546
|
-
| `
|
|
547
|
-
| `
|
|
548
|
-
| `
|
|
549
|
-
| `
|
|
445
|
+
| Study | Output column(s) | Options gist | Source |
|
|
446
|
+
| --------------------------- | -------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
|
|
447
|
+
| `sma` | `sma` | `{ period, column?, output? }` | `packages/financial/src/studies/moving-average.ts` |
|
|
448
|
+
| `ema` | `ema` | `{ period, column?, output? }` (α = 2/(period+1)) | `packages/financial/src/studies/moving-average.ts` |
|
|
449
|
+
| `movingAverage` | `ma` | `{ period, type?, column?, output? }` — the shared `MaType` menu (default `'sma'`) | `packages/financial/src/studies/moving-average.ts` |
|
|
450
|
+
| `bollinger` | `bbMiddle`, `bbUpper`, `bbLower` | `{ period, stdDev?, column?, prefix? }` | `packages/financial/src/studies/bollinger.ts` |
|
|
451
|
+
| `envelope` | `envMiddle`, `envUpper`, `envLower` | `{ period, percent?, maType?, column?, prefix? }` | `packages/financial/src/studies/envelope.ts` |
|
|
452
|
+
| `rollingStdev` | `stdev` | `{ period, column?, output? }` (population, ddof=0) | `packages/financial/src/studies/rolling-stat.ts` |
|
|
453
|
+
| `rollingMin` / `rollingMax` | `min` / `max` | `{ period, column?, output? }` (one edge; `donchian` gives the channel) | `packages/financial/src/studies/rolling-stat.ts` |
|
|
454
|
+
| `rollingPercentile` | `p{q}` (e.g. `p90`) | `{ period, q, column?, output? }` | `packages/financial/src/studies/rolling-stat.ts` |
|
|
455
|
+
| `zScore` | `zscore` | `{ period, column?, output? }` | `packages/financial/src/studies/z-score.ts` |
|
|
456
|
+
| `percentChange` | `pctChange` | `{ periods?, column?, output? }` (= ROC; TA-Lib-verified) | `packages/financial/src/studies/percent-change.ts` |
|
|
457
|
+
| `rsi` | `rsi` | `{ period?, column?, output? }` (Wilder, default 14) | `packages/financial/src/studies/rsi.ts` |
|
|
458
|
+
| `macd` | `macdLine`, `macdSignal`, `macdHist` | `{ fastPeriod?, slowPeriod?, signalPeriod?, column?, prefix? }` (12/26/9) | `packages/financial/src/studies/macd.ts` |
|
|
459
|
+
| `atr` | `atr` | `{ period?, high?, low?, close?, output? }` (Wilder, default 14) | `packages/financial/src/studies/atr.ts` |
|
|
460
|
+
| `momentum` | `momentum` | `{ period?, column?, output? }` (`v − v[−period]`, default 10) | `packages/financial/src/studies/momentum.ts` |
|
|
461
|
+
| `historicalVolatility` | `hv` | `{ period?, annualize?, column?, output? }` (σ of log returns, ×√252) | `packages/financial/src/studies/volatility.ts` |
|
|
462
|
+
| `stochastic` | `stochK`, `stochD` | `{ kPeriod?, slowing?, dPeriod?, high?, low?, close?, prefix? }` (14/3/3; `slowing: 1` = fast) | `packages/financial/src/studies/stochastic.ts` |
|
|
463
|
+
| `williamsR` | `williamsR` | `{ period?, high?, low?, close?, output? }` (default 14, bounded −100..0) | `packages/financial/src/studies/williams-r.ts` |
|
|
464
|
+
| `donchian` | `dcUpper`, `dcLower`, `dcMiddle` | `{ period?, high?, low?, prefix? }` (default 20) | `packages/financial/src/studies/donchian.ts` |
|
|
465
|
+
| `obv` | `obv` | `{ close?, volume?, output? }` (no period; TA-Lib seed `volume[0]`) | `packages/financial/src/studies/obv.ts` |
|
|
466
|
+
| `vwap` | `vwap` | `{ period, high?, low?, close?, volume?, output? }` (rolling, typical px) | `packages/financial/src/studies/vwap.ts` |
|
|
467
|
+
| `keltner` | `kcMiddle`, `kcUpper`, `kcLower` | `{ period?, atrPeriod?, multiplier?, maType?, high?, low?, close?, prefix? }` (modern variant: EMA(20) of typical price ± 2·ATR(10)) | `packages/financial/src/studies/keltner.ts` |
|
|
468
|
+
| `atrBands` | `atrbUpper`, `atrbLower` | `{ period?, multiplier?, column?, high?, low?, close?, prefix? }` (14/2; **no middle** — it is `column`) | `packages/financial/src/studies/atr-bands.ts` |
|
|
469
|
+
| `qstick` | `qstick` | `{ period?, maType?, open?, close?, output? }` (MA of `close − open`, default 8/sma) | `packages/financial/src/studies/qstick.ts` |
|
|
470
|
+
| `trix` | `trix`, `trixSignal` | `{ period?, signalPeriod?, column?, prefix? }` (1-bar % ROC of EMA³, 15/9; the line takes the prefix itself) | `packages/financial/src/studies/trix.ts` |
|
|
471
|
+
| `coppock` | `coppock` | `{ longPeriod?, shortPeriod?, wmaPeriod?, column?, output? }` (WMA of ROC₁₄+ROC₁₁, 14/11/10 — monthly by convention) | `packages/financial/src/studies/coppock.ts` |
|
|
472
|
+
| `priceOscillator` | `priceOsc` | `{ fastPeriod?, slowPeriod?, maType?, mode?, column?, output? }` (12/26/ema, percent = PPO, `mode: 'absolute'` = APO) | `packages/financial/src/studies/price-oscillator.ts` |
|
|
473
|
+
| `disparityIndex` | `disparity` | `{ period?, maType?, column?, output? }` (`100·(price − MA)/MA`, default 14/sma) | `packages/financial/src/studies/disparity-index.ts` |
|
|
474
|
+
| `detrendedPriceOscillator` | `dpo` | `{ period?, maType?, column?, output? }` (`price − MA[i − ⌊period/2⌋−1]`, default 20/sma) | `packages/financial/src/studies/detrended-price-oscillator.ts` |
|
|
475
|
+
| `elderRay` | `elderBull`, `elderBear` | `{ period?, high?, low?, close?, prefix? }` (`high/low − EMA(close)`, default 13) | `packages/financial/src/studies/elder-ray.ts` |
|
|
476
|
+
| `awesomeOscillator` | `ao` | `{ fastPeriod?, slowPeriod?, high?, low?, output? }` (SMA 5 − SMA 34 of `(high+low)/2`) | `packages/financial/src/studies/awesome-oscillator.ts` |
|
|
477
|
+
| `accumulationDistribution` | `ad` | `{ high?, low?, close?, volume?, output? }` (no period; cumulative CLV·volume, = TA-Lib `AD`) | `packages/financial/src/studies/accumulation-distribution.ts` |
|
|
478
|
+
| `chaikinOscillator` | `chaikinOsc` | `{ fastPeriod?, slowPeriod?, high?, low?, close?, volume?, output? }` (EMA 3 − EMA 10 of A/D, = TA-Lib `ADOSC`) | `packages/financial/src/studies/chaikin-oscillator.ts` |
|
|
479
|
+
| `priceVolumeTrend` | `pvt` | `{ close?, volume?, output? }` (no period; cumulative fractional-change·volume; bar 0 undefined) | `packages/financial/src/studies/price-volume-trend.ts` |
|
|
480
|
+
| `chaikinMoneyFlow` | `cmf` | `{ period?, high?, low?, close?, volume?, output? }` (Σ CLV·vol / Σ vol over 20, bounded −1..+1) | `packages/financial/src/studies/chaikin-money-flow.ts` |
|
|
481
|
+
| `moneyFlowIndex` | `mfi` | `{ period?, high?, low?, close?, volume?, output? }` (RSI form on typical-price·volume, default 14, = TA-Lib `MFI`) | `packages/financial/src/studies/money-flow-index.ts` |
|
|
482
|
+
| `forceIndex` | `force` | `{ period?, close?, volume?, output? }` (EMA of Δclose·volume, Elder's 13; `period: 1` is the raw force) | `packages/financial/src/studies/force-index.ts` |
|
|
483
|
+
| `easeOfMovement` | `eom` | `{ period?, maType?, scale?, high?, low?, volume?, output? }` (Arms' box ratio, 14/sma/1e8; quadratic in price) | `packages/financial/src/studies/ease-of-movement.ts` |
|
|
484
|
+
| `volumeOscillator` | `volOsc` | `{ fastPeriod?, slowPeriod?, maType?, volume?, output? }` (5/10/sma; `priceOscillator` percent-mode over volume) | `packages/financial/src/studies/volume-oscillator.ts` |
|
|
485
|
+
| `chandeMomentum` | `cmo` | `{ period?, column?, output? }` (Chande's **unsmoothed** up/down sums, default 14 — _not_ TA-Lib's CMO, which is `2·rsi − 100`) | `packages/financial/src/studies/chande-momentum.ts` |
|
|
486
|
+
| `ultimateOscillator` | `uo` | `{ shortPeriod?, mediumPeriod?, longPeriod?, high?, low?, close?, output? }` (7/14/28 weighted 4/2/1; TA-Lib `ULTOSC`) | `packages/financial/src/studies/ultimate-oscillator.ts` |
|
|
487
|
+
| `commodityChannelIndex` | `cci` | `{ period?, high?, low?, close?, output? }` (`(tp − SMA)/(0.015 · meanAbsDev)`, default 20; TA-Lib `CCI`) | `packages/financial/src/studies/commodity-channel-index.ts` |
|
|
488
|
+
| `intradayMomentumIndex` | `imi` | `{ period?, open?, close?, output? }` (RSI's form over `close − open`, **plain** sums, default 14) | `packages/financial/src/studies/intraday-momentum-index.ts` |
|
|
489
|
+
| `relativeVigorIndex` | `rvi`, `rviSignal` | `{ period?, open?, high?, low?, close?, prefix? }` (SWMA `(1,2,2,1)/6` body/range sums + SWMA signal, default 10) | `packages/financial/src/studies/relative-vigor-index.ts` |
|
|
490
|
+
| `psychologicalLine` | `psy` | `{ period?, column?, output? }` (percent of **up** closes, strict `>`, default 12) | `packages/financial/src/studies/psychological-line.ts` |
|
|
491
|
+
| `directionalMovement` | `dmiPlusDi`, `dmiMinusDi`, `dmiDx`, `dmiAdx`, `dmiAdxr` | `{ period?, high?, low?, close?, prefix? }` (Wilder's DMS — `+DI`/`−DI`/`DX`/`ADX`/`ADXR`, default 14; per-column warm-up; Wilder's seed, so a decaying transient vs TA-Lib) | `packages/financial/src/studies/directional-movement.ts` |
|
|
492
|
+
| `aroon` | `aroonUp`, `aroonDown`, `aroonOsc` | `{ period?, high?, low?, prefix? }` (`100·(period − bars since extreme)/period` over a **`period + 1`**-bar window, default 25; = TA-Lib `AROON`/`AROONOSC`) | `packages/financial/src/studies/aroon.ts` |
|
|
493
|
+
| `vortex` | `viPlus`, `viMinus` | `{ period?, high?, low?, close?, prefix? }` (`Σ\|H − prevL\| / Σ TR` and `Σ\|L − prevH\| / Σ TR`, default 14; positive, not bounded by 1) | `packages/financial/src/studies/vortex.ts` |
|
|
494
|
+
| `chaikinVolatility` | `chaikinVol` | `{ period?, rocPeriod?, high?, low?, output? }` (percent ROC of EMA(`high − low`), 10/10; **plain** range) | `packages/financial/src/studies/chaikin-volatility.ts` |
|
|
495
|
+
| `massIndex` | `mass` | `{ emaPeriod?, sumPeriod?, high?, low?, output? }` (Σ EMA(range)/EMA² over 25, Dorsey's 9/25; a **sum**, reads ≈ `sumPeriod`) | `packages/financial/src/studies/mass-index.ts` |
|
|
496
|
+
| `choppinessIndex` | `chop` | `{ period?, high?, low?, close?, output? }` (`100·log10(ΣTR/(HH−LL))/log10(period)`, default 14, bounded 0..100; `period ≥ 2`) | `packages/financial/src/studies/choppiness-index.ts` |
|
|
497
|
+
| `ulcerIndex` | `ulcer` | `{ period?, column?, output? }` (RMS % drawdown from the rolling peak, StockCharts' rolling form, default 14; warm-up `2·period−2`) | `packages/financial/src/studies/ulcer-index.ts` |
|
|
498
|
+
| `verticalHorizontalFilter` | `vhf` | `{ period?, column?, output? }` ((HH−LL)/Σ\|Δcolumn\| over 28, Adam White's; a **fraction** in (0, 1], warm-up `period`) | `packages/financial/src/studies/vertical-horizontal-filter.ts` |
|
|
499
|
+
| `gopalakrishnanRangeIndex` | `gapo` | `{ period?, high?, low?, output? }` (`ln(HH−LL)/ln(period)` = log base `period` of the range, default 10; `period ≥ 2`) | `packages/financial/src/studies/gopalakrishnan-range-index.ts` |
|
|
500
|
+
| `relativeVolatilityIndex` | `relVol` | `{ period?, stdevPeriod?, column?, output? }` (RSI's form on σ, Wilder-smoothed, Dorsey's 14/10 — **not** `rvi`, see below) | `packages/financial/src/studies/relative-volatility-index.ts` |
|
|
501
|
+
| `linearRegression` | `linregValue`, `linregSlope`, `linregIntercept`, `linregAngle`, `linregR2` | `{ period?, column?, prefix? }` (one rolling OLS fit against the bar index, default 14, `period ≥ 2`; `Value` = TA-Lib `LINEARREG`, `Intercept` = the fit at the window's **first** bar, `Angle` = degrees and **scale-dependent**) | `packages/financial/src/studies/linear-regression.ts` |
|
|
502
|
+
| `timeSeriesForecast` | `tsf` | `{ period?, column?, output? }` (the same fit one bar **past** the window, default 14; = TA-Lib `TSF`; deliberately not a `MaType`) | `packages/financial/src/studies/time-series-forecast.ts` |
|
|
503
|
+
| `chandeForecastOscillator` | `cfo` | `{ period?, column?, output? }` (`100·(price − TSF)/price`, default 14; scale-invariant, **not** shift-invariant) | `packages/financial/src/studies/chande-forecast-oscillator.ts` |
|
|
504
|
+
| `centerOfGravity` | `cog` | `{ period?, column?, output? }` (Ehlers' position-weighted balance point, default 10; **negative**, in `[−period, −1]` on positive prices, flat reads `−(period+1)/2` — TradingView's uncentred convention) | `packages/financial/src/studies/center-of-gravity.ts` |
|
|
505
|
+
| `correlation` | `corr` | `{ period?, column?, benchmark, output? }` (Pearson r of two columns over 30 bars, = TA-Lib `CORREL`; `benchmark` is a **column on the same joined series**, required) | `packages/financial/src/studies/correlation.ts` |
|
|
506
|
+
| `beta` | `beta` | `{ period?, column?, benchmark, output? }` (slope of `column`'s 1-bar returns on `benchmark`'s over 5 bars, = TA-Lib `BETA(benchmark, column)`; pass **prices**, returns taken inside) | `packages/financial/src/studies/beta.ts` |
|
|
507
|
+
| `priceRelative` | `priceRel` | `{ column?, benchmark, output? }` (`column / benchmark`, no period — ChartIQ's Price Relative / Relative Strength **comparative**; not `rsi`) | `packages/financial/src/studies/price-relative.ts` |
|
|
508
|
+
| `performanceIndex` | `perf` | `{ period?, column?, benchmark, output? }` (each side's own `period`-bar growth, divided; 1 = parity, default 20; `(x−1)·100` == `percentChange(priceRelative)`) | `packages/financial/src/studies/performance-index.ts` |
|
|
509
|
+
| `guppy` | `gmmaS3`…`gmmaS15`, `gmmaL30`…`gmmaL60` | `{ column?, type?, prefix? }` (Guppy's GMMA — the **fixed** twelve averages, short 3/5/8/10/12/15, long 30/35/40/45/50/60, default `ema`; the lists ship as `GUPPY_SHORT_PERIODS` / `GUPPY_LONG_PERIODS`) | `packages/financial/src/studies/guppy.ts` |
|
|
510
|
+
| `rainbow` | `rainbow1`…`rainbow10` | `{ column?, period?, type?, prefix? }` (Widner's Rainbow — ten **recursive** averages, each smoothing the previous; default period 2 / `sma`; stage `k` warms up at `k·(period−1)`) | `packages/financial/src/studies/rainbow.ts` |
|
|
511
|
+
| `rainbowOscillator` | `rbo`, `rboUpper`, `rboLower` | `{ column?, period?, lookback?, type?, prefix? }` (ChartIQ's — `100·(price − mean of the ten)/(HH−LL)` with the stack's own width as mirrored bands; default 2 / 10) | `packages/financial/src/studies/rainbow.ts` |
|
|
512
|
+
| `kst` | `kst`, `kstSignal` | `{ column?, signalPeriod?, prefix? }` (Pring's Know Sure Thing — ROC 10/15/20/30 smoothed 10/10/10/15, weighted 1/2/3/4; the twelve numbers are **not** options, only the signal SMA is, default 9) | `packages/financial/src/studies/kst.ts` |
|
|
513
|
+
| `priceMomentumOscillator` | `pmo`, `pmoSignal` | `{ column?, prefix? }` (DecisionPoint's PMO — two stages of **custom** `α = 2/n` smoothing over a 1-bar percent ROC, ×10, with a **span** EMA(10) signal; no period options) | `packages/financial/src/studies/price-momentum-oscillator.ts` |
|
|
514
|
+
| `stochasticRsi` | `stochRsiK`, `stochRsiD` | `{ column?, rsiPeriod?, stochPeriod?, kPeriod?, dPeriod?, prefix? }` (the stochastic construction over the RSI, 14/14/3/3; `stochRsiK` == TA-Lib `STOCHRSI`'s **fastd**, `stochRsiD` has no TA-Lib counterpart) | `packages/financial/src/studies/stochastic-rsi.ts` |
|
|
515
|
+
| `trueStrengthIndex` | `tsi`, `tsiSignal` | `{ column?, longPeriod?, shortPeriod?, signalPeriod?, prefix? }` (Blau's TSI — `100·EMA(EMA(Δ,long),short)/EMA(EMA(\|Δ\|,long),short)`, 25/13/7; bounded −100…100, long applied **first**) | `packages/financial/src/studies/true-strength-index.ts` |
|
|
516
|
+
| `movingAverageDeviation` | `maDev` | `{ period?, maType?, column?, output? }` (`price − MA`, in **price units**, default 20/sma — the points half of the pair whose percent half IS `disparityIndex`; no `mode` flag) | `packages/financial/src/studies/moving-average-deviation.ts` |
|
|
517
|
+
| `parabolicSar` | `psar`, `psarTrend` | `{ step?, maxStep?, high?, low?, prefix? }` (Wilder's stop-and-reverse, defaults 0.02 / 0.2; **= TA-Lib `SAR` exactly**; `Trend` is `+1` long / `−1` short — the stop can print ON an extreme, so the side is not derivable from the value) | `packages/financial/src/studies/parabolic-sar.ts` |
|
|
518
|
+
| `superTrend` | `st`, `stTrend` | `{ period?, multiplier?, high?, low?, close?, prefix? }` (Seban's ratcheting ATR band as TradingView's `ta.supertrend`, defaults 10 / 3; `st` **is** the live band, so the bands are not emitted; the seed side is DOWN) | `packages/financial/src/studies/super-trend.ts` |
|
|
519
|
+
| `atrTrailingStop` | `ats`, `atsTrend` | `{ period?, multiplier?, high?, low?, close?, prefix? }` (close-anchored ratcheting stop, Vervoort's, defaults 14 / 3; a close exactly ON the stop flips **short**; the Chandelier anchor is `donchian` + `atr`, not a knob) | `packages/financial/src/studies/atr-trailing-stop.ts` |
|
|
520
|
+
| `negativeVolumeIndex` | `nvi` | `{ column?, volume?, output?, start? }` (Fosback: compound the close return only on a **lower**-volume bar, base 1000; no period, no warm-up; a **flat** volume holds on both indices) | `packages/financial/src/studies/volume-index.ts` |
|
|
521
|
+
| `positiveVolumeIndex` | `pvi` | `{ column?, volume?, output?, start? }` (the same on a **higher**-volume bar) | `packages/financial/src/studies/volume-index.ts` |
|
|
522
|
+
| `klinger` | `kvo`, `kvoSignal` | `{ fastPeriod?, slowPeriod?, signalPeriod?, high?, low?, close?, volume?, prefix? }` (Klinger's ORIGINAL volume force through an EMA pair, defaults 34 / 55 / 13; **F-AMBIG** — TradingView's simplified `ta.kvo` is a different indicator) | `packages/financial/src/studies/klinger.ts` |
|
|
523
|
+
| `typicalPrice` | `typicalPrice` | `{ high?, low?, close?, output? }` (`(h+l+c)/3` = TA-Lib `TYPPRICE`, exact; **no warm-up**) | `packages/financial/src/studies/price-transform.ts` |
|
|
524
|
+
| `medianPrice` | `medianPrice` | `{ high?, low?, output? }` (`(h+l)/2` = `MEDPRICE`, exact; `close` on the shared options type is ignored) | `packages/financial/src/studies/price-transform.ts` |
|
|
525
|
+
| `weightedClose` | `weightedClose` | `{ high?, low?, close?, output? }` (`(h+l+2c)/4` = `WCLPRICE`, exact) | `packages/financial/src/studies/price-transform.ts` |
|
|
526
|
+
| `averagePrice` | `averagePrice` | `{ open?, high?, low?, close?, output? }` (`(o+h+l+c)/4` = `AVGPRICE`, exact — the only transform that reads the open) | `packages/financial/src/studies/price-transform.ts` |
|
|
527
|
+
| `balanceOfPower` | `bop` | `{ period?, maType?, open?, high?, low?, close?, output? }` (`(c−o)/(h−l)`, bounded −1…1; **raw by default** = TA-Lib `BOP` exact, `period` gives ChartIQ's smoothed form; a flat bar is `0`; `maType` without `period` throws) | `packages/financial/src/studies/balance-of-power.ts` |
|
|
528
|
+
| `starcBands` | `starcMiddle`, `starcUpper`, `starcLower` | `{ period?, atrPeriod?, multiplier?, maType?, high?, low?, close?, prefix? }` (Stoller: MA(**close**) ± mult·ATR, 20 / 15 / 2 / sma — the close-centred sibling of `keltner`'s typical-price centre) | `packages/financial/src/studies/starc-bands.ts` |
|
|
529
|
+
| `highLowBands` | `hlbMiddle`, `hlbUpper`, `hlbLower` | `{ period?, percent?, maType?, high?, low?, prefix? }` (MA(**median price**) × (1 ± percent%), 10 / 1% / trima; it **is** `envelope` over a `medianPrice` column — same `percent`, same units; ChartIQ labels the knob "shift") | `packages/financial/src/studies/high-low-bands.ts` |
|
|
530
|
+
| `bollingerBandwidth` | `bbWidth` | `{ period?, stdDev?, column?, output? }` (`100·(upper − lower)/middle`, 20 / 2 — the **×100** StockCharts form; a flat window is `0`, not missing; a zero-centre window — flat at zero or zero-mean — is missing) | `packages/financial/src/studies/bollinger-derived.ts` |
|
|
531
|
+
| `bollingerPercentB` | `percentB` | `{ period?, stdDev?, column?, output? }` (`(price − lower)/(upper − lower)`, 20 / 2 — the **decimal** form, unbounded; a flat window is a genuine `0/0` → missing) | `packages/financial/src/studies/bollinger-derived.ts` |
|
|
532
|
+
| `primeNumberBands` | `pnbUpper`, `pnbLower` | `{ high?, low?, prefix? }` (smallest prime ≥ high / largest ≤ low — a step function of the price LEVEL, no warm-up; a price below 2 is outside the domain; cost grows with price magnitude) | `packages/financial/src/studies/prime-number.ts` |
|
|
533
|
+
| `primeNumberOscillator` | `pno` | `{ column?, output? }` (`price − nearestPrime(price)`, signed; a tie goes to the **lower** prime; no warm-up; neither scale- nor shift-invariant) | `packages/financial/src/studies/prime-number.ts` |
|
|
534
|
+
| `marketFacilitationIndex` | `bwmfi` | `{ high?, low?, volume?, output? }` (Bill Williams' `(h−l)/volume`, raw — **`bwmfi`, not `mfi`**, which `moneyFlowIndex` owns; zero volume → missing, flat bar → `0`) | `packages/financial/src/studies/market-facilitation-index.ts` |
|
|
535
|
+
| `twiggsMoneyFlow` | `tmf` | `{ period?, high?, low?, close?, volume?, output? }` (Twiggs: CMF rebuilt on the **true** range and Wilder-smoothed, default 21; bounded −1…1; **F-AMBIG** — the window-sum form is 0.0706 away; warm-up `period`, and an interior gap ends it) | `packages/financial/src/studies/twiggs-money-flow.ts` |
|
|
536
|
+
| `tradeVolumeIndex` | `tvi` | `{ minTick, column?, volume?, output? }` (tick-direction accumulation; `minTick` — the instrument's minimum tick — is **required**; an undecided bar keeps the LAST direction, no first direction is invented, base 0, no warm-up; an interior gap **ends** the level, `obv`'s rule) | `packages/financial/src/studies/trade-volume-index.ts` |
|
|
537
|
+
| `shinoharaIntensityRatio` | `sirStrong`, `sirWeak` | `{ period?, open?, high?, low?, close?, prefix? }` (Shinohara's A and B ratios, `100·Σup/Σdown` over 26 bars — A against the bar's own open, B against the previous close; **F-AMBIG** on which is charted "strong"; neither is bounded and B inverts on a gappy tape; per-column warm-up 25 / 26) | `packages/financial/src/studies/shinohara-intensity-ratio.ts` |
|
|
538
|
+
| `elderImpulse` | `impulse` | `{ emaPeriod?, fastPeriod?, slowPeriod?, signalPeriod?, column?, output? }` (Elder: `+1` when EMA(13) **and** the MACD histogram both rise, `−1` when both fall, `0` otherwise — a **numeric** column, `withColumn` has no string door; ties are `0`; warm-up 34) | `packages/financial/src/studies/elder-impulse.ts` |
|
|
539
|
+
| `movingAverageCross` | `maCross` | `{ fastPeriod?, slowPeriod?, maType?, column?, output? }` (a **signal** column: `+1` on the bar the fast MA crosses above the slow, `−1` below, `0` otherwise — the averages themselves are `movingAverage`'s; an exact tie is no cross and a touch-and-retreat is no cross; `maType`, not `type`; warm-up `slowPeriod`) | `packages/financial/src/studies/moving-average-cross.ts` |
|
|
540
|
+
| `anchoredVwap` | `avwap` | `{ anchor, high?, low?, close?, volume?, output? }` (cumulative `Σ tp·vol / Σ vol` from the first bar **at or after** `anchor` — a `Date` or epoch ms, **required**; earlier bars `undefined`; an interior gap ends the line, `obv`'s rule; the session-reset form is `sessionVwap`, on the same kernel) | `packages/financial/src/studies/anchored-vwap.ts` |
|
|
541
|
+
| `ichimoku` | `ichiTenkan`, `ichiKijun`, `ichiSenkouA`, `ichiSenkouB`, `ichiChikou` | `{ conversionPeriod?, basePeriod?, spanBPeriod?, displacement?, high?, low?, close?, prefix? }` (Hosoda's five lines, 9/26/52/26 — each the window's HH/LL midpoint; `Chikou` is the close. **`displacement` shifts nothing**: every column is keyed to the bar it is _computed from_ (**G5**); warm-up 8/25/25/51/0) | `packages/financial/src/studies/ichimoku.ts` |
|
|
542
|
+
| `ichimokuOffsets` | — | `{ displacement?, prefix? }` (**not a study** — the per-column x-offset in **bars** a chart applies to `ichimoku`: `+displacement` on the two Senkou spans, `−displacement` on `Chikou`, `0` on the rest; pass it the study's own options) | `packages/financial/src/studies/ichimoku.ts` |
|
|
543
|
+
| `zigZag` | `zzPivot`, `zzDirection`, `zzLine` | `{ deviation?, high?, low?, prefix? }` (percent-reversal pivots, 5% of the leg's extreme by default; `zzPivot` sits on the extreme's **own** bar, `zzDirection` is the leg's `+1`/`−1`, `zzLine` joins them. **All three repaint** (**G6**); the last leg is provisional. A gap discards the leg in force) | `packages/financial/src/studies/zig-zag.ts` |
|
|
544
|
+
| `sessionVwap` | `svwap` | `{ sessions \| session, stamped?, high?, low?, close?, volume?, output? }` (`anchoredVwap` **re-anchored at every session open**; exactly one of `sessions` (a `TradingCalendar` or `Session[]` — the primary door) and `session` (a session-id column, e.g. from `tagSessions`); a bar in closed time is `undefined`; an interior gap ends **that session's** line and the next open re-seeds; `Σ vol = 0` → `undefined`) | `packages/financial/src/studies/session-vwap.ts` |
|
|
545
|
+
| `pivotPoints` | `ppPivot`, `ppR1–R3`, `ppS1–S3` (+ `ppR4`/`ppS4` on `'camarilla'`) | `{ sessions \| session, stamped?, method?, high?, low?, close?, prefix? }` (each session's ladder from the **previous session with bars**' high/low/close, held flat; `method` = `'standard'` (floor) \| `'fibonacci'` (0.382/0.618/1.000) \| `'woodie'` (`(H+L+2C)/4` centre) \| `'camarilla'` (1.1/12, 1.1/6, 1.1/4, 1.1/2 from the **close**, and the only set with a fourth pair — the column set and the return type follow `method`); the first session and closed time are `undefined`) | `packages/financial/src/studies/pivot-points.ts` |
|
|
546
|
+
| `stochasticMomentumIndex` | `smi`, `smiSignal` | `{ period?, longPeriod?, shortPeriod?, signalPeriod?, high?, low?, close?, prefix? }` (Blau's SMI — the close against the **midpoint** of the HH/LL range, double-EMA smoothed above and below, ×100; Blau's 13 / 25 / 2 / 3; bounded −100…100) | `packages/financial/src/studies/stochastic-momentum-index.ts` |
|
|
547
|
+
| `fisherTransform` | `fisher`, `fisherSignal` | `{ period?, high?, low?, prefix? }` (Ehlers' transform of the **median price's** own range position, default 10; the `0.33/0.67`, `±0.99→±0.999` clamp and `0.5/0.5` constants are Ehlers', not options; the signal is the line delayed one bar) | `packages/financial/src/studies/fisher-transform.ts` |
|
|
548
|
+
| `schaffTrendCycle` | `stc` | `{ fastPeriod?, slowPeriod?, cyclePeriod?, column?, output? }` (Schaff's double stochastic of a MACD with a fixed `0.5` smoothing between, 23 / 50 / 10, bounded 0…100; a pinned first stochastic leaves the second window flat → `undefined`) | `packages/financial/src/studies/schaff-trend-cycle.ts` |
|
|
549
|
+
| `prettyGoodOscillator` | `pgo` | `{ period?, column?, high?, low?, close?, output? }` (Johnson's `(close − SMA)/EMA(TR)`, default 14, in average-daily-ranges; **F-AMBIG** — the Wilder-ATR denominator port is a different study, measured) | `packages/financial/src/studies/pretty-good-oscillator.ts` |
|
|
550
|
+
| `swingIndex` | `si` | `{ limit, open?, high?, low?, close?, output? }` (Wilder 1978; `limit` — the instrument's limit move — is **required**, there being no defensible default; bounded −100…100 at a `limit` above the largest gap; `R = 0` → `undefined`) | `packages/financial/src/studies/swing-index.ts` |
|
|
551
|
+
| `accumulativeSwingIndex` | `asi` | `{ limit, open?, high?, low?, close?, output? }` (the running total of `swingIndex`; a running sum, so an interior gap — a halted bar pair included — ends it) | `packages/financial/src/studies/swing-index.ts` |
|
|
552
|
+
| `randomWalkIndex` | `rwiHigh`, `rwiLow` | `{ period?, high?, low?, close?, prefix? }` (Poulos: the max over horizons `2 … period` of `(high − low[−n])/(meanTR(n)·√n)`, default 14; the **`n`-bar mean** TR, not Wilder's ATR; O(N·period), and it goes negative) | `packages/financial/src/studies/random-walk-index.ts` |
|
|
553
|
+
| `ravi` | `ravi` | `{ shortPeriod?, longPeriod?, column?, output? }` (Chande: `100·\|SMA(7) − SMA(65)\|/SMA(65)`; **absolute**, so it answers "is there a trend", not "which way"; trending above 3%) | `packages/financial/src/studies/ravi.ts` |
|
|
554
|
+
| `trendIntensityIndex` | `tii` | `{ period?, maPeriod?, column?, output? }` (M. H. Pee: `100·Σpos/(Σpos + Σneg)` of the deviations from an SMA, 30 / 60, bounded 0…100; **F-AMBIG** — the count form is a different study; warm-up 88) | `packages/financial/src/studies/trend-intensity-index.ts` |
|
|
555
|
+
| `specialK` | `specialK` | `{ column?, output? }` (Pring's extended KST — twelve weighted smoothed ROCs across three groups; the thirty-six constants ARE the study, so there are no period options; **warm-up 724 bars**) | `packages/financial/src/studies/special-k.ts` |
|
|
550
556
|
|
|
551
557
|
**The two-series family takes a benchmark COLUMN, never a second
|
|
552
558
|
`TimeSeries`.** `correlation`, `beta`, `priceRelative` and `performanceIndex`
|
|
@@ -596,15 +602,32 @@ names it separately, but the formula is identical (and TA-Lib-verified through
|
|
|
596
602
|
Adding a study? Follow `packages/financial/src/studies/README.md` (uniform
|
|
597
603
|
shape + pandas oracle case + fluent method are all REQUIRED).
|
|
598
604
|
|
|
605
|
+
### Study catalog (`@pond-ts/financial/catalog`)
|
|
606
|
+
|
|
607
|
+
Every study, described at runtime — the facts a `@pond-ts/process` registry
|
|
608
|
+
or a picker needs that the options interfaces and return types carry only in
|
|
609
|
+
erased types. A separate subpath: importing it pulls in every study.
|
|
610
|
+
|
|
611
|
+
| Export | Purpose | Source |
|
|
612
|
+
| --------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
|
|
613
|
+
| `STUDIES` | `readonly StudyDescriptor[]` — one per fluent method, in family order then menu order (the catalog test pins the set equal to the fluent methods) | `packages/financial/src/catalog/index.ts` |
|
|
614
|
+
| `studyDescriptor(name)` | Look one up by its exported name | `packages/financial/src/catalog/index.ts` |
|
|
615
|
+
| `STUDY_FAMILIES` / `StudyFamily` | The nine picker groups (`moving-average`, `bands`, `momentum`, `trend`, `volatility`, `volume`, `statistical`, `price`, `session`) | `packages/financial/src/catalog/types.ts` |
|
|
616
|
+
| `StudyDescriptor`, `StudyInput`, `StudyParam` (`StudyNumberParam` \| `StudyEnumParam`), `StudyOutput`, `StudyNaming`, `StudyUnit`, `StudyRun` | The descriptor: `name`, `family`, `summary`, `inputs` (`role` + `default`, absent ⇒ required), `params` keyed by option (`kind`, `default` or `example`, `min`/`max` where validated, `suggest`), `naming` (`output` or `prefix` + its default), `outputs` (`id` suffix + `unit` — the axis-membership vocabulary), `optional: true` + `requires` for a switch-style option and a menu that needs it, `anchor: 'session' \| 'time'` for the session-anchored pair and `anchoredVwap`, `run` | `packages/financial/src/catalog/types.ts` |
|
|
617
|
+
| `defineStudy` / `StudySpec` | Author a descriptor against the study's options interface; the compiler classifies every key and rejects a missed one, a default on a required option or an undescribed option shape | `packages/financial/src/catalog/define.ts` |
|
|
618
|
+
|
|
599
619
|
### Trading calendars & sessions
|
|
600
620
|
|
|
601
|
-
| Export
|
|
602
|
-
|
|
|
603
|
-
| `TradingCalendar`
|
|
604
|
-
| `generateSessions`
|
|
605
|
-
| `normalizeSessions`
|
|
606
|
-
| `identityDiscontinuity` / `segmentDiscontinuity` / `weekendSkip`
|
|
607
|
-
| Types
|
|
621
|
+
| Export | Purpose | Source |
|
|
622
|
+
| ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------- |
|
|
623
|
+
| `TradingCalendar` | Query API: `.sessions()`, `.sessionOn()`, `.isTradingDay()`, `.isOpen()`, `.sessionsInRange()`, `.sessionSequence()`, `.barSequence(period)`, `.tagSessions()`, `.discontinuities()` | `packages/financial/src/calendar/` |
|
|
624
|
+
| `generateSessions` | `Session[]` from `SessionRules` over a date range (DST-correct) | `packages/financial/src/calendar/` |
|
|
625
|
+
| `normalizeSessions` | Validate + sort an explicit session list | `packages/financial/src/calendar/` |
|
|
626
|
+
| `identityDiscontinuity` / `segmentDiscontinuity` / `weekendSkip` | `DiscontinuityProvider`s for the trading-time axis | `packages/financial/src/calendar/` |
|
|
627
|
+
| Types | `Session`, `SessionBreak`, `SessionRules`, `DateRange`, `InstantRange`, `TaggedSchema`, `LiveSegment`, `DiscontinuityProvider` | `packages/financial/src/calendar/` |
|
|
628
|
+
| `SessionSource` / `SessionAnchorOptions` | The session-anchored studies' input: `TradingCalendar \| Session[]` (`sessions`), or a session-id column name (`session`), plus `stamped` | `packages/financial/src/contract/session-anchor.ts` |
|
|
629
|
+
| `PIVOT_METHODS` / `PivotMethod` | The four pivot formula sets (`standard`, `fibonacci`, `woodie`, `camarilla`) | `packages/financial/src/kernels/pivot.ts` |
|
|
630
|
+
| `PivotPointsSchema` / `CamarillaPivotPointsSchema` / `PivotPointsResult` | `pivotPoints`' method-dependent appended-schema types (7 columns, or 9 for Camarilla) | `packages/financial/src/studies/pivot-points.ts` |
|
|
608
631
|
|
|
609
632
|
### Contract & constants
|
|
610
633
|
|