What is a Virtual Trading Account#

A Virtual Trading Account lets a QuantScript strategy run on a shared broker account as if it had its own dedicated account. The platform computes per-strategy equity, P&L, and drawdown from that strategy’s positions only — while capital and margin are physically pooled with other strategies on the same account.

This is a first-class architectural capability, not a workaround: multiple independent strategies can trade the same account — even the same symbol — without interfering with each other.

The Problem: One EA Per Account#

In the MT5 ecosystem, the standard practice is one EA per account. Expert Advisors have no mechanism to identify which positions belong to them. Running two EAs on the same account risks cross-contamination — one EA may close or modify the other’s positions. The workaround: separate accounts for each EA, fragmenting capital and preventing margin sharing.

The cost compounds quickly: eight strategies means eight accounts, eight minimum deposits, eight terminals to maintain — and most of that capital sits idle as reserve.

How It Works#

Two complementary mechanisms provide hard isolation between strategies sharing an account:

  • Ownership tags — every order carries a unique comment prefix (e.g., "Sword02c1|"). Each strategy only touches positions matching its own tag. Strategies cannot interfere with each other, even when trading the same symbol simultaneously.
  • Virtual account computation — the platform tracks each strategy’s tagged positions and computes isolated equity, realised and unrealised P&L, and drawdown. Each strategy’s trade.account() and strategy.* introspection reflects its own virtual account, not the pooled whole.

The result: full per-strategy isolation and accountability, with the capital efficiency of a single pooled account.

Capital Efficiency#

MT5 EAsQuantScript
8 strategies8 accounts × $12.5k = $100k committed1 account, $20–30k committed
MarginFragmented (no sharing)Pooled (strategies share headroom)
Reserve capitalNone (all locked in accounts)$70–80k earning yield, available for stress top-up
Per-strategy P&LManual spreadsheet trackingAutomatic (Virtual Account)
Cross-strategy riskNoneRiskGuard portfolio-level policies
Operations8 terminals, 8 logins, 8 updates1 deployment, 1 monitoring view

Because uncorrelated strategies rarely hit their maximum drawdown simultaneously, the pooled account requires less total capital than the sum of isolated accounts — while providing full per-strategy isolation and accountability.

Configuration#

A strategy opts into a virtual account by declaring its allocated capital in the broker() configuration:

QuantScript
mode(mode_type: "live", script_name: "Grid Strategy A");

broker(adapter: "demotrader", config: {
  allocated_capital: 5000
});

With allocated_capital set, the strategy’s equity, margin usage, and risk limits are computed against its $5,000 virtual allocation — even though the physical broker account may host several other strategies with their own allocations.

Next Steps#