Skip to content
All library documents

MQL5 Long-Entry Scripts with Fixed Stops and Risk-Based Volume

Article MQL5 code base

Summary

The document describes four MQL5 scripts for opening long positions with stop loss and take profit distances specified in points from the current price. Two variants submit protective orders along with the trade for brokers that support this approach and have nonzero spreads. Two ECN variants first open the position without those orders, then modify it to add them, a sequence presented for brokers where simultaneous placement may be unsuitable.

The scripts offer two approaches to sizing. The standard versions use a money-management input tied to a share of account equity for deal volume. The X versions instead target a configured share of equity as the loss if the stop is triggered. Inputs also cover price deviation and retry behavior after unsuccessful deals. These are execution and sizing utilities, not evidence of a profitable entry signal. The document supplies parameter examples but no backtest results, broker-specific compatibility tests, or analysis of slippage and actual realized loss, so users must verify behavior under their own trading conditions.

Key ideas

  • The scripts open buy positions with fixed stop-loss and take-profit distances in points.
  • ECN variants place protective orders after opening the position.
  • Standard variants size trades using a configured share of account equity.
  • X variants set volume based on a target equity loss if the stop is reached.
  • The document gives no performance or broker compatibility evidence.

Tags

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