{"id":39785301,"url":"https://github.com/chironmind/ti-engine","last_synced_at":"2026-01-18T12:09:02.243Z","repository":{"id":309972342,"uuid":"1036928304","full_name":"chironmind/ti-engine","owner":"chironmind","description":"JavaScript Technical Indicator package","archived":false,"fork":false,"pushed_at":"2026-01-17T22:40:38.000Z","size":1197,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-17T23:03:40.881Z","etag":null,"topics":["finance","javascript","npm","rust","technical-analysis","technical-indicators","trading"],"latest_commit_sha":null,"homepage":"https://chironmind.github.io/ti-engine/","language":"JavaScript","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/chironmind.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-MIT","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","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-08-12T19:45:02.000Z","updated_at":"2025-11-02T09:15:49.000Z","dependencies_parsed_at":"2025-08-14T23:20:51.029Z","dependency_job_id":"8a97900c-40bb-4af9-8b75-b1fea577ca8c","html_url":"https://github.com/chironmind/ti-engine","commit_stats":null,"previous_names":["chironmind/ti-engine"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/chironmind/ti-engine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chironmind%2Fti-engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chironmind%2Fti-engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chironmind%2Fti-engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chironmind%2Fti-engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chironmind","download_url":"https://codeload.github.com/chironmind/ti-engine/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chironmind%2Fti-engine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28535442,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T10:13:46.436Z","status":"ssl_error","status_checked_at":"2026-01-18T10:13:11.045Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["finance","javascript","npm","rust","technical-analysis","technical-indicators","trading"],"created_at":"2026-01-18T12:09:01.917Z","updated_at":"2026-01-18T12:09:02.206Z","avatar_url":"https://github.com/chironmind.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](https://img.shields.io/npm/v/ti-engine?color=cb3837\u0026logo=npm)](https://www.npmjs.com/package/ti-engine)\n[![npm downloads](https://img.shields.io/npm/dm/ti-engine?logo=npm)](https://www.npmjs.com/package/ti-engine)\n[![Bundle size](https://img.shields.io/bundlephobia/minzip/ti-engine?label=min+zip\u0026logo=webpack)](https://bundlephobia.com/package/ti-engine)\n[![Node](https://img.shields.io/badge/Node-%3E%3D20-339933?logo=node.js\u0026logoColor=white)](#)\n\n[![WASM](https://img.shields.io/badge/Target-WASM-6556C0?logo=webassembly\u0026logoColor=white)](#)\n[![TypeScript](https://img.shields.io/badge/Types-Included-3178C6?logo=typescript\u0026logoColor=white)](#)\n[![Docs](https://img.shields.io/badge/docs-TypeDoc-blue?logo=githubpages)](https://chironmind.github.io/ti-engine/)\n[![CI](https://github.com/chironmind/ti-engine/actions/workflows/ci.yml/badge.svg)](https://github.com/chironmind/ti-engine/actions/workflows/ci.yml)\n[![License](https://img.shields.io/badge/License-MIT-blue)](LICENSE)\n\n# ti-engine\n\nti-engine is a WebAssembly-powered, JS/TS-idiomatic wrapper around RustTI — a high‑performance, pure‑Rust technical indicators library.\n\n- Production‑grade indicators, ported from battle‑tested Rust code\n- First‑class TypeScript types and clean, namespaced API\n- Works in Node and modern browsers (bundler + web builds)\n- Identical results to RustTI (with parity tests for core functions)\n\nLooking for the Rust crate? See: [ChironMind/RustTI](https://github.com/ChironMind/RustTI)\n\nLooking for the Python version? See: [ChironMind/PyTechnicalIndicators](https://github.com/chironmind/PyTechnicalIndicators)\n\n---\n\n## 🚀 Quick Start\n\nInstall from your package manager (example: local/private package)\n\n```bash\n# npm\nnpm install ti-engine\n\n# yarn\nyarn add ti-engine\n\n# pnpm\npnpm add ti-engine\n```\n\nInitialize and use (Node)\n\n```js\nimport init, {\n  momentumIndicators,\n  ConstantModelType,\n} from \"ti-engine\";\n\n// Node: init() is a no-op, but safe to call\nawait init();\n\nconst prices = [100.2, 100.46, 100.53, 100.38, 100.19];\n\nconst rsi = momentumIndicators.single.relativeStrengthIndex(\n  prices,\n  ConstantModelType.SimpleMovingAverage\n);\n\nconsole.log(\"RSI:\", rsi); // 49.2537313432832\n```\n\nBrowser (bundlers)\n\n```js\nimport init, { movingAverage, MovingAverageType } from \"ti-engine\";\n\nawait init(); // Required to load the WASM module in browsers\n\nconst sma = movingAverage.single.movingAverage(\n  [100.2, 100.46, 100.53, 100.38, 100.19],\n  MovingAverageType.Simple\n);\n\nconsole.log(\"SMA:\", sma); // 100.352\n```\n\nBrowser (CDN - jsdelivr/unpkg)\n\n```html\n\u003cscript type=\"module\"\u003e\n  // Note: Replace @latest with a specific version (e.g., @1.1.2) for production use\n  import init, * as wasm from 'https://cdn.jsdelivr.net/npm/ti-engine@latest/dist/web/ti_engine.js';\n  \n  await init(); // Initialize WASM module\n  \n  // When using the web target directly, use the flat WASM exports\n  const prices = [100.2, 100.46, 100.53, 100.38, 100.19];\n  const rsi = wasm.momentum_single_relativeStrengthIndex(\n    prices,\n    wasm.ConstantModelType.SimpleMovingAverage\n  );\n  \n  console.log(\"RSI:\", rsi); // 49.2537313432832\n  \n  // Or use the index.web.js wrapper for the same namespaced API as bundlers\n  // import init, { momentumIndicators, ConstantModelType } from 'https://cdn.jsdelivr.net/npm/ti-engine@1.1.2/index.web.js';\n\u003c/script\u003e\n```\n\n---\n\n## 🧩 What You Get\n\n- Same math and deterministic outputs as RustTI\n- Two styles for almost every indicator:\n  - single: full-window, scalar output\n  - bulk: rolling windows, vector output\n- Clean naming and nested namespaces:\n  - candleIndicators, chartTrends, correlationIndicators, momentumIndicators, movingAverage, otherIndicators, standardIndicators, strengthIndicators, trendIndicators, volatilityIndicators\n\nFully typed with ambient declarations — enjoy rich editor hints and autocomplete.\n\n---\n\n## 📚 API Overview\n\nAll indicator namespaces expose:\n- single: functions that compute a single value from the whole input\n- bulk: functions that compute rolling outputs (arrays)\n\nCommon enums:\n- ConstantModelType: SimpleMovingAverage, SmoothedMovingAverage, ExponentialMovingAverage, SimpleMovingMedian, SimpleMovingMode, PersonalisedMovingAverage\n- DeviationModel: StandardDeviation, MeanAbsoluteDeviation, MedianAbsoluteDeviation, ModeAbsoluteDeviation, UlcerIndex\n- Position: Long, Short (for SAR-like systems)\n- MovingAverageType: Simple, Smoothed, Exponential (for generic moving average helpers)\n\nTop namespaces:\n- movingAverage: generic MAs and McGinley Dynamic\n- momentumIndicators: RSI, Stochastic, MACD variants, PPO, MFI, OBV, CCI, Williams %R, Chaikin, CMO\n- strengthIndicators: Accumulation/Distribution, PVI, NVI, RVI\n- trendIndicators: Aroon (Up/Down/Oscillator), Parabolic Time Price System, Directional Movement System (+DI, –DI, ADX/ADXR), VPT, TSI\n- volatilityIndicators: Ulcer Index, Wilder’s volatility system\n- candleIndicators: Bands/Envelopes, Ichimoku, Donchian, Keltner, Supertrend\n- correlationIndicators: Asset correlation\n- chartTrends: Peaks/Valleys, trend lines, segmentation\n- otherIndicators: ROI, True Range / ATR, Internal Bar Strength, Positivity Indicator\n\nSee the full set of function signatures via your editor or the included `index.d.ts`.\n\n---\n\n## 🧪 Usage Examples\n\nRelative Strength Index (RSI)\n```js\nimport init, { momentumIndicators, ConstantModelType } from \"ti-engine\";\nawait init();\n\nconst prices = [100.2, 100.46, 100.53, 100.38, 100.19, 100.21, 100.32, 100.28];\n\n// Full window (single)\nconst rsi = momentumIndicators.single.relativeStrengthIndex(\n  prices.slice(0, 5),\n  ConstantModelType.SimpleMovingAverage\n);\n// -\u003e 49.2537313432832\n\n// Rolling (bulk), period = 5\nconst rsiSeries = momentumIndicators.bulk.relativeStrengthIndex(\n  prices,\n  ConstantModelType.SimpleMovingAverage,\n  5\n);\n// -\u003e [49.2537..., 20.9302..., 27.6595..., 36.1111...]\n```\n\nMACD (EMA/EMA)\n```js\nimport { momentumIndicators, ConstantModelType } from \"ti-engine\";\n\nconst macdLine = momentumIndicators.single.macdLine(\n  [100.46, 100.53, 100.38, 100.19, 100.21],\n  3,\n  ConstantModelType.ExponentialMovingAverage,\n  ConstantModelType.ExponentialMovingAverage\n);\n// -\u003e -0.06067027758972188\n\nconst signal = momentumIndicators.single.signalLine(\n  [-0.06067027758972188, -0.022417061611406552, 0.005788761002008869],\n  ConstantModelType.ExponentialMovingAverage\n);\n// -\u003e -0.011764193829214216\n```\n\nParabolic Time Price System (SAR)\n```js\nimport { trendIndicators, Position, ConstantModelType } from \"ti-engine\";\n\n// Long SAR track with rolling outputs\nconst sars = trendIndicators.bulk.parabolicTimePriceSystem(\n  [100.64, 102.39, 101.51, 99.48, 96.93], // highs\n  [95.92, 96.77, 95.84, 91.22, 89.12],    // lows\n  0.02, 0.2, 0.02,                        // AF start, max, step\n  Position.Long,                          // starting side\n  0.0                                     // previous SAR (seed)\n);\n// -\u003e [95.92, 95.92, 102.39, 101.9432, 101.17380800000001]\n```\n\nUlcer Index (volatility)\n```js\nimport { volatilityIndicators } from \"ti-engine\";\n\nconst ui = volatilityIndicators.single.ulcerIndex(\n  [100.46, 100.53, 100.38, 100.19, 100.21]\n);\n// -\u003e 0.21816086938686668\n```\n\nMoving Average helpers\n```js\nimport { movingAverage, MovingAverageType } from \"ti-engine\";\n\nconst sma = movingAverage.single.movingAverage(\n  [100.2, 100.46, 100.53, 100.38, 100.19],\n  MovingAverageType.Simple\n);\n// -\u003e 100.352\n```\n\n---\n\n## 🔌 Builds and Initialization\n\nThis package includes three targets out of the box:\n\n- Node: `dist/node/ti_engine.js` (CommonJS require via index.node.js)\n- Bundler: `dist/bundler/ti_engine.js` (ESM, for Vite/Webpack/Rollup)\n- Web: `dist/web/ti_engine.js` (ESM + separate `.wasm`)\n\nImport surfaces:\n\n- Node: `import init, * as api from \"ti-engine/index.node.js\";` (or default `import` from package root)\n- Bundler/Web: `import init, * as api from \"ti-engine\";`\n\nInitialization:\n\n- Web/Bundlers: You MUST `await init()` before calling indicators (it fetches/instantiates WASM).\n- Node: `init()` is a no‑op, safe to call for parity in shared code paths.\n\n---\n\n## 🧠 Tips \u0026 Conventions\n\n- Input validation mirrors RustTI: many functions panic for empty arrays or mismatched lengths. In JS, this surfaces as a thrown error.\n- Use `Float64Array` or `number[]`. Internally, values are copied into WASM memory; consider chunking for very large series.\n- Bulk functions typically return arrays of length `L - N + 1` where `N` is the rolling period (or long period for dual-period indicators).\n- All outputs are plain JS arrays for easy consumption; tuples are represented as small arrays (e.g., `[lower, middle, upper]`).\n\n---\n\n## 📈 Performance\n\n- All math is executed in highly optimized Rust and compiled to WebAssembly.\n- In Node, performance is near-native for numeric workloads.\n- In browsers, expect excellent performance; account for WASM boundary crossings (amortize by passing larger slices).\n\nFor raw Rust benchmarks and methodology, see:\n- [RustTI Benchmarks](https://github.com/ChironMind/RustTI-benchmarks)\n\n---\n\n## 🧪 Parity Tests\n\nThis repo includes value parity tests that assert equality with RustTI for a selection of indicators across modules. Run them in Node:\n\n```bash\nnpm test\n# or\nnode --test ti-engine/test/*.test.js\n```\n\n---\n\n## 🤝 Contributing\n\nContributions, bug reports, and feature requests are welcome!\n- Open an issue or discussion\n- Submit a PR with tests (value parity preferred)\n- Suggestions for new high‑value wrappers and DX improvements are appreciated\n\nPlease see [CONTRIBUTING.md](CONTRIBUTING.md).\n\n---\n\n## 📰 Release Notes\n\nSee Git history and [changelog](CHANGELOG.md) for details.\nWe follow semver where possible for API changes.\n\n---\n\n## 📄 License\n\nMIT License. See [LICENSE](LICENSE-MIT).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchironmind%2Fti-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchironmind%2Fti-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchironmind%2Fti-engine/lists"}