pinets 0.5.0 → 0.7.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.
Files changed (166) hide show
  1. package/README.md +150 -35
  2. package/dist/pinets.min.browser.es.js +117 -0
  3. package/dist/pinets.min.browser.es.js.map +1 -0
  4. package/dist/pinets.min.browser.js +96 -15
  5. package/dist/pinets.min.browser.js.map +1 -0
  6. package/dist/pinets.min.cjs +96 -14
  7. package/dist/pinets.min.cjs.map +1 -0
  8. package/dist/pinets.min.es.js +99 -4
  9. package/dist/pinets.min.es.js.map +1 -0
  10. package/dist/types/Context.class.d.ts +7 -13
  11. package/dist/types/PineTS.class.d.ts +2 -0
  12. package/dist/types/marketData/Binance/BinanceProvider.class.d.ts +2 -1
  13. package/dist/types/marketData/IProvider.d.ts +43 -0
  14. package/dist/types/marketData/Mock/MockProvider.class.d.ts +13 -1
  15. package/dist/types/namespaces/Barstate.d.ts +13 -0
  16. package/dist/types/namespaces/Core.d.ts +23 -3
  17. package/dist/types/namespaces/Log.d.ts +10 -0
  18. package/dist/types/namespaces/Plot.helper.d.ts +16 -0
  19. package/dist/types/namespaces/Plots.d.ts +16 -0
  20. package/dist/types/namespaces/Str.d.ts +23 -0
  21. package/dist/types/namespaces/Timeframe.d.ts +17 -0
  22. package/dist/types/namespaces/Types.d.ts +86 -0
  23. package/dist/types/namespaces/array/PineArrayObject.d.ts +102 -1
  24. package/dist/types/namespaces/array/array.index.d.ts +1 -129
  25. package/dist/types/namespaces/array/methods/avg.d.ts +2 -1
  26. package/dist/types/namespaces/array/methods/binary_search.d.ts +2 -0
  27. package/dist/types/namespaces/array/methods/binary_search_leftmost.d.ts +2 -0
  28. package/dist/types/namespaces/array/methods/binary_search_rightmost.d.ts +2 -0
  29. package/dist/types/namespaces/array/methods/covariance.d.ts +2 -1
  30. package/dist/types/namespaces/array/methods/every.d.ts +1 -1
  31. package/dist/types/namespaces/array/methods/fill.d.ts +2 -1
  32. package/dist/types/namespaces/array/methods/join.d.ts +5 -0
  33. package/dist/types/namespaces/array/methods/median.d.ts +2 -0
  34. package/dist/types/namespaces/array/methods/mode.d.ts +2 -0
  35. package/dist/types/namespaces/array/methods/new.d.ts +2 -1
  36. package/dist/types/namespaces/array/methods/new_float.d.ts +2 -1
  37. package/dist/types/namespaces/array/methods/new_int.d.ts +2 -1
  38. package/dist/types/namespaces/array/methods/percentile_linear_interpolation.d.ts +3 -0
  39. package/dist/types/namespaces/array/methods/percentile_nearest_rank.d.ts +2 -0
  40. package/dist/types/namespaces/array/methods/percentrank.d.ts +2 -0
  41. package/dist/types/namespaces/array/methods/push.d.ts +2 -1
  42. package/dist/types/namespaces/array/methods/range.d.ts +2 -1
  43. package/dist/types/namespaces/array/methods/set.d.ts +2 -1
  44. package/dist/types/namespaces/array/methods/some.d.ts +1 -1
  45. package/dist/types/namespaces/array/methods/sort.d.ts +2 -1
  46. package/dist/types/namespaces/array/methods/sort_indices.d.ts +2 -1
  47. package/dist/types/namespaces/array/methods/stdev.d.ts +2 -1
  48. package/dist/types/namespaces/array/methods/sum.d.ts +2 -1
  49. package/dist/types/namespaces/array/methods/unshift.d.ts +2 -1
  50. package/dist/types/namespaces/array/methods/variance.d.ts +2 -1
  51. package/dist/types/namespaces/array/utils.d.ts +5 -0
  52. package/dist/types/namespaces/input/methods/any.d.ts +1 -2
  53. package/dist/types/namespaces/input/methods/bool.d.ts +1 -2
  54. package/dist/types/namespaces/input/methods/color.d.ts +1 -2
  55. package/dist/types/namespaces/input/methods/enum.d.ts +1 -2
  56. package/dist/types/namespaces/input/methods/float.d.ts +1 -2
  57. package/dist/types/namespaces/input/methods/int.d.ts +1 -2
  58. package/dist/types/namespaces/input/methods/param.d.ts +1 -1
  59. package/dist/types/namespaces/input/methods/price.d.ts +1 -2
  60. package/dist/types/namespaces/input/methods/session.d.ts +1 -2
  61. package/dist/types/namespaces/input/methods/source.d.ts +1 -2
  62. package/dist/types/namespaces/input/methods/string.d.ts +1 -2
  63. package/dist/types/namespaces/input/methods/symbol.d.ts +1 -2
  64. package/dist/types/namespaces/input/methods/text_area.d.ts +1 -2
  65. package/dist/types/namespaces/input/methods/time.d.ts +1 -2
  66. package/dist/types/namespaces/input/methods/timeframe.d.ts +1 -2
  67. package/dist/types/namespaces/input/types.d.ts +12 -1
  68. package/dist/types/namespaces/input/utils.d.ts +2 -0
  69. package/dist/types/namespaces/map/PineMapObject.d.ts +26 -0
  70. package/dist/types/namespaces/map/map.index.d.ts +7 -0
  71. package/dist/types/namespaces/map/methods/clear.d.ts +3 -0
  72. package/dist/types/namespaces/map/methods/contains.d.ts +3 -0
  73. package/dist/types/namespaces/map/methods/copy.d.ts +3 -0
  74. package/dist/types/namespaces/map/methods/get.d.ts +3 -0
  75. package/dist/types/namespaces/map/methods/keys.d.ts +4 -0
  76. package/dist/types/namespaces/map/methods/new.d.ts +3 -0
  77. package/dist/types/namespaces/map/methods/param.d.ts +1 -0
  78. package/dist/types/namespaces/map/methods/put.d.ts +3 -0
  79. package/dist/types/namespaces/map/methods/put_all.d.ts +3 -0
  80. package/dist/types/namespaces/map/methods/remove.d.ts +3 -0
  81. package/dist/types/namespaces/map/methods/size.d.ts +3 -0
  82. package/dist/types/namespaces/map/methods/values.d.ts +4 -0
  83. package/dist/types/namespaces/math/math.index.d.ts +18 -0
  84. package/dist/types/namespaces/math/methods/abs.d.ts +2 -1
  85. package/dist/types/namespaces/math/methods/e.d.ts +5 -0
  86. package/dist/types/namespaces/math/methods/phi.d.ts +5 -0
  87. package/dist/types/namespaces/math/methods/pi.d.ts +5 -0
  88. package/dist/types/namespaces/math/methods/round_to_mintick.d.ts +2 -0
  89. package/dist/types/namespaces/math/methods/rphi.d.ts +5 -0
  90. package/dist/types/namespaces/math/methods/sign.d.ts +2 -0
  91. package/dist/types/namespaces/matrix/PineMatrixObject.d.ts +102 -0
  92. package/dist/types/namespaces/matrix/matrix.index.d.ts +7 -0
  93. package/dist/types/namespaces/matrix/methods/add_col.d.ts +3 -0
  94. package/dist/types/namespaces/matrix/methods/add_row.d.ts +3 -0
  95. package/dist/types/namespaces/matrix/methods/avg.d.ts +3 -0
  96. package/dist/types/namespaces/matrix/methods/col.d.ts +4 -0
  97. package/dist/types/namespaces/matrix/methods/columns.d.ts +3 -0
  98. package/dist/types/namespaces/matrix/methods/concat.d.ts +3 -0
  99. package/dist/types/namespaces/matrix/methods/copy.d.ts +3 -0
  100. package/dist/types/namespaces/matrix/methods/det.d.ts +3 -0
  101. package/dist/types/namespaces/matrix/methods/diff.d.ts +3 -0
  102. package/dist/types/namespaces/matrix/methods/eigenvalues.d.ts +4 -0
  103. package/dist/types/namespaces/matrix/methods/eigenvectors.d.ts +3 -0
  104. package/dist/types/namespaces/matrix/methods/elements_count.d.ts +3 -0
  105. package/dist/types/namespaces/matrix/methods/fill.d.ts +3 -0
  106. package/dist/types/namespaces/matrix/methods/get.d.ts +3 -0
  107. package/dist/types/namespaces/matrix/methods/inv.d.ts +3 -0
  108. package/dist/types/namespaces/matrix/methods/is_antidiagonal.d.ts +3 -0
  109. package/dist/types/namespaces/matrix/methods/is_antisymmetric.d.ts +3 -0
  110. package/dist/types/namespaces/matrix/methods/is_binary.d.ts +3 -0
  111. package/dist/types/namespaces/matrix/methods/is_diagonal.d.ts +3 -0
  112. package/dist/types/namespaces/matrix/methods/is_identity.d.ts +3 -0
  113. package/dist/types/namespaces/matrix/methods/is_square.d.ts +3 -0
  114. package/dist/types/namespaces/matrix/methods/is_stochastic.d.ts +3 -0
  115. package/dist/types/namespaces/matrix/methods/is_symmetric.d.ts +3 -0
  116. package/dist/types/namespaces/matrix/methods/is_triangular.d.ts +3 -0
  117. package/dist/types/namespaces/matrix/methods/is_zero.d.ts +3 -0
  118. package/dist/types/namespaces/matrix/methods/kron.d.ts +3 -0
  119. package/dist/types/namespaces/matrix/methods/max.d.ts +3 -0
  120. package/dist/types/namespaces/matrix/methods/median.d.ts +3 -0
  121. package/dist/types/namespaces/matrix/methods/min.d.ts +3 -0
  122. package/dist/types/namespaces/matrix/methods/mode.d.ts +3 -0
  123. package/dist/types/namespaces/matrix/methods/mult.d.ts +4 -0
  124. package/dist/types/namespaces/matrix/methods/new.d.ts +3 -0
  125. package/dist/types/namespaces/matrix/methods/param.d.ts +1 -0
  126. package/dist/types/namespaces/matrix/methods/pinv.d.ts +3 -0
  127. package/dist/types/namespaces/matrix/methods/pow.d.ts +3 -0
  128. package/dist/types/namespaces/matrix/methods/rank.d.ts +3 -0
  129. package/dist/types/namespaces/matrix/methods/remove_col.d.ts +4 -0
  130. package/dist/types/namespaces/matrix/methods/remove_row.d.ts +4 -0
  131. package/dist/types/namespaces/matrix/methods/reshape.d.ts +3 -0
  132. package/dist/types/namespaces/matrix/methods/reverse.d.ts +3 -0
  133. package/dist/types/namespaces/matrix/methods/row.d.ts +4 -0
  134. package/dist/types/namespaces/matrix/methods/rows.d.ts +3 -0
  135. package/dist/types/namespaces/matrix/methods/set.d.ts +3 -0
  136. package/dist/types/namespaces/matrix/methods/sort.d.ts +3 -0
  137. package/dist/types/namespaces/matrix/methods/submatrix.d.ts +3 -0
  138. package/dist/types/namespaces/matrix/methods/sum.d.ts +3 -0
  139. package/dist/types/namespaces/matrix/methods/swap_columns.d.ts +3 -0
  140. package/dist/types/namespaces/matrix/methods/swap_rows.d.ts +3 -0
  141. package/dist/types/namespaces/matrix/methods/trace.d.ts +3 -0
  142. package/dist/types/namespaces/matrix/methods/transpose.d.ts +3 -0
  143. package/dist/types/namespaces/request/methods/security_lower_tf.d.ts +9 -0
  144. package/dist/types/namespaces/request/request.index.d.ts +3 -0
  145. package/dist/types/namespaces/ta/methods/atr.d.ts +2 -1
  146. package/dist/types/namespaces/ta/methods/pivothigh.d.ts +1 -1
  147. package/dist/types/namespaces/ta/methods/pivotlow.d.ts +1 -1
  148. package/dist/types/namespaces/ta/methods/tr.d.ts +2 -1
  149. package/dist/types/namespaces/utils.d.ts +12 -0
  150. package/dist/types/transpiler/index.d.ts +1 -1
  151. package/dist/types/transpiler/pineToJS/ast.d.ts +167 -0
  152. package/dist/types/transpiler/pineToJS/codegen.d.ts +53 -0
  153. package/dist/types/transpiler/pineToJS/lexer.d.ts +31 -0
  154. package/dist/types/transpiler/pineToJS/parser.d.ts +45 -0
  155. package/dist/types/transpiler/pineToJS/pineToJS.index.d.ts +32 -0
  156. package/dist/types/transpiler/pineToJS/tokens.d.ts +34 -0
  157. package/dist/types/transpiler/settings.d.ts +6 -0
  158. package/dist/types/transpiler/transformers/WrapperTransformer.d.ts +5 -3
  159. package/dist/types/transpiler/utils/ASTFactory.d.ts +1 -0
  160. package/dist/types/types/PineTypes.d.ts +30 -15
  161. package/package.json +27 -6
  162. package/dist/pinets.dev.browser.js +0 -13887
  163. package/dist/pinets.dev.cjs +0 -14024
  164. package/dist/pinets.dev.cjs.map +0 -1
  165. package/dist/pinets.dev.es.js +0 -6375
  166. package/dist/pinets.dev.es.js.map +0 -1
package/README.md CHANGED
@@ -4,18 +4,25 @@
4
4
  [![Documentation](https://img.shields.io/badge/docs-github--pages-blue?style=flat-square)](https://quantforgeorg.github.io/PineTS/)
5
5
  [![Reddit](https://img.shields.io/reddit/subreddit-subscribers/QuantForge?style=flat-square&logo=reddit)](https://www.reddit.com/r/QuantForge/)
6
6
 
7
- This project aims to provide a Javascript/Typescript port for Tradingview's Pine Script.
8
- The current version does not run Pine Script directly, instead it runs a close Javascript equivalent called PineTS.
7
+ ---
9
8
 
10
- PineTS makes it possible to migrate Pine Script v5+ indicators to Javascript/Typescript, in order to run them in a Javascript environment.
9
+ **PineTS** is a JavaScript/TypeScript runtime that enables execution of Pine Script indicators in JavaScript environments. It supports two input formats:
11
10
 
12
- ## Disclaimer
11
+ 1. **Native Pine Script v5/v6** _(experimental)_ - Run original Pine Script code directly
12
+ 2. **PineTS Syntax** - A JavaScript/TypeScript syntax that closely mirrors Pine Script
13
+
14
+ This makes it possible to run Pine Script indicators in Node.js, browsers, and other JavaScript runtimes without modification or with minimal conversion effort.
13
15
 
14
- 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.
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._
15
17
 
16
18
  ## Overview
17
19
 
18
- PineTS enables seamless conversion of Pine Script indicators to JavaScript/TypeScript code. 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.
20
+ PineTS is a sophisticated 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** _(v0.7.0+, 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.
19
26
 
20
27
  ## See it in action
21
28
 
@@ -27,14 +34,15 @@ PineTS is used to generate plot data, and tradingview light weight chart is used
27
34
 
28
35
  ## Key Features
29
36
 
30
- - **Pine Script Compatibility**: Supports Pine Script v5+ syntax and functionality
37
+ - **Native Pine Script Support**: Run original Pine Script v5/v6 code directly _(experimental)_
38
+ - **Dual Input Format**: Support for both native Pine Script and PineTS syntax
31
39
  - **High Precision**: Aims for the same precision as Pine Script (up to the 8th digit)
32
40
  - **Time-Series Processing**: Handles historical data and series operations
33
- - **Technical Analysis Functions**: Comprehensive set of TA indicators and calculations
41
+ - **Technical Analysis Functions**: Comprehensive set of 60+ TA indicators and calculations
34
42
  - **Mathematical Operations**: Advanced mathematical functions and precision handling
35
43
  - **Input Management**: Flexible parameter and input handling system
36
44
  - **Context Management**: Maintains proper scoping and variable access rules
37
- - **Runtime Transpilation**: Converts PineTS code to executable JavaScript at runtime
45
+ - **Runtime Transpilation**: Converts code to executable JavaScript at runtime without pre-compilation
38
46
 
39
47
  ## Core Components
40
48
 
@@ -61,17 +69,52 @@ The main class that handles:
61
69
  npm install pinets
62
70
  ```
63
71
 
64
- ## Usage Example
72
+ ## Usage Examples
73
+
74
+ ### Option 1: Run Native Pine Script Directly _(Experimental)_
75
+
76
+ Starting with v0.7.0, you can run original Pine Script code directly:
77
+
78
+ ```javascript
79
+ import { PineTS, Provider } from 'pinets';
80
+
81
+ // Initialize with market data
82
+ const pineTS = new PineTS(Provider.Binance, 'BTCUSDT', 'D', 100);
83
+
84
+ // Run native Pine Script directly
85
+ const pineScriptCode = `
86
+ //@version=5
87
+ indicator('My EMA Cross Strategy')
88
+
89
+ ema9 = ta.ema(close, 9)
90
+ ema18 = ta.ema(close, 18)
91
+
92
+ bull_bias = ema9 > ema18
93
+ bear_bias = ema9 < ema18
94
+
95
+ plot(ema9, title = '9 EMA', color = color.yellow)
96
+ plot(ema18, title = '18 EMA', color = color.red)
97
+ `;
98
+
99
+ const { result, plots } = await pineTS.run(pineScriptCode);
100
+ // Access results: result.ema9, result.ema18, result.bull_bias, result.bear_bias
101
+ ```
102
+
103
+ > **⚠️ Note**: Native Pine Script support is experimental. Some indicators may fail if they use API features not yet implemented. Refer to the [API coverage badges](#pine-script-api-coverage) to check compatibility.
104
+
105
+ ### Option 2: Use PineTS Syntax
106
+
107
+ PineTS syntax is a JavaScript/TypeScript version of Pine Script with minimal differences:
65
108
 
66
- ### Converting Pine Script to PineTS
109
+ #### Converting Pine Script to PineTS
67
110
 
68
111
  Original Pine Script:
69
112
 
70
- <table>
113
+ <table width="100%">
71
114
  <tr>
72
115
  <td>
73
116
 
74
- ```javascript
117
+ ```pinescript
75
118
  /*==[ Original Pine Script ]==*/
76
119
 
77
120
  //@version=5
@@ -88,6 +131,10 @@ diff_close = close - prev_close;
88
131
 
89
132
  _oo = open;
90
133
  _oo = math.abs(open[1] - close[2]);
134
+
135
+ // plot ema's
136
+ plot(ema9, title = '9 EMA', color = color.yellow)
137
+ plot(ema18, title = '18 EMA', color = color.red)
91
138
  ```
92
139
 
93
140
  </td>
@@ -97,7 +144,7 @@ _oo = math.abs(open[1] - close[2]);
97
144
  /*==[ Equivalent PineTS ]==*/
98
145
 
99
146
  //
100
- //'My EMA Cross Strategy';
147
+ indicator('My EMA Cross Strategy');
101
148
 
102
149
  let ema9 = ta.ema(close, 9);
103
150
  let ema18 = ta.ema(close, 18);
@@ -110,6 +157,10 @@ let diff_close = close - prev_close;
110
157
 
111
158
  let _oo = open;
112
159
  _oo = math.abs(open[1] - close[2]);
160
+
161
+ // plot ema's
162
+ plot(ema9, { title: '9 EMA', color: color.yellow });
163
+ plot(ema18, { title: '18 EMA', color: color.red });
113
164
  ```
114
165
 
115
166
  </td>
@@ -147,38 +198,102 @@ const { result } = await pineTS.run((context) => {
147
198
 
148
199
  > **📖 For detailed documentation on initialization options, parameters, and advanced usage, see the [Initialization and Usage Guide](https://quantforgeorg.github.io/PineTS/initialization-and-usage/)**
149
200
 
150
- ## Key Differences from Pine Script
201
+ ## Key Differences: PineTS Syntax vs Native Pine Script
202
+
203
+ When using **PineTS syntax** (not native Pine Script), note these differences:
151
204
 
152
205
  1. **Variable Declaration**: Use JavaScript's `const`, `let`, and `var` instead of Pine Script's implicit declaration
153
206
  2. **Function Syntax**: JavaScript arrow functions and standard function syntax
154
- 3. **Module System**: Pine Script native types should be imported using syntax like : const ta = context.ta; const {close, open} = context.data;
155
- 4. **Scoping Rules**: Maintains Pine Script's series behavior through runtime transformation
156
- 5. **Return syntax**: PineTS can returns an object with the results of the indicator, allowing you to get the results of the indicator in a single call.
207
+ 3. **Module System**: Import Pine Script namespaces from context: `const { ta } = context; const { close, open } = context.data;`
208
+ 4. **Object Syntax**: Use JavaScript object notation for parameters: `plot(ema9, { title: '9 EMA', color: color.yellow })`
209
+ 5. **Scoping Rules**: Maintains Pine Script's series behavior through runtime transformation
210
+ 6. **Return Syntax**: Can return an object with indicator results for easy access in JavaScript
211
+
212
+ When using **Native Pine Script**, write code exactly as you would in TradingView - no conversion needed!
157
213
 
158
214
  ## Project Goals
159
215
 
160
- PineTS aims for **full coverage** of Pine Script functions and capabilities. The ultimate goal is to enable running **original Pine Script code directly** without manual conversion to PineTS syntax.
216
+ PineTS aims for **full coverage** of Pine Script functions and capabilities to enable seamless execution of Pine Script indicators in JavaScript environments.
161
217
 
162
- - Runtime Transpiler
163
- - Core Pine Script functions and variables
164
- - Series and scope management
165
- - Technical analysis functions
166
- - Mathematical functions
167
- - Input handling
168
- - Plots data handling
169
- - Market data connectors
170
- - Visualization add-ons
171
- - Strategy execution
172
- - Backtesting and simulation
218
+ **Current Status (v0.7.0)**:
219
+
220
+ - **Native Pine Script Support (Experimental)**: Run original Pine Script v5/v6 code directly
221
+ - **PineTS Runtime Transpiler**: Convert PineTS syntax to executable JavaScript
222
+ - **Core Pine Script API**: ~75% coverage of built-in functions and variables
223
+ - **Series and Scope Management**: Full Pine Script semantics preserved
224
+ - **Technical Analysis**: 60+ indicators and analysis functions
225
+ - **Mathematical Operations**: Comprehensive math functions
226
+ - **Data Structures**: Arrays and Matrices (90+ operations)
227
+ - **Input System**: Dynamic parameter handling
228
+ - **Plot Data Management**: Multi-series plotting support
229
+ - ✅ **Real-time Execution**: Live data processing capability
230
+ - ✔️🚧 **Market Data Providers**: Binance supported (more coming soon)
231
+ - ✅ **Visualization**: Interactive charting ==> handled in [QFChart](https://github.com/QuantForgeOrg/QFChart)
232
+ - 🚧 **Caching System**: Script and market data optimization (in progress)
233
+ - 🎯 **Strategy Execution**: Backtesting and live trading (planned)
234
+
235
+ > **⚠️ API Coverage**: While PineTS supports native Pine Script execution, not all Pine Script API features are implemented yet. Check the [API coverage badges](#pine-script-api-coverage) below to verify if specific functions are available. Indicators using unimplemented features will fail with descriptive error messages.
173
236
 
174
237
  ## Technical Details
175
238
 
176
- The library uses a runtime transpiler that:
239
+ The library uses a dual-layer transpilation system:
240
+
241
+ ### Pine Script Parser _(v0.7.0+, Experimental)_
242
+
243
+ - Automatically detects Pine Script v5 and v6 code
244
+ - Converts native Pine Script syntax to PineTS intermediate representation
245
+ - Preserves Pine Script semantics and behavior
246
+
247
+ ### Runtime Transpiler
248
+
249
+ - Transforms PineTS source (or converted Pine Script) to handle time-series data
250
+ - Manages variable scoping and context
251
+ - Handles array indexing and series operations
252
+ - Provides Pine Script-compatible function calls
253
+ - Executes in real-time without pre-compilation
254
+ ==> The resulting code is a low level javascript that allows handling the complex structures and specificities of PineScript
255
+
256
+ ### Pine Script API Coverage
257
+
258
+ #### Data
259
+
260
+ [![syminfo](./.github/badges/api-syminfo.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/syminfo.html)
261
+ [![session](./.github/badges/api-session.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/session.html)
262
+ [![timeframe](./.github/badges/api-timeframe.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/timeframe.html)
263
+ [![barstate](./.github/badges/api-barstate.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/barstate.html)
264
+ [![ticker](./.github/badges/api-ticker.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/ticker.html)
265
+ [![builtin](./.github/badges/api-builtin.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/builtin.html)
266
+
267
+ #### Calculation
268
+
269
+ [![ta](./.github/badges/api-ta.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/ta.html)
270
+ [![math](./.github/badges/api-math.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/math.html)
271
+ [![array](./.github/badges/api-array.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/array.html)
272
+ [![map](./.github/badges/api-map.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/map.html)
273
+ [![matrix](./.github/badges/api-matrix.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/matrix.html)
274
+ [![request](./.github/badges/api-request.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/request.html)
275
+ [![types](./.github/badges/api-types.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/types.html)
276
+ [![strategy](./.github/badges/api-strategy.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/strategy.html)
277
+ [![input](./.github/badges/api-input.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/input.html)
278
+
279
+ #### Visualization
280
+
281
+ [![color](./.github/badges/api-color.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/color.html)
282
+ [![plots](./.github/badges/api-plots.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/plots.html)
283
+ [![chart](./.github/badges/api-chart.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/chart.html)
284
+ [![label](./.github/badges/api-label.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/label.html)
285
+ [![line](./.github/badges/api-line.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/line.html)
286
+ [![polyline](./.github/badges/api-polyline.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/polyline.html)
287
+ [![box](./.github/badges/api-box.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/box.html)
288
+ [![table](./.github/badges/api-table.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/table.html)
289
+ [![linefill](./.github/badges/api-linefill.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/linefill.html)
290
+
291
+ #### Logging
292
+
293
+ [![log](./.github/badges/api-log.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/log.html)
294
+ [![str](./.github/badges/api-str.svg)](https://quantforgeorg.github.io/PineTS/api-coverage/str.html)
177
295
 
178
- 1. Transforms PineTS code to handle time-series data
179
- 2. Manages variable scoping and context
180
- 3. Handles array indexing and series operations
181
- 4. Provides Pine Script-compatible function calls
296
+ ---
182
297
 
183
298
  ## Contributing
184
299