An open-source visual charting & SVG diagram engine for trading documentation, SMC/ICT playbooks, and technical analysis guides.
English • Bahasa Indonesia • 简体中文
Built with React, TypeScript, Tailwind CSS, SVG, and TradingView Lightweight Charts v5.
- Visual Studio (
CustomChartBuilderModal,ChartCanvas,CandleTemplateTray): Interactive editor to place and customize candlesticks, market structure lines, zones, and annotations with live Dark/Light theme support. - Declarative JSON Renderer (
CustomChartRenderer): Render crisp, zoomable, pan-ready SVG trading diagrams directly from a typedCustomChartConfigJSON object. - Rich Trading Primitives:
- Candlesticks & Indicators: OHLC candles with custom colors/labels, optional volume histogram, and EMA overlay.
- Zones (
BoxDrawing): Order Blocks (order_block), Fair Value Gaps (fvg), Supply/Demand (supply_demand), and Liquidity Pools (liquidity_pool) with optional 50% Mean Threshold / Consequent Encroachment midlines. - Fibonacci Retracements (
FibonacciDrawing): Custom levels and shaded OTE (Optimal Trade Entry) Golden Pocket zones. - Risk/Reward Positions (
PositionDrawing): Long & Short entry/SL/TP boxes with automatic R:R ratio badges. - Structure & Flow:
TrendlineDrawing(BOS / CHoCH with rays & arrows),PolylineDrawing(zigzagorsmoothmacro waves), andArrowDrawing(straight or curved pointers). - Educational Callouts:
InfoCardDrawing(multi-line phase cards with step badges) andTextBadgeAnnotation(pill,badge,outline,callout).
- One-Click Export: Copy
CustomChartConfigJSON or export the rendered chart directly as an.svgfile for Markdown, Notion, GitHub, or web docs.
- Powered by TradingView
lightweight-chartsv5 (CandlestickSeries,HistogramSeries). - Supports interactive crosshair, markers (
arrowUp,arrowDown,circle,square), horizontal key price levels, and price box overlays.
- Ready-to-use vector diagrams covering core trading concepts (Candlestick Anatomy, Market Structure, BOS/CHoCH, Strong/Weak Levels, Supply & Demand, Order Blocks, and more).
- Display and annotate external chart screenshots or TradingView snapshot URLs (
https://www.tradingview.com/x/...auto-resolved to direct image URLs) with zoom and lightbox support.
- Drop-in component that unifies
preset,interactive_chart, andsnapshotmodes behind a single mode-switching interface.
- Bun (recommended) or Node.js 18+
# Install dependencies
bun install
# Start the TraderChart Studio
bun run devOpen http://localhost:3000 in your browser to launch TraderChart Studio.
bun run build
bun run previewpublic/
└── logo.svg # Project vector logo
src/
├── App.tsx # Standalone TraderChart Studio
├── types/
│ └── chartBuilderTypes.ts # CustomChartConfig & drawing primitive types
├── data/
│ └── sampleCharts.ts # Built-in SMC & FVG JSON presets
└── components/
├── VisualDiagram.tsx # Preset SVG trading diagram library
├── chart-builder/
│ ├── CustomChartBuilderModal.tsx # Interactive visual chart editor modal
│ ├── ChartCanvas.tsx # Interactive SVG editing canvas
│ └── CandleTemplateTray.tsx # Candlestick & scenario template tray
└── illustration/
├── CustomChartRenderer.tsx # Declarative SVG chart renderer
├── InteractiveTradingChart.tsx # Lightweight Charts v5 wrapper
├── ChartSnapshotViewer.tsx # Snapshot viewer & annotator
├── PresetSvgCatalog.tsx # Searchable preset diagram catalog
└── UnifiedIllustrationEngine.tsx # Multi-mode illustration wrapper
Embed any chart in your React documentation app by passing a CustomChartConfig object:
import { CustomChartRenderer } from './components/illustration/CustomChartRenderer';
import type { CustomChartConfig } from './types/chartBuilderTypes';
const config: CustomChartConfig = {
title: 'LIQUIDITY SWEEP & ORDER BLOCK ENTRY',
subtitle: 'BTC/USDT H1 • Bullish Displacement & 50% Mean Threshold Retest',
candleSpacing: 'wide',
showCandles: true,
showVolume: true,
candles: [
{ id: 'c0', index: 0, open: 100, high: 104, low: 98, close: 103, volume: 1200, label: 'Consolidation' },
{ id: 'c1', index: 1, open: 103, high: 105, low: 93, close: 97, volume: 2800, label: 'Judas Sweep' },
{ id: 'c2', index: 2, open: 97, high: 110, low: 96, close: 108, volume: 3900, label: 'Displacement' },
{ id: 'c3', index: 3, open: 108, high: 116, low: 107, close: 115, volume: 3400, label: 'BOS High' },
{ id: 'c4', index: 4, open: 115, high: 116, low: 103, close: 105, volume: 1400, label: 'OB Retest' },
{ id: 'c5', index: 5, open: 105, high: 125, low: 104, close: 123, volume: 4200, label: 'Expansion TP' },
],
boxes: [
{
id: 'ob-demand',
boxType: 'order_block',
startIndex: 1,
endIndex: 4,
topPrice: 103,
bottomPrice: 94,
label: 'Bullish Order Block (OB)',
labelPosition: 'bottom-left',
color: '#10B981',
opacity: 0.18,
showMidLine: true,
midLineLabel: '50% MT',
},
],
trendlines: [
{
id: 'tl-bos',
x1Index: 0,
y1Price: 104,
x2Index: 3,
y2Price: 104,
color: '#10B981',
strokeWidth: 1.6,
lineStyle: 'dashed',
label: 'BOS Valid Body Close',
labelAlignment: 'center',
showArrow: true,
},
],
};
export function ExampleDocChart() {
return <CustomChartRenderer config={config} title={config.title} />;
}When authoring CustomChartConfig JSON manually or via AI agents, follow these rules to keep charts clean and readable:
- 3-Tier Vertical Zoning:
- Lower Tier (3%–6% below lowest wick): Place SSL sweeps, demand labels, and long stop-loss badges.
- Middle Tier (candle body range): Reserve strictly for candles, Order Block / FVG boxes, and BOS trendlines. Never place
infoCardsorbadgesinside candle bodies. - Upper Tier (4%–8% above highest wick): Place BSL sweeps, resistance labels, and take-profit badges.
- Spacious Horizontal Spacing:
- Use
candleSpacing: 'wide'(92px step) or'ultra-wide'(120px step) whenever usinginfoCardsor multi-wordbadges.
- Use
- InfoCard Anchoring:
- Place right-side
infoCardsatcandleIndex: lastIndex + 1withalignX: 'left'so they extend into open whitespace rather than overlapping candles.
- Place right-side
- Standard Semantic Palette:
| Concept | Hex Color | Usage |
|---|---|---|
| Bullish / Demand / Order Block | #10B981 |
Demand zones, bullish displacement, long targets |
| Bearish / Supply / Liquidity Sweep | #EF4444 / #F43F5E |
Supply zones, stop loss, sweep callouts |
| Fair Value Gap (FVG) | #38BDF8 |
Price imbalance / inefficiency zones |
| Liquidity Pools (BSL / SSL) | #FACC15 / #F59E0B |
Equal highs/lows, retail stop clusters |
| Fibonacci OTE Zone | #8B5CF6 |
61.8% – 78.6% retracement pocket |
MIT License — see LICENSE for details.