QuantConnect’s built-in Return statistic is tied to the current live deployment. If you stop and redeploy an algorithm, its runtime statistics reset. This can make the displayed return misleading when an algorithm has been running across multiple deployments. QuantConnect confirms this behavior in its live-results documentation.

For example, my live node currently shows a built-in return of -1.7%, while the actual return measured from my original starting capital is +0.31%.

I wanted a simple dashboard statistic that always measures performance from the same original account value, regardless of how many times the algorithm is stopped and restarted.

from AlgorithmImports import *
from datetime import timedelta


class MyAlgorithm(QCAlgorithm):

    def initialize(self):
        self.absolute_return_starting_capital = 100000

        self.set_cash(self.absolute_return_starting_capital)

        self.schedule.on(
            self.date_rules.every_day(),
            self.time_rules.every(timedelta(minutes=1)),
            self.update_absolute_return
        )

        self.update_absolute_return()

    def update_absolute_return(self):
        if self.absolute_return_starting_capital <= 0:
            return

        portfolio_value = float(
            self.portfolio.total_portfolio_value
        )

        absolute_return = (
            portfolio_value
            / self.absolute_return_starting_capital
            - 1
        )

        self.set_runtime_statistic(
            "AbsRet%",
            f"{absolute_return:.2%}"
        )

Change this value to the portfolio value from which you want to measure performance:

self.absolute_return_starting_capital = 100000

In a backtest, set_cash sets the simulated starting balance. In live trading, QuantConnect ignores set_cash and loads the actual balances from the brokerage. The separate absolute_return_starting_capital variable is therefore the fixed reference point used by this calculation. QuantConnect initialization documentation

When the algorithm restarts, the custom statistic is recreated from:

current portfolio value / original starting capital - 1

It doesn’t depend on the previous deployment’s runtime statistics. As long as the same original starting-capital value remains in the code, the calculation continues from the same baseline.

The result appears as AbsRet% in the runtime-statistics banner and refreshes every minute. This has been much more useful to me than the deployment-specific Return figure because it shows the performance of the account from the point at which I originally started tracking it.