How to Build Multi-Asset Backtests for Real Trading Strategies

CrazyTomato1 pts0 comments

How to Build Multi-Asset Backtests for Real Trading Strategies | by DolphinDB | May, 2026 | MediumSitemapOpen in appSign up<br>Sign in

Medium Logo

Get app<br>Write

Search

Sign up<br>Sign in

How to Build Multi-Asset Backtests for Real Trading Strategies

DolphinDB

13 min read·<br>May 7, 2026

Listen

Share

Press enter or click to view image in full size

In financial markets, multi-asset investment strategies have long been standard practice. Whether for cross-market arbitrage, asset allocation, or hedging and volatility management, portfolios often combine multiple instruments, such as stocks, futures, and options. Compared with single-asset backtesting, multi-asset backtesting better reflects capital usage, risk exposure, and execution paths, narrowing the gap between backtesting results and live trading outcomes. To meet this need, DolphinDB introduces multi-asset backtesting, allowing you to perform coordinated backtests across multiple instruments within a unified framework and to manage cash and positions flexibly through either a single account or multiple accounts. This article demonstrates how to use the DolphinDB multi-asset backtesting engine and highlights its advantages in real-world applications using two representative examples: a stock-index futures hedging strategy and a futures-options arbitrage strategy.<br>1. Introduction<br>This article presents two multi-asset backtesting examples. The first combines technical-analysis-based stock investment across multiple accounts with positions in stock index futures to hedge systematic risk. The second uses put-call parity between futures and options to conduct cross-market arbitrage within a single account.<br>Before detailing the implementation of these strategies, this section introduces the core ideas behind both strategies and outlines the multi-asset backtesting solution provided by DolphinDB, helping you better understand the background and use cases.<br>1.1 Background on Stock-Futures Hedging Strategy<br>In stock investment, individual stocks are highly correlated with the broader market, so portfolios are inevitably exposed to systematic risk. Since this type of risk cannot be diversified away, investors typically use stock index futures for beta hedging. The beta coefficient measures a portfolio’s sensitivity to the market. By shorting stock index futures in an amount matched to the portfolio’s beta, investors can reduce the portfolio’s overall market risk exposure to a target level, thereby preserving excess returns from stock selection while limiting the impact of market fluctuations on performance. This strategy is widely used in actively managed funds, quantitative market-neutral frameworks, and risk management practices, making it a typical example of combining stocks with derivatives.<br>In this example, we select and invest in CSI 300 stocks based on multiple technical indicators, while using CSI 300 futures for beta hedging. This demonstrates how the DolphinDB multi-asset backtesting framework can be applied in real trading strategies.<br>1.2 Background on Cross-Market Futures-Options Arbitrage Strategy<br>In derivatives markets, futures and options are both derived from an underlying asset, but differ significantly in pricing mechanisms and risk characteristics. The pricing relationship between them is influenced not only by the price of the underlying asset, but also by factors such as the risk-free interest rate, dividend yield, and expected volatility. Theoretically, put-call parity imposes a strict pricing constraint between futures and options. If market prices deviate from this parity, risk-free or low-risk arbitrage opportunities may arise. Investors can lock in a deterministic spread profit by constructing a portfolio that buys the undervalued asset and sells the overvalued one.<br>In the following example, we design a cross-market arbitrage strategy based on put-call parity between futures and options, demonstrating the advantages of DolphinDB multi-asset backtesting in unified capital management, risk control, and cross-instrument trading.<br>1.3 Overview of the DolphinDB Multi-Asset Backtesting Solution<br>DolphinDB provides the Backtest plugin that supports multi-asset backtesting. Within a unified backtesting framework, you can load market data and trading rules for multiple assets, such as stocks, futures, and options, and manage capital, margin, and risk via a single engine, producing simulations that more closely reflect live trading. Compared with single-asset backtesting, multi-asset backtesting extends engine configuration, account management, and market data input methods, forming a more comprehensive solution.<br>Key differences from single-asset backtesting:<br>Account management: Multi-asset backtesting allows you to manage multiple accounts via a single engine, or configure a single account in a dictionary to cover multiple assets.<br>Multi-asset differentiation: Supports using the assetType column to distinguish among different assets, such as stocks,...

asset multi backtesting futures market risk

Related Articles