Skip to content
All library documents

Using Stochastic Momentum Across OHLC Values to Color Candles

Article MQL5 code base

Summary

This indicator adapts the Stochastic Momentum Indicator by calculating momentum for the open, high, low, and close, then using the values to show bar development through colored candles. For a lookback period, it compares price with the midpoint between the period’s highest and lowest prices. One selectable formula expresses the difference as an absolute amount; another scales price relative to that midpoint as a percentage. The indicator’s color buffer can also be queried to identify bar direction.

The author suggests interpreting sustained readings above or below the center line as trend evidence, and center line crossings as possible directional changes. A crossing followed by a return across the line after an extended move may suggest continuation. These are proposed uses rather than validated rules: the page reports no backtest, instrument, or performance results. It also notes that a large current bar can shift the center line and visually displace the bar; whether this behavior is useful remains untested.

Key ideas

  • The indicator calculates Stochastic Momentum for all four OHLC price values.
  • It offers absolute and percentage forms of the momentum calculation.
  • Sustained readings on one side of the center line may indicate a trend.
  • Center line crossings can suggest a directional change or, in some cases, trend continuation.
  • A large bar can shift the center line and create a display effect that remains untested.

Tags

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