TrainBard vs PineTS for Pine Script backtesting

A flat rounded engine shape contains a four-tile teal core and a small amber accent.

Key takeaways

  • PineTS suits developers embedding Pine in JavaScript and controlling their data. TrainBard supplies a hosted workspace for investigating supported strategies.
  • Current PineTS includes strategy execution and broker emulation; implemented API coverage still differs from agreement on every trade.
  • Compare the complete research task, including neighboring settings and trade evidence, after checking script and execution compatibility.

Choose PineTS when running Pine inside your own JavaScript application is part of the goal. Choose TrainBard when your immediate goal is to investigate a supported strategy across parameter ranges in a research interface. A team with an existing Node.js data pipeline may prefer the first route; a researcher who wants to examine the results of a sweep may prefer the second.

PineTS is LuxAlgo’s open-source TypeScript runtime for Node.js and browsers. It accepts Pine v5/v6 source, with native Pine support described as experimental, and allows custom candle arrays. These are useful foundations for controlling how signals enter another application. Official PineTS repository.

This comparison is written by TrainBard from documentation checked on October 19, 2026; it reports no matched performance benchmark.

What happens after the first backtest

A strategy returning a profit number is a starting point. The next question might be whether changing its lookback by two bars destroys the result, whether fewer trades explain the apparent improvement, or whether a lower-return setting has a more acceptable drawdown.

TrainBard connects those questions through Test, Analyze, and Study. Test runs a supported strategy across input ranges. Analyze offers Regions, Drivers, Trade-offs, and Explore for investigating the resulting table. Study, on Pro 5x, compares related sweeps across contexts. Study workflow.

With a runtime, you decide how to represent that investigation. This can be a major advantage: you can use the database, reporting conventions, and selection criteria your team already trusts. It also means the execution library and your surrounding research code jointly determine what the finished workflow can answer.

DecisionPineTS routeTrainBard route
Where calculations belongYour JavaScript process or browser integrationHosted testing through the app or MCP
Candle selectionCustom arrays or supported providersMarket and test settings offered by TrainBard
Sweep investigationAssemble or integrate the analysis your application needsUse the supplied Analyze views
Related experimentsDefine your own storage and comparison conventionsCompare included sweeps in Study on Pro 5x
Unusual requirementsInspect and extend the open-source implementationStay within the published compatibility contract

The PineTS deployment and data options come from its repository. The right-hand workflow is explained in TrainBard’s research workspace. This is a comparison of the routes each offers, rather than a claim that a developer cannot build the supplied analysis.

PineTS supports strategies as well as indicators

Calling PineTS an indicator-only library would miss its current scope. Its documentation includes order placement, position state, trade access, and a broker emulator. The strategy coverage page also names remaining differences involving liquidation, currency conversion, OCA sibling enforcement, and some accounting. An implemented function can therefore exist without reproducing every TradingView behavior. PineTS strategy coverage.

That distinction matters for research. A signal series can agree while the trade history differs because an exit is canceled differently. Ranking hundreds of settings cannot correct that mismatch. First choose a small case with understandable entries and exits; compare its signals, order timing, quantities, and closed trades before scaling it up.

TrainBard accepts a deliberate subset of Pine v6-style source. Its technical-analysis library includes moving averages, momentum and volatility calculations, while supported arrays and user-defined types allow more involved state. It constrains request.security() and excludes imports and strategy.risk.*. A successful TradingView compile does not establish TrainBard compatibility. Read the accepted functions and call shapes before deciding whether adaptation preserves your strategy.

Local control can be the deciding feature

Suppose you are adding a Pine-based signal to an existing web product. You need the calculated series next to customer data, your own chart controls, and a version pinned to the rest of the application. PineTS’s JavaScript integration is directly relevant to that job. Its ecosystem also includes Vela chart integration and a CLI for agent use. Vela integration, PineTS CLI.

For that reader, implementing the surrounding workflow is product development, not wasted effort. The ability to inspect the engine and keep calculation close to the rest of the application can outweigh the convenience of a hosted interface. PineTS uses AGPL-3.0; LuxAlgo separately offers commercial licensing for closed-source products. Include the applicable software terms, data access, and maintenance in the budget for an embedded product. PineTS commercial licensing.

TrainBard’s value is different: a researcher can use a supplied interface to examine parameter neighborhoods and open the trades behind a chosen result. Drivers summarizes how selected outcomes vary with inputs; it does not establish causation, and large datasets may be sampled. Trade-offs helps compare competing objectives without declaring one universal winner. Drivers, Trade-offs.

An illustrative experiment to compare the work

Consider a proposed EMA crossover study with six fast lengths and eight slow lengths, all chosen so the fast length stays below the slow one. That makes 48 settings. Use one market and a fixed historical period, followed by a separate period chosen before examining its results. This is an experiment design, not a reported test.

Begin with one setting and reconcile execution assumptions. Then record how each route handles the whole task:

  1. Complete the 48 settings and distinguish failed runs, zero-trade results, and valid losses.
  2. Select one attractive candidate and inspect its trades and adjacent settings.
  3. Compare return and drawdown without silently discarding weak neighbors.
  4. Freeze a candidate selection rule, then examine the second period.

For PineTS, include data preparation, orchestration, analysis, and retained outputs in the effort estimate. For TrainBard, include any script adaptation and the work needed to preserve the evidence. If the candle feeds cannot be matched, report a workflow comparison separately from any disagreement in P&L.

Which route fits your next project

PineTS is a strong candidate when you need JavaScript integration, custom data, engine inspection, or a reusable component inside a larger application. Its usefulness does not depend on copying a commercial research interface.

TrainBard fits a supported Pine strategy whose next questions concern parameter effects, local support, trade evidence, and comparison across sweeps. Start with a small accepted script and follow one result from Test through Analyze. Use MCP if your preferred research session is agent-driven, while preserving the returned outputs and assumptions.

For the wider choice of hosted tools and local engines, see the Pine Script backtesting comparisons.