Skip to content
All library documents

Time-Based Trading with Scheduled Entries and Exits

Article MQL5 code base

Summary

This document describes an Expert Advisor that opens trades at a configured time and can close them at another configured time. Users can enable buy orders, sell orders, or both, and set the entry time, entry window duration, trade volume, stop loss, and take profit. Optional trailing-stop settings include a distance and step, while a magic number identifies the advisor’s trades.

The accompanying guidance recommends optimizing the important parameters first, then selecting a candidate configuration and optimizing the remaining settings in a second pass. The document mentions an example result for EUR/USD on an hourly chart, but provides no performance figures or details about the test period, settings, costs, or robustness. It explains configurable mechanics rather than presenting a validated trading edge; performance would depend on the chosen schedule and parameter values.

Key ideas

  • The advisor can open trades at a specified hour and minute within a configured duration.
  • Buy and sell permissions can be controlled independently.
  • Positions can use scheduled closing, stop loss, take profit, and trailing stops.
  • The suggested workflow optimizes key settings first and remaining settings in a second pass.
  • The excerpt mentions an EUR/USD hourly example without reporting its results or test details.

Tags

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