{"id":34510269,"url":"https://github.com/quantforgeorg/pinets","last_synced_at":"2026-04-07T21:02:47.060Z","repository":{"id":274897885,"uuid":"924426714","full_name":"QuantForgeOrg/PineTS","owner":"QuantForgeOrg","description":"Run Pine Script anywhere. PineTS is an open-source transpiler and runtime that brings Pine Script logic to Node.js and the browser with 1:1 syntax compatibility. Reliably write, port, and run indicators or strategies on your own infrastructure.","archived":false,"fork":false,"pushed_at":"2026-04-02T14:00:31.000Z","size":10128,"stargazers_count":298,"open_issues_count":9,"forks_count":59,"subscribers_count":9,"default_branch":"main","last_synced_at":"2026-04-03T02:40:53.081Z","etag":null,"topics":["binance","bitcoin","chart","crypto","crypto-bot","crypto-bot-trading","crypto-trading","cryptocurrency","ethereum","market-analysis","pine","pine-script","pinescript","stocks","stocks-trading","technical-analysis","trading-algorithms","trading-strategies","tradingbot","tradingview"],"latest_commit_sha":null,"homepage":"https://quantforge.org/pinets/docs/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/QuantForgeOrg.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"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":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-01-30T01:18:21.000Z","updated_at":"2026-04-03T01:21:43.000Z","dependencies_parsed_at":"2025-12-24T04:07:28.171Z","dependency_job_id":null,"html_url":"https://github.com/QuantForgeOrg/PineTS","commit_stats":null,"previous_names":["alaa-eddine/pinets","quantforgeorg/pinets"],"tags_count":44,"template":false,"template_full_name":null,"purl":"pkg:github/QuantForgeOrg/PineTS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuantForgeOrg%2FPineTS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuantForgeOrg%2FPineTS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuantForgeOrg%2FPineTS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuantForgeOrg%2FPineTS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/QuantForgeOrg","download_url":"https://codeload.github.com/QuantForgeOrg/PineTS/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuantForgeOrg%2FPineTS/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31528752,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["binance","bitcoin","chart","crypto","crypto-bot","crypto-bot-trading","crypto-trading","cryptocurrency","ethereum","market-analysis","pine","pine-script","pinescript","stocks","stocks-trading","technical-analysis","trading-algorithms","trading-strategies","tradingbot","tradingview"],"created_at":"2025-12-24T03:57:36.047Z","updated_at":"2026-04-07T21:02:47.055Z","avatar_url":"https://github.com/QuantForgeOrg.png","language":"TypeScript","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./.github/images/banner.png\" alt=\"PineTS\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eRun Pine Script Anywhere\u003c/strong\u003e\u003cbr\u003e\n  Execute TradingView indicators in Node.js, browsers, and any JavaScript runtime\u003cbr /\u003e\nPineTS enables algorithmic traders, quant developers and platforms to integrate Pine Script logic directly into their infrastructure.  \n  \n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.npmjs.com/package/pinets\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/pinets.svg?style=flat-square\" alt=\"npm version\"\u003e\u003c/a\u003e\n  \u003ca href=\"#license\"\u003e\u003cimg src=\"https://img.shields.io/badge/License-AGPL--3.0%20%2F%20Commercial-blue.svg?style=flat-square\" alt=\"License\"\u003e\u003c/a\u003e\n  \u003ca href=\"./.github/badges/coverage.svg\"\u003e\u003cimg src=\"./.github/badges/coverage.svg\" alt=\"Coverage\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://quantforgeorg.github.io/PineTS/\"\u003e\u003cimg src=\"https://img.shields.io/badge/docs-github--pages-blue?style=flat-square\" alt=\"Documentation\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.reddit.com/r/QuantForge/\"\u003e\u003cimg src=\"https://img.shields.io/reddit/subreddit-subscribers/QuantForge?style=flat-square\u0026logo=reddit\" alt=\"Reddit\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#quick-start\"\u003eQuick Start\u003c/a\u003e •\n  \u003ca href=\"#features\"\u003eFeatures\u003c/a\u003e •\n  \u003ca href=\"#live-demos\"\u003eLive Demos\u003c/a\u003e •\n  \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e •\n  \u003ca href=\"#api-coverage\"\u003eAPI Coverage\u003c/a\u003e •\n  \u003ca href=\"#documentation\"\u003eDocs\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003eSponsors\u003c/b\u003e\u003cbr /\u003e\n  \u003ca href=\"https://luxalgo.com\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cimg src=\"./.github/images/luxalgo.png\" alt=\"LuxAlgo\" height=\"80px\" /\u003e\u003c/a\u003e \u0026nbsp; \n  \u003ca href=\"https://github.com/sponsors/QuantForgeOrg\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cimg src=\"./.github/images/sponsor.png\" alt=\"Sponsor\" height=\"80px\" /\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## What is PineTS?\n\n**PineTS** is an open-source transpiler and runtime that seamlessly bridges Pine Script and the JavaScript ecosystem. Develop your indicators once and deploy them everywhere : on your servers, in the browser, or fully integrated into your trading platforms.\n\n```javascript\nimport { PineTS, Provider } from 'pinets';\n\nconst pineTS = new PineTS(Provider.Binance, 'BTCUSDT', '1h', 100);\n\n// Run native Pine Script directly\nconst { plots } = await pineTS.run(`\n//@version=5\nindicator(\"EMA Cross\")\nplot(ta.ema(close, 9), \"Fast\", color.blue)\nplot(ta.ema(close, 21), \"Slow\", color.red)\n`);\n```\n\n\u003e **About Pine Script™?**  \n\u003e [Pine Script™](https://www.tradingview.com/pine-script-docs/welcome/) is a domain-specific programming language created by TradingView for writing custom technical analysis indicators and strategies.\n\n\u003e _**Disclaimer** : PineTS is an independent project and is not affiliated with, endorsed by, or associated with TradingView or Pine Script™. All trademarks and registered trademarks mentioned belong to their respective owners._\n\n---\n\n## Why PineTS?\n\n| Challenge                                   | PineTS Solution                                      |\n| ------------------------------------------- | ---------------------------------------------------- |\n| Pine Script only runs on TradingView        | Run indicators on your own infrastructure            |\n| Can't integrate indicators with custom apps | Full JavaScript/TypeScript integration               |\n| Limited to TradingView's data sources       | Use any data source (Binance, custom APIs, CSV)      |\n| No programmatic access to indicator values  | Get raw values for backtesting, alerts, ML pipelines |\n| Can't run indicators server-side            | Works in Node.js, Deno, Bun, browsers                |\n\n---\n\n## Quick Start\n\n### Installation\n\n```bash\nnpm install pinets\n```\n\n### Hello World\n\n```javascript\nimport { PineTS, Provider } from 'pinets';\n\n// Initialize with Binance data\nconst pineTS = new PineTS(Provider.Binance, 'BTCUSDT', '1h', 100);\n\n// Calculate a simple moving average\nconst { plots } = await pineTS.run(`\n//@version=5\nindicator(\"My First Indicator\")\nsma20 = ta.sma(close, 20)\nplot(sma20, \"SMA 20\")\n`);\n\nconsole.log('SMA values:', plots['SMA 20'].data);\n```\n\n**That's it!** You're running Pine Script in JavaScript.\n\n---\n\n## Features\n\n### Core Capabilities\n\n- **Native Pine Script v5/v6** : Run original TradingView code directly _(experimental)_\n- **60+ Technical Indicators** : SMA, EMA, RSI, MACD, Bollinger Bands, and more\n- **Time-Series Processing** : Full Pine Script semantics with lookback support\n- **Real-time Streaming** : Live data processing with event-based updates\n- **Multi-Timeframe Analysis** : `request.security()` for MTF indicators\n- **High Precision** : Matches TradingView's calculation precision\n\n### Two Ways to Write Indicators\n\n\u003ctable width=\"100%\"\u003e\n\u003ctr\u003e\n\u003cth\u003eNative Pine Script\u003c/th\u003e\n\u003cth\u003ePineTS Syntax (JavaScript)\u003c/th\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n\n```pinescript\n//@version=5\nindicator(\"RSI Strategy\")\n\nrsi = ta.rsi(close, 14)\nsma = ta.sma(rsi, 10)\n\nplot(rsi, \"RSI\")\nplot(sma, \"Signal\")\n```\n\n\u003c/td\u003e\n\u003ctd\u003e\n\n```javascript\n//@PineTS\nindicator('RSI Strategy');\n\nconst rsi = ta.rsi(close, 14);\nconst sma = ta.sma(rsi, 10);\n\nplot(rsi, 'RSI');\nplot(sma, 'Signal');\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n---\n\n## Live Demos\n\nSee PineTS in action with these browser-based examples:\n\n- **[Williams Vix Fix](https://quantforgeorg.github.io/PineTS/indicators/willvixfix/)** : Volatility-based indicator\n- **[Squeeze Momentum](https://quantforgeorg.github.io/PineTS/indicators/sqzmom/)** : Momentum oscillator\n- **[Playground](https://quantforge.org/playground/)** : Test your own Pine Script code\n\n_Demos are Built with PineTS + [QFChart](https://github.com/QuantForgeOrg/QFChart)_\n\n---\n\n## Usage\n\n### Running Native Pine Script\n\n```javascript\nimport { PineTS, Provider } from 'pinets';\n\nconst pineTS = new PineTS(Provider.Binance, 'BTCUSDT', 'D', 200);\n\nconst { plots } = await pineTS.run(`\n//@version=5\nindicator(\"MACD\", overlay=false)\n\n[macdLine, signalLine, hist] = ta.macd(close, 12, 26, 9)\n\nplot(macdLine, \"MACD\", color.blue)\nplot(signalLine, \"Signal\", color.orange)\nplot(hist, \"Histogram\", color.gray, style=plot.style_histogram)\n`);\n\n// Access the calculated values\nconsole.log('MACD Line:', plots['MACD'].data);\nconsole.log('Signal Line:', plots['Signal'].data);\n```\n\n### Using PineTS Syntax\n\n```javascript\nimport { PineTS, Provider } from 'pinets';\n\nconst pineTS = new PineTS(Provider.Binance, 'ETHUSDT', '4h', 100);\n\nconst { plots } = await pineTS.run(($) =\u003e {\n    const { close, high, low } = $.data;\n    const { ta, plot, plotchar } = $.pine;\n\n    // Calculate indicators\n    const ema9 = ta.ema(close, 9);\n    const ema21 = ta.ema(close, 21);\n    const atr = ta.atr(14);\n\n    // Detect crossovers\n    const bullish = ta.crossover(ema9, ema21);\n    const bearish = ta.crossunder(ema9, ema21);\n\n    // Plot results\n    plot(ema9, 'Fast EMA');\n    plot(ema21, 'Slow EMA');\n    plotchar(bullish, 'Buy Signal');\n    plotchar(bearish, 'Sell Signal');\n\n    return { ema9, ema21, atr, bullish, bearish };\n});\n```\n\n### Real-time Streaming\n\n```javascript\nimport { PineTS, Provider } from 'pinets';\n\nconst pineTS = new PineTS(Provider.Binance, 'BTCUSDT', '1m');\n\nconst stream = pineTS.stream(\n    `\n    //@version=5\n    indicator(\"Live RSI\")\n    plot(ta.rsi(close, 14), \"RSI\")\n    `,\n    { live: true, interval: 1000 },\n);\n\nstream.on('data', (ctx) =\u003e {\n    const rsi = ctx.plots['RSI'].data.slice(-1)[0].value;\n    console.log(`RSI: ${rsi.toFixed(2)}`);\n\n    if (rsi \u003c 30) console.log('Oversold!');\n    if (rsi \u003e 70) console.log('Overbought!');\n});\n\nstream.on('error', (err) =\u003e console.error('Stream error:', err));\n```\n\n### Custom Data Source\n\n```javascript\nimport { PineTS } from 'pinets';\n\n// Your own OHLCV data\nconst candles = [\n    { open: 100, high: 105, low: 99, close: 103, volume: 1000, openTime: 1704067200000 },\n    { open: 103, high: 108, low: 102, close: 107, volume: 1200, openTime: 1704153600000 },\n    // ... more candles\n];\n\nconst pineTS = new PineTS(candles);\n\nconst { plots } = await pineTS.run(`\n//@version=5\nindicator(\"Custom Data\")\nplot(ta.sma(close, 10))\n`);\n```\n\n---\n\n## API Coverage\n\nPineTS aims for complete Pine Script API compatibility. Current status:\n\n### Data \u0026 Context\n\n[![syminfo](./.github/badges/api-syminfo.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/syminfo.html)\n[![barstate](./.github/badges/api-barstate.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/barstate.html)\n[![timeframe](./.github/badges/api-timeframe.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/timeframe.html)\n[![ticker](./.github/badges/api-ticker.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/ticker.html)\n[![builtin](./.github/badges/api-builtin.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/builtin.html)\n[![session](./.github/badges/api-session.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/session.html)\n\n### Technical Analysis \u0026 Math\n\n[![ta](./.github/badges/api-ta.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/ta.html)\n[![math](./.github/badges/api-math.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/math.html)\n[![request](./.github/badges/api-request.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/request.html)\n[![input](./.github/badges/api-input.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/input.html)\n\n### Data Structures\n\n[![array](./.github/badges/api-array.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/array.html)\n[![matrix](./.github/badges/api-matrix.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/matrix.html)\n[![map](./.github/badges/api-map.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/map.html)\n[![types](./.github/badges/api-types.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/types.html)\n\n### Visualization\n\n[![plots](./.github/badges/api-plots.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/plots.html)\n[![color](./.github/badges/api-color.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/color.html)\n[![chart](./.github/badges/api-chart.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/chart.html)\n[![label](./.github/badges/api-label.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/label.html)\n[![line](./.github/badges/api-line.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/line.html)\n[![box](./.github/badges/api-box.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/box.html)\n[![table](./.github/badges/api-table.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/table.html)\n[![linefill](./.github/badges/api-linefill.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/linefill.html)\n[![polyline](./.github/badges/api-polyline.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/polyline.html)\n\n### Utilities\n\n[![str](./.github/badges/api-str.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/str.html)\n[![log](./.github/badges/api-log.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/log.html)\n[![strategy](./.github/badges/api-strategy.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/strategy.html)\n\n\u003e Click any badge to see detailed function-level coverage\n\n---\n\n## Documentation\n\n- **[Full Documentation](https://quantforgeorg.github.io/PineTS/)** — Complete guides and API reference\n- **[Initialization Guide](https://quantforgeorg.github.io/PineTS/initialization-and-usage/)** — Setup options and configuration\n- **[Architecture Overview](https://quantforgeorg.github.io/PineTS/architecture/)** — How PineTS works internally\n- **[API Coverage Details](https://quantforgeorg.github.io/PineTS/api-coverage/)** — Function-by-function compatibility\n\n---\n\n## Use Cases\n\n**Algorithmic Trading**\n\n- Build custom trading bots using Pine Script strategies\n- Integrate indicators with your execution systems\n\n**Backtesting**\n\n- Test Pine Script strategies against historical data\n- Export indicator values for analysis in Python/R\n\n**Alert Systems**\n\n- Create custom alert pipelines based on indicator signals\n- Monitor multiple assets with server-side indicator calculations\n\n**Research \u0026 Analysis**\n\n- Process large datasets with Pine Script indicators\n- Feed indicator outputs into machine learning models\n\n**Custom Dashboards**\n\n- Embed live indicators in web applications\n- Build real-time monitoring dashboards\n\n---\n\n## Roadmap\n\n| Status | Feature                                   |\n| ------ | ----------------------------------------- |\n| ✅     | Native Pine Script v5/v6 support          |\n| ✅     | 60+ technical analysis functions          |\n| ✅     | Arrays, matrices, and maps                |\n| ✅     | Real-time streaming                       |\n| ✅     | Multi-timeframe with `request.security()` |\n| 🚧     | Strategy backtesting engine               |\n| 🚧     | Additional data providers                 |\n| 🎯     | Pine Script v6 full compatibility         |\n| 🎯     | Market data Providers                     |\n| 🎯     | Trading Connectors                        |\n\n---\n\n## Related Projects\n\n- **[QFChart](https://github.com/QuantForgeOrg/QFChart)** : Charting library optimized for PineTS visualization\n\n---\n\n## Contributing\n\nContributions are welcome! Whether it's:\n\n- Adding missing Pine Script functions\n- Improving documentation\n- Fixing bugs\n- Suggesting features\n\nPlease feel free to open issues or submit pull requests.\n\n---\n\n## Contributors\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for the full guidelines.\n\nThanks to all PineTS contributors:\n\n\u003cp align=\"left\"\u003e\n  \u003ca href=\"https://github.com/alaa-eddine\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/1016513?v=4\u0026s=64\" width=\"64\" height=\"64\" alt=\"alaa-eddine\" title=\"alaa-eddine\" style=\"border-radius: 50%;\"/\u003e\u003c/a\u003e \n  \u003ca href=\"https://github.com/dcaoyuan\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/271571?v=4\u0026s=64\" width=\"64\" height=\"64\" alt=\"dcaoyuan\" title=\"dcaoyuan\" style=\"border-radius: 50%;\"/\u003e\u003c/a\u003e \n\u003ca href=\"https://github.com/C9Bad\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/57975070?v=4\u0026s=64\" width=\"64\" height=\"64\" alt=\"C9Bad\" title=\"C9Bad\" style=\"border-radius: 50%;\"/\u003e\u003c/a\u003e \n\u003ca href=\"https://github.com/aakash-code\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/71116743?v=4\u0026s=64\" width=\"64\" height=\"64\" alt=\"aakash-code\" title=\"aakash-code\" style=\"border-radius: 50%;\"/\u003e\u003c/a\u003e\n\n\u003c/p\u003e\n\n---\n\n## License\n\nPineTS is dual-licensed:\n\n- **[AGPL-3.0](./LICENSE)** — Free for everyone. You can use PineTS for personal projects, research, and internal tools without any obligation. The copyleft terms only apply if you **distribute** your application to others or **provide it as a network service** (e.g., SaaS, public API) — in that case, your full source code must also be released under AGPL-3.0.\n\n- **[Commercial License](./LICENSE-COMMERCIAL.md)** — For companies and individuals who want to use PineTS in proprietary or closed-source software without AGPL-3.0 obligations. [Contact us for licensing](https://quantforge.org/contact/).\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003csub\u003eBuilt with passion by \u003ca href=\"https://quantforge.org\"\u003eQuantForge\u003c/a\u003e\u003c/sub\u003e\n\u003c/p\u003e\n","funding_links":["https://github.com/sponsors/QuantForgeOrg"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantforgeorg%2Fpinets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquantforgeorg%2Fpinets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantforgeorg%2Fpinets/lists"}