Advanced Multi TF Forex Robot
Prompt
Create a professional and advanced Multi Timeframe Forex Trading Robot for MetaTrader 5 (MT5) implementing the specified swing trading, trend following, and multi-timeframe analysis and execution strategy. Details and Requirements: 1. Indicators Setup: - Daily Timeframe (HTF): - RSI with 25 period; buy signal level 54, sell signal level 46. - ATR with 14 period. - 1 Hour Timeframe (Semi HTF): - RSI with 25 period; buy level 54, sell level 46. - ATR with 14 period. - 15 Minutes Timeframe (LTF): - RSI with 7 period; buy level 27, sell level 73. - ATR with 14 period. 2. Entry Logic: - Buy Entries: - HTF: First buy when RSI 25 crosses above 54 from below 46; then switch to Semi HTF. - Semi HTF: Confirm HTF RSI > 54; enter buy when Semi HTF RSI crosses above 54; then switch to LTF. - LTF: Confirm Semi HTF RSI >= 46; enter buy on all RSI 7 crosses above 27 at candle close maintaining Semi HTF RSI restriction. - Sell Entries: - HTF: First sell when RSI 25 crosses below 46 from above 54; then switch to Semi HTF. - Semi HTF: Confirm HTF RSI < 46; enter sell when Semi HTF RSI crosses below 46; then switch to LTF. - LTF: Confirm Semi HTF RSI <= 54; enter sell on all RSI 7 crosses below 73 at candle close maintaining Semi HTF RSI restriction. 3. Trade Management: - Lot Size: Base lot of 0.5% per trade of account balance, with manual override option (default 1 lot). - Stop Loss: 2 times ATR. - Take Profit: 6 times ATR for HTF and Semi HTF trades; 4 times ATR for LTF trades. - Optional Breakeven: Activate when price moves 2.5 times ATR plus 0.5 ATR buffer. - Daily Drawdown Limit: 4% of account. 4. Customizability: Allow full customization of all indicator parameters and trade management settings. 5. Additional Features: - Assign unique Magic Number and include trade comments for identification. - Implement a professional dashboard displaying: - Trend direction and signal status for each timeframe. - Current account profit/loss. - Drawdown. - Equity information. 6. Performance and Reliability: - Optimize code to prevent memory leaks, array overflows, and lag. - Include robust error handling and input validations. # Steps - Implement RSI and ATR indicators as specified for each timeframe. - Monitor timeframe-specific RSI crosses for trade signals according to the detailed entry logic. - Manage trades with configurable lot sizing, stop loss, take profit and breakeven according to ATR-based multipliers. - Enforce daily drawdown limits. - Develop a user-configurable dashboard reflecting real-time trend and account statistics. - Ensure code optimization and stability with proper error handling. # Output Format Provide the full MT5 Expert Advisor code, properly commented, modularized, and adhering to MQL5 standards. Include instructions or comments on how to configure parameters and integrate the EA into MT5. # Notes - All crossovers and RSI level checks should occur on candle close to avoid false signals. - Ensure synchronization between timeframes. - Allow switching timeframe parameters, entry thresholds, and trade management parameters via input variables. - Maintain clear trade identification via magic numbers and comments for multi-instance management. - Dashboard must be responsive and resource-efficient. Your solution should produce a reliable, customizable, and professional-grade MT5 Forex Robot implementing the strategy precisely as specified.
Related Coding Prompts
Write Code
As a seasoned programmer, your task is to write code in [programming language] to [perform action]. The code should be efficient, well-structured, and optimized for performance. Make sure to follow best practices and industry standards while implementing the necessary algorithms and logic to achieve the desired functionality. Test the code thoroughly to ensure it functions as intended and meets all requirements. Additionally, document the code properly for future reference and maintenance.
Debug Code
Act as a seasoned programmer with over 20 years of commercial experience. Analyze the provided [piece of code] that is causing a specific [error]. Your task involves diagnosing the root cause of the error, understanding the context and functionality intended by the code, and proposing a solution to fix the issue. Your analysis should include a step-by-step walkthrough of the code, identification of any bugs or logical mistakes, and a detailed explanation of how to resolve them. Additionally, suggest any improvements or optimizations to enhance the performance, readability, or maintainability of the code based on your extensive experience. Ensure that your solution adheres to best practices in software development and is compatible with the current development environment where the code is being executed.
Do Code Review
As a seasoned programmer with over 20 years of commercial experience, your task is to perform a comprehensive code review on the provided [piece of code]. Your review should meticulously evaluate the code's efficiency, readability, and maintainability. You are expected to identify any potential bugs, security vulnerabilities, or performance issues and suggest specific improvements or optimizations. Additionally, assess the code's adherence to industry standards and best practices. Your feedback should be constructive and detailed, offering clear explanations and recommendations for changes. Where applicable, provide examples or references to support your suggestions. Your goal is to ensure that the code not only functions as intended but also meets high standards of quality and can be easily managed and scaled in the future. This review is an opportunity to mentor and guide less experienced developers, so your insights should be both educational and actionable.