Specification
Project Requirement Document: MT5 Arbitrage Trading Software (Gold - MCX vs COMEX)
Overview:
We are looking to develop an automated arbitrage trading software for MetaTrader 5 (MT5) that identifies and executes arbitrage opportunities between Gold traded on MCX (India) and COMEX (International). The two instruments are traded via separate MT5 accounts on different exchanges. The software must monitor live prices, detect price discrepancies based on a predefined logic, and simultaneously place and manage trades across both platforms.
Core Requirements:
1. Live Price Feed Integration:
-
Fetch real-time bid/ask prices for:
-
MCX Gold (Symbol example: MCX GOLD )
-
COMEX Gold (Symbol example: XAUUSD )
-
-
Data must be captured using MT5 API.
-
Must handle symbol format variations per broker.
2. Arbitrage Logic Engine:
-
The software should continuously calculate the live price difference based on a defined formula, for example:
Arbitrage Opportunity = (COMEX Gold Price - MCX Gold Price * Conversion Factor)
-
Trigger a trade when the price difference exceeds a user-defined threshold (in % or absolute terms).
-
Account for transaction costs, spreads, and slippage before confirming an opportunity.
3. Trade Execution Logic:
-
When conditions are met:
-
Simultaneously place buy order on MCX and sell order on COMEX or vice versa.
-
-
Orders must be executed as close to simultaneously as possible to minimize leg risk.
-
Support for both Market and Limit orders (configurable).
-
Order parameters (volume, slippage, deviation, etc.) should be user-configurable.
4. Position Management:
-
Define and apply exit rules:
-
Profit Target (in points or percentage)
-
Stop Loss
-
Time-based or volatility-based exit rules
-
-
On exit signal, close both trades simultaneously.
5. Multi-Account Integration:
-
Support two separate MT5 accounts (for MCX and COMEX).
-
Allow users to input and store their MT5 credentials securely.
-
Maintain independent sessions and trade management per account.
6. Commercial Use Packaging:
-
Deliver the software as a standalone Windows executable (.exe).
-
User Interface must include:
-
Input fields for MT5 login credentials
-
Configuration for arbitrage thresholds, lot size, SL/TP, etc.
-
Real-time dashboard showing live prices, signals, open trades, and P&L
-
-
Include user authentication or license management for commercial distribution.
7. Logging and Monitoring:
-
Log all trades, errors, and events to local files or database.
-
Include alerts for connection failure, missed execution, or unexpected behavior.
Technology Recommendations (if applicable):
-
Language: Python (preferred) or C# (if developer expertise is higher)
-
UI Framework: PyQt5 / PySide2 for GUI (if Python) or WPF (if C#)
-
MT5 Integration: Use MetaTrader5 API (via MetaTrader5 Python module or C++ bridge)
-
Packaging: PyInstaller (Python) or native packaging tools for .NET
Deliverables:
-
Fully functional arbitrage trading executable (.exe)
-
Source code (optional based on agreement)
-
Documentation for configuration, deployment, and usage
-
Logs and basic error handling