You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit was created on GitHub.com and signed with GitHub’s verified signature.
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.