Chartsv26.10.18
API reference

Indicators API (@unifin/chart-indicators)

Generated reference of 194 public symbols of @unifin/chart-indicators, grouped by kind and ordered as in the sources.

Generated from the package entry packages/chart-indicators/src/index.ts. Names are reachable through @unifin/chart-indicators; use your editor for full signatures - this page carries the map.

Classes (6)

SymbolWhat it does
FormulaSyntaxError-
FormulaCompileError-
FormulaLimitError-
RingWindowFixed window of the newest length values with a running sum. sum is NaN until the window is filled; at(offset) reads with 0 = newest.
EmaSmoothingExponential smoothing seeded by the simple average of the first length values (the convention shared with the S0 vector functions).
WilderSmoothingWilder smoothing: alpha = 1 / length, same seeding rule as the EMA.

Functions (29)

SymbolWhat it does
createCatalogRegistry-
defineStepped-
numberInput-
selectInput-
lineOutput-
histogramOutput-
parseFormula-
visitFormulaDepth first walk used by the compiler for arity and name checks.
compileFormula-
evaluateFormula-
defineFormulaWraps a formula into a normal incremental study definition.
runFormulaJobPure entry point for the host worker: no DOM, no timers, structured payload in and values out.
sma-
emaExponential moving average, seeded by the SMA of the first length values.
wmaLinearly weighted moving average (weights 1..length).
weightedAverageWeighted average with an arbitrary weight vector (newest value last).
fillNaN-
valueAtReads a value defensively: out-of-range and non-finite give NaN.
trueRangeAtTrue range against the previous close; the first bar uses high - low.
closeAt-
typicalPriceAtTypical price (high + low + close) / 3.
snapshotStateShallow state copy with deep copies of the listed ring and smoothing keys.
rsiRelative Strength Index (IND-017), Wilder smoothing.
macdMoving average convergence divergence (IND-018).
williamsRWilliams %R as a bounded momentum value in the range [-100, 0] (IND-021).
bollingerBollinger Bands (IND-042): middle is the SMA, band width is k * deviation.
trueRangeTrue range of one bar against the previous close.
atrAverage True Range (IND-041), Wilder smoothing.
keltnerKeltner channel: EMA centre with ATR based bands (IND-045).

Types (14)

SymbolWhat it does
SteppedSpecBuilder for incremental definitions: calculate replays the same step over the range, update runs one step, so the incremental and the full path can never drift apart ( §1-2).
FormulaNode-
ParsedFormula-
CompiledFormula-
FormulaLimits-
FormulaContextHost provided series (other instrument, index, spread) aligned to the bars.
FormulaSpec-
FormulaJobPayload-
FormulaJobResult-
NumericSeriesMoving averages (catalogue IND-001... IND-016). Contract: the result has the same length as the input; values that cannot be computed yet are NaN ( §2), never zero and never a shortened array.
CloneableShared incremental primitives for the wave W1 catalogue (S4). Every primitive is a small stateful object; definitions keep instances in the study state and clone them through clone for forming bar replays.
MacdResult-
BandResult-
OhlcBar-

Constants (145)

SymbolWhat it does
INDICATOR_CATALOGCatalogue waves: W1 (S4, 32 studies) plus the S5 groups as they land. Every id below has a provenance record in with a test link; the gate fails when they drift apart.
CATALOG_PROVENANCE_IDSCatalog ids that reference a provenance record (IND-xxx).
userFormulaDefinition-
compositeDefinition-
otherInstrumentDefinition-
eventDefinition-
CUSTOM_DEFINITIONS-
hilbertDefinition-
sineWaveDefinition-
laguerreRsiDefinition-
fisherMedianDefinition-
savitzkyGolayDefinition-
kalmanDefinition-
butterworthDefinition-
superSmootherDefinition-
hilbertChannelDefinition-
adaptiveRsiDefinition-
instantaneousTrendlineDefinition-
roofingFilterDefinition-
CYCLE_DEFINITIONS-
tsiDefinition-
ultimateDefinition-
awesomeDefinition-
kstDefinition-
coppockDefinition-
bopDefinition-
rviDefinition-
rsiDivergenceDefinition-
macdDivergenceDefinition-
rsRatioDefinition-
pmoDefinition-
fisherDefinition-
cogDefinition-
trendMeterDefinition-
smiDefinition-
MOMENTUM_DEFINITIONS_2Second momentum group in catalogue order (IND-025... IND-040).
rsiDefinition-
macdDefinition-
stochasticDefinition-
williamsRDefinition-
rocDefinition-
momentumDefinition-
cciDefinition-
stochRsiDefinition-
cmoDefinition-
MOMENTUM_DEFINITIONS-
correlationDefinition-
betaDefinition-
zScorePriceDefinition-
zScoreVolumeDefinition-
spreadDefinition-
ratioDefinition-
linRegSlopeDefinition-
rSquaredDefinition-
meanDeviationDefinition-
medianPriceDefinition-
percentileDefinition-
typicalPriceDefinition-
weightedCloseDefinition-
seasonalityDefinition-
volatilityTimeDefinition-
atrPercentDefinition-
STATISTICS_DEFINITIONS-
ichimokuDefinition-
vortexDefinition-
dpoDefinition-
schaffTrendDefinition-
qstickDefinition-
zigzagDefinition-
fractalsDefinition-
pivotClassicDefinition-
pivotFibonacciDefinition-
pivotCamarillaDefinition-
pivotWoodieDefinition-
linRegChannelDefinition-
raffChannelDefinition-
priceChannelDefinition-
trendIntensityDefinition-
massIndexDefinition-
elderImpulseDefinition-
choppinessDefinition-
vhfDefinition-
adxrDefinition-
STRENGTH_DEFINITIONS_2-
adxDefinitionTrend strength and structure studies of the wave W1 catalogue ( §5).
psarDefinition-
aroonDefinition-
trixDefinition-
STRENGTH_DEFINITIONS-
kamaDefinitionSecond trend group of the catalogue ( §1, wave S5).
almaDefinition-
zlemaDefinition-
t3Definition-
mcginleyDefinition-
demarkLineDefinition-
supertrendDefinition-
TREND_DEFINITIONS_2-
smaDefinitionTrend studies of the wave W1 catalogue ( §1).
emaDefinition-
wmaDefinition-
demaDefinition-
temaDefinition-
hmaDefinition-
lsmaDefinition-
rmaDefinition-
vwmaDefinition-
TREND_DEFINITIONS-
chaikinVolatilityDefinitionSecond volatility group of the catalogue ( §3, wave S5).
historicalVolatilityDefinition-
chandelierExitDefinition-
atrTrailingStopDefinition-
ulcerIndexDefinition-
squeezeMomentumDefinition-
relativeVolatilityIndexDefinition-
volatilityStopDefinition-
trueRangeDefinition-
VOLATILITY_DEFINITIONS_2-
atrDefinitionVolatility studies of the wave W1 catalogue ( §3).
bollingerDefinition-
percentBDefinition-
bandwidthDefinition-
keltnerDefinition-
donchianDefinition-
stdDevDefinition-
VOLATILITY_DEFINITIONS-
anchoredVwapDefinition-
accumulationDistributionDefinition-
chaikinMoneyFlowDefinition-
moneyFlowIndexDefinition-
forceIndexDefinition-
easeOfMovementDefinition-
volumeOscillatorDefinition-
priceVolumeTrendDefinition-
klingerDefinition-
volumeProfileDefinition-
deltaFootprintDefinition-
volumeWeightedMacdDefinition-
negativeVolumeIndexDefinition-
VOLUME_DEFINITIONS_2-
volumeDefinitionVolume studies of the wave W1 catalogue ( §4).
vwapDefinition-
obvDefinition-
VOLUME_DEFINITIONS-
FORMULA_VARIABLESSandboxed runtime for user formulas ( §5): the AST from the parser is interpreted against bar data with a function whitelist and hard limits. There is no access to DOM, network, storage or trading APIs by construction, and a limit breach raises FormulaLimitError so the engine can disable the study.
FORMULA_FUNCTIONS-

On this page