cross-market-strategy
Installation
SKILL.md
When to Use
When the user requests a backtest with codes from different markets — e.g. ["000001.SZ", "BTC-USDT"], ["TD.TO", "PNG.V"], or ["AAPL.US", "EUR/USD", "600519.SH"].
The CompositeEngine handles calendar alignment, shared capital, and market rules automatically. The strategy only needs to output per-symbol signals.
Key Concepts
1. Market Classification in generate()
Group symbols by market type and apply market-specific indicator parameters:
def generate(self, data_map):
groups = {}
for code, df in data_map.items():
market = self._detect_market(code)
groups.setdefault(market, {})[code] = df