---
title: "PineTS: Run Pine Script® in JavaScript"
description: "Run your TradingView® indicators in your own app, bot, or server. PineTS executes native Pine Script® in Node.js and the browser and hands you the values as plain JavaScript. Free and open source."
canonical: https://www.luxalgo.com/pinets/
---

# PineTS: Run Pine Script® in JavaScript

> Run your TradingView® indicators in your own app, bot, or server. PineTS executes native Pine Script® in Node.js and the browser and hands you the values as plain JavaScript. Free and open source.

## Run Pine Script® anywhere.

The indicators you already run on your charts, running in your own app, bot, or server. Paste the original code and PineTS hands you the values back as plain JavaScript.

```bash
npm install pinets
```

## Paste the original. Get the numbers.

No rewriting, no reverse-engineering the math. PineTS runs the exact Pine Script® you already have, v6 or v5, with the same time-series behavior and precision the chart shows. What comes back is just arrays of numbers your code can use.

```js
import { PineTS, Provider } from 'pinets'

const pineTS = new PineTS(Provider.Binance, 'BTCUSDT', 'D', 200)

const { plots } = await pineTS.run(`
//@version=6
indicator("MACD")
[macdLine, signalLine, hist] = ta.macd(close, 12, 26, 9)
plot(macdLine, "MACD", color.blue)
plot(signalLine, "Signal", color.orange)
`)
```

## One runtime. Everywhere.

Pine Script® was built for the chart; PineTS is the runtime for everything around it. The same script runs on a server, in a browser tab, at the edge, or on your laptop, and behaves the same everywhere.

- Node.js: servers & bots
- Browsers: dashboards & web apps
- Deno: edge & scripts
- Bun: fast local tooling

## Any market you can get candles for.

Point it at a built-in provider and go, or hand it the candles you already have from any API, database, or CSV. PineTS is not tied to any one data source.

- Binance: crypto candles, built in (keyless)
- Financial Modeling Prep: stocks and ETFs (built in)
- Alpaca: US equities (built in)
- Your own candles: pass any OHLCV array from any source (no provider needed)

One constructor either way: a provider, symbol, and timeframe, or an array of your own OHLCV candles.

## Live, bar by bar.

Streaming mode recalculates on every new bar and hands your code the fresh values as events. That is a custom alert pipeline or a monitoring desk over hundreds of symbols, in a few lines, running on your own machine.

## The Pine Script® ecosystem, in your product.

This is the pitch: anything your users already run as Pine Script®, your app can now run natively, on your own charts, on your own infrastructure. One commercial license covers shipping it closed-source at any size, up to a major exchange, with published pricing and standard terms.

PineTS powers the Pine Script® runtime in Vela™ Pro, and its calculations match TradingView®'s output so results transfer one to one. 60+ ta functions, arrays, matrices, maps, and request.security() multi-timeframe, all covered by tests.

Commercial licensing: https://www.luxalgo.com/vela/pricing/

## Your logic is yours.

PineTS executes Pine Script® independently: in your app, your backend, your research stack. Open source on GitHub and npm, with commercial licensing for closed-source products.

## Links

- Try it in your browser: https://www.luxalgo.com/pinets/playground/
- Docs and API coverage: https://docs.luxalgo.com/developers/pinets
- GitHub: https://github.com/LuxAlgo/PineTS
- npm: https://www.npmjs.com/package/pinets

PineTS is an independently developed open-source compiler and runtime engine.

"TradingView" and "Pine Script" are trademarks or registered trademarks
of TradingView, Inc. LuxAlgo is not affiliated with, sponsored by, or
endorsed by TradingView, Inc.

Sitemap: https://www.luxalgo.com/sitemap.xml · Machine-readable index: https://www.luxalgo.com/llms.txt
