nseries package

nseries package

nseries is Algolang’s numeric series and indicator library. This reference includes its core operations, arithmetic, statistics, moving averages, technical indicators and relative-series calculations.

Use the alphabetical index to find a name, or choose a category below. Each category gathers related sections of the package with their function signatures and complete documentation.

Using the package

nseries.Series is a []float64 ordered from oldest to newest. In an Algolang callback, use the indicator conversion helpers to view SDK history as a numeric series. Copy a borrowed view before retaining it beyond the callback.

For standalone numeric data in a Go package:

import "nseries"

values := nseries.New([]float64{10, 12, 14, 16, 18})
average := values.SMA(3)
latest := average.Value()   // 16
previous := average.Value(1) // 14

Algolang pins nseries in nseries.ref; make deps prepares the checkout. The module path is nseries, so a separate Go module needs a replace nseries => /path/to/checkout directive. Follow installation and dependencies for the pinned setup.

Series conventions

  • The most recent value is Value() or Value(0); Value(1) reads the preceding value.
  • LookBack(n) removes the latest n observations; Window(n) selects a trailing window for positive n. Check each function’s contract for empty or invalid inputs.
  • Two numeric series are paired by position, not timestamps. Use SDK alignment when instruments or timeframes have different observation times.
  • Warmup and missing-value behavior vary by function. Read the relevant function description before using its output as a signal.

Browse categories

636 functions in 14 categories, from the nseries version pinned by this release (e3b888542c67).

CategorySectionsFunctions
Series operationsCore, Arithmetic, Comparison, Conditional, Function Application, Map, Slice Operations, Sorting, Highest / Lowest, Index Of, Variable-Length Windows52
MathsMath, Clamp, Gaussian Distribution, Random57
Statistics and regressionStatistics, Percent Rank, R-Squared, Spearman Rank Correlation, Linear Regression, Fractional Differencing29
Moving averages and filtersMoving Averages, KAMA, Cong Adaptive MA, Kalman Filter, One Euro Filter53
Ehlers and cycle indicatorsEhlers Indicators, Endpoint FFT44
Momentum and oscillatorsMomentum, Rate of Change, Delta / Change, Velocity / Acceleration, RSI, Connors RSI, Stochastic, Williams %R, Percent R, Ultimate Oscillator, Casey Percent C, Commodity Channel Index, MACD, TRIX, Trend Continuation Factor, QStick, Fisher Transform29
Trend and regimeDirectional Movement, Average Directional Index, Aroon, Vortex Indicator, Random Walk Index, Choppiness Index, Efficiency Ratio, Congestion Index, Follow-Through Index, Regime Detection, Hurst Exponent, Structural Breaks34
Volatility and bandsTrue Range, Volatility Estimators, Bid-Ask Spread Estimators, Ulcer Index, Bollinger Bands, Keltner Channels, Donchian Channels29
Volume and breadthAccumulation / Distribution, On-Balance Volume, Money Flow Index, Chaikin Oscillator, Klinger Volume Oscillator, Volume Flow, Volume Profile, Breadth22
Stops and trade stateStops and Reversals, SuperTrend, Trade State44
Signals and eventsCrossover Detection, Event Operators, Consecutive, N of M, Up / Down, Bar Classification32
Swings and pivotsSwings, Swing Points, Swing State, Pivots, Floor Trader Pivots, Darvas Box46
Patterns and chart typesChart Patterns, Candlesticks, Heikin-Ashi, Point and Figure, Kagi, DeMark Indicators, Elliott Wave91
Relative seriesRelative: Alignment, Relative: Ratio and Relative Strength, Relative: Channels, Relative: Correlation, Relative: Regression and Spread, Relative: Divergence, Relative: Lead-Lag and Phase, Relative: Cross-Section, Relative: Timeframes74