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()orValue(0);Value(1)reads the preceding value. LookBack(n)removes the latestnobservations;Window(n)selects a trailing window for positiven. 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).