multi-asset
Multi-asset and multi-pair EA management for MQL5. Use for all logic involving trading more than one instrument: per-symbol configuration profiles (SSymbolConfig struct); 17 pre-built asset profiles across forex, metals, indices, and crypto CFDs; portfolio-level risk with correlation group limits; CMultiAssetManager class for position discovery, group counting, and total-risk enforcement; magic number assignment per symbol; multi-symbol OnTick architecture that processes each symbol independently. Trigger: "multi-pair", "portfolio EA", "multiple symbols", "all pairs", "forex and gold", "symbol manager", "asset class", "per-pair settings", "correlation management", "basket trading", "run on all symbols", "trade everything", "SymbolInfoInteger", "SymbolSelect".
Unsigned, install at your own risk
UnverifiedThis skill has no cryptographic signature attached. We can't verify the contents match what the publisher intended.
Install this skill
No account required. Pick your tool, or use the command that detects it for you.
Run in your terminal. It detects your AI tool.
npx @skills-hub-ai/cli install metatrader-multi-assetManual setup by platform
Claude Code
~/.claude/skills/metatrader-multi-asset/SKILL.md
Instructions
Multi-Asset
A true trading system trades multiple instruments with proper portfolio-level
risk controls. One brain, many markets — with isolation per symbol and
correlation limits across the portfolio.
Purpose
Defines the infrastructure for running a single EA across multiple instruments:
per-symbol configuration profiles, correlation-based position limits, total
portfolio risk caps, and a multi-symbol OnTick processing loop. Also catalogs
the SymbolInfo* API surface for symbol discovery and metadata access.
When to Use
- Building an EA designed to trade multiple pairs simultaneously
- Adding a new asset class or symbol to an existing multi-asset EA
- Diagnosing over-correlated position stacking
- Enforcing total portfolio risk limit across all open positions
- Checking symbol trading conditions (stops level, fill mode, execution mode)
- Looking up symbol property identifiers or API signatures
Do NOT use for:
- Single-symbol EA architecture -> use
ea-architect - Market regime detection -> use
market-regime - Risk/sizing for a single position -> use
risk-engine
Core Guidance
SSymbolConfig — Per-Symbol Parameter Profile
struct SSymbolConfig {
string symbol;
int magicNumber;
double maxSpreadPoints;
double atrMultiplierSL;
double atrMultiplierTP;
int atrPeriod;
ENUM_TIMEFRAMES entryTF;
ENUM_TIMEFRAMES htfTF;
int sessionStartUTC;
int sessionEndUTC;
double correlationGroup;
string assetClass; // "forex" | "metal" | "index" | "crypto"
};
Pre-Built Asset Profile Table (17 instruments)
Factory defaults for 17 instruments across forex majors, metals, US/EU indices,
and crypto CFDs. Each has a unique magic number, asset-appropriate spread and
ATR settings, session windows, and correlation group IDs.
Correlation Groups and Position Limits
Group 1.0 — USD Majors (EUR/GBP/CHF): EURUSD, GBPUSD, USDCHF -> max 2
Group 2.0 — JPY pairs: USDJPY, EURJPY, GBPJPY -> max 2
Group 3.0 — Commodity currencies: AUDUSD, NZDUSD -> max 1
Group 4.0 — CAD: USDCAD -> max 1
Group 5.0 — Metals: XAUUSD, XAGUSD -> max 1
Group 6.0 — US Indices (0.95 correlation): US500, US100, US30 -> max 1
Group 7.0 — EU Indices: GER40, UK100 -> max 1
Group 8.0 — Crypto: BTCUSD, ETHUSD -> max 1
Portfolio: all groups -> max 5% total open risk
CMultiAssetManager
class CMultiAssetManager {
bool GetSymbolConfig(string symbol, SSymbolConfig &cfg);
bool IsNewPositionAllowed(SSymbolConfig &cfg);
int CountPositionsInGroup(double groupId);
double GetTotalOpenRiskPct();
};
Multi-Symbol OnTick
void OnTick() {
if(!IsNewBar(PERIOD_M15)) return;
for(int i=0;i<ArraySize(g_SymbolProfiles);i++)
ProcessSymbol(g_SymbolProfiles[i]);
}
void ProcessSymbol(SSymbolConfig &cfg) {
// Spread check -> risk gate -> portfolio check -> session -> signal -> lot size -> trade
double spread=(double)SymbolInfoInteger(cfg.symbol,SYMBOL_SPREAD);
if(spread>cfg.maxSpreadPoints) return;
if(!g_RiskMgr.IsTradeAllowed()) return;
if(!g_AssetMgr.IsNewPositionAllowed(cfg)) return;
if(!IsSymbolSessionActive(cfg)) return;
STradeSignal sig=g_Signal.GetSignalForSymbol(cfg.symbol,cfg);
if(sig.type==SIGNAL_NONE) return;
double atr=iATR(cfg.symbol,cfg.entryTF,cfg.atrPeriod,1);
double slDist=atr*cfg.atrMultiplierSL/SymbolInfoDouble(cfg.symbol,SYMBOL_POINT);
double lots=g_RiskMgr.CalculateLotSizeSymbol(cfg.symbol,slDist);
if(lots<=0) return;
g_TradeMgr.OpenTradeOnSymbol(cfg.symbol,sig,lots,cfg.magicNumber);
}
References
Symbol info enum reference (ENUM_SYMBOL_INFO_INTEGER/DOUBLE/STRING), symbol
discovery API (SymbolsTotal, SymbolName, SymbolSelect), tick/session/margin
helpers (SymbolInfoTick, SymbolInfoMarginRate, SymbolInfoSession*), and
DOM API (MarketBookAdd/Get/Release) are documented in the MQL5 Reference:
docs/mql5_com_-_docs/constants-environment_state-marketinfoconstants.mddocs/mql5_com_-_docs/marketinformation-symbolstotal.mddocs/mql5_com_-_docs/marketinformation-symbolname.mddocs/mql5_com_-_docs/marketinformation-symbolselect.mddocs/mql5_com_-_docs/marketinformation-symbolinfotick.mddocs/mql5_com_-_docs/marketinformation-marketbookadd.md
Security
Reviews (0)
Related skills
Browse all →More from MetaTrader Skills
View source →More Build skills
Browse category →Frequently asked questions about multi-asset
What does the multi-asset skill do?
Multi-asset and multi-pair EA management for MQL5. Use for all logic involving trading more than one instrument: per-symbol configuration profiles (SSymbolConfig struct); 17 pre-built asset profiles across forex, metals, indices, and crypto CFDs; portfolio-level risk with correlation group limits; CMultiAssetManager class for position discovery, group counting, and total-risk enforcement; magic number assignment per symbol; multi-symbol OnTick architecture that processes each symbol independently. Trigger: "multi-pair", "portfolio EA", "multiple symbols", "all pairs", "forex and gold", "symbol manager", "asset class", "per-pair settings", "correlation management", "basket trading", "run on all symbols", "trade everything", "SymbolInfoInteger", "SymbolSelect". It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.
How do I install the multi-asset skill?
Run `npx @skills-hub-ai/cli install metatrader-multi-asset` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/metatrader-multi-asset/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.
Which AI tools does multi-asset work with?
multi-asset runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.
Is the multi-asset skill free?
Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.
How do I use multi-asset after installing it?
In Claude Code, type `/metatrader-multi-asset` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.
Can I share the multi-asset skill with my team?
Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.