Trading Platform Research

Home / Research examples / Backtesting a market-cap rebalanced portfolio

How did a portfolio that rebalances by market cap perform?

Weighting by market cap needs a fundamental value at every rebalance date. This test shows which platforms can do that and how much work it takes.

Documented

The company says so in its own docs. The source is linked and dated.

Observed

I ran it and this is what happened. Inputs and steps are shown.

Opinion

My judgment. You may weigh the same facts differently.

The test

Question
Backtest a portfolio that holds a fixed set of stocks and rebalances to market-cap weights on a schedule.
Inputs
AAPL, MSFT, NVDA, GOOGL, AMZN, META, AVGO, TSLA, JPM and LLY, rebalanced monthly to market-cap weights, from January 1, 2020 through December 31, 2025, starting with $10,000.
Method
  1. Give each platform the same instruction once, in plain English, through its AI assistant.
  2. Run the backtest over the shared date range and starting balance.
  3. Record total return, maximum drawdown and the trades each platform made.
Result
Observed
NexusTradeQuantConnectComposer
Built without writing codeYesYes, the assistant wrote the PythonYes
Idea to finished backtest1 min 52 sMessage sent 03:33:55 UTC; the answer finished at 03:35:47 UTC.12 min 37 sMessage sent 02:16:56 UTC; QuantConnect's status changed to Completed between 02:29:23 and 02:29:33 UTC. Its first backtest results appeared about 4 minutes in. It then found and fixed two problems in its own code and ran the backtest again before answering.55 sMessage sent 21:27:14 UTC; the answer stopped growing at 21:28:08 UTC.
Total return+353.62%+334.1%Not run: no market-cap weighting
Maximum drawdown40.42%39.3%Not run
Limits
A fixed stock list chosen today carries hindsight: these companies are large now because they did well. Results differ between platforms when price adjustments, fill assumptions or share-count data differ. A backtest describes the past.

The results

Observed

NexusTrade: what it returned

Portfolio value, $10,000 invested January 2, 2020

Market-cap portfolio: $45,298SPY, same dates: $22,878
$0$11,425$22,851$34,276$45,701202020212022202320242025

From an earlier run of the same question on November 16, which returned +352.98%. NexusTrade query_backtest_history, backtest 6afb58120eb2264a06c6c1ef.

The first rebalance, January 2, 2020

TickerSharesFill priceValueWeight
AAPL29.7066$73.94$2,196.4722.3%
MSFT12.7761$158.61$2,026.4220.6%
GOOGL23.1032$67.54$1,560.3615.8%
AMZN16.4779$93.95$1,548.1115.7%
META4.7737$206.84$987.3710.0%
JPM5.2739$140.06$738.647.5%
NVDA40.6810$5.96$242.532.5%
LLY1.6148$131.77$212.782.2%
AVGO6.6382$31.81$211.152.1%
TSLA4.4926$28.47$127.891.3%

From that same earlier run. NexusTrade weighted the ten stocks by market cap at the first rebalance.

NexusTrade's chat showing the question, its written results and the saved strategy with its market-cap weighting rule
NexusTrade's answer as it appeared in the chat.

QuantConnect: what it returned

QuantConnect's final results

"Total return +334.1% ($10,000 → $43,411.26). CAGR 27.70%. Max drawdown 39.3% (recovered in 560 days). Orders: 25, all filled, zero rejected, zero runtime errors."

It reported an initial purchase of all ten stocks on January 2, 2020 at market-cap weights (AAPL 22%, MSFT 21%, GOOGL 16%, AMZN 16%, META 10%, JPM 7%, NVDA 2.5%, LLY 2.2%, AVGO 2.2%, TSLA 1.3%), then 15 rebalancing trades through 2025. With $10,000, most monthly adjustments rounded to less than one share.

Quoted and summarized from QuantConnect's assistant, backtest 15787e93160d399fa461cf7d198123f1.

QuantConnect's assistant reporting the finished market-cap backtest
QuantConnect's assistant at the end of the run.

Composer: what it returned

Composer said it cannot weight by market cap

"Composer does not directly support market-cap weighting or backtesting over specific historical periods. Instead, I will provide a symphony that rebalances monthly with equal weights as a proxy."

It then built an equal-weight portfolio of the ten stocks, rebalanced monthly. I checked the editor myself: the weighting menu on that block offers Equal, Specified and Inverse Volatility.

Quoted from Composer's assistant. Composer's documentation lists market cap as a fourth weighting type; the editor's menu for this block offered the three named above.

Composer's editor showing the weighting type menu with Equal, Specified and Inverse Volatility
The weighting choices Composer's editor offered for the ten-stock block.

Comparisons that use this test