Skip to content
All library documents

Portfolio Backtesting Metrics, Trade Controls, and Risk Evaluation

Article TradingView scripts

Summary

This indicator framework aggregates results for multiple assets and exposes configurable entry signals, trade directions, filters, stops, position sizing, fees, and slippage. Its controls include optional MACD, moving-average, RSI, volume, and price-change filters, plus initial and in-trade stop methods such as ATR distances, trailing rules, break-even moves, and prior highs or lows. The framework is designed to compare portfolio-level outcomes under different assumptions.

The document explains metrics including net profit, trade count, average trade length, maximum drawdown and its duration, largest loss, consecutive losses, profit-to-drawdown, profit-loss ratio, win rate, time in market, return on investment, open profit, and active days. These measures frame profitability alongside exposure and loss experience. The script’s metrics and configurable mechanics are useful for evaluation, but no particular strategy’s results are supplied. Backtest conclusions remain dependent on signal definitions, asset data, costs, sizing assumptions, and the selected test period.

Key ideas

  • The framework can aggregate trading results across multiple assets and entry signal configurations.
  • Filters include momentum, moving-average, bar-direction, volume, and price-change conditions.
  • Entry and in-trade stops can use volatility, percentage, fixed-price, trailing, or break-even rules.
  • Portfolio evaluation includes return, drawdown, trade quality, exposure, and losing-streak measures.
  • Reported backtest metrics depend on the chosen data, costs, sizing, signals, and test period.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.