Building an MQL5 Expert Advisor with Daily Candlestick Signals and Trade Limits
Summary
This beginner-oriented project describes an MQL5 Expert Advisor that chooses a daily direction from the previous day’s candle: bearish suggests selling and bullish suggests buying. It also uses the close of the first hourly candle as a signal check. The article walks through retrieving candle open and close prices, using the trade library and a magic number, and organizing EA logic with pseudocode.
It also covers practical controls such as avoiding repeated entries on every tick, limiting simultaneous positions and daily trade counts, setting trading hours and permitted weekdays, and applying profit or loss limits. The material is a programming guide rather than evidence of a profitable strategy. Its pseudocode and prose contain inconsistencies about allowed weekdays and trade limits, so readers should reconcile the intended rules with the implementation before relying on the EA.
Key ideas
- The example EA derives a daily buy or sell bias from the prior daily candle’s open and close.
- The first hourly candle’s close is used as an additional check on trading signals.
- MQL5 price-copy functions can retrieve candle data for strategy decisions.
- A trade library and magic number help an EA place and identify its trades.
- Time, weekday, position, daily trade, and profit or loss constraints can limit automated activity.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.