Skip to content
All library documents

Parabolic SAR Rules for Trailing an Open Position’s Stop Loss

Article MQL5 code base

Summary

This note describes a utility that trails an open position’s stop loss using Parabolic SAR on a selected timeframe. For a buy position, it considers moving the stop when the prior bar’s SAR is above the entry price and below that bar’s low. For a sell position, the comparisons are reversed: SAR must be below the entry price and above the prior bar’s high. In either case, the SAR point must have formed after the position was opened.

The configurable inputs are the timeframe, SAR step, and maximum step; the document gives default values for the two indicator parameters. It explains the update conditions but does not provide performance results, entry rules, or a broader trading strategy. The method therefore offers a mechanical stop adjustment rule, not evidence that SAR trailing improves returns or controls risk in all market conditions. Its behavior will depend on timeframe, parameter choices, and price movement.

Key ideas

  • The utility bases stop adjustments on Parabolic SAR from a configurable timeframe.
  • Buy and sell positions use mirrored comparisons between SAR, entry price, and the prior bar’s extreme.
  • The SAR value must have formed after the position was opened.
  • The SAR step and maximum step are configurable indicator parameters.

Tags

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