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

@tradejs/strategy-cup-and-handle

v3.0.6

Published

Cup-and-handle and inverse-pattern strategy with pivot geometry, breakout confirmation, retests, and structural risk for TradeJS.

Readme

@tradejs/strategy-cup-and-handle

TradeJS strategy plugin providing CupAndHandle.

Strategy overview

CupAndHandle detects bullish cup-and-handle and bearish inverse formations from replayable pivots. It validates rim similarity, cup depth and symmetry, handle depth, and pattern age, then enters on breakout, close acceptance, or retest with geometry-derived stops and targets.

The optional CUPHANDLE_REQUIRE_PATH_QUALITY guard requires both cup legs to progress on more than half of their comparable closes. In deterministic AI_MODE: "gate", the strategy-local gate approves both LONG and SHORT signals only when the nearest resistance has at least 19 hits and the target's 20-period beta to ETH is non-negative. Missing gate features fail closed.

Logic at a glance

CupAndHandle strategy logic

Signal on an example chart

The chart labels the two rims, rounded cup, bounded handle, and the rim breakout that turns the completed formation into a LONG signal.

CupAndHandle signal on an illustrative ticker chart

The illustration is schematic, not market data. Exact thresholds, confirmation rules, and risk parameters come from the active TradeJS strategy config.

Install

yarn add @tradejs/strategy-cup-and-handle

Register the package in tradejs.config.ts:

import { defineConfig } from "@tradejs/core/config";

export default defineConfig({
  strategies: ["@tradejs/strategy-cup-and-handle"],
});

The package exports strategyEntries for the TradeJS plugin loader together with its strategy definitions, manifests, default configs, and public AI/ML adapters. Strategy implementation changes are released from this repository, independently of the TradeJS engine.

Development

yarn install --immutable
yarn checks

Publishing is beta-first and delegated to the pinned TradeJS-Workflows@v1 reusable workflow. A relevant push publishes a unique prerelease and moves the npm beta tag only after the repository checks pass and the published tarball imports successfully in a clean npm consumer. The current verified beta is promoted to one stable latest release by the weekly automation; production never consumes prereleases.

Keywords: ai, claude, codex.

Runtime host contract

All @tradejs/* runtime packages are peer dependencies. The consuming TradeJS Project owns their exact installed versions and package manifest, so this package never loads a hidden nested engine, types package, indicator package, or Strategy Kit. Repository builds use matching dev dependencies only.