Skip to content
All library documents

Adjusting Historical High and Low Stop Levels with an Offset

Article FMZ forum · Author: hope

Summary

The post presents a chart indicator that uses the highest high and lowest low over a configurable lookback, excluding the current bar, to plot proposed long and short stop-loss and take-profit levels. Its stop logic compares the distance from the current open to the relevant historical extreme with a configurable offset. When the distance is within that threshold, the stop level is adjusted by the offset; otherwise, it uses the historical extreme. Take-profit levels apply the offset multiplied by a profit-to-loss ratio.

The author raises a question about why the conditional plotting behavior does not change when the stop distance exceeds the offset. The supplied code and comments describe the intended rule but do not include a diagnosis or confirmed fix. The approach is a technical indicator example, not a tested execution strategy; it offers no performance evidence, and its levels depend on the chosen lookback and inputs.

Key ideas

  • The indicator derives reference levels from prior highs and lows over a configurable lookback.
  • It conditionally adjusts stop levels based on the distance from the current open relative to an offset.
  • Take-profit levels scale the offset by a configurable profit-to-loss ratio.
  • The post reports an unresolved issue with the conditional stop calculation and provides no verified correction.

Tags

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