@trading-toolkit/smc
v0.1.1
Published
TypeScript Smart Money Concepts indicators
Readme
@trading-toolkit/smc
TypeScript implementations of common Smart Money Concepts (SMC) indicators.
Install
npm install @trading-toolkit/smcRequires Node.js 22.14 or later.
Usage
import { smc, type OhlcData } from "@trading-toolkit/smc";
const candles: OhlcData = {
open: [100, 101, 104],
high: [102, 105, 108],
low: [99, 100, 103],
close: [101, 104, 107],
volume: [1000, 1200, 1400],
};
const gaps = smc.fvg(candles);
const swings = smc.swingHighsLows(candles, 5);OhlcData.dates is required by previousHighLow() and sessions() and must be
an ascending array of date strings with one item per candle.
API
The smc export provides these indicator methods:
fvg(ohlc, joinConsecutive?)swingHighsLows(ohlc, swingLength?)bosChoch(ohlc, swingHighsLows, closeBreak?)ob(ohlc, swingHighsLows, closeMitigation?)liquidity(ohlc, swingHighsLows, rangePercent?)previousHighLow(ohlc, timeFrame?)sessions(ohlc, session?, startTime?, endTime?, timeZone?)retracements(ohlc, swingHighsLows)
Public result and input types are exported from the package root.
Important: indicator timing
Several SMC concepts require future candles to identify or fully annotate a historical setup. In particular, FVG mitigation, symmetric swings, BOS/CHoCH, order blocks, liquidity, and retracements are retrospective indicators. Do not treat the array index where an annotation is written as the time it became tradable. A trading or backtesting application must model when every signal becomes known and use only information available at that point.
Development
npm ci
npm run lint
npm run typecheck
npm test
npm run build
npm pack --dry-runThe published tarball is intentionally limited to compiled dist/ files,
README.md, and LICENSE.
