Skip to content
All library documents

Directional Frequency: A Close-Range Trend Coloring Indicator

Article ProRealCode

Summary

Directional Frequency labels price as bullish or bearish by comparing the current close with the midpoint between the highest and lowest closes over a chosen lookback period. The example sets the lookback to 14 by convention and colors candles green when the close is above that midpoint and red when it is below. It also exposes the rolling high, low, and midpoint as outputs.

The document presents this as a simple visual trend indicator and allows the period to be adjusted. It gives no performance tests, entry or exit rules, or evidence that the signal predicts future returns. The midpoint comparison alone does not define how to handle a close exactly at the midpoint, and the source code does not set candle colors in that case. Traders would need to evaluate the indicator across instruments and timeframes and specify risk controls before using it in a strategy.

Key ideas

  • The indicator compares each close with the midpoint of the rolling highest and lowest closes.
  • A close above the midpoint is colored green, while a close below it is colored red.
  • The lookback period is adjustable, with 14 used as a conventional default.
  • The document offers no backtest or evidence of predictive performance.

Tags

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