Skip to content
All library documents

A Heikin-Ashi Color-Change Strategy with Trading-Hour Limits

Article MQL5 code base

Summary

This MetaTrader 5 expert advisor uses changes in the CandlesticksBW indicator’s candle color as trend-change signals. It evaluates signals when a bar closes and lets the operator restrict trading to a selected daily time window. The documented defaults allow trading from midnight and close open positions near the end of the day; if the start time is later than the end time, the closing time is interpreted as occurring the next day.

The document reports that default settings were tested on GBPUSD at the four-hour interval over 2016, and refers to a chart of the results. It gives no numerical performance statistics in the supplied text, so the quality, robustness, and transaction-cost sensitivity of the results cannot be assessed. Stop loss and take profit were not used in testing, limiting what the test can establish about risk controls. The EA also depends on a separately compiled indicator being available to the terminal.

Key ideas

  • The EA treats a CandlesticksBW color change on a closed bar as a trend-change signal.
  • Inputs define the permitted trading start and end times.
  • Positions are closed at the configured end time, including when that time falls on the following day.
  • A GBPUSD four-hour test for 2016 is mentioned, but numerical results are not included in the text.
  • The reported test used no stop loss or take profit.

Tags

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