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

wickchart-scenario

v0.1.0

Published

Scenario planning for wickchart — ghost paths of future prices with σ-volatility cones widening with √h, plus R-multiple risk plans (entry/stop anchor, kR reward lines, risk/reward shading). Opt-in plugin, zero dependencies beyond wickchart's pure core.

Readme

wickchart-scenario

npm

Scenario planning for wickchart, as an opt-in plugin — two planning surfaces drawn straight onto the chart:

  • Scenario projection — a ghost path of future prices plus optional σ-bands (a volatility cone widening with √h from realized volatility). Setting a scenario reserves future space on the right so the projection stays visible.
  • Risk plan — an R-multiple grid anchored at entry/stop. 1R = |entry − stop|; reward lines are drawn at kR beyond the entry with risk/reward zones shaded, so sizing and take-profit choices read directly off the chart.
npm install wickchart wickchart-scenario

import 'wickchart';
import { attachScenario } from 'wickchart-scenario';

const scenario = attachScenario(chart);

chart.setScenario({ path: [64000, 65500, 68000], label: 'bull case' });
chart.setScenario({ horizon: 48 });          // cone-only projection
chart.setScenario({ horizon: 24, cone: false }); // path/labels only
chart.scenario;                              // a copy of the active one
chart.clearScenario();

chart.setRiskPlan({ entry: 64500, stop: 63800, multiples: [1, 2, 3] });
chart.setRiskPlan({ entry: 64500, stop: 63800, targets: [65900, 67300] });
chart.riskPlan;   // { entry, stop, risk, direction, levels: [{k, price}], … }
chart.clearRiskPlan();

scenario.detach();

Attaching installs the familiar methods on the instance, so existing call sites keep their shape. Until wickchart 2.0 the core element ships its own identical methods; attaching shadows them (this package is the home they move into at the cut — see ROADMAP-V2.md in the repo).

Semantics

  • Invalid specs are dropped, never thrown — and clear what was there before (replace semantics, same as setOverlays).
  • Scenario: path is future bars 1..N (plain prices or {price} objects, junk dropped, capped at 250); horizon 1–500 defaults to the path length; levels are σ multipliers (default [1, 2], each ≤ 5); color accepts up/down/accent or safe CSS colors.
  • Risk plan: direction is derived (stop below entry ⇒ long); explicit targets convert to their signed R multiple, wrong-side prices drop; multiples win when both are given; at most 8 levels, each ≤ 20R.
  • Both are analysis data, excluded from getState()/setState() — they are app state, not chart state.

API

attachScenario(chart) returns the controller; the methods land on the chart itself:

| Method | Meaning | | ------ | -------------------------------------------------------- | | chart.setScenario(spec) | project a path + cone; returns the normalized spec or null | | chart.clearScenario() | remove the projection | | chart.scenario | a copy of the active scenario (or null) | | chart.setRiskPlan(spec) | lay out the R-multiple grid; same return contract | | chart.clearRiskPlan() | remove the plan | | chart.riskPlan | a copy of the active plan (or null) | | scenario.detach() | restore the element's own methods |

The pure surface (validators, the √h cone math, realized volatility) is a separate import: wickchart-scenario/core. During 1.x it re-exports the functions from wickchart/core unchanged — they are shared (the scene validator in wickchart-narrator imports the same normalizers) — and they settle into this package at the 2.0 cut.

MIT.