Building a UT Bot Expert Advisor with Confirmed-Bar Signals and ATR Stops
Summary
This tutorial turns a custom UT Bot Alerts indicator into an MQL5 Expert Advisor. It emphasizes reading indicator buffers reliably and synchronizing decisions with new bars. The EA evaluates the signal from the most recently closed candle, avoiding unstable values on the forming bar and preventing repeated decisions during a candle. It supports long-only, short-only, or two-way trading, and closes an existing position in the opposite direction before considering a new entry.
Optional protective stops are based on the ATR of the last closed bar, while profit targets are set using a reward-to-risk ratio. The tutorial also describes isolating the EA's trades with a magic number and separating signal reading, decision logic, and order execution into dedicated functions. It supplies a Strategy Tester setup and parameter files for experiments on gold using daily bars over a stated period, but the provided text does not include their results. It therefore teaches implementation and testing procedures rather than establishing profitability; execution details, indicator behavior, and risk settings still require independent validation.
Key ideas
- The EA acts only when a new bar opens and evaluates signals from the previous, completed candle.
- It reads UT Bot Alerts indicator buffers and offers long-only, short-only, or two-way trade settings.
- Opposite-direction positions are closed before a new signal is considered.
- Optional stop losses use ATR, and profit targets follow a configurable reward-to-risk ratio.
- The article provides a historical testing procedure but no performance results in the supplied text.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.