Skip to content
All library documents

Opening Range Breakout with Account-Level Risk Controls

Article MQL5 code base

Summary

This educational strategy template trades breakouts of the high and low formed during a defined period after the session opens. It places stop orders on both sides of the range and cancels the opposite order after one triggers, limiting the approach to one trade per day. Positions are closed before the session ends. The example targets a US100/Nasdaq 100 CFD, while its range is calculated from one-minute data regardless of the chart timeframe; session inputs must be adjusted to the broker’s server time.

Risk controls set position size from a chosen percentage of account balance and the stop distance, with trades skipped when the minimum lot would exceed the permitted risk. Inputs also include a take-profit multiple, daily loss limit, and maximum drawdown threshold that closes positions and halts the EA. The document provides no performance results, and the template is not evidence of profitability; it recommends testing in a strategy tester and on a demo account before live use.

Key ideas

  • The strategy places opposing stop orders beyond the high and low of an opening range.
  • After one order fills, the other is canceled, and the system allows only one trade per day.
  • Position size depends on the selected risk percentage and stop distance.
  • The EA skips trades when its minimum lot would breach the allowed risk.
  • A maximum drawdown threshold closes positions and stops the system.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.