22. 5. 2026

5 0

Portfolio Rescaler

Overview

StrategyQuant X builds portfolio results by merging multiple strategies and stacking their trade P&Ls on top of a single starting balance. This is fast and simple, but it introduces a systematic distortion = every strategy was back tested in isolation, sizing its positions to its own account (e.g. 1% of $100,000). Once merged, the portfolio grows, but the individual trade sizes never adjust to reflect the larger combined balance. A strategy that opened a $1,000 position when the portfolio was at $100k is still opening a $1,000 position when the portfolio has grown to $400k. The position is now a quarter of what 1% risk would actually be.

This plugin reruns the portfolio’s full trade history chronologically, applying a scale factor to every trade so that each strategy’s position is always sized relative to the current combined portfolio balance rather than its own isolated starting balance. The result is two side-by-side equity curves with Original (matching SQX exactly) and Rescaled (what correct compounding would have produced) with a drawdown comparison chart below.

What It Does

  • Replicates SQX’s original portfolio curve exactly so you have a verified baseline to compare against
  • Reruns the portfolio with correct per-trade scaling where each trade is rescaled by current portfolio balance ÷ algo’s isolated balance at that point in time
  • Shows a drawdown % chart for both curves so you can see when drawdowns occurred and whether rescaling makes them better or worse
  • Auto-detects all starting balances from order data, the portfolio start and each algo’s isolated start are read directly from the first order of each strategy; no manual inputs required
  • Supports a max-lots cap so you can see the real-world constrained curve for prop firm position limits
  • Date range filter with warm-start. Restrict the view to any sub-period; pre-range trades are replayed to advance all balances to the correct state before the window begins
  • Rebase to Start toggle normalizes both curves to a the original starting point for any selected range, making any two time periods directly comparable on equal footing

How It Works
Starting balances are auto-detected. The portfolio starting balance is read as firstOrder.Balance − firstOrder.ProfitLoss. Each strategy’s isolated starting balance is detected the same way from that strategy’s own first order (identified by ResultName).

The Original curve is a straight replay: start at the detected portfolio balance, add every trade’s original ProfitLoss in chronological order. This must match SQX’s reported net profit, final balance, and drawdown exactly. If it does not, the detected starting balance is off.

The Rescaled curve uses the same starting balance, then for each trade:

scaleFactor = currentPortfolioBalance ÷ algoIsolatedBalance
scaledPL = originalPL × scaleFactor

 

The algo’s isolated balance is updated after each of its own trades (isoBal += originalPL) so the ratio reflects how that strategy’s account would have evolved in isolation. If a max-lots cap is set, the scale factor is floored so the implied position never exceeds maxLots ÷ originalLotSize.

Drawdown % is tracked independently of drawdown $, exactly as SQX does: the worst percentage drop (peak-to-valley ÷ local peak) and the worst dollar drop are measured separately across the full trade history and reported in the stats table.

 

Assumptions

  1. Strategies use percentage-based position sizing (e.g. 1% risk per trade)
    1. If strategies use fixed lot sizes, the scale factor changes the notional P&L but not the actual lot count. The rescaled curve will look different but won’t reflect what you could actually execute.
  2. The Balance field in portfolio orders represents the per-strategy isolated account balance (not the combined portfolio balance)
    1. This is what the plugin uses to detect each algo’s starting capital and track its evolution. If SQX stores the portfolio-level running balance in this field, the per-algo scale factors will be incorrect. Validate by checking that the detected algo start chips match your strategy starting balances.
  3. All strategies use the same base currency
    1. P&L values are summed and scaled in raw currency units; cross-currency portfolios are not handled.
  4. Starting balance detection assumes no trades closed before the very first order in the data
    1. If the data export is truncated (e.g. you are viewing an Out-of-Sample slice), the detected starting balance will be the balance at the start of that slice, not the original configured capital.

Limitations & Drawbacks

The rescaled curve is a simulation, not a backtest. The scale factor is applied to the original P&L, which was computed using fixed lot sizes. In reality, trading a larger lot would have a different market impact and may have moved the price against you differently. This effect is negligible for liquid instruments and small account sizes but can be significant for illiquid markets or very large positions.

Overlapping trades are not handled. The rescaling assumes each trade is independent. If two strategies hold positions simultaneously, the combined exposure at any moment is the sum of both scaled positions — the plugin does not check whether this would breach margin or exposure limits.

The max-lots cap is applied per trade, not per open position. If multiple strategies have open trades simultaneously, each is individually capped, but the total open lots across all concurrent positions is not constrained.

Drawdown is measured at trade close times only. Intra-trade equity swings (open drawdown) are not visible in the order data. The reported max drawdown may be lower than what would be observed on a tick-by-tick equity curve.

Fixed-lot strategies will show no meaningful difference between Original and Rescaled — the scale factor changes the implied dollar gain/loss but not the strategy’s actual risk behavior.

This is designed to give you an idea of how your portfolio risk will truly scale as the Drawdown value in StrategyQuant’s results is not accurate with Risk %

 

0 Comments
Oldest
Newest Most Voted