Skip to content
All library documents

Top and Bottom Breakouts as a Bar-Count Crossover Signal

Article ProRealCode

Summary

This indicator tracks breakouts beyond recent lows and highs over configurable lookback periods. Each new bearish breakout resets a counter for bars elapsed since that low event; each bullish breakout resets a separate counter since the high event. A buy signal occurs when the low-breakout counter crosses above the high-breakout counter, while a sell signal occurs on the reverse crossover. The display also plots both counters and colors the background according to which is larger.

The document provides indicator logic and example code converted from another platform, with both lookback settings shown as 14. It offers no test results or evidence that the crossovers predict profitable trades. The method compares the ages of the latest breakout events rather than measuring breakout magnitude or price trend directly. The supplied explanation and code are the basis for understanding the signal; the document does not specify trade exits, risk controls, or how to handle market regimes where the counters repeatedly cross.

Key ideas

  • The method resets separate bar counters after breakouts of recent lows and highs.
  • A buy signal follows when the low-breakout counter crosses above the high-breakout counter.
  • A sell signal follows when the high-breakout counter becomes larger through a crossover.
  • The example uses equal lookback periods of 14 bars.
  • No performance testing, exits, or risk rules are reported.

Tags

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