pinetsRun Pine Script indicators from the command line using pinets-cli. Use when asked to execute, test, or analyze Pine Script indicators, calculate technical an...
Install via ClawdBot CLI:
clawdbot install alaa-eddine/pinetspinets is a CLI tool that executes TradingView Pine Script indicators via the PineTS runtime. It outputs structured JSON with calculated indicator values.
```bash
npm install -g pinets-cli
npx pinets-cli run indicator.pine --symbol BTCUSDT -q
```
Verify (if installed globally):
```bash
pinets --version
```
When using npx, replace pinets with npx pinets-cli in all examples below.
```
pinets run [file] [options]
```
The indicator can be a file argument or piped from stdin.
| Flag | Description |
| ----------------------- | -------------------------------------------------------------------------------------------- |
| -s, --symbol | Symbol from Binance (e.g., BTCUSDT, ETHUSDT, SOLUSDT.P for futures) |
| -t, --timeframe | Candle timeframe: 1, 5, 15, 30, 60, 120, 240, 1D, 1W, 1M (default: 60) |
| -d, --data | JSON file with candle data (alternative to --symbol) |
| Flag | Description |
| --------------------- | -------------------------------------------------------------- |
| -o, --output | Write to file instead of stdout |
| -f, --format | default (plots only) or full (plots + result + marketData) |
| --pretty | Pretty-print JSON |
| --clean | Filter out null, false, and empty values from plot data |
| --plots | Comma-separated list of plot names to include (default: all) |
| -q, --quiet | Suppress info messages (essential when parsing stdout) |
| Flag | Description |
| ------------------- | -------------------------------------------------------- |
| -n, --candles | Number of output candles (default: 500) |
| -w, --warmup | Extra warmup candles excluded from output (default: 0) |
| Flag | Description |
| --------- | ------------------------------------------- |
| --debug | Show transpiled JavaScript code (to stderr) |
```bash
pinets run indicator.pine --symbol BTCUSDT --timeframe 60 --candles 100 -q
```
```bash
pinets run ema200.pine -s BTCUSDT -t 1D -n 100 -w 200 -q
```
```bash
echo '//@version=5
indicator("RSI")
plot(ta.rsi(close, 14), "RSI")' | pinets run -s BTCUSDT -t 60 -n 20 -q
```
```bash
pinets run indicator.pine --data candles.json --candles 50 -q
```
```bash
pinets run rsi.pine -s BTCUSDT -t 60 -o results.json -q
```
```bash
pinets run indicator.pine -s BTCUSDT -f full -q --pretty
```
```bash
pinets run ma_cross.pine -s BTCUSDT -t 1D -n 500 -q
pinets run ma_cross.pine -s BTCUSDT -t 1D -n 500 --clean -q
```
```bash
pinets run rsi_bands.pine -s BTCUSDT --plots "RSI" -q
pinets run signals.pine -s BTCUSDT --plots "Buy,Sell" -q
pinets run signals.pine -s BTCUSDT --plots "Buy,Sell" --clean -q
```
default format```json
{
"indicator": {
"title": "RSI",
"overlay": false
},
"plots": {
"RSI": {
"title": "RSI",
"options": { "color": "#7E57C2" },
"data": [
{ "time": 1704067200000, "value": 58.23 },
{ "time": 1704070800000, "value": 61.45 }
]
}
}
}
```
full formatAdds result (raw return values per bar) and marketData (OHLCV candles) to the default output.
```json
[
{
"openTime": 1704067200000,
"open": 42000.5,
"high": 42500.0,
"low": 41800.0,
"close": 42300.0,
"volume": 1234.56,
"closeTime": 1704070799999
}
]
```
Required fields: open, high, low, close, volume. Recommended: openTime, closeTime.
pinets-cli accepts standard TradingView Pine Script v5+:
```pinescript
//@version=5
indicator("My Indicator", overlay=false)
// Technical analysis functions
rsi = ta.rsi(close, 14)
[macdLine, signalLine, hist] = ta.macd(close, 12, 26, 9)
sma = ta.sma(close, 20)
ema = ta.ema(close, 9)
bb_upper = ta.sma(close, 20) + 2 * ta.stdev(close, 20)
// Output — each plot() creates a named entry in the JSON output
plot(rsi, "RSI", color=color.purple)
```
-q when parsing JSON output programmatically.NaN for the first N bars. Use --warmup to pre-feed the indicator.time values are Unix timestamps in milliseconds.| Indicator | Minimum warmup |
| ------------------- | -------------- |
| SMA(N) / EMA(N) | N |
| RSI(14) | 30 |
| MACD(12,26,9) | 50 |
| Bollinger Bands(20) | 30 |
| SMA(200) | 200+ |
Rule of thumb: set warmup to 1.5x-2x the longest lookback period.
Generated Mar 1, 2026
Traders use PineTS to run custom Pine Script indicators on live Binance data, generating buy/sell signals for cryptocurrencies like BTCUSDT. By filtering outputs with --clean and --plots options, they extract actionable signals for automated trading systems or manual analysis.
Quantitative analysts backtest trading strategies by executing Pine Script indicators on historical market data from JSON files. They analyze outputs in full format to validate indicator performance, optimize parameters, and assess risk before live deployment.
Instructors in finance courses use PineTS to demonstrate technical analysis concepts like RSI or MACD by running scripts via stdin. Students can experiment with different symbols and timeframes, receiving structured JSON outputs for hands-on learning without TradingView accounts.
Developers integrate PineTS into backend services to calculate technical indicators on-the-fly for crypto trading platforms. By piping scripts and using quiet mode, they efficiently process real-time data from Binance, outputting JSON for API responses or dashboards.
Asset managers run long-period indicators like EMA 200 with warmup on multiple crypto pairs to monitor market trends and portfolio risks. They schedule automated runs, saving outputs to files for periodic reports and alerting on signal changes.
Offer a cloud-based service where users upload Pine Scripts to analyze crypto data via PineTS, with subscription tiers for API access, advanced outputs, and historical data storage. Revenue comes from monthly fees based on usage volume and features.
Provide consulting services to create and optimize Pine Script indicators for traders and firms, using PineTS for testing and validation. Charge project-based fees or retainers for ongoing support and integration into client systems.
Sell packaged toolkits that bundle PineTS with pre-built indicators and data visualization dashboards for educational institutions or small trading firms. Revenue is generated through one-time licenses or annual renewals for updates and support.
💬 Integration Tip
Use the -q flag for quiet mode when parsing outputs programmatically, and leverage --data with custom JSON for offline testing to avoid API rate limits.
Remote-control tmux sessions for interactive CLIs by sending keystrokes and scraping pane output.
Command-line tool to manage Google Workspace services including Gmail, Calendar, Drive, Sheets, Docs, Slides, Contacts, Tasks, People, Groups, and Keep.
Runs shell commands inside a dedicated tmux session named claw, captures, and returns the output, with safety checks for destructive commands.
A modern text-based browser. Renders web pages in the terminal using headless Firefox.
Write robust, portable shell scripts. Use when parsing arguments, handling errors properly, writing POSIX-compatible scripts, managing temp files, running commands in parallel, managing background processes, or adding --help to scripts.
NotebookLM CLI wrapper via `node {baseDir}/scripts/notebooklm.mjs`. Use for auth, notebooks, chat, sources, notes, sharing, research, and artifact generation/download.