Skip to content

0.6.0 — TradingView strategy report metrics parity

Choose a tag to compare

@heyphat heyphat released this 06 Jul 13:00
· 10 commits to main since this release
9759480

Added

  • computeStrategyMetrics gains the rest of TradingView's Strategy Report
    ratios
    , closing most of the gap documented in
    docs/tradingview-strategy-report-metrics.md: avgWinLossRatio,
    largestWinPercentOfGrossProfit, largestLossPercentOfGrossLoss,
    netProfitPercentOfLargestLoss, avgBarsInWinners/avgBarsInLosers,
    returnOnInitialCapitalPercent, buyHoldPnL, and
    maxRunupPercentOfInitialCapital/maxDrawdownPercentOfInitialCapital.
  • Close-to-close run-up/drawdown family: maxRunupCloseToClose,
    maxDrawdownCloseToClose, avgRunupCloseToClose, avgDrawdownCloseToClose,
    avgRunupDurationDays, avgDrawdownDurationDays — computed from the
    bar-close equity curve, distinct from the existing intrabar max_runup/
    max_drawdown Pine builtins.
  • StrategyReport now also reports maxRunup/maxRunupPercent (the broker
    already tracked them; only maxDrawdown was previously exposed).

Changed

  • buyHoldReturnPercent/buyHoldPnL/outperformance now enter at the
    first closed trade's entry fill, matching TradingView's stated basis
    ("from when the strategy's first position was opened"), instead of always
    the second bar's open. Runs with no closed trades keep the old fallback.