Skip to content
All library documents

Pending Limit Orders with Triggered-Order Cancellation and Daily Closure

Article MQL5 code base

Summary

This MetaTrader expert advisor places buy limit and sell limit orders when its conditions are checked at the start of a new bar. If one order triggers, it removes the remaining pending orders. The description also says position trailing is checked on every tick, and that at 23:50 each day it cancels pending orders and closes open positions.

Inputs let the user set order volume, stop loss, take profit, trailing distance and step, and a unique identifier. The document reports a test setup covering all symbols on daily data from 2018-01-01 to 2018-05-08, but gives no performance results, entry conditions, or rationale for the order levels. It therefore describes operational behavior rather than a complete trading strategy, and the stated test period alone does not establish profitability or robustness.

Key ideas

  • The advisor evaluates pending-order placement conditions when a new bar appears.
  • It places buy limit and sell limit orders.
  • When one pending order triggers, the advisor removes the others.
  • Trailing checks occur on each tick, while a daily routine closes positions and removes pending orders at 23:50.
  • The document provides a test period but no performance evidence or details of the entry logic.

Tags

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