Phoenix Level Trader
- Experts
- Nigel Nii Darku Narnor Darko
- 버전: 5.0
Turning the Phoenix Level Trader from a manual indicator into a fully functional Expert Advisor (EA) shifts its role from a passive analysis tool to an active trading assistant. Below are the key feature updates and technical changes integrated for this transition and for MQL5 Market validation:1. Active Trade Execution & Management The primary update is the addition of the CTrade class, which enables the EA to interact with the broker's server. One-Click Execution: Integrated BUY, SELL, and CLOSE buttons on the "Scalp" tab for instant market entries and exits. Dynamic Lot Sizing: Added a lot size dropdown menu (0.01 to 2.0) that replaces static lot inputs, allowing for quick adjustments directly from the chart interface. Net Profit/Loss (P/L) Tracking: A new real-time label tracks the total net profit (including swap) for all open positions on the current symbol, providing immediate feedback on active trades.2. Internal Indicator Handling (EMA 21)To meet MQL5 Market validation standards and improve performance, the EMA 21 is no longer called as an external .ex5 file. Handle-Based Logic: The EA now creates its own internal handle for the EMA 21 in the OnInit() function using iMA(). This eliminates the need for the #property tester_indicator dependency.Resource Management: Included Indicator Release() in the OnDeinit() block to ensure system memory is cleared when the EA is removed from the chart—a mandatory requirement for professional validation.3. Professional Risk & Compliance Features Several "under-the-hood" updates ensure the EA works reliably across different brokers and account types: Price Normalization: All trade prices (Entry, Stop Loss, and Take Profit) are automatically processed through Normalize Double() to match the specific digit precision of the broker (e.g., 3-digit vs 5-digit).Broker Safety Checks: Stop Level Check: The EA automatically queries the broker’s minimum allowed distance (SYMBOL_TRADE_STOPS_LEVEL) to prevent "Invalid Stops" errors. Volume Validation: Uses trade. Check Volume() to verify that the selected lot size is within broker limits and that the account has sufficient margin before sending the order. Filling Mode Auto-Detection: Automatically sets the correct filling mode (e.g., Fill or Kill vs Immediate) using SetTypeFillingBySymbol(), ensuring compatibility with ECN and Standard accounts.4. Interface & Performance Updates Tab-Specific Visibility: The UI now intelligently hides trading controls when you switch to the "Liquidity" or "FVG" tabs, keeping the workspace clean and focused on analysis. Timer-Based Updates: Critical UI elements like the P/L display and Next Bar Clock now update via an internal 1-second timer (OnTimer), ensuring they stay accurate even when market volatility is low and price ticks are infrequent.
