npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@stocksharp/indicators

v4.0.0

Published

StockSharp JS Indicators — 163 technical-analysis indicators driven bar by bar, a machine-readable catalogue of their parameters, and a suite that checks them against the C# StockSharp platform. No DOM, no dependencies.

Readme

StockSharp JS Indicators

@stocksharp/indicators — the technical-analysis layer of the StockSharp web stack, as a standalone, dependency-free package: ~165 indicators with both a batch and an incremental implementation, a machine-readable catalogue of their parameters, and a parity suite that checks the arithmetic against the C# platform rather than against itself.

No DOM, no canvas, no chart. The package computes numbers; drawing them is somebody else's job. @stocksharp/chart is the first consumer.

Install

npm install @stocksharp/indicators

Browser, no bundler — the IIFE build publishes the SSIndicators global:

<script src="https://unpkg.com/@stocksharp/indicators/dist/ssindicators.js"></script>

Two ways to compute

Batch — a whole series at once, one output point per input bar. This is what a chart redraw wants:

import { apply, getCalcFn } from '@stocksharp/indicators';

const candles = [{ time: 1710000000, open: 1, high: 2, low: 0.5, close: 1.5 }, /* ... */];

const sma = apply('SimpleMovingAverage', candles, { length: 20 });  // [{time, value}, ...]
const bb  = apply('bb', candles, { length: 20, deviation: 2 });     // {upper: [...], middle: [...], lower: [...]}

Both the platform's canonical kind (SimpleMovingAverage) and its short alias (sma) resolve to the same function, case-insensitively.

Incremental — one bar in, one value out, O(1) per update, with the running state kept inside. This is what a live feed wants:

import { IndicatorRuntime, RelativeStrengthIndexIndicator } from '@stocksharp/indicators';

const rsi = new IndicatorRuntime({
    definition: RelativeStrengthIndexIndicator,
    parameters: { length: 14 },
});

for (const bar of stream)
    rsi.update({ time: bar.time, value: bar }, /* isFinal */ true);

rsi.points('line');   // the formed values, aligned to their bar index

The runtime is built for a live feed rather than a replay: the unclosed bar can be pushed with isFinal: false and withdrawn (discardPreview), a bar that arrives corrected is replayed from the nearest checkpoint (correct), and the whole state serialises (snapshot) so a reconnect does not recompute the history.

The two paths are independent implementations of the same formula and are tested against each other — a divergence between them is a bug in one of them.

The catalogue

Every indicator is described by data, not by prose: its canonical kind, aliases, parameter keys with defaults and ranges, output shape, and which pane it belongs on.

import { getClientCatalog, getIndicatorDefinition } from '@stocksharp/indicators';

getClientCatalog();                                   // the full list, ready for a picker UI
getIndicatorDefinition('MoneyFlowIndex')?.parameters; // one entry

A UI can build its indicator picker straight from this without knowing a single indicator by name.

Correctness

The reference is StockSharp's C# Algo.Indicators, not this package's own output. npm test requires the .NET SDK and a sibling StockSharp (GitHub) checkout, builds a dumper against the real platform, and compares catalogue and values against it. If the oracle is unavailable, the command fails: an unverified parity run must never publish as green.

See AGENTS.md for the layout, the commands and the rules that keep the parity suite honest.

License

Proprietary — see LICENSE and NOTICE.