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-paper

v0.1.0

Published

Paper trading for wickchart — orders against the replayed tape with honest fills (next-bar opens, gap-aware limits), a docked equity curve with peak/drawdown, and the position mirrored onto the chart. Opt-in plugin, zero dependencies, zero core changes.

Readme

wickchart-paper

npm

Paper trading for wickchart, as an opt-in plugin — place orders while wickchart-replay plays the tape forward, watch them fill at honest prices, and see the session's equity curve docked under the chart. Zero dependencies, zero core changes: the engine is plain data in / data out, driven from the chart's public wick:replay events and rendered through the layer API.

npm install wickchart wickchart-replay wickchart-paper

import 'wickchart';
import { attachReplay } from 'wickchart-replay';
import { attachPaper } from 'wickchart-paper';

const chart = document.querySelector('wick-chart');
const replay = attachReplay(chart);
const paper = attachPaper(chart, { cash: 10000, fee: 0.0004 });

replay.start();          // ~70% into the data, future hidden
paper.buy(1);            // queued — fills at the NEXT bar's open
paper.buyLimit(95, 1);   // working until a bar trades through it
paper.flatten();         // market-close the whole position
replay.play(8);          // watch the fills and the equity curve

paper.stats;             // equity, realized, trades, winRate, maxDD, series
paper.detach();

The open position mirrors onto the core positions API (addPosition) — an entry line with a live P&L readout on the price chart itself. Fills draw as dots on the equity curve.

The honesty contract

  • An order placed while paused at bar N fills during bar N+1 — you can never trade a close you have already seen.
  • Market orders fill at the next bar's open.
  • Limit orders fill at the limit, or at the open when the open gaps through it — the better price for the taker, never worse.
  • Equity is marked at each bar's close: cash + qty × close; peak and max drawdown are tracked off that series.
  • Seeking the replay backwards (or looping) resets the session — equity restarts from the new anchor.

Accounting

Signed quantities net and flip (sell 5 against a long of 2 closes it and opens a short of 3; the flip's fee splits proportionally between the closed trade and the new position). Adds average the entry. Fees (fee — a fraction of fill notional, e.g. 0.0004 = 4 bps) come off cash per fill.

API

attachPaper(chart, { cash = 10000, fee = 0, dock = 44 }) returns the controller:

| Method | Meaning | | ------ | -------------------------------------------------------------- | | buy(qty) / sell(qty) | queue a market order (fills next open) | | buyLimit(price, qty) / sellLimit(price, qty) | working limit orders | | cancel(id) | remove a working order | | flatten() | queue a market order that exactly closes the position | | reset(time?) | restore the starting account | | stats | { cash, position, realized, trades, wins, winRate, maxDD, series, … } | | detach() | unsync and remove the strip |

Events on the chart (wick:paper): order, fill, close, cancel, reset — the detail carries the affected object plus the live position, realized P&L and equity.

The pure engine (PaperModel) is a separate import with no DOM and no chart: import { PaperModel } from 'wickchart-paper/core' — useful for backtesting strategies directly against arrays of bars.

MIT.