Daily Breakout Stop Orders with Breakeven
- Experts
-
Hariz Karamovic
Experienced algorithmic trader and automation enthusiast specializing in the development, rigorous backtesting, and practical deployment of MQL5 Expert Advisors for MetaTrader 5. - Versione: 1.23
- Attivazioni: 5
Daily Breakout Stop Orders with Breakeven & Notifications (V1.23)
Daily Breakout Stop Orders V1.23 is a robust, professional automated Expert Advisor designed to capture daily market momentum by trading breakout stop orders based on the previous day’s high and low price range. Building upon the reliable mechanics of our core breakout framework, this enhanced version introduces an advanced automatic Breakeven module and real-time mobile push notifications, ensuring you stay fully informed and protected even when away from your trading terminal.
Key Features
- Automated Daily Range Breakout: Automatically reads the previous day's High and Low, calculates the ATR, and places pending Buy Stop and Sell Stop orders at optimized breakout levels with predefined Stop Loss and Take Profit distances.
- Built-in Breakeven Management: Automatically manages open positions by shifting the Stop Loss to entry (or locking in a small custom profit) once the price moves in your favor by a specified risk multiplier ($1R$).
- Instant Mobile Push Notifications: Integrated SendNotification triggers alert you instantly on your mobile device when a pending order is filled and when the Stop Loss is successfully secured at breakeven.
- Strict Time Window Control: Opens positions precisely at your configured setup hour and automatically cleans up (deletes) unexecuted pending orders at the designated end time to avoid overnight exposure.
- Smart OCO & Single-Pair Logic: Executes a disciplined one-cancels-other approach with daily execution locks to prevent double-entry and over-leveraging.
- Manual Reset UI with Safety Lock: Features an interactive chart button equipped with a two-click confirmation safeguard allowing you to safely reset the daily attempt window when desired.
- Robust State Persistence: Utilizes terminal Global Variables to securely track daily execution states, preventing duplicate trades even if the platform restarts.
Input Parameters
Basic Settings
- InpMagicNumber – Unique identifier for trades (default: 630001).
- InpFixedLot – Fixed trading volume if risk percentage is disabled (default: 0.10).
- InpUseRiskPercent – Enable dynamic lot sizing based on account equity and risk percentage.
- InpRiskPercent – Percentage of account equity risked per trade (default: 0.50%).
- InpMaxSpreadPoints – Maximum allowed spread filter to block entries during high volatility (default: 50).
- InpSlippagePoints – Maximum allowed slippage in points (default: 20).
Breakout Settings
- InpATRPeriod – Period for the Average True Range volatility calculation (default: 14).
- InpBreakoutBufferATR – Buffer added to previous day's high/low based on ATR (default: 0.2).
- InpSL_ATR – Stop Loss multiplier based on ATR (default: 1.5).
- InpTP_ATR – Take Profit multiplier based on ATR (default: 2.5).
Breakeven (Experimental / Advanced)
- InpUseBreakeven – Master switch to enable or disable automatic breakeven management (default: false).
- InpBE_TriggerR – Activates breakeven once price moves in profit by this multiple of initial risk ($1R$, default: 1.0).
- InpBE_LockPoints – Locks in a small profit above/below entry price in points (0 = exact breakeven).
Server Time Schedule
- InpSetupHour / InpSetupMinute – Time of day when pending orders are placed (default: 08:00).
- InpDeleteHour / InpDeleteMinute – Time of day when unexecuted pending orders are removed (default: 22:00).
Technical & UI
- InpCleanupRetrySec – Retry interval for order cleanup routines.
- InpStatusIntervalSec – Status logging frequency.
- InpEnableManualReset – Enables the on-chart reset button utility.
Recommendations & Best Settings
- Timeframe: Optimized for M5 or M15 charts (analysis relies on D1 and H1 data structures).
- Symbols: Highly effective on major Forex pairs and Gold (XAUUSD).
- Account Type: Fully compatible with both Hedging and Netting accounts.
- VPS Setup: For optimal performance and reliable mobile notification delivery, running the EA on a low-latency Virtual Private Server (VPS) with "Never Sleep" configuration is highly recommended.
Disclaimer: Trading foreign currency and cryptocurrencies carries a high level of risk and may not be suitable for all investors. Past performance is not indicative of future results. The developer assumes no responsibility for any losses incurred using this Expert Advisor. Use it at your own risk.
