Trabajo finalizado
Tarea técnica
Introduction
The goal is to develop a Grid Robot that implements a customizable grid trading strategy on netting accounts across futures, equities, and forex. The EA will enforce unidirectional trading (only buys or only sells per symbol), allow precise manual entry of grid levels, and provide a user-friendly interface for placing, modifying, and closing orders. Key risk controls include stop-loss, profit-target, breakeven, daily max-loss, and a kill/pause mechanism. Additionally, the EA must support limited automatic re-entry at a grid level after a stop-out (up to three attempts).
1. Netting Account Enforcement
1.1. All grid logic must respect MT5 and broker (AMP futures) netting rules.
1.2. The EA enforces unidirectional trading—once either buy or sell mode is selected for a symbol, the opposite side cannot be opened.
2. Functional Requirements
2.1 Grid Configuration & Execution
-
2.1.1 Manual definition of grid levels: users input exact price points for each grid line.
-
2.1.2 Global parameters apply uniformly across all levels: order type (limit/stop), stop-loss, take-profit, breakeven.
-
2.1.3 Support for futures, equities, and FX instruments within the same EA.
2.2 Re-Entry Logic
-
2.2.1 If an order at a grid level is stopped out, automatically re-place the equivalent order (limit or stop) at that same level.
-
2.2.2 Configurable maximum re-entry attempts per level (default: 3).
-
2.2.3 Only one active order may exist at any grid level; further entries at that level are blocked until the existing order is resolved.
2.4 Order Lifecycle & Controls
-
2.4.1 Create, modify, and cancel individual or all grid orders via UI or automated triggers.
-
2.4.2 “Pause Grid” and “Cancel All” buttons prominently available in the interface.
2.4.3 Capture basic trade performance data of the robot.
2.7.1 For every executed order (filled or closed), record
Entry timestamp, entry price
-
Exit timestamp, exit price
-
Executed volume/lot size
-
Net P&L (in both account currency and ticks/pips)
-
Drawdown experienced during the trade (max adverse excursion)
-
Time in trade
-
-
2.7.2 Persist performance data to a CSV.
-
2.7.3 Provide in-EA reporting:
-
Daily/weekly/monthly P&L summaries
-
Win rate, average win/loss, max consecutive losses
-
Equity curve chart (simple line plot)
-
-
2.7.4 Allow export of raw trade log and summary reports via the UI.
2.5 Risk Management & Compliance
-
2.5.1 Pre-trade checks: enforce maximum order size and notional limits.
-
2.5.2 Block any trade that would violate netting or margin requirements.
-
2.5.3 Daily maximum loss threshold per grid—breach triggers an automatic kill-switch (halts all new orders).
2.6 Multi-Account Deployment
-
2.6.1 Packaged EA installer for rapid deployment across multiple MT5 accounts owned by the user.
3. Non-Functional Requirements
3.1 Usability & UX
-
Intuitive, responsive panel for all grid controls (place/modify/close).
-
Real-time display of P&L, open order count, net position.
3.2 Performance & Scalability
-
UI latency < 200 ms from chart adjustment to live-order update.
-
Support at least 10 simultaneous grid levels per account without performance degradation.
3.3 Reliability & Recovery
-
Persist grid state to disk so the EA can restart and re-apply pending orders after platform or PC restarts.
-
Automatic reconnection and failover to secondary data and execution gateways.
3.4 Security & Compliance
-
All broker and data-feed connections secured via TLS encryption.
-
Role-based access control: only authorized users can modify grid settings or trigger kill-switch.