{"id":34857518,"url":"https://github.com/deepentropy/lightweight-charts-indicators","last_synced_at":"2026-02-28T01:48:35.057Z","repository":{"id":328873569,"uuid":"1113047661","full_name":"deepentropy/lightweight-charts-indicators","owner":"deepentropy","description":"120+ Technical analysis indicators for TradingView's lightweight-charts v5 library","archived":false,"fork":false,"pushed_at":"2026-02-25T19:39:34.000Z","size":3409,"stargazers_count":50,"open_issues_count":0,"forks_count":9,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-25T19:54:54.992Z","etag":null,"topics":["lightweight-charts","technical-analysis","tradingview"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deepentropy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-09T12:59:30.000Z","updated_at":"2026-02-25T19:39:38.000Z","dependencies_parsed_at":"2025-12-19T15:03:22.464Z","dependency_job_id":null,"html_url":"https://github.com/deepentropy/lightweight-charts-indicators","commit_stats":null,"previous_names":["deepentropy/lightweight-charts-indicators"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/deepentropy/lightweight-charts-indicators","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepentropy%2Flightweight-charts-indicators","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepentropy%2Flightweight-charts-indicators/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepentropy%2Flightweight-charts-indicators/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepentropy%2Flightweight-charts-indicators/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deepentropy","download_url":"https://codeload.github.com/deepentropy/lightweight-charts-indicators/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deepentropy%2Flightweight-charts-indicators/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29918973,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"ssl_error","status_checked_at":"2026-02-27T19:37:41.463Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lightweight-charts","technical-analysis","tradingview"],"created_at":"2025-12-25T20:14:34.641Z","updated_at":"2026-02-28T01:48:35.049Z","avatar_url":"https://github.com/deepentropy.png","language":"TypeScript","funding_links":[],"categories":["Community"],"sub_categories":["Lightweight Charts™"],"readme":"# lightweight-charts-indicators\n\n**[Live Demo](https://deepentropy.github.io/lightweight-charts-indicators/)**\n\n446 technical analysis indicators for TradingView's lightweight-charts library — 82 standard indicators, 317 community indicators, and 44 candlestick patterns. PineScript v6 compatible with full drawing primitive support (lines, boxes, labels, tables).\n\n## Installation\n\n```bash\nnpm install lightweight-charts-indicators oakscriptjs lightweight-charts\n```\n\n## Quick Start\n\n```typescript\nimport { SMA, RSI, MACD, BollingerBands } from 'lightweight-charts-indicators';\nimport type { Bar } from 'oakscriptjs';\n\nconst bars: Bar[] = [\n  { time: 1, open: 100, high: 105, low: 95, close: 102, volume: 1000 },\n  // ... more bars\n];\n\n// Simple Moving Average\nconst smaResult = SMA.calculate(bars, { len: 14 });\n\n// RSI\nconst rsiResult = RSI.calculate(bars, { length: 14 });\n\n// MACD\nconst macdResult = MACD.calculate(bars, { fastLength: 12, slowLength: 26, signalLength: 9 });\n\n// Bollinger Bands\nconst bbResult = BollingerBands.calculate(bars, { length: 20, mult: 2 });\n```\n\n## Lightweight-Charts Integration Example\n\nHere's a complete example showing how to integrate indicators with TradingView's lightweight-charts:\n\n```typescript\nimport { createChart, ColorType, LineSeries, CandlestickSeries } from 'lightweight-charts';\nimport { SMA, RSI, BollingerBands } from 'lightweight-charts-indicators';\nimport type { Bar } from 'oakscriptjs';\n\n// Sample OHLCV data\nconst bars: Bar[] = [\n  { time: 1609459200, open: 100, high: 105, low: 98, close: 103, volume: 1000 },\n  { time: 1609545600, open: 103, high: 108, low: 101, close: 107, volume: 1200 },\n  { time: 1609632000, open: 107, high: 110, low: 104, close: 105, volume: 900 },\n  // ... more bars\n];\n\n// Create the main chart\nconst chartContainer = document.getElementById('chart')!;\nconst chart = createChart(chartContainer, {\n  layout: {\n    background: { type: ColorType.Solid, color: '#1e1e1e' },\n    textColor: '#d1d4dc',\n  },\n  width: 800,\n  height: 400,\n});\n\n// Add candlestick series\nconst candlestickSeries = chart.addSeries(CandlestickSeries);\ncandlestickSeries.setData(bars.map(bar =\u003e ({\n  time: bar.time as number,\n  open: bar.open,\n  high: bar.high,\n  low: bar.low,\n  close: bar.close,\n})));\n\n// Calculate and add SMA overlay\nconst smaResult = SMA.calculate(bars, { len: 20, src: 'close' });\nconst smaSeries = chart.addSeries(LineSeries, { color: '#2962FF', lineWidth: 2 });\nsmaSeries.setData(smaResult.plots.plot0);\n\n// Calculate and add Bollinger Bands\nconst bbResult = BollingerBands.calculate(bars, { length: 20, mult: 2 });\nconst bbUpperSeries = chart.addSeries(LineSeries, { color: '#787B86', lineWidth: 1 });\nconst bbMiddleSeries = chart.addSeries(LineSeries, { color: '#FF6D00', lineWidth: 1 });\nconst bbLowerSeries = chart.addSeries(LineSeries, { color: '#787B86', lineWidth: 1 });\nbbUpperSeries.setData(bbResult.plots.plot0);  // Upper band\nbbMiddleSeries.setData(bbResult.plots.plot1); // Basis (middle)\nbbLowerSeries.setData(bbResult.plots.plot2);  // Lower band\n\n// Create a separate pane for RSI (oscillator)\nconst rsiContainer = document.getElementById('rsi-chart')!;\nconst rsiChart = createChart(rsiContainer, {\n  layout: {\n    background: { type: ColorType.Solid, color: '#1e1e1e' },\n    textColor: '#d1d4dc',\n  },\n  width: 800,\n  height: 150,\n});\n\nconst rsiResult = RSI.calculate(bars, { length: 14, src: 'close' });\nconst rsiSeries = rsiChart.addSeries(LineSeries, { color: '#7E57C2', lineWidth: 2 });\nrsiSeries.setData(rsiResult.plots.plot0);\n\n// Sync the time scales\nchart.timeScale().subscribeVisibleLogicalRangeChange(range =\u003e {\n  if (range) rsiChart.timeScale().setVisibleLogicalRange(range);\n});\n```\n\n## Available Indicators (446)\n\n### Moving Averages\n\n| Indicator | Export | Description |\n|-----------|--------|-------------|\n| Simple Moving Average | `SMA` | Arithmetic mean over a specified period |\n| Exponential Moving Average | `EMA` | Weighted average giving more weight to recent prices |\n| Weighted Moving Average | `WMA` | Linearly increasing weights |\n| Smoothed Moving Average (RMA) | `RMA` | Wilder smoothing (alpha = 1/length) |\n| Double EMA | `DEMA` | Reduces lag by applying EMA twice |\n| Triple EMA | `TEMA` | Further reduces lag with triple exponential smoothing |\n| Hull Moving Average | `HMA` | Reduces lag while maintaining smoothness |\n| Least Squares Moving Average | `LSMA` | Uses linear regression to fit a line |\n| Arnaud Legoux Moving Average | `ALMA` | Gaussian distribution to reduce lag |\n| Volume Weighted Moving Average | `VWMA` | Moving average weighted by volume |\n| Smoothed Moving Average | `SMMA` | Wilder smoothing moving average |\n| McGinley Dynamic | `McGinleyDynamic` | Adaptive moving average that adjusts to market speed |\n| MA Cross | `MACross` | Two moving averages for crossover signals |\n| Moving Average Ribbon | `MARibbon` | Multiple MAs showing trend direction and momentum |\n| Zero Lag LSMA | `ZLSMA` | Double linreg to cancel LSMA lag |\n\n### Oscillators\n\n| Indicator | Export | Description |\n|-----------|--------|-------------|\n| Relative Strength Index | `RSI` | Momentum oscillator (0-100) measuring price changes |\n| Stochastic | `Stochastic` | Compares closing price to price range |\n| Stochastic RSI | `StochRSI` | Stochastic applied to RSI values |\n| Commodity Channel Index | `CCI` | Measures variation from statistical mean |\n| Williams %R | `WilliamsPercentRange` | Momentum showing overbought/oversold levels |\n| Awesome Oscillator | `AwesomeOscillator` | Market momentum using SMA difference |\n| Chande Momentum Oscillator | `ChandeMO` | Momentum on a scale of -100 to +100 |\n| Detrended Price Oscillator | `DPO` | Removes trend to identify cycles |\n| Relative Vigor Index | `RVI` | Measures conviction of price action |\n| SMI Ergodic Indicator | `SMIErgodic` | TSI-based momentum with signal line |\n| SMI Ergodic Oscillator | `SMIErgodicOscillator` | SMI minus signal as histogram |\n| True Strength Index | `TSI` | Double-smoothed momentum oscillator |\n| Woodies CCI | `WoodiesCCI` | CCI with turbo for faster signals |\n| Bollinger Bands %B | `BBPercentB` | Price position relative to BB (0=lower, 1=upper) |\n| Fisher Transform | `FisherTransform` | Gaussian distribution for clearer turning points |\n| Ultimate Oscillator | `UltimateOscillator` | Multi-timeframe weighted momentum |\n| Rank Correlation Index | `RCI` | Correlation between price rank and time rank |\n| RCI Ribbon | `RCIRibbon` | Multiple RCI lines for trend visualization |\n| Relative Volatility Index | `RelativeVolatilityIndex` | Volatility-based oscillator |\n| Chop Zone | `ChopZone` | Colored zone indicator for market choppiness |\n| CCT Bollinger Band Oscillator | `CCTBBO` | Normalized BB position (0-100) with signal line |\n| KDJ | `KDJ` | Extended Stochastic with J line (3K - 2D) |\n| WaveTrend | `WaveTrend` | Channel index oscillator with cross signals |\n| Forecast Oscillator | `ForecastOscillator` | Percentage deviation from linear regression |\n| Schaff Trend Cycle | `SchaffTrendCycle` | Double stochastic smoothing of MACD |\n\n### Momentum\n\n| Indicator | Export | Description |\n|-----------|--------|-------------|\n| MACD | `MACD` | Relationship between two EMAs |\n| Momentum | `Momentum` | Rate of change of price |\n| Rate of Change | `ROC` | Percentage change over a period |\n| Balance of Power | `BOP` | Strength of buyers vs sellers |\n| Bull Bear Power | `BullBearPower` | Buying/selling pressure relative to EMA |\n| Elder Force Index | `ElderForceIndex` | Combines price and volume |\n| Price Oscillator (PPO) | `PriceOscillator` | MACD as percentage for comparison |\n| Coppock Curve | `CoppockCurve` | Long-term momentum using ROC and WMA |\n| TRIX | `TRIX` | Triple EMA rate of change, filters noise |\n| Connors RSI | `ConnorsRSI` | Composite of RSI, streak, and percentile rank |\n| KST | `KST` | Know Sure Thing - weighted ROC sum |\n| MACD 4C | `MACD4C` | MACD histogram with 4-color coding |\n| Squeeze Momentum | `SqueezeMomentum` | BB/KC squeeze with momentum oscillator |\n| Impulse MACD | `ImpulseMACD` | ZLEMA vs SMMA channel impulse |\n\n### Trend\n\n| Indicator | Export | Description |\n|-----------|--------|-------------|\n| Average Directional Index | `ADX` | Measures trend strength regardless of direction |\n| Directional Movement Index | `DMI` | +DI, -DI, and ADX for trend direction/strength |\n| Ichimoku Cloud | `IchimokuCloud` | Comprehensive trend system with support/resistance |\n| Parabolic SAR | `ParabolicSAR` | Trend-following with entry/exit points |\n| Supertrend | `Supertrend` | ATR-based dynamic support/resistance |\n| Aroon | `Aroon` | Trend strength by time since high/low |\n| BBTrend | `BBTrend` | Measures trend using Bollinger Bands |\n| Choppiness Index | `Choppiness` | Market choppiness vs trending |\n| Mass Index | `MassIndex` | Identifies reversals via high-low range |\n| Vortex Indicator | `VortexIndicator` | Identifies trend start and direction |\n| Williams Alligator | `WilliamsAlligator` | Three smoothed MAs for trend detection |\n| Zig Zag | `ZigZag` | Connects pivot highs and lows |\n| Trend Strength Index | `TrendStrengthIndex` | Trend strength based on directional movement |\n| Chande Kroll Stop | `ChandeKrollStop` | ATR-based trailing stop system |\n| Williams Fractals | `WilliamsFractals` | Identifies reversal points in price |\n| Moon Phases | `MoonPhases` | New and full moon markers |\n| TWAP | `TWAP` | Time-weighted average price |\n| Coral Trend | `CoralTrend` | Cascaded EMA filter for smooth trend detection |\n| Chandelier Exit | `ChandelierExit` | ATR-based trailing stop system |\n| Donchian Trend Ribbon | `DonchianTrendRibbon` | Multi-layer Donchian breakout composite score |\n\n### Volatility\n\n| Indicator | Export | Description |\n|-----------|--------|-------------|\n| Average True Range | `ATR` | Average range between high and low |\n| Average Day Range | `ADR` | Average daily price range |\n| Standard Deviation | `StandardDeviation` | Measures price volatility |\n| Historical Volatility | `HistoricalVolatility` | Annualized standard deviation of log returns |\n| Bollinger BandWidth | `BBBandWidth` | Width of Bollinger Bands as percentage |\n| Bollinger Bars | `BollingerBars` | Colored candles based on BB position |\n\n### Channels \u0026 Bands\n\n| Indicator | Export | Description |\n|-----------|--------|-------------|\n| Bollinger Bands | `BollingerBands` | Volatility bands using standard deviation |\n| Keltner Channels | `KeltnerChannels` | Volatility envelope using EMA and ATR |\n| Donchian Channels | `DonchianChannels` | Highest high and lowest low over period |\n| Envelope | `Envelope` | Moving average with fixed percentage bands |\n| Median | `Median` | Median price with ATR bands |\n\n### Volume\n\n| Indicator | Export | Description |\n|-----------|--------|-------------|\n| On Balance Volume | `OBV` | Cumulative volume based on price direction |\n| Money Flow Index | `MFI` | Volume-weighted RSI |\n| Price Volume Trend | `PVT` | Cumulative volume weighted by price changes |\n| Volume Oscillator | `VolumeOscillator` | Percentage difference between volume EMAs |\n| Chaikin Money Flow | `ChaikinMF` | Buying/selling pressure using price and volume |\n| Chaikin Oscillator | `ChaikinOscillator` | Momentum of Accumulation/Distribution line |\n| Ease of Movement | `EaseOfMovement` | Price change relative to volume |\n| Klinger Oscillator | `KlingerOscillator` | Volume-based long-term money flow |\n| Net Volume | `NetVolume` | Difference between up and down volume |\n| Volume Delta | `VolumeDelta` | Difference between buying and selling volume |\n| Cumulative Volume Delta | `CumulativeVolumeDelta` | Running total of volume delta |\n| Relative Volume at Time | `RelativeVolumeAtTime` | Current volume vs historical average |\n| Colored Volume Bars | `ColoredVolume` | Volume colored by price/volume trend |\n| OBV MACD | `OBVMACD` | MACD applied to On Balance Volume |\n\n### Community Indicators (317)\n\n317 community indicators ported from TradingView PineScript sources, covering trend systems, divergence detectors, multi-MA strategies, volume analysis, market structure, and more. Full list in [docs/INDICATOR_INVENTORY_COMMUNITY.md](docs/INDICATOR_INVENTORY_COMMUNITY.md).\n\nCategories include: Hyper Trend, AlphaTrend, HalfTrend, QQE MOD, Hull Suite, SuperTrend variants, Market Structure Trailing Stop, Liquidity Levels, Order Blocks, ZigZag Fibonacci, Trendlines with Breaks, and many more.\n\nDrawing primitive support: Lines (`LineDrawingData`), Boxes (`BoxData`), Labels (`LabelData`), Tables (`TableData`), Markers, Bar Colors, Background Colors, and Plot Candles.\n\n### Candlestick Patterns (44)\n\nAll 44 patterns from TradingView's standard candlestick pattern library, rendered as chart markers.\n\n| Pattern | Signal | Candles |\n|---------|--------|---------|\n| Abandoned Baby | Bullish / Bearish | 3 |\n| Dark Cloud Cover | Bearish | 2 |\n| Doji | Neutral | 1 |\n| Doji Star | Bullish / Bearish | 2 |\n| Downside Tasuki Gap | Bearish | 3 |\n| Dragonfly Doji | Bullish | 1 |\n| Engulfing | Bullish / Bearish | 2 |\n| Evening Doji Star | Bearish | 3 |\n| Evening Star | Bearish | 3 |\n| Falling Three Methods | Bearish | 5 |\n| Falling Window | Bearish | 2 |\n| Gravestone Doji | Bearish | 1 |\n| Hammer | Bullish | 1 |\n| Hanging Man | Bearish | 1 |\n| Harami | Bullish / Bearish | 2 |\n| Harami Cross | Bullish / Bearish | 2 |\n| Inverted Hammer | Bullish | 1 |\n| Kicking | Bullish / Bearish | 2 |\n| Long Lower Shadow | Bullish | 1 |\n| Long Upper Shadow | Bearish | 1 |\n| Marubozu Black | Bearish | 1 |\n| Marubozu White | Bullish | 1 |\n| Morning Doji Star | Bullish | 3 |\n| Morning Star | Bullish | 3 |\n| On Neck | Bearish | 2 |\n| Piercing | Bullish | 2 |\n| Rising Three Methods | Bullish | 5 |\n| Rising Window | Bullish | 2 |\n| Shooting Star | Bearish | 1 |\n| Spinning Top Black | Neutral | 1 |\n| Spinning Top White | Neutral | 1 |\n| Three Black Crows | Bearish | 3 |\n| Three White Soldiers | Bullish | 3 |\n| Tri-Star | Bullish / Bearish | 3 |\n| Tweezer Bottom | Bullish | 2 |\n| Tweezer Top | Bearish | 2 |\n| Upside Tasuki Gap | Bullish | 3 |\n\n## Output Format\n\nAll indicators return an `IndicatorResult` object:\n\n```typescript\ninterface IndicatorResult {\n  metadata: {\n    title: string;\n    shortTitle: string;\n    overlay: boolean;  // true = display on price chart, false = separate pane\n  };\n  plots: {\n    plot0: Array\u003c{ time: number; value: number }\u003e;\n    plot1?: Array\u003c{ time: number; value: number }\u003e;\n    // ... additional plots as needed\n  };\n}\n```\n\n## Indicator Registry\n\nFor dynamic indicator selection (e.g., building a UI), use the `indicatorRegistry`:\n\n```typescript\nimport { indicatorRegistry } from 'lightweight-charts-indicators';\n\n// List all indicators\nindicatorRegistry.forEach(indicator =\u003e {\n  console.log(`${indicator.name} (${indicator.category})`);\n});\n\n// Get indicator by ID\nconst sma = indicatorRegistry.find(i =\u003e i.id === 'sma');\nconst result = sma?.calculate(bars, sma.defaultInputs);\n\n// Filter by category\nconst oscillators = indicatorRegistry.filter(i =\u003e i.category === 'Oscillators');\n```\n\n## Building\n\n```bash\nnpm run build\n```\n\n## Testing\n\n```bash\nnpm test\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepentropy%2Flightweight-charts-indicators","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeepentropy%2Flightweight-charts-indicators","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeepentropy%2Flightweight-charts-indicators/lists"}