MULTIPLE STRATEGIES

Capacity: 10,000 saved strategies; 2-1,000 strategies per combined run; two
active backtests total (single or combined). Each run can request up to 16
workers. Both runs share the whole-engine 50% RAM planning budget and CPU;
actual workers may be lower or wait for capacity. A running day is never killed
to reclaim resources. Progress, cancellation, output folders and risk clocks
are independent between runs. Shared SL/target applies within one run only.

Save each strategy from the editor, select at least two library rows, choose a
common date range and Run selected strategies. Edit updates the same saved ID;
Copy loads an independent draft. Saving definitions does not change old run snapshots.

Each strategy retains its own index, entry/exit, units, costs and leg/portfolio
SL/target. Portfolio risk in the editor applies ONLY to that strategy. Overall
daily SL/target in the combined panel applies across ALL selected strategies.
Both zero means independent aggregation. No capital/margin allocation or netting.

SHARED DAILY RISK (when either overall limit is enabled)
Use a positive INR amount, e.g. overall_sl=10000 means stop at net P&L <= -10000.
Realized plus active liquidation P&L includes configured fees and slippage.
On the common one-second clock, existing active positions are marked first.
Overall risk takes priority over scheduled exits, strategy/leg risk and new
entries at the same second. If no overall trigger, strategy/leg exits run and
scheduled new entries are placed as a same-second batch, followed by another
overall risk check including entry costs. Imported re-entry and delayed-entry
rules can run until the overall daily stop; that stop cancels all pending entries.
Trigger closes every active leg at available LTP with configured slippage;
prices are NOT clamped to the threshold, so gaps can exceed the loss limit.
All later strategy entries that day are blocked. State resets the next day.
Already closed positions retain their realized P&L. Pending strategies blocked
before their scheduled time have zero trades/P&L and an explicit blocked status.
Invalid data needed only AFTER a day lock does not invalidate the stopped day.
Invalid data required before the lock excludes the whole shared-risk session.
All active quotes must meet their own freshness limits on the common clock.
Individual views show contributions UNDER shared risk, not standalone results.
Daily reports show trigger time, net MTM and blocked-strategy count. risk_events.csv
contains one row for every triggered day. Trades identify overall_sl/overall_target.

Combined daily P&L is the sum of all selected strategies for a common session.
Intraday MTM is timestamp-aligned last-known simulated MTM: zero before a strategy
enters, realized P&L retained after it closes. Max/min MTM and drawdown are derived
from this combined curve, NEVER by summing separate extrema/drawdowns.

A combined session without shared risk is included only if EVERY selected strategy completed it.
Missing/partial/stale data for one strategy excludes the full combined session.
Successful individual runs on excluded combined dates remain in the individual
reports with combined_included=false. Individual summaries use their own valid
days; comparison.csv also shows combined_included_pnl for an apples-to-apples sum.
Catalog dates are the union across selected symbols; absent market-session records
are not inferred. Combined valid coverage is the intersection of successful runs.

Combined: daily.csv, trades.csv, intraday.csv, equity.csv.
Individual: strategy_daily.csv, strategy_trades.csv, strategy_intraday.csv.
comparison.csv: strategy summaries and contribution on combined valid days.
All results and configuration snapshots remain on E:.

V5 missing-quote policy (supersedes earlier stale-quote exclusion descriptions):
New and existing definitions without an explicit policy use next_tick. A stale
active quote pauses the simulation clock until the required active-leg quotes
are fresh again. Shared-risk mode pauses the whole basket; independent members
wait separately. Risk checks, entries, and fills only resume at the actual later
time. No future price is assigned to an earlier timestamp. Scheduled entries
inside a pause are delayed (or blocked by a shared stop on resume); scheduled
exits may occur after their configured time. Pending entries retry on later ticks.
Continuous SL-wait timing resets over a gap. Gap times appear in daily warnings.
If no usable later quote exists that session, the session still reports the
unresolved data condition rather than inventing an exit or a completed P&L.
Explicit gap_policy=strict preserves the earlier exclusion model.

Strategy editor: visible Strategy rules section includes combined SL in rupees
or entry-premium percent, per-lot currency basis, losing-only exit, SL to cost,
strategy re-execution limits, shared cap, delay/cutoff, and profit-lock steps.
Premium-percent SL = total quantity-weighted cycle entry premium * percentage.
It compares cycle net loss including configured fees/slippage. Risk basis does
not multiply that percentage threshold again. Zero SL disables the rule.
