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 A–Z function index to find a name, or choose a category below. Each category contains the function signatures and complete documentation from the package.

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

298 functions in 78 categories, from the nseries version pinned by this release (044ce6d94f55).

CategoryFunctions
Core16
Arithmetic4
Comparison10
Conditional1
Function Application1
Map1
Slice Operations2
Sorting2
Math51
Moving Averages13
Ehlers Indicators29
KAMA1
Cong Adaptive MA1
Casey Percent C4
Kalman Filter1
One Euro Filter1
Bollinger Bands2
Donchian Channels3
Keltner Channels5
RSI2
Connors RSI1
Stochastic1
Williams %R1
Percent R1
Percent Rank1
MACD1
TRIX2
Commodity Channel Index1
Aroon2
Momentum1
Rate of Change1
Delta / Change2
Directional Movement2
Average Directional Index1
Vortex Indicator2
True Range3
SuperTrend1
Choppiness Index1
Accumulation / Distribution1
On-Balance Volume1
Money Flow Index2
Chaikin Oscillator1
Volume Profile7
Pivots2
Floor Trader Pivots7
Swings3
Swing Points2
Bar Classification2
Highest / Lowest2
Index Of4
Crossover Detection4
Consecutive4
N of M4
Up / Down3
Congestion Index1
Follow-Through Index4
Regime Detection2
Hurst Exponent2
Efficiency Ratio1
Statistics4
R-Squared1
Spearman Rank Correlation1
Relative: Alignment1
Relative: Ratio and Relative Strength3
Relative: Channels8
Relative: Correlation11
Relative: Regression and Spread13
Relative: Divergence7
Relative: Lead-Lag and Phase4
Relative: Timeframes0
Linear Regression1
Fisher Transform2
Gaussian Distribution1
Random2
Clamp1
Velocity / Acceleration2
QStick1
Ulcer Index1