## [0.9.6] - 2026-03-14 - Runtime Error Handling, Loop Guard, Array Fixes, Nested UDTs, New Market Data Providers#165
Merged
alaa-eddine merged 11 commits intomainfrom Mar 14, 2026
Merged
Conversation
Fix user functions returning tuples
Misc fixes and optimizations
Market data providers
updated changelog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added
FMPProvider (beta)(Financial Modeling Prep): New provider for US equities, ETFs, crypto and forex via the FMP REST API. Supports daily (EOD) and intraday timeframes (1m–4h, paid plans). Configures withProvider.FMP.configure({ apiKey: '...' }).AlpacaProvider (beta): New provider for US equities and ETFs via Alpaca Markets. Supports minute through monthly timeframes with cursor-based pagination (up to 10 000 bars/page). Configures withProvider.Alpaca.configure({ apiKey: '...', secretKey: '...' }).BaseProviderAbstract Class: New shared base class for all providers. HandlescloseTimenormalization, fail-early API key validation, and automatic candle aggregation — when a requested timeframe is not natively supported,BaseProviderselects the best available sub-timeframe, fetches sub-candles, and aggregates them transparently.BinanceProviderandMockProviderhave been refactored to extend it.src/marketData/aggregation.ts): New module withselectSubTimeframe(),aggregateCandles(), andgetAggregationRatio(). Supports fixed-ratio aggregation for intraday timeframes and calendar-based grouping for weekly/monthly bars.PineRuntimeError: New exported error class with amethod?: stringproperty. Thrown on Pine Script runtime violations (out-of-bounds access, loop limit exceeded). Distinguishable from general JS errors viainstanceof.PineTS.setMaxLoops(n): Configures the maximum iterations allowed per loop (default 500 000, matching TradingView's limit). Exceeding it throws aPineRuntimeError.for/whilebody, preventing runaway loops from hanging the runtime.array.get,array.set,array.insert,array.remove,matrix.get,matrix.setnow accept negative indices (-1= last element).Fixed
$.set()now appliescontext.precision()when writing a number into a Series, preventing floating-point drift from accumulating across bars.transformReturnStatementwas not walking into binary, unary, call, logical, or conditional expression nodes inside tuple arrays. Expressions like_mid + _dev * multor-_valwere left with bare identifiers, producing wrong values at runtime.array.get/set/insert/removeandmatrix.get/set/row/colnow throw aPineRuntimeErrorwhen an index (after negative normalization) is still out of bounds, replacing the previous silentNaN/undefined.