Documentation

Documentation

11. v0.8.6 — Pine strategy metrics from piner

Created
Jul 6, 2026
Updated
Jul 6, 2026

Released 2026-07-06. Bumps the Pine Script engine (piner) to v0.5.1 and switches Pine strategy results to use piner's own derived metrics instead of recomputing them, fixing several numbers that previously diverged from TradingView.

Changed

  • Pine strategy stats now come from piner, not a local recomputation. Sharpe, Sortino, CAGR, market exposure, expectancy, largest win/loss, average bars per trade, and the buy-&-hold benchmark are computed by piner's computeStrategyMetrics over the same run — the same math the native (non-Pine) strategy path already used, so both paths stay annualized on fractal's own market-calendar convention.
  • Per-trade commission and excursions are now real. Closed-trade rows for Pine strategies report their actual commission and their true maximum favorable/adverse excursion (intrabar run-up/drawdown while the trade was open), instead of a commission of zero and placeholder excursions.
  • Max drawdown for Pine strategies now matches TradingView's method. It's computed from intrabar equity extremes (open → near extreme → far extreme → close), the same convention TradingView's Strategy Tester uses, instead of a close-only scan of the equity curve.
  • The Pine strategy error banner's "report a bug" link now points to piner's GitHub Discussions instead of the retired Discourse forum.

Fixed

  • "Percent profitable" now matches TradingView's definition for Pine strategies. A trade that closes at exactly break-even is excluded from the win count but still counted in the total trade count, matching TradingView's Strategy Tester. Previously, break-even trades were excluded from both, which could overstate the win rate on strategies with break-even trades.

Technical notes

  • Piner 0.5.x also ships broker-side correctness fixes bundled into this bump: strategy.exit() now scopes to entries that existed when it was called (not later same-id entries), reserves quantity in call order across brackets on the same position, and the pyramiding cap now correctly frees a slot when an open trade closes. A Pine strategy relying on any of that prior (incorrect) behavior may see different backtest results after this update.
  • piner's own winRate broker getter is not used here — it counts win rate over decided (win + loss) trades only, diverging from TradingView whenever a strategy has break-even trades. Tracked upstream: heyphat/piner#8.

Next steps

Back to the release list.

Next: Release Notes