Skip to content
All library documents

Bar-by-Bar Trading from a Three-Bar Closing-Price Comparison

Article MQL5 code base

Summary

The document describes a simple MetaTrader trading rule that compares closing prices across bars. On each bar, it opens a sell position when the first bar’s close exceeds the third bar’s close, and opens a buy position when the third bar’s close exceeds the first bar’s close. The author says the condition can be changed by editing the order-entry logic.

This is a minimal signal description rather than a complete strategy specification. It gives no position sizing, exit rules, transaction-cost assumptions, market or timeframe scope, or backtest evidence. Because it calls for an order on each bar when the comparison holds, the rule may generate repeated entries; the document does not explain how positions are managed or how conflicting conditions are handled.

Key ideas

  • The rule compares the closes of the first and third bars.
  • It opens a sell when the first close is higher than the third close.
  • It opens a buy when the third close is higher than the first close.
  • The signal is evaluated on each bar, with no stated exit or position-management rules.
  • No backtest evidence or cost assumptions are provided.

Tags

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