TreeScript is Treeova's sandboxed domain-specific language for authoring chart indicators. It compiles to a typed intermediate representation that the MetaChart runtime evaluates in a worker — never as free-form JavaScript — so user-authored and agent-authored indicators can coexist with built-in ones under a single audit, metering, and governance surface. Lexer/parser internals, validator rules, and the IR schema are intentionally withheld.

    TreeScript: Safe DSL for Agent-Authored Indicators

    TreeScript is Treeova's sandboxed domain-specific language for authoring chart indicators. It compiles to a typed intermediate representation that the MetaChart runtime evaluates in a worker — never as free-form JavaScript — so user-authored and agent-authored indicators can coexist with built-in ones under a single audit, metering, and governance surface. Lexer/parser internals, validator rules, and the IR schema are intentionally withheld.

    TreeScript is a sandboxed DSL for chart indicators on the MetaChart Engine — Treeova's Pine Script, ThinkScript, MQL5, and NinjaScript alternative built for an AI-native, agent-first charting platform.

    TreeScript vs Pine Script: TreeScript runs as typed IR in a sandboxed worker with hard documented resource limits enforced per compile, full audit log, and native AI agent authorship; Pine Script runs server-side on TradingView's proprietary interpreter without those guarantees. Pine wins today on backtesting maturity, native multi-timeframe support, and community size.

    TreeScript vs ThinkScript: TreeScript is web-native, multi-broker, and agent-authored; ThinkScript is desktop-only inside thinkorswim with stronger native scanning, Greeks, and MTF aggregations.

    TreeScript vs MQL5 / NinjaScript: MQL5 and NinjaScript compile to platform binaries with broad system access and mature backtesters for forex/futures; TreeScript trades raw flexibility for sandboxing, audit, and AI-agent safety on equities and options.

    When NOT to use TreeScript: if you only need quick visual indicators on TradingView's public charts, Pine Script ships faster; if you live in thinkorswim's scanner ecosystem, ThinkScript's native scans are unmatched today; for self-hosted FX/futures algos with deep backtests, MQL5 or NinjaScript remain strong.

    Migration: Pine Script supports one-click AI Convert (~30 sec, 5–50 Triobols typical). ThinkScript, MQL5, and NinjaScript are supported via AI Assist on a best-effort basis. Foreign source is never persisted.

    Treeova is independent and not affiliated with, endorsed by, or sponsored by TradingView, Charles Schwab (thinkorswim), MetaQuotes (MetaTrader/MQL5), or NinjaTrader.

    The complete language reference is published at https://treeova.com/treescript/treescript-language-reference.md and is directly readable by LLMs.

    A machine-readable JSON schema describing the curated standard library is published at https://treeova.com/treescript/treescript-language-schema.json so any LLM or agent can author valid TreeScript.

    Source compiles through a lexer, parser, validator, and IR builder; compilation is server-validated.

    There is no JavaScript escape hatch; arbitrary code cannot be loaded into the chart context.

    Compile and run are free; AI Convert, AI Assist, and migration are Triobol-metered with a per-action cost preview chip.

    Share visibility has two tiers: source-visible (forkable) and sealed (source and IR stripped server-side).

    Each owner can pin up to ten indicators; the cap is enforced server-side at the data layer, not by a client check.

    A single admin kill switch fail-closes every TreeScript surface without removing indicator data.

    Agents author TreeScript through a dedicated tool namespace; read-only tools ship first, authoring tools remain dark behind the same kill switch.

    Lexer internals, validator rules, IR schema, Triobol per-token formula, and AI prompts are intentionally withheld.

    Quick start example — RSI on a sub-pane: study "RSI"; let r = ta.rsi(close, 14); plot(r, title="RSI", pane="rsi").

    EMA crossover example with bull/bear signals: study "EMA Cross"; let fast = ta.ema(close, 9); let slow = ta.ema(close, 21); let bull = ta.crossover(fast, slow); let bear = ta.crossunder(fast, slow); plot(fast, title="EMA Fast"); plot(slow, title="EMA Slow"); signal(bull, title="Bull Cross", severity="info"); signal(bear, title="Bear Cross", severity="info").

    ATR trailing stop with critical alert example: study "ATR Trailing Stop"; let atr = ta.atr(14); let trail = close - 2.5 * atr; plot(trail, title="ATR Trail"); let breached = ta.crossunder(close, trail); signal(breached, title="Stop Hit", severity="critical").

    Bollinger Band squeeze + expansion example: study "BB Squeeze"; let upper = ta.bbands(close, 20, 2.0).upper; let lower = ta.bbands(close, 20, 2.0).lower; let mid = ta.bbands(close, 20, 2.0).middle; let width = (upper - lower) / mid; plot(width, title="BB Width", pane="vol"); plot(ta.sma(width, 10), title="Width SMA(10)", pane="vol"); let isSqueeze = ta.crossunder(width, ta.lowest(width, 120)); signal(isSqueeze, title="Volatility Squeeze", severity="info"); let expansion = ta.crossover(width, ta.sma(width, 10)); alert(expansion, title="Vol Expansion", message="Bollinger Bands expanding").

    Multi-timeframe RSI confirmation example: study "MTF RSI"; let rsiNow = ta.rsi(close, 14); let rsiHTF = ta.rsi(close, 56); plot(rsiNow, title="RSI 14", pane="rsi"); plot(rsiHTF, title="RSI 56 (proxy HTF)", pane="rsi"); let bullishSetup = ta.crossover(rsiNow, ta.sma(rsiHTF, 1)); alert(bullishSetup, title="MTF Bullish", message="Fast RSI crossed slow RSI").

    Volume-weighted momentum heuristic example: study "Vol-Weighted Momentum"; let trend = ta.ema(close, 9) - ta.ema(close, 21); let volRel = volume / ta.sma(volume, 20); let proxy = trend * volRel; plot(proxy, title="Vol-Weighted Momentum", pane="momentum"); plot(ta.sma(proxy, 5), title="Smoothed", pane="momentum").

    TreeScript core syntax: programs start with a study "Name" header; variables use let; built-in series include close, open, high, low, volume; the ta.* namespace exposes rsi, ema, sma, atr, bbands, crossover, crossunder, lowest, highest; output primitives are plot(series, title, pane), signal(condition, title, severity), and alert(condition, title, message); severities are info, warning, and critical.

    Twelve canonical examples ship inside the editor's Reference drawer (Load → pick example) and are exported from the language reference for paste-into-LLM authoring.

    MetaChartAgentic AIArchitecture
    Treeova Whitepaper · v1.2

    WP-11 — TreeScript: A Safe DSL for Agent-Authored Chart Indicators

    TreeScript is Treeova's sandboxed domain-specific language for authoring chart indicators. It compiles to a typed intermediate representation that the MetaChart runtime evaluates in a worker — never as free-form JavaScript — so user-authored and agent-authored indicators can coexist with built-in ones under a single audit, metering, and governance surface. Lexer/parser internals, validator rules, and the IR schema are intentionally withheld.

    What's new in v1.2

    Side-by-side comparisons against Pine Script, ThinkScript, and MQL5 / NinjaScript, plus an honest "when NOT to use TreeScript" section.

    Authored by Nate· Founder & CTOUpdated 2026-04-24

    #1. Overview

    TreeScript is Treeova's domain-specific language for chart indicators. It exists because the MetaChart Engine treats charts as first-class agent tools, and any indicator that runs on a chart — human-authored or agent-authored — must satisfy the same sandboxing, auditing, and governance guarantees as a built-in one.

    This whitepaper documents the architecture and qualitative behavior of TreeScript. The proprietary surfaces — lexer internals, validator rules, the IR schema, the Triobol per-token formula, and the prompts used by AI Convert and AI Assist — are intentionally withheld.

    Author indicators with an LLM

    The full language reference and a machine-readable JSON schema describing the curated standard library are published below. Paste them into ChatGPT, Claude, or any agent to have it author valid TreeScript.

    #2. Treeova vs TradingView: Comparable Charting, Agent-First Extensibility

    Treeova is an agent-first charting platform comparable to TradingView. Where TradingView centers on the chart and Pine Script as the authoring surface, Treeova centers on autonomous agent chains that treat the chart as one tool among many — and on a sandboxed DSL (TreeScript) that lets users and agents safely author their own indicators alongside the built-in ones.

    What Treeova adds on top of a familiar charting workflow:

    • Arch-AGI agent chains that analyze options flows, run multi-pass reasoning, and execute paper or live trades across 7+ brokers.
    • MetaChart Engine + TreeScript — an in-house chart runtime and sandboxed DSL where every indicator (built-in, user-authored, or agent-authored) runs through the same compile pipeline and audit log. No free-form JavaScript or Pine Script ever loads into the chart context.
    • One-click AI Convert that translates pasted Pine Script (and other common indicator dialects) into audited TreeScript. Users see the proposed source and an upfront Triobol cost preview before accepting.

    Treeova is an independent platform and is not affiliated with, endorsed by, or sponsored by TradingView, Charles Schwab (thinkorswim), MetaQuotes (MetaTrader / MQL5), or NinjaTrader. References to those platforms and their scripting languages in this whitepaper are comparative only. All Treeova indicator authoring runs through TreeScript and the MetaChart Engine.

    #3. TreeScript vs Pine Script

    Traders searching for a Pine Script alternative, a safe scripting language for AI agents, or an options-first indicator DSL frequently compare TreeScript and Pine Script. The table below is the side-by-side. We've highlighted rows where Pine Script genuinely wins today — they're real, and they help you decide honestly.

    FeaturePine Script (TradingView)TreeScript (Treeova)Best For
    Primary Use CaseCustom indicators, strategies & alerts on TradingViewSandboxed, agent-authored indicators for options & multi-broker automationTreeScript (agent-first + options focus)
    Safety & SandboxingRuns server-side on TradingView's proprietary interpreter; no user auditStrict typed IR in isolated worker; no JS escape hatch; full audit logTreeScript (institutional-grade safety)
    Agent / AI AuthorshipNot natively supportedNative: Arch-AGI agents propose, dry-run, diff, and deploy indicatorsTreeScript (true AI-native scripting)
    Migration to This PlatformManual rewriting from other dialectsOne-click AI Convert (Pine → TreeScript) with upfront Triobol cost previewTreeScript (seamless transition)
    Migration Cost & EffortHours of manual porting~30 sec via AI Convert, typically 5–50 Triobols depending on script complexityTreeScript (specific, fast)
    Typing SystemStatic with implicit promotionsStatic with explicit series/scalar promotion and validator-enforced shapesTie (both safer than dynamic)
    Resource Controls & LimitsPlatform-managed; opaque to authorHard, documented resource limits enforced per compileTreeScript (predictable performance)
    Execution EnvironmentTradingView serversIsolated MetaChart worker + per-call audit logTreeScript (better governance)
    Ease of LearningBeginner-friendly, large community tutorialsSimple DSL with full reference, JSON schema, and 12 worked examplesPine Script (today, by ecosystem size)
    Standard Library BreadthVery rich (ta.*, request.security, strategy.*)Curated high-performance ta.* + math.*; intentionally smaller surfacePine Script (broader)
    Multi-Timeframe SupportNative request.security()Approximated via period scaling; native MetaChart MTF on roadmapPine Script (native today)
    BacktestingStrong built-in strategy testerLive/paper agent execution + alerts; deep backtester not the focusPine Script (mature backtester)
    AI Convert & AssistanceLimited community toolsBuilt-in AI Convert + AI Assist (Explain / Improve / Fix) with cost previewTreeScript (native AI tooling)
    Sharing & IP ProtectionPublic scripts always visible (or invite-only)Source-visible OR sealed (source/IR stripped server-side) + stable sourceHashTreeScript (better IP control)
    Governance & CompliancePlatform-level onlyPer-indicator pinning cap, full audit log, single admin kill switchTreeScript (enterprise-ready)
    Options Trading FocusGeneral-purposeOptions-aware examples (gamma proxies, IV regimes, vol-weighted momentum)TreeScript (options-first design)
    Cost ModelFree with TradingView account; paid tiers unlock featuresCompile + run free; AI Convert / Assist priced via Triobol with upfront previewPine Script (free)
    Community & EcosystemMassive public library of community scriptsGrowing library + deep Arch-AGI agent integrationPine Script (today)
    Overall Best ForTraditional charting + TradingView community workflowsSecure AI-agent workflows + multi-broker options automationDifferent jobs — pick by workflow

    Summary. Pine Script remains excellent for quick visual indicators on TradingView and benefits from a much larger community library and a mature backtester. TreeScript is the stronger choice for anyone building agent-driven systems, needing strong sandboxing and audit, or focusing on options trading automation across multiple brokers. AI Convert bridges the two so you can move existing Pine Script forward without manual rewrites.

    #4. TreeScript vs ThinkScript (thinkorswim)

    ThinkScript powers advanced workflows inside the thinkorswim desktop platform (Charles Schwab). For thinkorswim power users evaluating a modern, web-native, agent-first alternative, the table below maps the practical differences.

    FeatureThinkScript (thinkorswim)TreeScript (Treeova)Best For
    Primary Platformthinkorswim desktop (Charles Schwab)Treeova web workspace + embedded TradingView Advanced ChartsTreeScript (web + multi-broker)
    Safety & SandboxingRuns inside the TOS desktop processStrict typed IR in isolated worker; full audit logTreeScript (sandboxed)
    Agent / AI AuthorshipNot supported (human-only scripting)Native: Arch-AGI agents author and deploy indicatorsTreeScript (AI-native)
    Typing SystemMostly dynamic; runtime errors commonStatic typing + server-side validationTreeScript (fewer runtime issues)
    Resource LimitsSoft platform limitsHard, documented resource limits enforced per compileTreeScript (predictable)
    Options Trading FocusExcellent native Greeks, options chains, IV surfaceStrong gamma/IV proxies + agent-driven options automationThinkScript (raw data) / TreeScript (automation)
    Scanning & WatchlistsExtremely powerful custom scans & dynamic watchlistsChart-focused indicators + agent alerts; native scanner not todayThinkScript (scanning power)
    Multi-Timeframe AnalysisNative secondary aggregationsApproximated via period scaling; native MTF on roadmapThinkScript (native today)
    Trade ExecutionAddOrder() inside TOS only (single broker)Arch-AGI agent chains across 7+ brokers (live + paper)TreeScript (multi-broker automation)
    MigrationManual porting between platformsAI Assist (paste ThinkScript → review proposed TreeScript)TreeScript (AI-assisted)
    Sharing & IP ProtectionTOS community sharing; source visibleSource-visible OR sealed + stable sourceHashTreeScript (sealed option)
    Governance & AuditingPlatform-level controlsPinning cap (10), full audit log, admin kill switchTreeScript (enterprise-ready)
    Cost ModelFree with Schwab brokerage accountCompile + run free; AI features priced via Triobol with previewThinkScript (free)
    Cross-Platform AccessibilityDesktop only (Windows / macOS)Browser-based + embedded TradingView widgetsTreeScript (modern accessibility)
    Community & EcosystemLarge, dedicated TOS user baseGrowing + deep Arch-AGI agent integrationThinkScript (today)
    Overall Best ForPower users inside TOS — scanners, Greeks, options chainSecure AI-agent workflows + multi-broker options automationDifferent jobs — pick by workflow

    Summary. ThinkScript is hard to beat for deep options analysis, native Greeks, and dynamic scanning inside thinkorswim. TreeScript is the stronger choice when you need sandboxed safety, agent-authored indicators, sealed sharing with stable source hashes, and multi-broker automation in the browser. The two coexist well — many traders use thinkorswim for scanning and Treeova for execution and agent workflows.

    #5. TreeScript vs MQL5 and NinjaScript

    MQL5 (MetaTrader 4 / 5) and NinjaScript (NinjaTrader 8) are the dominant scripting languages for self-hosted forex and futures algorithmic trading. They compile to platform binaries with broad system access and ship with mature backtesters. TreeScript takes the opposite trade-off: tighter constraints, full sandboxing, and AI-agent authorship as a first-class concern.

    FeatureMQL5 / NinjaScriptTreeScript (Treeova)Best For
    Primary PlatformMetaTrader 4/5 (MQL5) and NinjaTrader 8 (NinjaScript / C#)Treeova web workspace + MetaChart EngineDifferent — pick by asset class
    Asset Class FocusForex, futures, CFDs (MetaTrader); futures + equities (NinjaTrader)Equities, ETFs, and options across 7+ brokersMQL5/NinjaScript (FX/futures) / TreeScript (options + equities)
    Language & CompilationCompiled to platform binaries (.ex5, .dll); broad system accessCompiled to typed IR; runs in sandboxed worker; no system accessTreeScript (safer) / MQL5 (more flexible)
    Safety & SandboxingEffectively unsandboxed — full filesystem and network accessNo filesystem, no outbound network, no arbitrary code executionTreeScript (institutional-grade safety)
    Agent / AI AuthorshipNot natively supported; requires external toolingNative: Arch-AGI agents author and deploy through audited pipelineTreeScript (AI-native)
    BacktestingMature: Strategy Tester (MetaTrader), Strategy Analyzer (NinjaTrader)Live/paper agent execution; deep backtester not the focusMQL5/NinjaScript (mature backtesters)
    MigrationManual porting; no first-party AI converterAI Assist (paste source → review proposed TreeScript)TreeScript (AI-assisted)
    Resource ControlsSoft, platform-managed; rogue indicator can hang the terminalHard, documented resource limits enforced per compileTreeScript (predictable)
    Execution EnvironmentLocal desktop terminalServer-validated, browser-rendered, audit-loggedTreeScript (modern + auditable)
    Sharing & IP ProtectionCompiled .ex5 / .dll obfuscates source but is platform-lockedSource-visible OR sealed (source/IR stripped server-side) + sourceHashTie — different IP models
    Governance & ComplianceNo platform-level audit log for indicator changesFull audit log per compile / save / share / AI call + kill switchTreeScript (enterprise-ready)
    Cost ModelFree language; broker- and Marketplace-pricedCompile + run free; AI features priced via Triobol with previewMQL5/NinjaScript (free)
    Cross-Platform AccessibilityMetaTrader: desktop + mobile. NinjaTrader: Windows-onlyAny modern browserTreeScript (modern accessibility)
    Community & EcosystemLarge MQL5 marketplace; mature NinjaTrader ecosystemGrowing library + deep Arch-AGI agent integrationMQL5/NinjaScript (today)
    Overall Best ForSelf-hosted FX/futures algos with deep backtestingSecure AI-agent workflows + multi-broker options automationDifferent jobs — pick by workflow

    Summary. MQL5 and NinjaScript remain strong for self-hosted FX and futures algos with deep backtests and broker-direct execution. TreeScript is the stronger choice for equity- and options-focused workflows where audit, sandboxing, sealed sharing, and AI-agent authorship matter more than raw system access.

    #6. When NOT to Use TreeScript (Honest Limitations)

    TreeScript is intentionally constrained. Here are the situations where another scripting language is the better tool today — pick the right one for the job.

    • Quick visual indicators on TradingView's public charts. If you only need to share a script with the TradingView community, Pine Script ships faster and benefits from a much larger public library.
    • Heavy strategy backtesting. Pine Script's strategy tester, MQL5's Strategy Tester, and NinjaTrader's Strategy Analyzer are mature, deep backtesting environments. TreeScript focuses on live and paper agent execution; deep backtesting is on the roadmap, not shipping today.
    • Native multi-timeframe via a single call. Pine Script's request.security() and ThinkScript's secondary aggregations are native today. TreeScript approximates MTF via period scaling; native MetaChart MTF is on the roadmap.
    • Custom scanners and dynamic watchlists. ThinkScript's scan engine inside thinkorswim is unmatched for power users. TreeScript is chart-and-agent focused; native scanning isn't the primary surface.
    • Self-hosted FX or futures algos with broker-direct execution. MQL5 and NinjaScript run locally with full system access. TreeScript is browser-rendered and server-validated; that's the wrong shape for a local execution rig.

    Where TreeScript wins: safety, audit, agent authorship, sealed sharing, and multi-broker options automation. Where it doesn't, use the right tool — and migrate later via AI Convert or AI Assist when the trade-offs shift.

    #7. Why a DSL Instead of JavaScript

    A free-form scripting surface on a chart is a liability: arbitrary code can read the chart context, exfiltrate data, consume unbounded compute, or destabilize other indicators. Treeova's posture is that no user-authored code path may load free-form JavaScript into the chart context. TreeScript is the only authoring path; the DSL exists so that the platform can keep that posture without giving up the ability for users — and agents — to write their own indicators.

    The trade-off is intentional. Authors lose the freedom of arbitrary JavaScript; in exchange they get deterministic execution, transparent metering, sharable provenance, and first-class coexistence with built-in indicators.

    #8. Examples Library

    The TreeScript editor ships with a curated example library covering trend, momentum, volatility, and volume patterns. Every example below compiles cleanly against the current standard library and is regression-tested against each release of the validator and IR builder, so what you read here is what the platform will accept today.

    Quick start: RSI on a sub-pane

    study "RSI"
    
    let r = ta.rsi(close, 14)
    
    plot(r, title="RSI", pane="rsi")

    EMA crossover with bull / bear signals

    study "EMA Cross"
    
    let fast = ta.ema(close, 9)
    let slow = ta.ema(close, 21)
    
    let bull = ta.crossover(fast, slow)
    let bear = ta.crossunder(fast, slow)
    
    plot(fast, title="EMA Fast")
    plot(slow, title="EMA Slow")
    signal(bull, title="Bull Cross", severity="info")
    signal(bear, title="Bear Cross", severity="info")

    Advanced: ATR trailing stop with critical alert

    Useful as a volatility-aware long-side stop for options or equity positions. Emits a critical signal when price closes through the trail.

    study "ATR Trailing Stop"
    
    let atr   = ta.atr(14)
    let trail = close - 2.5 * atr
    
    plot(trail, title="ATR Trail")
    
    let breached = ta.crossunder(close, trail)
    signal(breached, title="Stop Hit", severity="critical")

    Advanced: Bollinger Band squeeze + expansion

    A starting scaffold for volatility-regime indicators. Plots band width on a sub-pane, flags squeeze conditions when width crosses below its 120-bar low, and alerts on the subsequent expansion crossover — a useful prompt for options-IV plays.

    study "BB Squeeze"
    
    let upper = ta.bbands(close, 20, 2.0).upper
    let lower = ta.bbands(close, 20, 2.0).lower
    let mid   = ta.bbands(close, 20, 2.0).middle
    let width = (upper - lower) / mid
    
    plot(width, title="BB Width", pane="vol")
    plot(ta.sma(width, 10), title="Width SMA(10)", pane="vol")
    
    let isSqueeze = ta.crossunder(width, ta.lowest(width, 120))
    signal(isSqueeze, title="Volatility Squeeze", severity="info")
    
    let expansion = ta.crossover(width, ta.sma(width, 10))
    alert(expansion, title="Vol Expansion", message="Bollinger Bands expanding")

    Advanced: Multi-timeframe RSI confirmation

    Approximates a higher-timeframe RSI by lengthening the period (14 → 56, ~4× factor) and alerts when the fast series crosses the slow one — a lightweight HTF confirmation pattern.

    study "MTF RSI"
    
    let rsiNow = ta.rsi(close, 14)
    let rsiHTF = ta.rsi(close, 56)
    
    plot(rsiNow, title="RSI 14", pane="rsi")
    plot(rsiHTF, title="RSI 56 (proxy HTF)", pane="rsi")
    
    let bullishSetup = ta.crossover(rsiNow, ta.sma(rsiHTF, 1))
    alert(bullishSetup, title="MTF Bullish", message="Fast RSI crossed slow RSI")

    Advanced: Volume-weighted momentum proxy (heuristic)

    A heuristic — not a true gamma-exposure or order-flow indicator. It scales the EMA-of-close trend by relative volume to emphasize moves on above-average participation. Treat the thresholds as starting points and tune to the symbol.

    study "Vol-Weighted Momentum"
    
    let trend  = ta.ema(close, 9) - ta.ema(close, 21)
    let volRel = volume / ta.sma(volume, 20)
    let proxy  = trend * volRel
    
    plot(proxy, title="Vol-Weighted Momentum", pane="momentum")
    plot(ta.sma(proxy, 5), title="Smoothed", pane="momentum")

    Twelve canonical examples ship inside the editor's Reference drawer (Load → pick example) and are exported from the language reference linked above for paste-into-LLM authoring.

    #9. Compile Pipeline

    TreeScript source flows through four named stages: a lexer tokenizes the input, a parser produces an AST, a validator checks structural and semantic invariants, and an IR builder emits the typed intermediate representation that the chart runtime executes. Each successful compile produces a stable sourceHash that pins the artifact to its source.

    Compilation is server-validated. The editor can preview compile locally, but no IR can be persisted that has not survived the same pipeline server-side. The exact validator rules and the IR schema are withheld.

    #10. Runtime and Sandbox

    Compiled IR runs inside the MetaChart worker, on the same execution surface as built-in indicators, with the same sandboxing constraints. TreeScript indicators cannot reach arbitrary application state, cannot import outside code, and cannot bypass the audit log. Their inputs, outputs, and execution boundaries are exactly the ones the IR declares.

    #11. Triobol Metering

    Compile and run are free. Triobol-debiting actions are limited to surfaces that invoke AI: AI Convert (translates a foreign indicator script into TreeScript), AI Assist (Explain / Improve / Fix), and the migration assistant. Each of these surfaces shows a per-action Triobol cost preview chip before the request fires, so users see the cost up front.

    Per-action pricing is governed by the Triconomic Engine and shares the same audit, refund, and reconciliation surfaces as the rest of the platform. The exact per-token formula is withheld.

    #12. Sharing and Visibility Tiers

    Owners can mint a share link for a TreeScript indicator in one of two tiers:

    • Source-visible. Recipients see the TreeScript source and can fork it as editable source. Useful for community indicators and pedagogy.
    • Sealed. Recipients see only the indicator's name, summary, inputs, and emit metadata. The source and IR are stripped server-side; the share resolver never returns them.

    Switching tiers revokes the old slug and mints a new one, so the visibility level a recipient sees is always the level the owner currently intends. Shares can be revoked at any time; revocation is irreversible for that slug.

    #13. Pinning

    Any owner can pin up to ten TreeScript indicators for quick attach to the chart. The pin cap is enforced at the data layer, not by a client-side check, so the limit holds regardless of UI state. Pins are personal and never appear on another user's chart automatically.

    #14. Governance and Kill Switch

    The entire TreeScript surface is gated by a single admin flag. When the flag is off, every server endpoint fail-closes — compile, save, migrate, assist, share, and the agent tool dispatch all return immediately without touching user data. Indicator records are preserved; only the live surface is suspended.

    Every Triobol-debiting action and every state change writes a row to the TreeScript audit log, attributed to the caller, with caller class (user vs agent), tool key, source hash, and outcome. This is what makes TreeScript safe to expose to agent chains: every action is traceable.

    #15. Agent Authoring Surface

    Agents do not author TreeScript by emitting source into a chat message. They call into a dedicated tool namespace that the Meta-Agent Trading Stack executes through the same DAG engine that runs the rest of the agent stack.

    The read-only tools — list indicators, describe IR, attach to chart — ship first. The authoring tools — propose draft, dry-run compile, diff IRs, evaluate candidate — remain dark until they are fully gated by the same kill switch and Triobol metering as the human-facing surfaces. Agents never bypass the compile pipeline.

    #16. What This Whitepaper Withholds

    • The lexer and parser internals.
    • The exact validator rules and the failure-mode catalog.
    • The intermediate-representation field-by-field schema.
    • The Triobol per-token formula used by AI Convert / AI Assist.
    • The half-lives that any standard library function relies on for decay-aware behavior.
    • The prompts used by the AI Convert and AI Assist surfaces.
    • The internal heuristics agents use to propose drafts.

    #17. Limitations

    • TreeScript is a constrained language. Indicators that require capabilities the DSL does not expose cannot be authored as TreeScript and must be delivered as built-in indicators instead.
    • AI Convert is best-effort. It translates many common indicator dialects into TreeScript, but the output is a proposal, not a guarantee — owners review and accept before saving.
    • The sealed share tier hides source and IR, but the indicator's behavior on a recipient's chart is still observable. Sealed should be treated as confidentiality of authorship and method, not of output.
    • Agent-authored indicators are subject to the same compile, sandbox, and audit guarantees as user-authored ones. Agents do not get a privileged code path.
    • Nothing in this whitepaper is investment advice. Trading options involves substantial risk of loss; users should review Treeova's risk disclosures.

    Whitepaper FAQ

    Disclaimer. Past performance does not guarantee future results. Trading options involves substantial risk of loss. See our risk disclosures for details.

    © 2026 Treeova Technologies Inc · This whitepaper documents architecture and qualitative behavior only; proprietary internals (formulas, thresholds, prompts, model routing) are intentionally withheld.