Работа завершена
Техническое задание
Overview:
The goal is to develop an Expert Advisor (EA) capable of executing automated hedging and scalping strategies between two separate account terminals on the Meta Trader 5 platform. This EA will ensure high-speed execution (ideally between 1-20 milliseconds), maximizing profitability while adhering to user-defined parameters. It will support a single trading instrument at a time across various asset classes (crypto, forex, commodities, indices).
Functional Requirements:
HEDGING PART
The EA must:
Open complementary BUY and SELL orders across two separate accounts.
Example:
Account A: 2 BUY positions, 1 SELL position.
Account B: 2 SELL positions, 1 BUY position.
The number of order positions opened is non-adjustable, but the value of each position is adjustable.
Support hedging for a single trading instrument per session to optimize performance.
Automatically terminate operation under the following conditions:
Accounts or instruments are modified during active trading.
Lay the foundation for the scalping process by ensuring that the hedging process is successfully executed prior to initiating scalping.
SCALPING EXECUTION
The EA must:
Initiate scalping only after profitable conditions are confirmed for current open positions. (More info will be given in comment)
Profit calculation must account for:
Spreads of Instruments traded. (Depends on Type of Account and Brokers)
Execute trade closures within 1-20 milliseconds to secure profits.
Never close any position in loss, except when:
Stop Loss Mode is manually enabled (default: OFF) with a customizable stop-loss value (default: 10 pips) using pips to measure distance of SL.
Stop Loss cannot be used onto Accounts with LIGHT-Sell or LIGHT-Buy. Meaning that if the Accounts is BUY-Heavy, then SL is available same thing as SELL-Heavy account.
Stop Loss executions NEED to be lightning fast. Both Setup and Executions of SL onto Both Accounts need to be AT THE SAME TIME.
Operate independently across both accounts:
Account A: Secure profits for positions where confirmed, while awaiting other positions to turn profitable.
Account B: Mirror the same scalping logic. But inverted.
Each time the EA is attached, it creates a "Generation" (Gen) of trading activities.
Generations are displayed sequentially on the chart (e.g., Gen 1, Gen 2, etc.).
Generation timing is customizable in EA settings (default: 600 seconds).
Automatic alternation of trading roles across accounts for each new Generation:
Gen 1: Account A (BUY-heavy), Account B (SELL-heavy).
Gen 2: Reverse roles (Account A becomes SELL-heavy, Account B becomes BUY-heavy).
Continues in this manner for subsequent Generations.
The EA establishes direct socket communication between the two terminals to synchronize trading activities.
Server ports must be configurable through EA settings (e.g., Server Port = 30303,30302 ).
Symbol on Brokers must be inserted in the settings for further calibrations (e.g., Symbol = BTCUSD, XBRUSD)
Works for both Accounts in settings.
Offers Sandbox Mode for continuous trading without predefined strategies.
Ensures that all scalping actions adhere strictly to indicator-confirmed profit conditions.
Supports user-defined lot size configurations:
BUY and SELL lot sizes must remain identical across both accounts.
Compatible with any leverage level.
Includes an optional compounding feature (Default settings: False)
When enabled, profits are reinvested into subsequent trades.
Execution Speed
Opening and closing of trades must be processed within 1-20 milliseconds.
Customizable Parameters
Generation Duration: Adjustable (default: 600 seconds).
Stop Loss Mode: Disabled by default, customizable to preferred pip distances.
Server Ports: Configurable through settings.
Error Handling
The EA must automatically shut down if:
Account terminals or trading instruments are modified mid-operation.
Communication disruptions occur between terminals.
Platform Compatibility
Fully compatible with Meta Trader 5.
Operates across multiple asset classes:
Cryptocurrencies
Commodities
Indices
ALL ASSET CLASS AND INSTRUMENT
✔ Hedging Across Accounts: Simultaneously opens complementary positions on two terminals.
✔ High-Speed Scalping: Executes trades within 1-20 milliseconds.
✔ Generational Logic: Organizes trading cycles with role alternations.
✔ No Pre-Defined Strategies: Sandbox Mode.
✔ Direct Communication: Seamless synchronization using socket connections. Server Port
✔ Dynamic Configurations: Flexible lot sizing, leverage options, and profit-compounding.
Notes for Developers: The EA should be built with high performance and minimal latency in mind, ensuring smooth execution even during volatile market conditions. Please assess the complexity and cost of development based on the provided specifications and communicate any potential limitations or additional requirements.