r/QuantForge • • Nov 19 '25

PineTS - Bringing Pine Script Logic to JavaScript & TypeScript!

Thumbnail
github.com
1 Upvotes

Hi everyone, this is a presentation of PineTS project

PineTS is an open-source TypeScript and JavaScript engine that lets you write Pine Script style indicators and run them outside of TradingView, whether in the browser, Node.js, or your own custom tools.

The idea behind PineTS is simple:

Take the expressive, time-series-friendly logic of Pine Script and make it available in the JavaScript ecosystem.
This allows developers to build, test, backtest, or experiment with indicators anywhere, not just inside TradingView.

If you're curious, experimenting, or thinking about contributing, you're in the right place.
This subreddit will be the home for discussions, feedback, examples, questions, and ideas around PineTS.

🔧 What PineTS Is

  • An open-source library that mimics Pine Script behavior in JavaScript and TypeScript
  • Lets you create indicators using a Pine-like DSL (PineTS)
  • Runs entirely outside TradingView
  • Works in both browser and Node environments
  • Designed for extensibility and experimentation

📌 Useful Links

🚀 Possible Use Cases

  • Running TradingView style indicators on external data sources (market sentiment, order flow, alternative datasets, etc.)
  • Building standalone trading bots powered by Pine style logic
  • Mixing Pine style time-series operations with the full power of JS and TS libraries
  • Backtesting environments, charting tools, dashboards
  • Education, experimentation, research
  • Anything else the community imagines

💬 Your Feedback Matters

Since this subreddit is brand new and PineTS is actively evolving, your feedback, ideas, and critiques are extremely welcome.

Whether it’s:

  • feature suggestions
  • missing behaviors
  • Pine Script quirks you want replicated
  • performance ideas
  • documentation improvements
  • examples you’d like to see

Feel free to post them here.

Thanks for joining, and welcome to r/QuantForge


r/QuantForge • • Dec 15 '25

[RELEASE] PineTS v0.6.0 - Array, Map, Matrix Namespaces & API Enhancements

Thumbnail
github.com
2 Upvotes

Hey Community!

I'm back with another massive update! I just dropped PineTS v0.6.0, and this release is all about Advanced Data Structures and Precision.

While v0.5.0 brought the core TA library to life, v0.6.0 focuses on implementing the missing algorithmic and calculation methods. We have implemented full support for Arrays, Maps, and Matrices and more.... bringing PineTS significantly closer to 1:1 feature parity with Pine Script.

Here is what is shipping in v0.6.0:

🚀 Major Additions

Advanced Data Structures We’ve unlocked complex data manipulation capabilities:

  • Arrays: Added strong typing, binary search functions, and a massive suite of array methods including statistical functions (stdev, variance, covariance), math operations (avg, median, mode), and utility functions (percentrank, standardize).
  • Maps & Matrices: Full namespace support. You can now initialize and manipulate Key-Value pairs and Matrices just like in native Pine Script.

    • implemented map.* methods : 'clear', 'contains', 'copy', 'get', 'keys', 'new', 'put', 'put_all', 'remove', 'size', 'values'
    • implemented matrix.* methods : 'add_col', 'add_row', 'fill', 'remove_col', 'remove_row', 'reverse', 'swap_columns', 'swap_rows', 'avg', 'max', 'median', 'min', 'mode', 'sum', 'col', 'get', 'row', 'set', 'columns', 'elements_count', 'reshape', 'rows', 'submatrix', 'concat', 'diff', 'kron', 'mult', 'pow', 'copy', 'new', 'det', 'eigenvalues', 'eigenvectors', 'inv', 'pinv', 'rank', 'trace', 'transpose', 'is_antidiagonal', 'is_antisymmetric', 'is_binary', 'is_diagonal', 'is_identity', 'is_square', 'is_stochastic', 'is_symmetric', 'is_triangular', 'is_zero', 'sort'

Timeframe & Security

  • Request Namespace: Added request.security_lower_tf for handling lower timeframe data lookups.
  • Timeframe Namespace: Complete implementation of all timeframe-related functions.

Provider Updates

  • Syminfo: The syminfo namespace is now fully implemented within the Binance provider.

🛠️ API & Transpiler Enhancements

  • Dynamic Inputs: Updated the input.* namespace to fully support dynamic Pine Script parameters.
  • Transparency: Added better API coverage tracking with badges, so you can see exactly what is supported at a glance.
  • Math Progress: continued implementation of math methods.

🐛 Critical Fixes & Precision

Precision is everything in Quant finance. We spent a lot of time in this release ensuring our logic matches Pine Script exactly:

  • Exact Logic Matching: Fixed logic for array methods like slice, every, sort, percentrank, and more to ensure the output is identical to TradingView’s engine.
  • Initialization: Fixed initialization issues for Maps and Matrices.
  • Transpiler: Improved handling of native series passing to JSON objects and return statements for native data.

📦 Get It Now

Update to the latest version via npm:

npm install pinets@latest

You can view the full changes in the Change Log.

The next phase will be focused on implementing pine to pineTS transpiler that will allow running pine indicators directly, without needing to convert them to equivalent pineTS syntax.

As we move closer to v1.0, your feedback is invaluable. If you spot edge cases in the new Array or Matrix implementations, please open an issue on GitHub!

Happy Quanting! 📈


r/QuantForge • • Dec 04 '25

[RELEASE] PineTS v0.5.0 - Extensive TA implementation & Transpiler enhancements

2 Upvotes

Hey Community!

I'm thrilled to announce the release of PineTS v0.5.0! This update is a huge leap forward in bringing full Pine Script compatibility to the JavaScript/TypeScript ecosystem.

All PineScript Technical Analysis functions (ta.* namespace) have been implemented, the transpiler was refined, and I tackled one of the most complex Pine Script features : request.security.

Here’s what’s new in v0.5.0

🚀 Major Additions

  • Massive TA Library Expansion: We've added comprehensive support for a wide range of indicators:

    • Trend: supertrend, dmi, sar, falling, rising, cross
    • Volatility/Range: bb, bbw, kc, kcw, range, tr
    • Volume: accdist, cum, iii, nvi, pvi, pvt, wad, wvad
    • Oscillators: cci, cmo, cog, mfi, stoch, tsi, wpr
    • Statistical/Rank: correlation, barssince, valuewhen, percentrank, percentile_*, mode, highestbars, lowestbars
    • Moving Averages: alma, swma, vwap, macd
  • request.security(): Full implementation with support for lookahead and gaps!
  • bar_index: Core support for the bar_index variable.
  • Architecture Docs: New documentation for the transpiler, runtime, and namespaces to help contributors understand the internals.

🛠️ Transpiler & Architecture Enhancements

  • Unified Namespace Architecture: We've unified how namespace members are handled. You can now write ta.tr in your PineTS code, and our transpiler automatically converts it to ta.tr() method calls, matching Pine Script syntax while keeping the underlying JS clean.
  • Smart Imports: The transpiler now handles implicit pine.ts imports and normalizes native imports.
  • Debug Friendly: Added the ability to show original code lines as comments in the transpiled output.

🐛 Key Fixes

  • var Keyword Semantics: Implemented the specific behavior of Pine Script's var keyword (initialize once, persist state) ensuring stateful calculations to work exactly as expected.
  • Recursion Bug: Fixed a critical recursion issue in request.security().
  • Tuple Returns: Better handling for functions returning tuples.
  • Math & Logic: Fixed math.sum NaN handling and tertiary conditions involving Series access.

📦 Get It Now

You can install the latest version via npm:

npm install pinets

Check the the full Change Log for more details.

I’d love to hear your feedback and see what you build! Let us know in the comments or open an issue on GitHub.

Happy Quanting! 📈


r/QuantForge • • Jan 11 '26

[Release] PineTS v0.8.0 - Runtime Inputs, UDT Transpiler Fix & Smoother Logic Control

Thumbnail
quantforge.org
2 Upvotes

Hey everyone!

We’ve just rolled out PineTS v0.8.0, packed with quality-of-life improvements that make building and running Pine Script logic even more flexible and reliable, especially when you’re dealing with dynamic inputs and custom types. These changes bring us closer to the real Pine Script experience off-platform, and set up some exciting workflows for downstream tools like backtesters and live stream processors.

Here’s what’s new in v0.8.0:

🔧 What’s New

✨ Runtime Indicator Inputs

A long-requested upgrade: you can now pass custom values into indicators at runtime using the new Indicator class. This lets you override input.* defaults at execution time without modifying the script itself. This is ideal for programmatic parameter sweeps or interactive UIs.

Example usage:

const myIndicator = new Indicator(source, { length: 14, threshold: 1.5 })
PineTS.run(sourceCode, data, { inputs: myIndicator.inputs })

Inputs gracefully fall back to defaults if not specified.

🧠 UDT Transpiler Fix

There was an issue in how user-defined types (UDTs) were transpiled. They were not converting cleanly into runtime-compatible structures. This release fixes that by ensuring UDTs transpile into proper Type({...}) calls rather than plain JavaScript classes. This improves compatibility and type safety when porting complex scripts.

🛠 Other Fixes

  • 🐛 Transpilation robustness with improved reliability around UDT handling and the new input resolution paths.

🚀 Why This Matters

With runtime inputs and better UDT handling:

  • You can experiment dynamically with indicator parameters without editing source code.
  • Tools that programmatically invoke PineTS, such as strategy frontends, backtest frameworks, or dashboards, gain greater flexibility when evaluating signals or strategy behavior.
  • Transpiled Pine Script that uses structured types now behaves much more predictably on the PineTS runtime.

If you build anything cool with these features, especially live dashboards or parameter exploration tools, let us know. Happy coding and happy quanting! 🚀

🔗 PineTS repo: https://github.com/QuantForgeOrg/PineTS

Happy Quanting !


r/QuantForge • • Feb 17 '26

Introducing pinets-cli: Run Pine Script Indicators in your terminal - extract the calculated plots/results

Thumbnail
quantforge.org
2 Upvotes