Skip to content
All library documents

Opposite-Position Entries with Stop Loss and Trailing Stop

Article MQL5 code base

Summary

The Expert Advisor described opens two opposing positions when a new bar forms. Its intended outcome is for one position to close at a stop loss while the other can remain profitable through a trailing stop. The example is framed around EUR/USD on a one-minute chart.

The document highlights a backtesting detail: entries occur only at bar formation, but the trailing-stop condition is checked on every tick. It recommends comparing real-tick and standard every-tick simulation modes because the difference in tick generation can affect how trailing behavior is represented. No performance results, position sizing rules, or evidence that the paired-position approach is profitable are provided.

Key ideas

  • The Expert Advisor opens two opposite positions at the start of a new bar.
  • One position uses a stop loss, while the other uses a trailing stop to pursue gains.
  • Entry checks occur on new bars, while trailing conditions are evaluated on each tick.
  • Backtests should compare real-tick and standard every-tick modes because simulation detail may affect trailing behavior.

Tags

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