Skip to content
All library documents

Contrarian Channel Entries with Virtual Take Profit

Article MQL5 code base

Summary

This expert advisor uses a price channel calculated from a selected number of bars, starting with bar one. It compares the current bar’s close with the channel extremes and takes a contrarian position: a close below the minimum triggers a buy, while a close above the maximum triggers a sell. The description therefore presents a channel-based reversal rule rather than a conventional breakout entry.

Take profit is handled virtually: the program monitors the position and closes it at market when the target is reached, rather than placing a broker-side take-profit order. The document explains the entry and exit concept but supplies no parameter values, stop-loss rule, position-sizing method, backtest, or performance evidence. Results would depend on channel length, target settings, execution conditions, and the behavior of the market; the brief description does not evaluate those choices.

Key ideas

  • The channel is calculated from prior bars beginning at bar one.
  • A close below the channel minimum triggers a buy, and a close above the maximum triggers a sell.
  • The entry rule takes positions against moves beyond the channel extremes.
  • The virtual take-profit closes positions at market when its target is reached.
  • The description provides no backtest, stop-loss rule, or position-sizing guidance.

Tags

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