pinets 0.7.8 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +275 -216
- package/dist/pinets.min.browser.es.js +14 -18
- package/dist/pinets.min.browser.es.js.map +1 -1
- package/dist/pinets.min.browser.js +14 -18
- package/dist/pinets.min.browser.js.map +1 -1
- package/dist/pinets.min.cjs +14 -18
- package/dist/pinets.min.cjs.map +1 -1
- package/dist/pinets.min.es.js +14 -18
- package/dist/pinets.min.es.js.map +1 -1
- package/dist/types/Context.class.d.ts +24 -1
- package/dist/types/Indicator.d.ts +5 -0
- package/dist/types/PineTS.class.d.ts +4 -3
- package/dist/types/index.d.ts +2 -1
- package/dist/types/namespaces/Types.d.ts +7 -0
- package/dist/types/namespaces/input/types.d.ts +0 -1
- package/dist/types/namespaces/input/utils.d.ts +1 -0
- package/dist/types/transpiler/analysis/ScopeManager.d.ts +2 -0
- package/dist/types/transpiler/pineToJS/tokens.d.ts +0 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,335 +1,394 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="./.github/images/banner.png" alt="PineTS" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<strong>Run Pine Script Anywhere</strong><br>
|
|
7
|
+
Execute TradingView indicators in Node.js, browsers, and any JavaScript runtime
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
<a href="https://www.npmjs.com/package/pinets"><img src="https://img.shields.io/npm/v/pinets.svg?style=flat-square" alt="npm version"></a>
|
|
12
|
+
<a href="https://opensource.org/licenses/AGPL-3.0"><img src="https://img.shields.io/badge/License-AGPL--3.0-blue.svg?style=flat-square" alt="License"></a>
|
|
13
|
+
<a href="./.github/badges/coverage.svg"><img src="./.github/badges/coverage.svg" alt="Coverage"></a>
|
|
14
|
+
<a href="https://quantforgeorg.github.io/PineTS/"><img src="https://img.shields.io/badge/docs-github--pages-blue?style=flat-square" alt="Documentation"></a>
|
|
15
|
+
<a href="https://www.reddit.com/r/QuantForge/"><img src="https://img.shields.io/reddit/subreddit-subscribers/QuantForge?style=flat-square&logo=reddit" alt="Reddit"></a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<p align="center">
|
|
19
|
+
<a href="#quick-start">Quick Start</a> •
|
|
20
|
+
<a href="#features">Features</a> •
|
|
21
|
+
<a href="#live-demos">Live Demos</a> •
|
|
22
|
+
<a href="#usage">Usage</a> •
|
|
23
|
+
<a href="#api-coverage">API Coverage</a> •
|
|
24
|
+
<a href="#documentation">Docs</a>
|
|
25
|
+
</p>
|
|
6
26
|
|
|
7
27
|
---
|
|
8
28
|
|
|
9
|
-
|
|
29
|
+
## What is PineTS?
|
|
10
30
|
|
|
11
|
-
|
|
12
|
-
2. **PineTS Syntax** - A JavaScript/TypeScript syntax that closely mirrors Pine Script
|
|
31
|
+
**PineTS** is an open-source transpiler and runtime that brings Pine Script to JavaScript. Write indicators once, run them anywhere : on your own servers, in the browser, or embedded in your trading applications.
|
|
13
32
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
> _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._
|
|
17
|
-
|
|
18
|
-
## Overview
|
|
19
|
-
|
|
20
|
-
PineTS is a runtime + transpiler that converts Pine Script (or PineTS syntax) into executable JavaScript. It preserves the original functionality and behavior while providing robust handling of time-series data processing, technical analysis calculations, and Pine Script's distinctive scoping mechanisms.
|
|
21
|
-
|
|
22
|
-
### Input Format Support
|
|
23
|
-
|
|
24
|
-
- **Native Pine Script** _(experimental)_: Run original Pine Script v5 and v6 indicators directly. Note that some indicators may fail if they use Pine Script API features not yet implemented in PineTS. Check the [API coverage badges](#pine-script-api-coverage) below to verify compatibility.
|
|
25
|
-
- **PineTS Syntax**: A JavaScript/TypeScript syntax that mirrors Pine Script closely, requiring minimal conversion effort from original Pine Script code.
|
|
26
|
-
|
|
27
|
-
## See it in action
|
|
28
|
-
|
|
29
|
-
Bellow are two ports of Pine Script indicators running in the browser.
|
|
30
|
-
PineTS is used to generate plot data, and tradingview light weight chart is used to display the plot.
|
|
31
|
-
|
|
32
|
-
- [Williams Vix Fix](https://quantforgeorg.github.io/PineTS/indicators/willvixfix/)
|
|
33
|
-
- [Squeeze Momentum](https://quantforgeorg.github.io/PineTS/indicators/sqzmom/)
|
|
33
|
+
```javascript
|
|
34
|
+
import { PineTS, Provider } from 'pinets';
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
const pineTS = new PineTS(Provider.Binance, 'BTCUSDT', '1h', 100);
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
- **Runtime Transpilation**: Converts code to executable JavaScript at runtime without pre-compilation
|
|
38
|
+
// Run native Pine Script directly
|
|
39
|
+
const { plots } = await pineTS.run(`
|
|
40
|
+
//@version=5
|
|
41
|
+
indicator("EMA Cross")
|
|
42
|
+
plot(ta.ema(close, 9), "Fast", color.blue)
|
|
43
|
+
plot(ta.ema(close, 21), "Slow", color.red)
|
|
44
|
+
`);
|
|
45
|
+
```
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
> _**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._
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
---
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
## Why PineTS?
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
| Challenge | PineTS Solution |
|
|
54
|
+
| ------------------------------------------- | ---------------------------------------------------- |
|
|
55
|
+
| Pine Script only runs on TradingView | Run indicators on your own infrastructure |
|
|
56
|
+
| Can't integrate indicators with custom apps | Full JavaScript/TypeScript integration |
|
|
57
|
+
| Limited to TradingView's data sources | Use any data source (Binance, custom APIs, CSV) |
|
|
58
|
+
| No programmatic access to indicator values | Get raw values for backtesting, alerts, ML pipelines |
|
|
59
|
+
| Can't run indicators server-side | Works in Node.js, Deno, Bun, browsers |
|
|
57
60
|
|
|
58
|
-
|
|
61
|
+
---
|
|
59
62
|
|
|
60
|
-
|
|
61
|
-
- **TechnicalAnalysis**: Comprehensive set of technical indicators and analysis functions
|
|
62
|
-
- **PineMath**: Mathematical operations and precision handling
|
|
63
|
-
- **Input**: Parameter and input management system
|
|
64
|
-
- **Syminfo**: Symbol information and market data helpers
|
|
63
|
+
## Quick Start
|
|
65
64
|
|
|
66
|
-
|
|
65
|
+
### Installation
|
|
67
66
|
|
|
68
67
|
```bash
|
|
69
68
|
npm install pinets
|
|
70
69
|
```
|
|
71
70
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
### Streaming Data
|
|
75
|
-
|
|
76
|
-
PineTS provides a convenient event-based interface for streaming live data:
|
|
71
|
+
### Hello World
|
|
77
72
|
|
|
78
73
|
```javascript
|
|
79
74
|
import { PineTS, Provider } from 'pinets';
|
|
80
75
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
// Start streaming with 1 second interval
|
|
84
|
-
const evt = pineTS.stream(
|
|
85
|
-
indicator,
|
|
86
|
-
//assuming that indicator is a pine source code or pineTS function
|
|
87
|
-
{
|
|
88
|
-
pageSize: 10,
|
|
89
|
-
live: true,
|
|
90
|
-
interval: 1000,
|
|
91
|
-
}
|
|
92
|
-
);
|
|
76
|
+
// Initialize with Binance data
|
|
77
|
+
const pineTS = new PineTS(Provider.Binance, 'BTCUSDT', '1h', 100);
|
|
93
78
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
79
|
+
// Calculate a simple moving average
|
|
80
|
+
const { plots } = await pineTS.run(`
|
|
81
|
+
//@version=5
|
|
82
|
+
indicator("My First Indicator")
|
|
83
|
+
sma20 = ta.sma(close, 20)
|
|
84
|
+
plot(sma20, "SMA 20")
|
|
85
|
+
`);
|
|
97
86
|
|
|
98
|
-
|
|
87
|
+
console.log('SMA values:', plots['SMA 20'].data);
|
|
99
88
|
```
|
|
100
89
|
|
|
101
|
-
|
|
90
|
+
**That's it!** You're running Pine Script in JavaScript.
|
|
102
91
|
|
|
103
|
-
|
|
92
|
+
---
|
|
104
93
|
|
|
105
|
-
|
|
106
|
-
import { PineTS, Provider } from 'pinets';
|
|
94
|
+
## Features
|
|
107
95
|
|
|
108
|
-
|
|
109
|
-
const pineTS = new PineTS(Provider.Binance, 'BTCUSDT', 'D', 100);
|
|
96
|
+
### Core Capabilities
|
|
110
97
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
98
|
+
- **Native Pine Script v5/v6** : Run original TradingView code directly _(experimental)_
|
|
99
|
+
- **60+ Technical Indicators** : SMA, EMA, RSI, MACD, Bollinger Bands, and more
|
|
100
|
+
- **Time-Series Processing** : Full Pine Script semantics with lookback support
|
|
101
|
+
- **Real-time Streaming** : Live data processing with event-based updates
|
|
102
|
+
- **Multi-Timeframe Analysis** : `request.security()` for MTF indicators
|
|
103
|
+
- **High Precision** : Matches TradingView's calculation precision
|
|
104
|
+
|
|
105
|
+
### Two Ways to Write Indicators
|
|
115
106
|
|
|
116
|
-
|
|
117
|
-
|
|
107
|
+
<table width="100%">
|
|
108
|
+
<tr>
|
|
109
|
+
<th>Native Pine Script</th>
|
|
110
|
+
<th>PineTS Syntax (JavaScript)</th>
|
|
111
|
+
</tr>
|
|
112
|
+
<tr>
|
|
113
|
+
<td>
|
|
118
114
|
|
|
119
|
-
|
|
120
|
-
|
|
115
|
+
```pinescript
|
|
116
|
+
//@version=5
|
|
117
|
+
indicator("RSI Strategy")
|
|
121
118
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
`;
|
|
119
|
+
rsi = ta.rsi(close, 14)
|
|
120
|
+
sma = ta.sma(rsi, 10)
|
|
125
121
|
|
|
126
|
-
|
|
127
|
-
|
|
122
|
+
plot(rsi, "RSI")
|
|
123
|
+
plot(sma, "Signal")
|
|
128
124
|
```
|
|
129
125
|
|
|
130
|
-
>
|
|
131
|
-
|
|
132
|
-
### Option 2: Use PineTS Syntax
|
|
126
|
+
</td>
|
|
127
|
+
<td>
|
|
133
128
|
|
|
134
|
-
|
|
129
|
+
```javascript
|
|
130
|
+
//@PineTS
|
|
131
|
+
indicator('RSI Strategy');
|
|
135
132
|
|
|
136
|
-
|
|
133
|
+
const rsi = ta.rsi(close, 14);
|
|
134
|
+
const sma = ta.sma(rsi, 10);
|
|
137
135
|
|
|
138
|
-
|
|
136
|
+
plot(rsi, 'RSI');
|
|
137
|
+
plot(sma, 'Signal');
|
|
138
|
+
```
|
|
139
139
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
</td>
|
|
141
|
+
</tr>
|
|
142
|
+
</table>
|
|
143
143
|
|
|
144
|
-
|
|
145
|
-
/*==[ Original Pine Script ]==*/
|
|
144
|
+
---
|
|
146
145
|
|
|
147
|
-
|
|
148
|
-
indicator('My EMA Cross Strategy');
|
|
146
|
+
## Live Demos
|
|
149
147
|
|
|
150
|
-
|
|
151
|
-
ema18 = ta.ema(close, 18);
|
|
148
|
+
See PineTS in action with these browser-based examples:
|
|
152
149
|
|
|
153
|
-
|
|
154
|
-
|
|
150
|
+
- **[Williams Vix Fix](https://quantforgeorg.github.io/PineTS/indicators/willvixfix/)** : Volatility-based indicator
|
|
151
|
+
- **[Squeeze Momentum](https://quantforgeorg.github.io/PineTS/indicators/sqzmom/)** : Momentum oscillator
|
|
152
|
+
- **[Playground](https://quantforge.org/playground/)** : Test your own Pine Script code
|
|
155
153
|
|
|
156
|
-
|
|
157
|
-
diff_close = close - prev_close;
|
|
154
|
+
_Demos are Built with PineTS + [QFChart](https://github.com/QuantForgeOrg/QFChart)_
|
|
158
155
|
|
|
159
|
-
|
|
160
|
-
_oo = math.abs(open[1] - close[2]);
|
|
156
|
+
---
|
|
161
157
|
|
|
162
|
-
|
|
163
|
-
plot(ema9, title = '9 EMA', color = color.yellow)
|
|
164
|
-
plot(ema18, title = '18 EMA', color = color.red)
|
|
165
|
-
```
|
|
158
|
+
## Usage
|
|
166
159
|
|
|
167
|
-
|
|
168
|
-
<td>
|
|
160
|
+
### Running Native Pine Script
|
|
169
161
|
|
|
170
162
|
```javascript
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
//
|
|
174
|
-
indicator('My EMA Cross Strategy');
|
|
163
|
+
import { PineTS, Provider } from 'pinets';
|
|
175
164
|
|
|
176
|
-
|
|
177
|
-
let ema18 = ta.ema(close, 18);
|
|
165
|
+
const pineTS = new PineTS(Provider.Binance, 'BTCUSDT', 'D', 200);
|
|
178
166
|
|
|
179
|
-
|
|
180
|
-
|
|
167
|
+
const { plots } = await pineTS.run(`
|
|
168
|
+
//@version=5
|
|
169
|
+
indicator("MACD", overlay=false)
|
|
181
170
|
|
|
182
|
-
|
|
183
|
-
let diff_close = close - prev_close;
|
|
171
|
+
[macdLine, signalLine, hist] = ta.macd(close, 12, 26, 9)
|
|
184
172
|
|
|
185
|
-
|
|
186
|
-
|
|
173
|
+
plot(macdLine, "MACD", color.blue)
|
|
174
|
+
plot(signalLine, "Signal", color.orange)
|
|
175
|
+
plot(hist, "Histogram", color.gray, style=plot.style_histogram)
|
|
176
|
+
`);
|
|
187
177
|
|
|
188
|
-
//
|
|
189
|
-
|
|
190
|
-
|
|
178
|
+
// Access the calculated values
|
|
179
|
+
console.log('MACD Line:', plots['MACD'].data);
|
|
180
|
+
console.log('Signal Line:', plots['Signal'].data);
|
|
191
181
|
```
|
|
192
182
|
|
|
193
|
-
|
|
194
|
-
</tr>
|
|
195
|
-
</table>
|
|
196
|
-
|
|
197
|
-
### Running PineTS Code
|
|
183
|
+
### Using PineTS Syntax
|
|
198
184
|
|
|
199
185
|
```javascript
|
|
200
186
|
import { PineTS, Provider } from 'pinets';
|
|
201
187
|
|
|
202
|
-
|
|
203
|
-
const pineTS = new PineTS(Provider.Binance, 'BTCUSDT', 'D', 100);
|
|
204
|
-
|
|
205
|
-
// Run your indicator
|
|
206
|
-
const { result } = await pineTS.run((context) => {
|
|
207
|
-
const { ta, math } = context;
|
|
208
|
-
const { close, open } = context.data;
|
|
188
|
+
const pineTS = new PineTS(Provider.Binance, 'ETHUSDT', '4h', 100);
|
|
209
189
|
|
|
210
|
-
|
|
211
|
-
|
|
190
|
+
const { plots } = await pineTS.run(($) => {
|
|
191
|
+
const { close, high, low } = $.data;
|
|
192
|
+
const { ta, plot, plotchar } = $.pine;
|
|
212
193
|
|
|
213
|
-
|
|
214
|
-
|
|
194
|
+
// Calculate indicators
|
|
195
|
+
const ema9 = ta.ema(close, 9);
|
|
196
|
+
const ema21 = ta.ema(close, 21);
|
|
197
|
+
const atr = ta.atr(14);
|
|
215
198
|
|
|
216
|
-
|
|
217
|
-
|
|
199
|
+
// Detect crossovers
|
|
200
|
+
const bullish = ta.crossover(ema9, ema21);
|
|
201
|
+
const bearish = ta.crossunder(ema9, ema21);
|
|
218
202
|
|
|
219
|
-
|
|
220
|
-
|
|
203
|
+
// Plot results
|
|
204
|
+
plot(ema9, 'Fast EMA');
|
|
205
|
+
plot(ema21, 'Slow EMA');
|
|
206
|
+
plotchar(bullish, 'Buy Signal');
|
|
207
|
+
plotchar(bearish, 'Sell Signal');
|
|
221
208
|
|
|
222
|
-
return { ema9,
|
|
209
|
+
return { ema9, ema21, atr, bullish, bearish };
|
|
223
210
|
});
|
|
224
211
|
```
|
|
225
212
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
## Key Differences: PineTS Syntax vs Native Pine Script
|
|
213
|
+
### Real-time Streaming
|
|
229
214
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
1. **Variable Declaration**: Use JavaScript's `const`, `let`, and `var` instead of Pine Script's implicit declaration
|
|
233
|
-
2. **Function Syntax**: JavaScript arrow functions and standard function syntax
|
|
234
|
-
3. **Module System**: Import Pine Script namespaces from context: `const { ta } = context; const { close, open } = context.data;`
|
|
235
|
-
4. **Object Syntax**: Use JavaScript object notation for parameters: `plot(ema9, { title: '9 EMA', color: color.yellow })`
|
|
236
|
-
5. **Scoping Rules**: Maintains Pine Script's series behavior through runtime transformation
|
|
237
|
-
6. **Return Syntax**: Can return an object with indicator results for easy access in JavaScript
|
|
215
|
+
```javascript
|
|
216
|
+
import { PineTS, Provider } from 'pinets';
|
|
238
217
|
|
|
239
|
-
|
|
218
|
+
const pineTS = new PineTS(Provider.Binance, 'BTCUSDT', '1m');
|
|
240
219
|
|
|
241
|
-
|
|
220
|
+
const stream = pineTS.stream(
|
|
221
|
+
`
|
|
222
|
+
//@version=5
|
|
223
|
+
indicator("Live RSI")
|
|
224
|
+
plot(ta.rsi(close, 14), "RSI")
|
|
225
|
+
`,
|
|
226
|
+
{ live: true, interval: 1000 }
|
|
227
|
+
);
|
|
242
228
|
|
|
243
|
-
|
|
229
|
+
stream.on('data', (ctx) => {
|
|
230
|
+
const rsi = ctx.plots['RSI'].data.slice(-1)[0].value;
|
|
231
|
+
console.log(`RSI: ${rsi.toFixed(2)}`);
|
|
244
232
|
|
|
245
|
-
|
|
233
|
+
if (rsi < 30) console.log('Oversold!');
|
|
234
|
+
if (rsi > 70) console.log('Overbought!');
|
|
235
|
+
});
|
|
246
236
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
- ✅ **Core Pine Script API**: ~75% coverage of built-in functions and variables
|
|
250
|
-
- ✅ **Series and Scope Management**: Full Pine Script semantics preserved
|
|
251
|
-
- ✅ **Technical Analysis**: 60+ indicators and analysis functions
|
|
252
|
-
- ✅ **Mathematical Operations**: Comprehensive math functions
|
|
253
|
-
- ✅ **Data Structures**: Arrays and Matrices (90+ operations)
|
|
254
|
-
- ✅ **Input System**: Dynamic parameter handling
|
|
255
|
-
- ✅ **Plot Data Management**: Multi-series plotting support
|
|
256
|
-
- ✅ **Real-time Execution**: Live data processing capability
|
|
257
|
-
- ✔️🚧 **Market Data Providers**: Binance supported (more coming soon)
|
|
258
|
-
- ✅ **Visualization**: Interactive charting ==> handled in [QFChart](https://github.com/QuantForgeOrg/QFChart)
|
|
259
|
-
- 🚧 **Caching System**: Script and market data optimization (in progress)
|
|
260
|
-
- 🎯 **Strategy Execution**: Backtesting and live trading (planned)
|
|
237
|
+
stream.on('error', (err) => console.error('Stream error:', err));
|
|
238
|
+
```
|
|
261
239
|
|
|
262
|
-
|
|
240
|
+
### Custom Data Source
|
|
263
241
|
|
|
264
|
-
|
|
242
|
+
```javascript
|
|
243
|
+
import { PineTS } from 'pinets';
|
|
265
244
|
|
|
266
|
-
|
|
245
|
+
// Your own OHLCV data
|
|
246
|
+
const candles = [
|
|
247
|
+
{ open: 100, high: 105, low: 99, close: 103, volume: 1000, openTime: 1704067200000 },
|
|
248
|
+
{ open: 103, high: 108, low: 102, close: 107, volume: 1200, openTime: 1704153600000 },
|
|
249
|
+
// ... more candles
|
|
250
|
+
];
|
|
267
251
|
|
|
268
|
-
|
|
252
|
+
const pineTS = new PineTS(candles);
|
|
269
253
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
254
|
+
const { plots } = await pineTS.run(`
|
|
255
|
+
//@version=5
|
|
256
|
+
indicator("Custom Data")
|
|
257
|
+
plot(ta.sma(close, 10))
|
|
258
|
+
`);
|
|
259
|
+
```
|
|
273
260
|
|
|
274
|
-
|
|
261
|
+
---
|
|
275
262
|
|
|
276
|
-
|
|
277
|
-
- Manages variable scoping and context
|
|
278
|
-
- Handles array indexing and series operations
|
|
279
|
-
- Provides Pine Script-compatible function calls
|
|
280
|
-
- Executes in real-time without pre-compilation
|
|
281
|
-
==> The resulting code is a low level javascript that allows handling the complex structures and specificities of PineScript
|
|
263
|
+
## API Coverage
|
|
282
264
|
|
|
283
|
-
|
|
265
|
+
PineTS aims for complete Pine Script API compatibility. Current status:
|
|
284
266
|
|
|
285
|
-
|
|
267
|
+
### Data & Context
|
|
286
268
|
|
|
287
269
|
[](https://quantforgeorg.github.io/PineTS/api-coverage/syminfo.html)
|
|
288
|
-
[](https://quantforgeorg.github.io/PineTS/api-coverage/session.html)
|
|
289
|
-
[](https://quantforgeorg.github.io/PineTS/api-coverage/timeframe.html)
|
|
290
270
|
[](https://quantforgeorg.github.io/PineTS/api-coverage/barstate.html)
|
|
271
|
+
[](https://quantforgeorg.github.io/PineTS/api-coverage/timeframe.html)
|
|
291
272
|
[](https://quantforgeorg.github.io/PineTS/api-coverage/ticker.html)
|
|
292
273
|
[](https://quantforgeorg.github.io/PineTS/api-coverage/builtin.html)
|
|
274
|
+
[](https://quantforgeorg.github.io/PineTS/api-coverage/session.html)
|
|
293
275
|
|
|
294
|
-
|
|
276
|
+
### Technical Analysis & Math
|
|
295
277
|
|
|
296
278
|
[](https://quantforgeorg.github.io/PineTS/api-coverage/ta.html)
|
|
297
279
|
[](https://quantforgeorg.github.io/PineTS/api-coverage/math.html)
|
|
280
|
+
[](https://quantforgeorg.github.io/PineTS/api-coverage/request.html)
|
|
281
|
+
[](https://quantforgeorg.github.io/PineTS/api-coverage/input.html)
|
|
282
|
+
|
|
283
|
+
### Data Structures
|
|
284
|
+
|
|
298
285
|
[](https://quantforgeorg.github.io/PineTS/api-coverage/array.html)
|
|
299
|
-
[](https://quantforgeorg.github.io/PineTS/api-coverage/map.html)
|
|
300
286
|
[](https://quantforgeorg.github.io/PineTS/api-coverage/matrix.html)
|
|
301
|
-
[](https://quantforgeorg.github.io/PineTS/api-coverage/map.html)
|
|
302
288
|
[](https://quantforgeorg.github.io/PineTS/api-coverage/types.html)
|
|
303
|
-
[](https://quantforgeorg.github.io/PineTS/api-coverage/strategy.html)
|
|
304
|
-
[](https://quantforgeorg.github.io/PineTS/api-coverage/input.html)
|
|
305
289
|
|
|
306
|
-
|
|
290
|
+
### Visualization
|
|
307
291
|
|
|
308
|
-
[](https://quantforgeorg.github.io/PineTS/api-coverage/color.html)
|
|
309
292
|
[](https://quantforgeorg.github.io/PineTS/api-coverage/plots.html)
|
|
293
|
+
[](https://quantforgeorg.github.io/PineTS/api-coverage/color.html)
|
|
310
294
|
[](https://quantforgeorg.github.io/PineTS/api-coverage/chart.html)
|
|
311
295
|
[](https://quantforgeorg.github.io/PineTS/api-coverage/label.html)
|
|
312
296
|
[](https://quantforgeorg.github.io/PineTS/api-coverage/line.html)
|
|
313
|
-
[](https://quantforgeorg.github.io/PineTS/api-coverage/polyline.html)
|
|
314
297
|
[](https://quantforgeorg.github.io/PineTS/api-coverage/box.html)
|
|
315
298
|
[](https://quantforgeorg.github.io/PineTS/api-coverage/table.html)
|
|
316
299
|
[](https://quantforgeorg.github.io/PineTS/api-coverage/linefill.html)
|
|
300
|
+
[](https://quantforgeorg.github.io/PineTS/api-coverage/polyline.html)
|
|
317
301
|
|
|
318
|
-
|
|
302
|
+
### Utilities
|
|
319
303
|
|
|
320
|
-
[](https://quantforgeorg.github.io/PineTS/api-coverage/log.html)
|
|
321
304
|
[](https://quantforgeorg.github.io/PineTS/api-coverage/str.html)
|
|
305
|
+
[](https://quantforgeorg.github.io/PineTS/api-coverage/log.html)
|
|
306
|
+
[](https://quantforgeorg.github.io/PineTS/api-coverage/strategy.html)
|
|
307
|
+
|
|
308
|
+
> Click any badge to see detailed function-level coverage
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## Documentation
|
|
313
|
+
|
|
314
|
+
- **[Full Documentation](https://quantforgeorg.github.io/PineTS/)** — Complete guides and API reference
|
|
315
|
+
- **[Initialization Guide](https://quantforgeorg.github.io/PineTS/initialization-and-usage/)** — Setup options and configuration
|
|
316
|
+
- **[Architecture Overview](https://quantforgeorg.github.io/PineTS/architecture/)** — How PineTS works internally
|
|
317
|
+
- **[API Coverage Details](https://quantforgeorg.github.io/PineTS/api-coverage/)** — Function-by-function compatibility
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
## Use Cases
|
|
322
|
+
|
|
323
|
+
**Algorithmic Trading**
|
|
324
|
+
|
|
325
|
+
- Build custom trading bots using Pine Script strategies
|
|
326
|
+
- Integrate indicators with your execution systems
|
|
327
|
+
|
|
328
|
+
**Backtesting**
|
|
329
|
+
|
|
330
|
+
- Test Pine Script strategies against historical data
|
|
331
|
+
- Export indicator values for analysis in Python/R
|
|
332
|
+
|
|
333
|
+
**Alert Systems**
|
|
334
|
+
|
|
335
|
+
- Create custom alert pipelines based on indicator signals
|
|
336
|
+
- Monitor multiple assets with server-side indicator calculations
|
|
337
|
+
|
|
338
|
+
**Research & Analysis**
|
|
339
|
+
|
|
340
|
+
- Process large datasets with Pine Script indicators
|
|
341
|
+
- Feed indicator outputs into machine learning models
|
|
342
|
+
|
|
343
|
+
**Custom Dashboards**
|
|
344
|
+
|
|
345
|
+
- Embed live indicators in web applications
|
|
346
|
+
- Build real-time monitoring dashboards
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## Roadmap
|
|
351
|
+
|
|
352
|
+
| Status | Feature |
|
|
353
|
+
| ------ | ----------------------------------------- |
|
|
354
|
+
| ✅ | Native Pine Script v5/v6 support |
|
|
355
|
+
| ✅ | 60+ technical analysis functions |
|
|
356
|
+
| ✅ | Arrays, matrices, and maps |
|
|
357
|
+
| ✅ | Real-time streaming |
|
|
358
|
+
| ✅ | Multi-timeframe with `request.security()` |
|
|
359
|
+
| 🚧 | Strategy backtesting engine |
|
|
360
|
+
| 🚧 | Additional data providers |
|
|
361
|
+
| 🎯 | Pine Script v6 full compatibility |
|
|
362
|
+
| 🎯 | Market data Providers |
|
|
363
|
+
| 🎯 | Trading Connectors |
|
|
364
|
+
|
|
365
|
+
---
|
|
366
|
+
|
|
367
|
+
## Related Projects
|
|
368
|
+
|
|
369
|
+
- **[QFChart](https://github.com/QuantForgeOrg/QFChart)** : Charting library optimized for PineTS visualization
|
|
322
370
|
|
|
323
371
|
---
|
|
324
372
|
|
|
325
373
|
## Contributing
|
|
326
374
|
|
|
327
|
-
Contributions are welcome!
|
|
375
|
+
Contributions are welcome! Whether it's:
|
|
376
|
+
|
|
377
|
+
- Adding missing Pine Script functions
|
|
378
|
+
- Improving documentation
|
|
379
|
+
- Fixing bugs
|
|
380
|
+
- Suggesting features
|
|
381
|
+
|
|
382
|
+
Please feel free to open issues or submit pull requests.
|
|
383
|
+
|
|
384
|
+
---
|
|
328
385
|
|
|
329
386
|
## License
|
|
330
387
|
|
|
331
|
-
|
|
388
|
+
AGPL-3.0 - See [LICENSE](LICENSE) for details.
|
|
332
389
|
|
|
333
|
-
|
|
390
|
+
---
|
|
334
391
|
|
|
335
|
-
|
|
392
|
+
<p align="center">
|
|
393
|
+
<sub>Built with passion by <a href="https://quantforge.org">QuantForge</a></sub>
|
|
394
|
+
</p>
|