- Binance Provider : Wrong handling of stream data when sDate and eDate are not provided
- Deprecation Warnings: Fixed wrong warning message appearing with valid code.
- Pine Script Parser: Fixed multiline Pine Script conditions parsing (indent error).
- Transpiler: Fixed
switchstatement syntax conversion.
- Math Namespace: Added
math.todegreesandmath.toradiansfunctions. (contribution)
- Math Namespace: Fixed
math.precisionimplementation andmath.roundprecision parameter handling. - Variable Scope Collision: Fixed critical issue where local variables (
var,let,const) in user-defined functions were sharing state across different function calls. Implemented dynamic scoping using unique call IDs to ensure each function instance maintains isolated state and history. - SMA NaN Handling: Improved
ta.smato correctly propagateNaNvalues and handleNaNcontamination in the rolling window by falling back to full recalculation when necessary. - Transpiler Optimization: Major optimization of user-defined function transpilation. Introduced local context (
$$) for scoping variables, reducing transpiled code complexity and improving readability by removing redundant_callIdargument passing. - Array Access in Expressions: Fixed a bug in the transpiler where array access inside expressions (e.g. ternary operators) could use incorrect static scope keys.
- Scientific Notation Parsing: Fixed Pine Script lexer to correctly parse scientific notation literals (e.g.,
10e10,1.2e-5,1E+5). Previously, these were incorrectly tokenized as separate tokens, causing syntax errors in transpiled code. - Namespace Function Calls in Return Statements: Fixed critical bug where namespace function calls (e.g.,
math.max(),ta.sma()) in single-expression return statements were incorrectly transpiled with double parentheses (e.g.,math.max()()), resulting in runtime errors. Removed redundant AST traversal intransformReturnStatement.
- Plot Fill Method: Implemented
plot.fill()method to fill the area between two plot lines with customizable colors and transparency.
- Transpiler Variable Names Collision: Fixed variable name collision issues in the transpiler that could cause incorrect variable renaming and scope conflicts.
- Logical Expressions in Function Arguments: Fixed handling of logical expressions (e.g.,
&&,||) when passed as arguments to functions, ensuring proper evaluation and transpilation.
- Transpiler Math Operations: Fixed operator precedence issue where parentheses were lost in complex arithmetic expressions (e.g.,
(a + b) * cbecominga + b * c).
- Runtime Indicator Inputs: New
Indicatorclass to pass custom input values at runtime. Create indicators withnew Indicator(source, inputs)and pass them toPineTS.run(). Input values override default values frominput.*declarations. - Input Resolution: Enhanced
input.*namespace methods to resolve values from runtime inputs viacontext.inputs, falling back to default values when not provided.
- PineScript UDT Transpilation: User-defined types (
typekeyword) now correctly transpile toType({...})syntax instead of JavaScript classes, ensuring compatibility with PineTS runtime.
- Critical Transpiler Fix: Resolved cache collision bug in user-defined functions containing
ta.*calls. Implemented context stack mechanism ($.pushId(),$.peekId(),$.popId()) to manage unique call IDs without explicit arguments, preventing state corruption and argument shifting issues with default parameters.
- PineTS.stream() Method: Event-driven wrapper of
PineTS.run()to simplify handling live data and real-time updates - Documentation updates for streaming functionality
- Critical Fix: Live data processing was producing wrong values in
ta.*functions due to incorrect handling of current vs committed candles
- Plot Functions: Added support for additional Pine Script plot functions:
plotbar()- Renders OHLC data as traditional bar charts with horizontal ticksplotcandle()- Renders OHLC data as candlesticks with filled bodies and wicksbgcolor()- Fills the chart background with colors based on conditionsbarcolor()- Colors the main chart candlesticks based on indicator conditions
- Enhanced
Plotsnamespace with support for OHLC array values and color application to main chart - Updated API coverage documentation to reflect new plot functions
- Support for User defined types
- Unit-tests for PineToJS transpiler branch bringing the total coverage back to > 80%
- plot styles were missing in the generated code (e.g plot.style_columns ...etc )
- Plot Functions: Added support for
plotshapeandplotarrowfunctions - PineScript Type Constants: Full implementation of PineScript type namespaces:
format.*- Number format typesplot.*- Plot style typeslocation.*- Location constants for shapessize.*- Size constants for shapesshape.*- Shape style constantsdisplay.*- Display mode constants
- Hotfix : Binance provider failing for USA users, implemented a fallback logic to use the default binance url and fallback to US local url if the first one fails.
- Pine Script Parser/Converter: Initial implementation of native Pine Script parser that automatically detects and converts Pine Script v5 and v6 source code into PineTS executable code. PineTS.run(source) can now run a native PineScript source.
- Async Statement Handling: Graceful handling of async statements (e.g.,
request.security) declared in PineTS syntax without explicitawait, bringing PineTS syntax closer to native Pine Script - Test Coverage: New comprehensive unit tests covering the PineTS transpiler
- Namespace Documentation: Added detailed documentation for Namespaces folder
- Build Pipeline: Updated build system to generate modern package supporting multiple formats and environments (ESM, CJS, UMD)
- Plot Namespace: Restructured Plot namespace for better organization and maintainability
- Documentation: Updated README with improved formatting and comprehensive project information
- Critical TA bug : Fixed a critical bug in atr, ema and stdev moving averages, the bug was affecting series that contain NaN values.
- Equality Operator: Fixed
__eqmethod to properly handle string value comparisons - Transpiler Expression Handling: Fixed wrong decomposition of expressions passed to JSON objects
- TA Functions: Fixed
ta.pivotlowandta.pivothighwhen called without optional source argument - Matrix Build: Fixed matrix namespace build issues
- Array namespace enhancements:
- Implementation of array strong typing
- Array binary search functions
- Additional array methods:
sum,avg,min,max,median,mode,stdev,variance,covariance,standardize,range,abs,percentrank,percentile_linear_interpolation,percentile_nearest_rank
- Map namespace: Full support for
mapnamespace operations - Matrix namespace: Full support for
matrixnamespace operations - Timeframe namespace: Complete implementation of timeframe-related functions
- Request namespace: Added
request.security_lower_tffunction - Syminfo namespace: Fully implemented in Binance provider
- Better API coverage tracking with badges
- Progress on
mathmethods implementations
- Updated
input.*namespace to fully support dynamic Pine Script parameters
- Map and Matrix initialization issues
- Array precision handling
- Array methods fixes to match exact PineScript logic:
slice,every,median,mode,percentile_nearest_rank,percentrank,some,sort_indices,sort - Array method fixes:
fill,new_float,push,set,unshift - Transpiler return statement for native data
- Binance provider cache handling
- Transpiler: passing native series to JSON objects
- Comprehensive implementation of
tanamespace methods:- Trend:
supertrend,dmi,sar,falling,rising,cross - Volatility/Range:
bb(Bollinger Bands),bbw,kc(Keltner Channels),kcw,range,tr(True Range as method) - Volume:
accdist,cum,iii,nvi,pvi,pvt,wad,wvad - Oscillators:
cci,cmo,cog,mfi,stoch,tsi,wpr - Statistical/Rank:
correlation,barssince,valuewhen,percentrank,percentile_linear_interpolation,percentile_nearest_rank,mode,highestbars,lowestbars
- Trend:
- Core
bar_indexvariable support
- Unified Namespace Architecture: All namespace members (e.g.,
ta.tr,ta.obv) are now implemented as methods. The transpiler automatically handles the conversion from property access to method call (e.g.,ta.tr→ta.tr()) - Updated
ta.trandta.obvto align with the unified method pattern
varkeyword semantics: Implemented correct Pine Script behavior forvarvariables (initialize once, persist state across bars) via$.initVarmath.sumhandling ofNaNvalues- Transpiler handling of tertiary conditions involving Series access
ta.supertrendcalculation logic
- Full implementation of
request.security()function with lookahead and gaps support - New TA methods:
obv,alma,macd,swma,vwap - Architecture documentation for transpiler, runtime, and namespaces
- Support for handling raw .pine.ts indicator code (without context function wrapper)
- Ability to show original code lines in transpiled code as comments for debugging
- Comprehensive unit tests for
request.security()functionality - harmonization of Series logic accross the codebase
- Restructured TA unit tests for better organization
- Improved Series handling for better performance and reliability
- Enhanced transpiler to handle implicit pine.ts imports and normalize native imports
- Namespaces import harmonization across the codebase
- Critical recursion bug in
request.security()implementation - Tuple return handling in functions
- Property type check issues
- Automatic code coverage badge generation
- Pagination and streaming mode support for processing large datasets
- Automatic regression tests generator for Pine Script compatibility testing
- Series class implementation for forward arrays optimization
- Support for checking transpiled code during development
- Added Pine Script language unit tests
- Added WillVixFix and SQZMOM indicators for compatibility tests
- Automatic code coverage badge
- Major namespaces refactoring for better organization and maintainability
- Transpiler refactor for improved code generation
- Updated unit tests with new approach to compare to Pine Script data
- Updated documentation pages and build process
- Improved README readability and documentation links
- Fixed compound assignment operations
- Fixed history access in series
- Fixed index handling in forward arrays
- Fixed plot parameters
- Fixed arithmetic operations for native series
- Fixed browser build
- Fixed plot values and time indexes
- Missing math namespace for floating point equality check
- Small performance optimization (removed array slicing in the main loop)
- Updated README and transpiler unit tests (added cache id)
- Documentation indicators update
- Performance optimization: reimplementation of most TA functions to enhance performance (~x5 execution speed on average)
- Documentation updates
- Fix issue #4 (LuxAlgo#4)
- Fix doc page chart
- Documentation updates
- Added demo chart to the documentation
- Theme update: switching to just-the-docs theme
- GitHub pages layout updates
- Documentation layout fixes
- Functions variables bug fix
- Support for ta.crossover, ta.crossunder, ta.pivothigh, ta.pivotlow functions
- Fix for math.avg function
- Multiple transpiler fixes
- Fix Logical, Binary and unary expressions when passed as arguments to PineTS internal functions (e.g plot(close && open, ...))
- Support fo "na" as valid value (will be converted to NaN by the transpiler)
- Fix for Pine Script functions returning tupples
- Add partial support for color.rgb and color.new (these need to be completely rewritten)
- Experimenting a cache approach for TA functions (not yet ready, only tested with sma)
- Add Support for querying large time interval from MarketDataProvider by running multiple requests with a step, the requested market data is cached to prevent rate limiting and optimize performance
- Complete refactor of math.* functions to ensure compatibility with time series for all functions using the same syntax as Pine Script
- Support for request.security() function : in this build we only support the security() function for timeframes higher than the current timeframe, also, gaps, ignore_invalid_symbol, currency and calc_bars_count parameters are supported yet
- array namespace partial support. Ported functions : array.new_bool, array.new_float, array.new_int, array.new_string, array.new, abs, avg, clear, concat, copy, covariance, every, fill, first, from, get, includes, indexof, insert, join, last, lastindexof, pop, push, range, remove, reverse, set, shift, slice, some, sort, sort_indices, standardize, stdev, sum.
- Documentation pages to track portage coverage of Pine Script API and Language features.
This is the first release of PineTS, a TypeScript library that allows you to port Pine Script indicators to TypeScript.
- Support for Pine Script time series, if conditions, for loops, functions, and partial plot directives.
- Partial implementation of ta namespace. ported functions : ema, sma, vwma, wma, hma, rma, change, rsi, atr, mom, roc, dev, variance, highest, lowest, median, stdev, linreg, supertrend.
- Partial implementation of math namespace. ported functions : abs, pow, sqrt, log, ln, exp, floor, round, random, max, min, sin, cos, tan, asin, acos, atan, avg.