Skip to content

mahmoud20138/Gold-MultiAgent-Analyzer

Repository files navigation

πŸ₯‡ Gold MultiAgent Analyzer

Python MT5 Multi-Agent AI License

Stars Issues License


πŸ€– 8-Agent AI-Powered Gold Analysis System β€” Smart Money Concepts β€” Multi-Provider LLM β€” MetaTrader 5

A comprehensive multi-agent gold trading analysis system that runs 8 specialized agents in parallel β€” technical indicators (40+), Smart Money Concepts (BOS, CHoCH, FVG, Order Blocks), volume profiling, correlation tracking across 10+ instruments, LLM-powered sentiment analysis, and risk management β€” to produce confidence-scored trade recommendations with entry, stop loss, and 3 take-profit levels.


πŸ“‘ Table of Contents

  1. 🎯 Key Features
  2. πŸ—οΈ System Architecture
  3. πŸ”„ Analysis Pipeline
  4. πŸ€– The 8 Agents
  5. 🎯 Confidence Scoring
  6. πŸ“Š Correlation Tracking
  7. 🧠 LLM Integration
  8. πŸ“ˆ Technical Indicators
  9. πŸ’° Risk Management
  10. πŸ› οΈ Technology Stack
  11. πŸ“ Project Structure
  12. πŸš€ Getting Started
  13. πŸ’» Usage
  14. πŸ“Š Results Output
  15. 🀝 Contributing
  16. πŸ“œ License

🎯 Key Features

Feature Icon Description
Multi-Agent Architecture πŸ€– 8 specialized agents running in parallel
Smart Money Concepts πŸ“Š BOS, CHoCH, FVG, Order Blocks, Liquidity Zones
40+ Technical Indicators πŸ“ˆ RSI, MACD, Bollinger, ADX, Ichimoku, Stochastic, CCI
Volume Analysis πŸ“‰ Volume Profile, CMF, OBV, Accumulation/Distribution
Correlation Tracking πŸ”— Monitors 10+ instruments (DXY, Silver, Oil, EURUSD)
LLM-Powered Sentiment 🧠 Azure, Groq, Anthropic, OpenAI with auto-fallback
Risk Management πŸ›‘οΈ Position sizing, R:R enforcement, portfolio limits
Confidence Scoring 🎯 0-100 score with grades A+/A/B/C
Multi-Timeframe ⏰ M15, H1, H4, D1 alignment analysis
MT5 Integration πŸ“‘ Real-time data from MetaTrader 5

πŸ—οΈ System Architecture

╔═══════════════════════════════════════════════════════════════════════════════════════════════╗
β•‘                                    GOLD MULTIAGENT ANALYZER                                     β•‘
β•‘                                   Production-Ready Trading System                              β•‘
╠═══════════════════════════════════════════════════════════════════════════════════════════════╣
β•‘                                                                                                   β•‘
β•‘  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β•‘
β•‘  β”‚                                      CLI INTERFACE                                           β”‚  β•‘
β•‘  β”‚                        main.py ──► --quick --symbol --json --live                          β”‚  β•‘
β•‘  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β•‘
β•‘                                            β”‚                                                    β•‘
β•‘                                            β–Ό                                                    β•‘
β•‘  ╔══════════════════════════════════════════════════════════════════════════════════════════════╗  β•‘
β•‘  β•‘                              ORCHESTRATOR (Command Center)                                   β•‘  β•‘
β•‘  β•‘  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β•‘  β•‘
β•‘  β•‘  β”‚  β€’ Coordinates 8 agents in parallel                                                    β”‚  β•‘  β•‘
β•‘  β•‘  β”‚  β€’ Synthesizes all outputs into final recommendation                                 β”‚  β•‘  β•‘
β•‘  β•‘  β”‚  β€’ Multi-provider LLM fallback (Azure β†’ Groq β†’ Claude β†’ OpenAI β†’ Rule-based)        β”‚  β•‘  β•‘
β•‘  β•‘  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β•‘  β•‘
β•‘  β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•  β•‘
β•‘                                            β”‚                                                    β•‘
β•‘        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β•‘
β•‘        β”‚                                 β”‚                                                 β”‚    β•‘
β•‘        β–Ό                                 β–Ό                                                 β–Ό    β•‘
β•‘  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β•‘  β”‚    DATA     β”‚                  β”‚     LLM    β”‚                                   β”‚    RISK    β”‚
β•‘  β”‚   FETCHER  β”‚                  β”‚  PROVIDERS  β”‚                                   β”‚   ENGINE   β”‚
β•‘  β”‚   Agent    β”‚                  β”‚            β”‚                                   β”‚            β”‚
β•‘  β”‚            β”‚                  β”‚  β€’ Azure   β”‚                                   β”‚  β€’ Sizing  β”‚
β•‘  β”‚  MT5 Data  β”‚                  β”‚  β€’ Groq    β”‚                                   β”‚  β€’ R:R     β”‚
β•‘  β”‚  OHLCV     β”‚                  β”‚  β€’ Claude  β”‚                                   β”‚  β€’ Limits  β”‚
β•‘  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                  β”‚  β€’ OpenAI  β”‚                                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β•‘        β”‚                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                         β”‚
β•‘        β”‚                               β”‚                                                    β”‚
β•‘        β–Ό                               β–Ό                                                    β”‚
β•‘  ╔═══════════════════════════════════════════════════════════════════════════════════════╗    β•‘
β•‘  β•‘                              8 SPECIALIZED AGENTS (PARALLEL)                              β•‘    β•‘
β•‘  ╠═══════════════════════════════════════════════════════════════════════════════════════╣    β•‘
β•‘  β•‘                                                                                         β•‘    β•‘
β•‘  β•‘   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                  β•‘    β•‘
β•‘  β•‘   β”‚    CHART    β”‚  β”‚   MARKET    β”‚  β”‚   VOLUME    β”‚  β”‚  CORRELATIONβ”‚                  β•‘    β•‘
β•‘  β•‘   β”‚  ANALYSIS  β”‚  β”‚  STRUCTURE  β”‚  β”‚  ANALYSIS   β”‚  β”‚   ENGINE   β”‚                  β•‘    β•‘
β•‘  β•‘   β”‚            β”‚  β”‚            β”‚  β”‚            β”‚  β”‚            β”‚                  β•‘    β•‘
β•‘  β•‘   β”‚ RSI, MACD  β”‚  β”‚    BOS     β”‚  β”‚   Volume   β”‚  β”‚    DXY     β”‚                  β•‘    β•‘
β•‘  β•‘   β”‚ Bollinger  β”‚  β”‚   CHoCH    β”‚  β”‚   Profile  β”‚  β”‚   Silver   β”‚                  β•‘    β•‘
β•‘  β•‘   β”‚   ADX      β”‚  β”‚    FVG     β”‚  β”‚    CMF     β”‚  β”‚    Oil     β”‚                  β•‘    β•‘
β•‘  β•‘   β”‚ Ichimoku   β”‚  β”‚  Order Blk β”‚  β”‚    OBV     β”‚  β”‚   EURUSD   β”‚                  β•‘    β•‘
β•‘  β•‘   β”‚ Stochasticβ”‚  β”‚  Liquidity β”‚  β”‚  Divergenceβ”‚  β”‚   Indices  β”‚                  β•‘    β•‘
β•‘  β•‘   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                  β•‘    β•‘
β•‘  β•‘                                                                                         β•‘    β•‘
β•‘  β•‘   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                  β•‘    β•‘
β•‘  β•‘   β”‚  SENTIMENT  β”‚  β”‚    RISK     β”‚  β”‚    TRADE   β”‚  β”‚            β”‚                  β•‘    β•‘
β•‘  β•‘   β”‚   MASTER   β”‚  β”‚ MANAGEMENT  β”‚  β”‚RECOMMENDATIONβ”‚  β”‚            β”‚                  β•‘    β•‘
β•‘  β•‘   β”‚            β”‚  β”‚            β”‚  β”‚            β”‚  β”‚            β”‚                  β•‘    β•‘
β•‘  β•‘   β”‚ Fed Policy β”‚  β”‚  Position  β”‚  β”‚ Confidence β”‚  β”‚            β”‚                  β•‘    β•‘
β•‘  β•‘   β”‚ Geopoliticsβ”‚  β”‚  Sizing   β”‚  β”‚    Score   β”‚  β”‚            β”‚                  β•‘    β•‘
β•‘  β•‘   β”‚Economic   β”‚  β”‚  R:R      β”‚  β”‚    Grade   β”‚  β”‚            β”‚                  β•‘    β•‘
β•‘  β•‘   β”‚   News    β”‚  β”‚  Limits   β”‚  β”‚ Entry/SL/TPβ”‚  β”‚            β”‚                  β•‘    β•‘
β•‘  β•‘   β”‚Positioningβ”‚  β”‚  Blackout β”‚  β”‚   Trade    β”‚  β”‚            β”‚                  β•‘    β•‘
β•‘  β•‘   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                  β•‘    β•‘
β•‘  β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•    β•‘
β•‘        β”‚                                                                                       β”‚
β•‘        β–Ό                                                                                       β”‚
β•‘  ╔══════════════════════════════════════════════════════════════════════════════════════════════╗  β•‘
β•‘  β•‘                            FINAL OUTPUT                                                     β•‘  β•‘
β•‘  β•‘  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β•‘  β•‘
β•‘  β•‘  β”‚  BUY/SELL | Confidence: 82/100 | Grade: A | Entry | SL | TP1 | TP2 | R:R | Lot Size  β”‚  β•‘  β•‘
β•‘  β•‘  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β•‘  β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

πŸ”„ Analysis Pipeline

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                              ANALYSIS PIPELINE                                              β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                  β”‚
β”‚  β”‚    MT5     β”‚    β”‚  CORRELATED β”‚    β”‚    LLM      β”‚    β”‚   CONFIG    β”‚                  β”‚
β”‚  β”‚   DATA     β”‚    β”‚ INSTRUMENTS β”‚    β”‚   PROVIDERS β”‚    β”‚   FILES     β”‚                  β”‚
β”‚  β”‚            β”‚    β”‚             β”‚    β”‚             β”‚    β”‚             β”‚                  β”‚
β”‚  β”‚ XAUUSD     β”‚    β”‚ DXY        β”‚    β”‚ Azure      β”‚    β”‚ Risk Params β”‚                  β”‚
β”‚  β”‚ M15/H1/H4  β”‚    β”‚ Silver     β”‚    β”‚ Groq       β”‚    β”‚ Gold Config β”‚                  β”‚
β”‚  β”‚ D1         β”‚    β”‚ Oil        β”‚    β”‚ Claude     β”‚    β”‚ LLM Config  β”‚                  β”‚
β”‚  β”‚            β”‚    β”‚ EURUSD     β”‚    β”‚ OpenAI     β”‚    β”‚ Credentialsβ”‚                  β”‚
β”‚  β”‚            β”‚    β”‚ Indices    β”‚    β”‚             β”‚    β”‚             β”‚                  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜                  β”‚
β”‚         β”‚                  β”‚                  β”‚                  β”‚                          β”‚
β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                          β”‚
β”‚                                        β”‚                                                   β”‚
β”‚                                        β–Ό                                                   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚                    8 AGENTS RUN IN PARALLEL                                             β”‚  β”‚
β”‚  β”‚                                                                                       β”‚  β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”‚  β”‚
β”‚  β”‚  β”‚   Chart    β”‚ β”‚   Market   β”‚ β”‚  Volume    β”‚ β”‚   Corr    β”‚ β”‚ Sentiment  β”‚         β”‚  β”‚
β”‚  β”‚  β”‚   Agent    β”‚ β”‚ Structure  β”‚ β”‚   Agent    β”‚ β”‚   Agent   β”‚ β”‚   Agent    β”‚         β”‚  β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β”‚  β”‚
β”‚  β”‚                                                                                       β”‚  β”‚
β”‚  β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                      β”‚  β”‚
β”‚  β”‚  β”‚   Risk    β”‚ β”‚   Trade    β”‚ β”‚   Data     β”‚                                      β”‚  β”‚
β”‚  β”‚  β”‚   Agent   β”‚ β”‚   Rec      β”‚ β”‚  Fetcher   β”‚                                      β”‚  β”‚
β”‚  β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                      β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                        β”‚                                                   β”‚
β”‚                                        β–Ό                                                   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚                      TRADE RECOMMENDATION SYNTHESIS                                      β”‚  β”‚
β”‚  β”‚                                                                                       β”‚  β”‚
β”‚  β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚  β”‚
β”‚  β”‚   β”‚  CONFIDENCE SCORING (0-100)                                                     β”‚    β”‚  β”‚
β”‚  β”‚   β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚    β”‚  β”‚
β”‚  β”‚   β”‚  β”‚ Component         β”‚ Max Pts   β”‚ Calculation                          β”‚    β”‚    β”‚  β”‚
β”‚  β”‚   β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€    β”‚    β”‚  β”‚
β”‚  β”‚   β”‚  β”‚ Chart Analysis    β”‚   +/-25   β”‚ Trend + Indicators                  β”‚    β”‚    β”‚  β”‚
β”‚  β”‚   β”‚  β”‚ Market Structure β”‚   +/-20   β”‚ BOS + CHoCH + OBs + FVG            β”‚    β”‚    β”‚  β”‚
β”‚  β”‚   β”‚  β”‚ Volume Analysis  β”‚   +/-15   β”‚ Flow + Profile + Divergence         β”‚    β”‚    β”‚  β”‚
β”‚  β”‚   β”‚  β”‚ Correlations    β”‚   +/-15   β”‚ DXY + Safe Haven                    β”‚    β”‚    β”‚  β”‚
β”‚  β”‚   β”‚  β”‚ Sentiment        β”‚   +/-15   β”‚ LLM Fundamental                   β”‚    β”‚    β”‚  β”‚
β”‚  β”‚   β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚    β”‚  β”‚
β”‚  β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚  β”‚
β”‚  β”‚                                                                                       β”‚  β”‚
β”‚  β”‚   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚  β”‚
β”‚  β”‚   β”‚  GRADE ASSIGNMENT                                                            β”‚    β”‚  β”‚
β”‚  β”‚   β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”‚    β”‚  β”‚
β”‚  β”‚   β”‚  β”‚ Grade    β”‚    Score       β”‚            Action                    β”‚    β”‚    β”‚  β”‚
β”‚  β”‚   β”‚  β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€    β”‚    β”‚  β”‚
β”‚  β”‚   β”‚  β”‚   A+     β”‚     85-100     β”‚ Full position size                  β”‚    β”‚    β”‚  β”‚
β”‚  β”‚   β”‚  β”‚   A      β”‚     70-84      β”‚ Standard position size              β”‚    β”‚    β”‚  β”‚
β”‚  β”‚   β”‚  β”‚   B      β”‚     55-69      β”‚ Reduced position size               β”‚    β”‚    β”‚  β”‚
β”‚  β”‚   β”‚  β”‚   C      β”‚      <55       β”‚ Skip or paper trade only           β”‚    β”‚    β”‚  β”‚
β”‚  β”‚   β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚    β”‚  β”‚
β”‚  β”‚   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                        β”‚                                                   β”‚
β”‚                                        β–Ό                                                   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚                            FINAL OUTPUT                                                 β”‚  β”‚
β”‚  β”‚                                                                                       β”‚  β”‚
β”‚  β”‚   Direction: BUY/SELL    Confidence: 82/100    Grade: A    Action: TRADE             β”‚  β”‚
β”‚  β”‚                                                                                       β”‚  β”‚
β”‚  β”‚   Entry: 2658.40    Stop Loss: 2639.50    Take Profit 1: 2677.30                        β”‚  β”‚
β”‚  β”‚   Take Profit 2: 2696.20    Take Profit 3: 2715.10    R:R: 1:2.6    Lot: 0.05          β”‚  β”‚
β”‚  β”‚                                                                                       β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                                                                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ€– The 8 Agents

# Agent Icon Role Key Functions
1 Data Fetcher πŸ“‘ Connects to MT5, retrieves multi-TF OHLCV XAUUSD, DXY, Silver, Oil, EURUSD
2 Chart Analysis πŸ“ˆ 40+ technical indicators RSI, MACD, Bollinger, ADX, Ichimoku, Stochastic, CCI, ATR
3 Market Structure πŸ—οΈ Smart Money Concepts BOS, CHoCH, FVG, Order Blocks, Liquidity Zones, Premium/Discount
4 Volume Analysis πŸ“‰ Money flow analysis Volume Profile (POC, VAH, VAL), CMF, OBV, Accumulation/Distribution
5 Correlations Engine πŸ”— Cross-market analysis DXY, Silver, Oil, EURUSD, Bonds, VIX, Indices
6 Sentiment Master 🧠 LLM-powered fundamentals Fed Policy, Geopolitics, Economic Data, News, Positioning
7 Risk Management πŸ›‘οΈ Position sizing & limits Lot sizing, R:R enforcement, Portfolio limits, Event blackout
8 Trade Recommendation 🎯 Final signal synthesis Confidence scoring, Grade assignment, Entry/SL/TP levels

🎯 Confidence Scoring

Score Components

Component Max Points Description
Chart Analysis +/-25 Trend direction, indicator alignment, signal strength
Market Structure +/-20 BOS confirmation, CHoCH, Order Blocks, FVG quality
Volume Analysis +/-15 Money flow direction, profile position, divergence
Correlations +/-15 DXY correlation, safe-haven flow, cross-market alignment
Sentiment +/-15 LLM fundamental score, news sentiment, positioning

Grade Thresholds

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                              GRADE THRESHOLDS                                               β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                                             β”‚
β”‚   Grade A+  ═══════════════════════════════════════  85-100  ═══  Full position size       β”‚
β”‚   Grade A   ═════════════════════════════════════════  70-84   ═══  Standard position      β”‚
β”‚   Grade B   ═════════════════════════════════════════  55-69   ═══  Reduced position        β”‚
β”‚   Grade C   ═════════════════════════════════════════   <55    ═══  Skip / Paper trade     β”‚
β”‚                                                                                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“Š Correlation Tracking

Monitored Instruments

Instrument Symbol Expected Correlation Type Analysis
US Dollar Index DXY -0.85 Inverse Gold moves opposite to USD
Silver XAGUSD +0.90 Positive Strong correlation with gold
EUR/USD EURUSD +0.80 Positive Currency impact on gold
US 10Y Bonds US10Y -0.70 Inverse Real rates affect gold
Real Rates - -0.80 Inverse Negative correlation
VIX Index VIX +0.60 Positive Risk sentiment
S&P 500 SPX -0.30 Weak Inverse Stock market correlation
Crude Oil USOIL +0.40 Positive Commodity correlation

Correlation Alerts

  • Divergence Detection: Alerts when current correlation diverges from expected
  • Safe Haven Flow: Tracks gold vs risk assets (stocks, crypto)
  • Currency Impact: DXY impact on gold pricing
  • Momentum Confirmation: Cross-asset momentum alignment

🧠 LLM Integration

Multi-Provider Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                              LLM PROVIDER FALLBACK                                           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                                                             β”‚
β”‚                           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                              β”‚
β”‚                           β”‚   User Request  β”‚                                              β”‚
β”‚                           β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                              β”‚
β”‚                                    β”‚                                                        β”‚
β”‚                                    β–Ό                                                        β”‚
β”‚                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                           β”‚
β”‚                     β”‚           PRIORITY QUEUE                 β”‚                           β”‚
β”‚                     β”‚                                          β”‚                           β”‚
β”‚                     β”‚   1️⃣  Azure AI  (GPT-4o, Llama-3.1)    │◄── Primary              β”‚
β”‚                     β”‚   2️⃣  Groq       (Llama-3.3-70B)        │◄── Free tier            β”‚
β”‚                     β”‚   3️⃣  Anthropic  (Claude Sonnet)        │◄── Cloud                β”‚
β”‚                     β”‚   4️⃣  OpenAI     (GPT-4o-mini)         │◄── Fallback             β”‚
β”‚                     β”‚   5️⃣  Rule-based  (No API needed)        │◄── Always available     β”‚
β”‚                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                           β”‚
β”‚                                    β”‚                                                        β”‚
β”‚                           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”                                             β”‚
β”‚                           β”‚   AUTO FALLBACK  β”‚                                             β”‚
β”‚                           β”‚                   β”‚                                             β”‚
β”‚                           β”‚  If provider N   β”‚                                             β”‚
β”‚                           β”‚  fails or times   β”‚                                             β”‚
β”‚                           β”‚  out β†’ try N+1    β”‚                                             β”‚
β”‚                           β”‚                   β”‚                                             β”‚
β”‚                           β”‚  Timeout: 30s     β”‚                                             β”‚
β”‚                           β”‚  Max retries: 2   β”‚                                             β”‚
β”‚                           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Provider Details

Priority Provider Models Latency Cost Notes
1 Azure AI GPT-4o, Llama-3.1 ~1s $$ Primary production
2 Groq Llama-3.3-70B ~200ms Free Fast inference
3 Anthropic Claude Sonnet ~1.5s $$ High quality
4 OpenAI GPT-4o-mini ~500ms $ Fallback
5 Rule-based - Instant Free Always available

LLM Use Cases

  • πŸ“° Sentiment Analysis: Fed policy, geopolitical risk, economic data
  • πŸ“Š Report Generation: Daily analysis summary
  • πŸ’¬ Analyst Commentary: Natural language trade rationale
  • πŸ” News Analysis: Real-time news impact assessment

πŸ“ˆ Technical Indicators

Implemented Indicators

Category Indicators
Trend EMA (9, 21, 50, 200), SMA (20, 50, 100, 200), ADX, Ichimoku
Momentum RSI (14), MACD (12,26,9), Stochastic (14,3), CCI (14), Williams %R (14)
Volatility Bollinger Bands (20,2), ATR (14), Keltner Channels
Volume Volume SMA, OBV, CMF, Accumulation/Distribution
Patterns Doji, Hammer, Engulfing, Morning/Evening Star, Harami, Pin Bar

Multi-Timeframe Analysis

Timeframe Purpose Indicators Used
M15 Entry timing All fast indicators
H1 Intraday trend EMA 21/50, MACD, RSI
H4 Swing direction EMA 50/200, ADX, ATR
D1 Long-term bias EMA 200, trend structure

πŸ’° Risk Management

Position Sizing Formula

Position Size = (Account Balance Γ— Risk%) / (SL Distance Γ— Point Value)

Risk Parameters

Parameter Default Description
Max Risk per Trade 2.0% Maximum risk per position
Max Portfolio Risk 6.0% Total risk across all positions
Min R:R Ratio 1:1.5 Minimum reward to risk
Max Open Trades 3 Maximum concurrent positions
Consecutive Loss Pause 3 Pause after 3 losses

Event Blackout

Event Blackout Duration
NFP (Non-Farm Payrolls) +/- 1 hour
CPI (Inflation) +/- 1 hour
FOMC (Fed Rate Decision) +/- 2 hours
Major Geopolitical Until resolved

πŸ› οΈ Technology Stack

Category Technology Version Purpose
Runtime Python 3.10+ Core language
Trading MetaTrader5 5.0.45+ Market data & execution
Data Pandas 2.0+ Data manipulation
NumPy NumPy 1.24+ Numerical computing
HTTP Requests 2.31+ API calls
Async aiohttp 3.9+ Async operations
LLM OpenAI 1.0+ LLM integration
LLM Anthropic 0.18+ Claude integration
Logging Loguru 0.7+ Structured logging
Rich Rich 13.0+ Terminal output

πŸ“ Project Structure

Gold-MultiAgent-Analyzer/
β”‚
β”œβ”€β”€ πŸ“œ LICENSE                         # MIT License
β”œβ”€β”€ 🀝 CONTRIBUTING.md                 # Contribution guidelines
β”œβ”€β”€ πŸ“– README.md                       # This file
β”‚
β”œβ”€β”€ .github/
β”‚   β”œβ”€β”€ ISSUE_TEMPLATE/
β”‚   β”‚   β”œβ”€β”€ πŸ› bug_report.md
β”‚   β”‚   └── ✨ feature_request.md
β”‚   └── πŸ“ PULL_REQUEST_TEMPLATE.md
β”‚
β”œβ”€β”€ main.py                            # 🎯 CLI entry point
β”œβ”€β”€ unified_executor.py                # πŸ”„ Unified execution
β”œβ”€β”€ execute_and_monitor.py             # πŸ“Š Live monitoring
β”œβ”€β”€ forex_scan.py                      # πŸ’± Forex scanning
β”œβ”€β”€ scan_group1.py                    # πŸ“ˆ Group scanning
β”œβ”€β”€ scan_us_stocks.py                  # 🏦 US stock scanning
β”œβ”€β”€ check_time.py                     # ⏰ Time utilities
β”œβ”€β”€ test_full.py                      # πŸ§ͺ Full system test
β”‚
β”œβ”€β”€ agents/                            # πŸ€– Agent modules
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ orchestrator.py              # 🎯 Command center
β”‚   β”œβ”€β”€ data_fetcher_agent.py        # πŸ“‘ MT5 data retrieval
β”‚   β”œβ”€β”€ chart_analysis_agent.py      # πŸ“ˆ Technical indicators
β”‚   β”œβ”€β”€ market_structure_agent.py    # πŸ—οΈ SMC analysis
β”‚   β”œβ”€β”€ volume_analysis_agent.py    # πŸ“‰ Volume profiling
β”‚   β”œβ”€β”€ correlations_engine_agent.py# πŸ”— Cross-market
β”‚   β”œβ”€β”€ sentiment_master_agent.py   # 🧠 LLM sentiment
β”‚   β”œβ”€β”€ risk_management_agent.py    # πŸ›‘οΈ Risk controls
β”‚   β”œβ”€β”€ sentiment/
β”‚   β”‚   └── sentiment_master_agent.py
β”‚   └── trade_recommendation_agent.py# 🎯 Final signal
β”‚
β”œβ”€β”€ tools/                            # πŸ› οΈ Tool modules
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ mt5_tools.py                 # MetaTrader5 wrapper
β”‚   β”œβ”€β”€ indicator_tools.py           # Technical calculations
β”‚   β”œβ”€β”€ pattern_tools.py             # Candlestick patterns
β”‚   β”œβ”€β”€ structure_tools.py           # SMC functions
β”‚   β”œβ”€β”€ volume_tools.py              # Volume analysis
β”‚   β”œβ”€β”€ correlation_tools.py         # Cross-market
β”‚   β”œβ”€β”€ signal_tools.py              # Signal scoring
β”‚   β”œβ”€β”€ risk_tools.py               # Risk calculations
β”‚   β”œβ”€β”€ sentiment_scoring_tools.py   # Sentiment analysis
β”‚   β”œβ”€β”€ web_search_tools.py          # News scraping
β”‚   └── __init__.py
β”‚
β”œβ”€β”€ utils/                            # πŸ”§ Utilities
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ llm_client.py               # Multi-provider LLM
β”‚   β”œβ”€β”€ data_formatter.py           # Data conversion
β”‚   β”œβ”€β”€ logger.py                   # Structured logging
β”‚   └── time_utils.py               # Session context
β”‚
β”œβ”€β”€ config/                           # βš™οΈ Configuration
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ gold_config.json             # Gold parameters
β”‚   β”œβ”€β”€ risk_parameters.json         # Risk thresholds
β”‚   β”œβ”€β”€ correlation_config.json      # Correlation settings
β”‚   └── (mt5_credentials.json)        # MT5 login (gitignored)
β”‚
β”œβ”€β”€ tests/                            # πŸ§ͺ Test suite
β”‚   └── test_system.py
β”‚
└── requirements.txt                  # πŸ“¦ Dependencies

πŸš€ Getting Started

Prerequisites

Requirement Description
🐍 Python 3.10+
πŸ–₯️ MT5 Terminal Running on Windows
πŸ’Ύ RAM 4GB+ recommended

Installation

# Clone repository
git clone https://github.com/mahmoud20138/Gold-MultiAgent-Analyzer.git
cd Gold-MultiAgent-Analyzer

# Create virtual environment
python -m venv venv

# Activate (Windows)
venv\Scripts\activate

# Activate (Linux/Mac)
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

Configuration

# 1. Configure MT5 credentials
# Edit config/mt5_credentials.json
{
  "account": 12345678,
  "password": "your_password",
  "server": "YourBroker-Server",
  "path": "C:\\Program Files\\MetaTrader 5\\terminal64.exe"
}

# 2. Configure LLM (optional - rule-based fallback available)
# Edit config/llm_config.json
{
  "azure_api_key": "your-key",
  "groq_api_key": "your-key",
  "anthropic_api_key": "sk-ant-...",
  "openai_api_key": "sk-..."
}

# 3. Adjust risk parameters (optional)
# Edit config/risk_parameters.json

πŸ’» Usage

Command Line Options

# Full analysis (technical + sentiment)
python main.py

# Quick technical only (no LLM, faster)
python main.py --quick

# Analyze different symbol
python main.py --symbol EURUSDm

# JSON output for API integration
python main.py --json

# Live monitoring (re-analyze every 60s)
python main.py --live --interval 60

# Sentiment analysis only
python main.py --sentiment-only

# Verbose debug output
python main.py --verbose

# Help
python main.py --help

Example Output

╔═══════════════════════════════════════════════════════════════════════════════╗
β•‘                          FINAL TRADE RECOMMENDATION                          β•‘
╠═══════════════════════════════════════════════════════════════════════════════╣
β•‘                                                                               β•‘
β•‘  BUY   Confidence: 82/100   Grade: A   Action: TRADE                        β•‘
β•‘                                                                               β•‘
β•‘  LEVELS                                                                     β•‘
β•‘  Entry              2658.40                                                 β•‘
β•‘  Stop Loss          2639.50                                                 β•‘
β•‘  Take Profit 1      2677.30                                                 β•‘
β•‘  Take Profit 2      2696.20                                                 β•‘
β•‘  Take Profit 3      2715.10                                                 β•‘
β•‘  R:R                1:2.6                                                    β•‘
β•‘  Lot Size           0.05                                                     β•‘
β•‘  Risk Amount        $94.50                                                   β•‘
β•‘                                                                               β•‘
β•‘  Reasons:                                                                     β•‘
β•‘    - Strong bullish trend (ADX > 25)                                        β•‘
β•‘    - Bullish market structure (HH, HL)                                       β•‘
β•‘    - Volume shows accumulation                                              β•‘
β•‘    - DXY weakening -> Bullish for Gold                                      β•‘
β•‘    - Sentiment score positive (7/10 bullish)                               β•‘
β•‘                                                                               β•‘
β•‘  Warnings:                                                                    β•‘
β•‘    ! RSI overbought - watch for pullback                                     β•‘
β•‘    ! Price extended above POC - consolidation likely                        β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

   Overall Bias      BULLISH
   Alignment         ALIGNED (all TFs bullish)
     M15            BULLISH  strength=STRONG
     H1             BULLISH  strength=STRONG
     H4             BULLISH  strength=MEDIUM
     D1             BULLISH  strength=MEDIUM

πŸ“Š Results Output

Trade Recommendation

Field Description
Direction BUY or SELL
Confidence 0-100 score
Grade A+, A, B, or C
Action TRADE, SKIP, or PAPER
Entry Recommended entry price
Stop Loss Protective stop loss
Take Profit 1/2/3 Target levels
R:R Risk:Reward ratio
Lot Size Position size
Risk Amount Dollar risk

Multi-Timeframe Alignment

Timeframe Bias Strength
M15 BULLISH STRONG
H1 BULLISH STRONG
H4 BULLISH MEDIUM
D1 BULLISH MEDIUM

Smart Money Concepts

Element Status
Structure BULLISH (HH, HL)
Price Zone DISCOUNT (62% of range)
BOS Events 3 (latest=BULLISH_BOS @ 2645.20)
CHoCH Events 1
FVGs Unfilled 2 / 5
Order Blocks 4

🀝 Contributing

Contributions are welcome! Please read CONTRIBUTING.md for guidelines.


πŸ“œ License

This project is licensed under the MIT License - see LICENSE for details.


⚠️ Disclaimer

⚠️ WARNING: Trading financial instruments carries significant risk.

  • This system is for educational and research purposes only
  • Past performance does not guarantee future results
  • Always use proper risk management
  • Test on demo accounts before live trading
  • The authors assume no liability for trading losses

Made with πŸ€– for algorithmic gold trading

About

Multi-agent Gold (XAUUSD) analysis platform -- chart, correlations, market structure, sentiment, risk, volume agents with GLM-5 AI

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages