For setting up this application, please refer Setup
This document describes a sophisticated trading system architecture that enables copying trades from TradingView to the MetaTrader5 (MT5) platform. The system is designed with multiple layers to ensure reliable trade execution, data persistence, and synchronization across various MT5 terminals.
- TradingView Browser/Desktop: The entry point where trades are placed.
- Network Traffic: Handles API calls from TradingView to the proxy service layer.
- mitmproxy: Intercepts and monitors network traffic from TradingView.
- Proxy Server: Extracts and validates the payload from intercepted traffic.
- Trade Handler: Processes trade data and distributes it to appropriate containerized services.
- Redis Pub/Sub: Manages real-time message queuing between Proxy and Worker service layers.
- PostgreSQL Database: Provides persistent storage for trade data and system state.
- MT5 Worker: Subscribes to Redis messages and prepares trades for execution.
- MT5 Python API: Interfaces with the MetaTrader5 platform for trade execution.
- MT5 Account: Central trading account where orders are placed.
- Multiple Terminals: Trades get synchronized across web, mobile and desktop applications.
- Trading signals originate from TradingView browser/desktop.
- The proxy service layer intercepts and processes these signals by continuously listening to TradingView network traffic.
- Trade data is:
- Stored in PostgreSQL for persistence and analysis.
- Published to Redis for real-time message handling.
- MT5 Worker subscribes to Redis messages and executes trades via the MT5 Python API.
- Orders are placed in MT5 and synchronized across all terminals.
- Scalability: Containerized services allow for easy scaling.
- Reliability: Multiple layers ensure robust trade execution.
- Persistence: Trade data is stored for analysis and auditing.
- Multi-platform Access: Synchronized trading across different devices.
- Real-time Processing: Redis pub/sub enables immediate trade execution.
- Secure Interception: Network traffic interception is handled securely through
mitmproxy
. - Isolated Database Access: Database access is containerized and isolated.
- Encrypted Communication: MT5 API communications are encrypted.
- Validation Layers: Multiple validation layers prevent unauthorized trade execution.
This architecture provides a robust foundation for automated trading while maintaining flexibility for future enhancements and scaling requirements.
Developer Contact: [email protected]
If you find this tool helpful and want to support its continued development, you can contribute in the following ways:
- Bitcoin:
bc1qv734cfcwlm9l34da7naeqkvu7taf9mp9g8c0hh
- Ethereum:
0x024e8D8A0F74b5966C86ef7FFefA6358d3713497
- USDT (TRC20):
TVcA2grqRLkB91S9LrfqaNM1ro7GYTP9dU
- ⭐ Star this repository
- 🐛 Report bugs and contribute fixes
- 💡 Suggest new features and improvements
- 📖 Help improve documentation
Your support helps keep this project maintained and free for everyone! 🙏
MIT License - see LICENSE file for details.