# hakizajr3-glitch/mt5-propfirm-superea architecture

> Architecture diagram of the GitHub repository hakizajr3-glitch/mt5-propfirm-superea, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hakizajr3-glitch/mt5-propfirm-superea
- Repository: https://github.com/hakizajr3-glitch/mt5-propfirm-superea

## Overview

PropFirm SuperEA provides the same trend-following rules and prop-firm guardrails through separate MT5 and TradeLocker runtimes, with historical backtesting for the Python strategy. The repository also includes a dashboard-driven autonomous bot and an AI multi-agent decision pipeline. The excerpts establish the dashboard’s live engine and AI orchestration calls, but do not show every provider, execution, or MT5 implementation detail; those connections are included only where the README or sampled code supports them.

Main entry points: [`dashboard/app.py`](https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/dashboard/app.py) (Flask dashboard), [`ai_hedge_fund/orchestrator.py`](https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/ai_hedge_fund/orchestrator.py) (Cycle orchestrator), [`tradelocker_bot/bot.py`](https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/tradelocker_bot/bot.py) (TradeLocker bot), [`dashboard/static/app.js`](https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/dashboard/static/app.js) (Dashboard interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_trading["Trading runtimes"]
  node_mt5_ea["MT5 Expert Advisor"]
  node_tl_bot["TradeLocker bot<br/>[bot.py]"]
  node_tl_strategy["Entry and exit rules<br/>[strategy.py]"]
  node_tl_risk["Prop-firm guardrails<br/>[risk.py]"]
  node_tl_config["Bot configuration<br/>[config.py]"]
end

subgraph group_hedge_fund["AI decision pipeline"]
  node_hf_orchestrator["Cycle orchestrator<br/>[orchestrator.py]"]
  node_agents["Investor agents"]
  node_hf_risk["Consensus and risk<br/>[risk_manager.py]"]
  node_portfolio["Portfolio decisions"]
  node_execution["Order execution<br/>[executor.py]"]
end

subgraph group_dashboard["Dashboard and signals"]
  node_dashboard_app["Flask dashboard<br/>[app.py]"]
  node_dashboard_ui["Dashboard interface<br/>[app.js]"]
  node_engine["Autonomous engine<br/>[engine.py]"]
  node_providers["Market data providers<br/>[providers.py]"]
  node_dashboard_state["Dashboard state<br/>[state.py]"]
  node_webhook["TradingView webhook<br/>[webhook.py]"]
end

subgraph group_validation["Strategy validation"]
  node_backtest["Historical backtester<br/>[backtest.py]"]
end

node_trader(("Trader"))
node_broker{{"TradeLocker API"}}
node_mt5{{"MetaTrader 5"}}
node_market_data["Historical price data"]
node_web_user(("Dashboard user"))
node_tradingview{{"TradingView alerts"}}

node_trader -->|"attaches EA"| node_mt5_ea
node_mt5_ea -->|"trades on"| node_mt5
node_trader -->|"configures bot"| node_tl_config
node_tl_config -->|"configures"| node_tl_bot
node_tl_bot -->|"computes signals"| node_tl_strategy
node_tl_bot -->|"checks risk"| node_tl_risk
node_tl_bot -->|"requests market data and orders"| node_broker
node_backtest -->|"reuses rules"| node_tl_strategy
node_backtest -->|"loads history"| node_market_data
node_web_user -->|"uses"| node_dashboard_ui
node_dashboard_ui -->|"requests API"| node_dashboard_app
node_dashboard_app -->|"gets account and bars"| node_providers
node_dashboard_app -->|"builds state"| node_dashboard_state
node_dashboard_app -->|"runs hedge-fund cycle"| node_hf_orchestrator
node_dashboard_app -->|"starts and reports"| node_engine
node_engine -->|"connects and runs cycles"| node_tl_bot
node_engine -->|"via bot"| node_broker
node_tradingview -->|"posts alert"| node_webhook
node_dashboard_app -->|"registers routes"| node_webhook
node_dashboard_ui -->|"fetches signals"| node_webhook
node_hf_orchestrator -->|"requests analysis"| node_agents
node_hf_orchestrator -->|"evaluates signals"| node_hf_risk
node_hf_orchestrator -->|"requests decision"| node_portfolio
node_hf_orchestrator -->|"dispatches order"| node_execution
node_execution -.->|"submits order"| node_broker

click node_mt5_ea "https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/PropFirm_SuperEA.mq5"
click node_tl_bot "https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/tradelocker_bot/bot.py"
click node_tl_strategy "https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/tradelocker_bot/strategy.py"
click node_tl_risk "https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/tradelocker_bot/risk.py"
click node_tl_config "https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/tradelocker_bot/config.py"
click node_backtest "https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/tradelocker_bot/backtest.py"
click node_dashboard_app "https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/dashboard/app.py"
click node_dashboard_ui "https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/dashboard/static/app.js"
click node_engine "https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/dashboard/engine.py"
click node_providers "https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/dashboard/providers.py"
click node_dashboard_state "https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/dashboard/state.py"
click node_webhook "https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/ai_hedge_fund/webhook.py"
click node_hf_orchestrator "https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/ai_hedge_fund/orchestrator.py"
click node_agents "https://github.com/hakizajr3-glitch/mt5-propfirm-superea/tree/main/ai_hedge_fund/agents"
click node_hf_risk "https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/ai_hedge_fund/risk_manager.py"
click node_portfolio "https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/ai_hedge_fund/portfolio_manager.py"
click node_execution "https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/ai_hedge_fund/executor.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_mt5_ea,node_tl_bot,node_tl_strategy,node_tl_risk,node_tl_config,node_web_user,node_tradingview toneBlue
class node_hf_orchestrator,node_agents,node_hf_risk,node_portfolio,node_execution toneAmber
class node_dashboard_app,node_dashboard_ui,node_engine,node_providers,node_dashboard_state,node_webhook,node_broker toneMint
class node_backtest toneRose
class node_trader,node_mt5,node_market_data toneIndigo
```

## Components

### Trading runtimes

- [MT5 Expert Advisor](https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/PropFirm_SuperEA.mq5): `PropFirm_SuperEA.mq5`
- [TradeLocker bot](https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/tradelocker_bot/bot.py): `tradelocker_bot/bot.py`
- [Entry and exit rules](https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/tradelocker_bot/strategy.py): `tradelocker_bot/strategy.py`
- [Prop-firm guardrails](https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/tradelocker_bot/risk.py): `tradelocker_bot/risk.py`
- [Bot configuration](https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/tradelocker_bot/config.py): `tradelocker_bot/config.py`

### AI decision pipeline

- [Cycle orchestrator](https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/ai_hedge_fund/orchestrator.py): `ai_hedge_fund/orchestrator.py`
- [Investor agents](https://github.com/hakizajr3-glitch/mt5-propfirm-superea/tree/main/ai_hedge_fund/agents): `ai_hedge_fund/agents`
- [Consensus and risk](https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/ai_hedge_fund/risk_manager.py): `ai_hedge_fund/risk_manager.py`
- [Portfolio decisions](https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/ai_hedge_fund/portfolio_manager.py): `ai_hedge_fund/portfolio_manager.py`
- [Order execution](https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/ai_hedge_fund/executor.py): `ai_hedge_fund/executor.py`

### Dashboard and signals

- [Flask dashboard](https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/dashboard/app.py): `dashboard/app.py`
- [Dashboard interface](https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/dashboard/static/app.js): `dashboard/static/app.js`
- [Autonomous engine](https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/dashboard/engine.py): `dashboard/engine.py`
- [Market data providers](https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/dashboard/providers.py): `dashboard/providers.py`
- [Dashboard state](https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/dashboard/state.py): `dashboard/state.py`
- [TradingView webhook](https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/ai_hedge_fund/webhook.py): `ai_hedge_fund/webhook.py`

### Strategy validation

- [Historical backtester](https://github.com/hakizajr3-glitch/mt5-propfirm-superea/blob/main/tradelocker_bot/backtest.py): `tradelocker_bot/backtest.py`

### Other components

- **Trader**
- **TradeLocker API**
- **MetaTrader 5**
- **Historical price data**
- **Dashboard user**
- **TradingView alerts**

## Connections

- Trader → MT5 Expert Advisor: attaches EA
- MT5 Expert Advisor → MetaTrader 5: trades on
- Trader → Bot configuration: configures bot
- Bot configuration → TradeLocker bot: configures
- TradeLocker bot → Entry and exit rules: computes signals
- TradeLocker bot → Prop-firm guardrails: checks risk
- TradeLocker bot → TradeLocker API: requests market data and orders
- Historical backtester → Entry and exit rules: reuses rules
- Historical backtester → Historical price data: loads history
- Dashboard user → Dashboard interface: uses
- Dashboard interface → Flask dashboard: requests API
- Flask dashboard → Market data providers: gets account and bars
- Flask dashboard → Dashboard state: builds state
- Flask dashboard → Cycle orchestrator: runs hedge-fund cycle
- Flask dashboard → Autonomous engine: starts and reports
- Autonomous engine → TradeLocker bot: connects and runs cycles
- Autonomous engine → TradeLocker API: via bot
- TradingView alerts → TradingView webhook: posts alert
- Flask dashboard → TradingView webhook: registers routes
- Dashboard interface → TradingView webhook: fetches signals
- Cycle orchestrator → Investor agents: requests analysis
- Cycle orchestrator → Consensus and risk: evaluates signals
- Cycle orchestrator → Portfolio decisions: requests decision
- Cycle orchestrator → Order execution: dispatches order
- Order execution → TradeLocker API: submits order
