You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP β†’
Socket
Book a DemoInstallSign in
Socket

chart-patterns

Package Overview
Dependencies
Maintainers
1
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chart-patterns

Trading Chart Patterns

1.0.24
latest
npmnpm
Version published
Weekly downloads
129
-54.42%
Maintainers
1
Weekly downloads
Β 
Created
Source

chart-patterns

npm version GitHub license

Advanced Technical Analysis Library for Algo Traders

chart-patterns is a comprehensive TypeScript/JavaScript library that provides technical analysis tools for financial markets. This library includes traditional candlestick pattern recognition, volume analysis, order flow insights, and market structure identification.

πŸ“Š Market & Volume Distribution

ToolDescription
Market ProfileGenerates TPO profiles with Value Area, Initial Balance, and Point of Control.
Volume ProfileProcess candles or individual trades to build volume histograms with Point of Control and Value Area.
Value AreaCalculates Value Area, POC, and key volume levels from price data.

🧭 Support & Resistance

ToolDescription
Peak DetectorFinds swing highs/lows and directional ranges in price movement.
Pivot PointsCalculates classic pivot points and support/resistance levels.
Range FinderFinds key support and resistance zones from price swings.
ZscoreMeasures how far price deviates from the mean β€” useful for spotting extremes.
ZigzagsIdentifies significant price swings, filtering out minor moves.

πŸ” Orderflow

Footprint candles built from the Orderflow service.

ToolDescription
Stacked ImbalancesFinds clusters of aggressive buying or selling β€” potential turning points.
High Volume NodeHighlights price levels with exceptionally high traded volume.

βš™οΈ General Indicators

ToolDescription
EMAExponential Moving Average β€” responds faster to price changes.
MFIMoney Flow Index β€” volume-weighted RSI showing buying/selling pressure.
RSIRelative Strength Index β€” shows overbought/oversold conditions.
SMASimple Moving Average β€” smooths out price over a defined window.
Stochastic RSIStochastic oscillator applied to RSI β€” faster signals for momentum changes.
VWAPVolume-Weighted Average Price β€” key level used by institutions.

πŸ•―οΈ Candlestick Patterns

PatternDescription
DojiIndicates indecision β€” open and close are nearly equal.
EngulfingA reversal pattern where one candle fully engulfs the previous one.
ExcessIdentifies candles with excess (tails/wicks) suggesting rejection.
Morning Star / Evening StarReversal patterns formed across three candles β€” bullish or bearish.

Usage

import * as ta from 'chart-patterns';
import { IVolumeProfile, IMarketProfile, ILocalRange, IZScoreConfig } from 'chart-patterns/dist/types';
import { MARKET_PROFILE_PERIODS } from 'chart-patterns/dist/constants';

// Market Profile
const marketProfiles: IMarketProfile[] = ta.MarketProfile.build({
  candles,
  candleGroupingPeriod: MARKET_PROFILE_PERIODS.DAILY,
  tickSize: 0.1,
  pricePrecision: 2,
  tickMultiplier: 100,
  timezone: 'Europe/London'
});

// Volume Profile - Session-based API
// Create a session for candle-based volume profile
const barSession = ta.VolumeProfile.createBarSession({
  valueAreaRowSize: 24,
  valueAreaVolume: 0.7,
  pricePrecision: 2
});

// Process candles one by one
for (const candle of candles) {
  barSession.processCandle(candle);
}

// Get value area and distribution results
const valueArea = barSession.getValueArea();
const distribution = barSession.getVolumeDistribution();

// For raw trade data - even more precision
const tickSession = ta.VolumeProfile.createTickSession();
// Process each individual trade
for (const trade of trades) {
  tickSession.processTrade(trade);
}
// Get detailed trade analysis with exact price levels
const tickDistribution = tickSession.getVolumeDistribution();

// Money Flow Index - volume-based momentum oscillator
const mfiValues = ta.MFI.calculateMFI(candles, 14);

// RSI and Stochastic RSI
const rsiValues = ta.RSI.calculateRSI(candles, 14);
const stochRsiResult = ta.RSI.calculateStochasticRSI(candles, 14, 14, 3, 3);

// Z-Score configuration for peak/pattern detection algorithms
const zScoreConfig: IZScoreConfig = {
  lag: 2,        // Controls smoothing and adaptability to trend changes
  threshold: 0.1, // Number of standard deviations to classify a signal
  influence: 1    // How strongly signals affect future calculations (0-1)
};

const ranges: ILocalRange[] = ta.RangeBuilder.findRanges(candles, zScoreConfig);

// Create zigzag points for pattern recognition
const zigzags = ta.ZigZags.create(candles, zScoreConfig);
  • Maket Profile image

  • Ranges rr_fullsize

FAQs

Package last updated on 15 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts