Specification
Objective: Develop a fully functional Expert Advisor (EA) based on the breakout trading strategy outlined below. The EA should be capable of placing a single trade per breakout per day, following strict entry and exit rules, and displaying a performance dashboard with key account metrics.
Key Trading Strategy Requirements:
-
Single Entry Per Breakout:
-
The EA must ensure that only one entry is placed per breakout event each day.
-
If a breakout occurs at the top (above a specific price level), the EA will execute a buy trade.
-
If a breakout occurs at the bottom (below a specific price level), the EA will execute a sell trade.
-
-
Handling TP Hits and Breakout Reversals:
-
After a top breakout and a successful TP hit, if the price comes back inside the breakout zone (the previous range), no further buy entry should be placed, even if the price breaks the top again.
-
If the price breaks out to the top, hits the TP, and then reverses and breaks the bottom, the EA should execute a sell order.
-
Only one entry (either buy or sell) is allowed per breakout per day, regardless of whether the price retraces or breaks the same level again.
-
-
Entry Timing:
-
The EA should place an entry only after the current candlestick on the chart has closed (on the current TF).
-
The entry should be placed at the opening price of the next candlestick after the current one closes, if the breakout condition is met.
-
For example, if the breakout happens at the top, and the current candlestick closes, the EA will place a buy order at the opening price of the next candlestick.
-
-
TP and SL:
-
The EA should be configured to allow a take-profit (TP) and stop-loss (SL) to be set based on specific parameters (such as ATR, fixed pip distance, etc.). These parameters should be adjustable.
-
-
Performance & Accuracy:
-
The EA must be fully functional, with proper risk management (including handling market gaps and slippage).
-
The EA must be able to run in real-time trading conditions without errors or performance issues, such as placing trades too early or too late after breakout events.
-
Dashboard Requirements:
A performance dashboard should be integrated into the EA to display key account metrics in real-time. The dashboard should update continuously with the following data:
-
Equity: Current account equity (including open trade values).
-
Daily Profit: Total profit or loss made today (since the beginning of the current trading day).
-
Weekly Profit: Total profit or loss made this week (since the start of the current week).
-
Monthly Profit: Total profit or loss made this month (since the start of the current month).
-
Account Growth (%): Percentage change in account equity since the account was opened or the last reset.
-
Total Drawdown: The total drawdown from the highest account equity point (calculated as a percentage).
The dashboard should be clearly visible on the chart, ideally in a non-intrusive corner, with the option to customize the font size and color. The information should be updated in real-time and displayed in an easy-to-read format.
Additional Notes:
-
Timeframe Compatibility: The EA should be optimized for use on M5 (5-minute) timeframe charts, but should also allow flexibility for use on other timeframes if needed.
-
Risk Management: The EA should incorporate proper risk management features, such as adjustable lot sizes, risk-to-reward ratio, and maximum drawdown limits.
-
Trade Execution: Ensure the EA places trades accurately and promptly after breakouts, considering factors like market slippage and spread.
-
No More Than One Entry Per Breakout: Ensure that the EA does not place multiple entries for the same breakout event on the same day.