Skip to content
All library documents

Two-Timeframe XPeriodCandle Trend-Following System

Article MQL5 code base

Summary

This Expert Advisor combines two smoothed XPeriodCandle indicators across different timeframes. A slower indicator sets the prevailing trend from the color of its most recently closed candle, while a faster indicator provides entries when its candle color changes. A signal is considered at bar close only when the fast direction has changed and agrees with the slow trend. The described configuration separates a higher timeframe filter from a lower timeframe entry signal, and includes controls for long and short permissions, signal bars, smoothing, and trend based position exits.

The parameter list also includes deposit-based sizing, stop loss, take profit, and price-deviation settings. The document says the displayed tests used default parameters and omitted stop loss and take profit, and mentions a historical XAUUSD test with a daily trend filter and hourly entries. The results themselves are not included in the text, so no profitability or robustness conclusion can be drawn. The indicator files and platform-specific components are required for operation.

Key ideas

  • The system filters entries through agreement between a slower trend indicator and a faster signal indicator.
  • Entries occur at bar close when the fast indicator changes direction in line with the slow trend.
  • Inputs control timeframe, candle calculation, smoothing, signal bars, trade permissions, sizing, and exits.
  • The document mentions a historical gold test but does not provide its results in text.
  • The described test omitted stop loss and take profit despite those controls being available.

Tags

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