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:
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).
| Category | Sections | Functions |
|---|
| Series operations | Core, Arithmetic, Comparison, Conditional, Function Application, Map, Slice Operations, Sorting, Highest / Lowest, Index Of, Variable-Length Windows | 52 |
| Maths | Math, Clamp, Gaussian Distribution, Random | 57 |
| Statistics and regression | Statistics, Percent Rank, R-Squared, Spearman Rank Correlation, Linear Regression, Fractional Differencing | 29 |
| Moving averages and filters | Moving Averages, KAMA, Cong Adaptive MA, Kalman Filter, One Euro Filter | 53 |
| Ehlers and cycle indicators | Ehlers Indicators, Endpoint FFT | 44 |
| Momentum and oscillators | Momentum, 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 Transform | 29 |
| Trend and regime | Directional Movement, Average Directional Index, Aroon, Vortex Indicator, Random Walk Index, Choppiness Index, Efficiency Ratio, Congestion Index, Follow-Through Index, Regime Detection, Hurst Exponent, Structural Breaks | 34 |
| Volatility and bands | True Range, Volatility Estimators, Bid-Ask Spread Estimators, Ulcer Index, Bollinger Bands, Keltner Channels, Donchian Channels | 29 |
| Volume and breadth | Accumulation / Distribution, On-Balance Volume, Money Flow Index, Chaikin Oscillator, Klinger Volume Oscillator, Volume Flow, Volume Profile, Breadth | 22 |
| Stops and trade state | Stops and Reversals, SuperTrend, Trade State | 44 |
| Signals and events | Crossover Detection, Event Operators, Consecutive, N of M, Up / Down, Bar Classification | 32 |
| Swings and pivots | Swings, Swing Points, Swing State, Pivots, Floor Trader Pivots, Darvas Box | 46 |
| Patterns and chart types | Chart Patterns, Candlesticks, Heikin-Ashi, Point and Figure, Kagi, DeMark Indicators, Elliott Wave | 91 |
| Relative series | Relative: 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: Timeframes | 74 |