Skip to content
All library documents

Intrabar Stochastic Crossover Signals with Position Trailing

Article MQL5 code base

Summary

This Expert Advisor trades on every tick within the current bar and allows only one open position at a time, making it suitable for either hedging or netting account modes. A sell signal occurs when the main Stochastic line on the current bar is below its signal line while at least one line is above the upper threshold of 80. The buy conditions reverse the sell conditions. If an opposite position exists, the EA closes it and opens a position in the new direction.

The EA also trails an open position, with its first modification moving the stop to guaranteed breakeven, according to the description. The cited example uses EURUSD on a 12-hour chart and specifies real-tick testing. The text explains the signal and basic position behavior but provides no performance results, entry or exit risk analysis, or details about costs and parameter robustness. Because the conditions use the forming bar, signals may change before the bar closes; the excerpt does not discuss how that affects live execution or testing.

Key ideas

  • The EA evaluates Stochastic conditions on every tick within the active bar.
  • A sell requires the main Stochastic line to be below its signal line while at least one line exceeds the upper threshold.
  • Buy conditions reverse the sell conditions, and an opposite position is closed when a new signal appears.
  • Trailing moves the position to breakeven on its first modification.
  • The description gives no profitability or robustness evidence and does not discuss the effects of intrabar signal changes.

Tags

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