Bullish and Bearish Breakout Screener

Bullish and Bearish Breakout Screener

A few months ago, we shared an indicator on ProRealCode called the Market Structure Breakers Indicator (you can read the full article here). This indicator was designed to identify breaks in market structures, both bullish and bearish, based on pivots and key points on price charts.

Today, we take it a step further with the development of a screener that uses this logic of breakouts to automatically scan markets and find assets meeting these conditions. This screener allows traders to detect trading opportunities in real time, simplifying decision-making.

In the following sections, we’ll explain how to configure and use this screener, detail its internal logic, and provide the full code so you can implement and adapt it to your needs.

Screener Configuration

The Market Structure Breakers screener is designed to identify market structure breakouts using logic based on pivots and key levels. It identifies both bullish and bearish breakouts, assigning “Long” or “Short” signals accordingly.

Configurable Parameter: length

  • length: This parameter determines the number of bars used to calculate pivots and validate breakouts. By default, it is set to 20, but you can adjust it depending on the timeframe or behavior of the analyzed asset.

Signal Conditions

  • “Long” Signal (Bullish Breakout): Generated when the price breaks through a previous bearish structure, indicating a possible shift toward an uptrend.
  • “Short” Signal (Bearish Breakout): Triggered when the price breaks through a previous bullish structure, suggesting a potential move toward a downtrend.

These configurations allow the screener to adapt to various strategies and trading styles, whether intraday, swing, or long-term positions.

How the Screener Works

The Market Structure Breakers screener is based on a structured logic that combines pivots, market structures, and key breakouts to generate precise signals. Here’s how it works:

Identifying Pivots

  • For bullish structures (Bullish Breaker), high pivots are detected if:
    • The current high is lower than a reference value (high[length]).
    • This reference value is the highest high within the last length periods.
    • This high is higher than the maximum from an earlier period (highest[length](high)[length+1]).
  • For bearish structures (Bearish Breaker), low pivots are identified if:
    • The current low is higher than a reference value (low[length]).
    • The lowest low within the last length periods is above the low of an earlier period.

Testing Market Structures

  • Bullish Structures:
    • Once a high pivot is identified, it validates if the current close (close) is higher than the most recent high pivot ($ph).
    • If true, the breakout level is stored, and a bullish continuation signal is triggered.
  • Bearish Structures:
    • Similarly, it checks if the current close is below the most recent low pivot ($pl).
    • If this condition is met, a bearish breakout signal is generated.

Detecting Breakouts

  • The screener constantly evaluates for key breakouts:
    • For bullish breakouts, it detects when the close is above the structure level while the open remains below it.
    • For bearish breakouts, the opposite occurs: the close is below, and the open is above the relevant level.

Generating Signals

  • The screener uses the variables checkup and checkdw to mark bullish and bearish breakouts, respectively:
    • checkup: Indicates a bullish breakout (“Long”).
    • checkdw: Indicates a bearish breakout (“Short”).
  • These signals are evaluated and displayed in real time, allowing for data-driven decision-making.

Screener Code

Below is the full code for the Market Structure Breakers screener, including comments for easier understanding and implementation in ProRealTime.

Conclusion

The Market Structure Breakers screener is a powerful tool for detecting key market structure breakouts, providing clear, data-driven signals. Building upon the original indicator, this screener automates breakout detection and displays real-time results, enabling swift action.

Its flexibility makes it suitable for various strategies, from intraday trading to long-term investing. Furthermore, its high customizability allows you to tailor it to your specific needs by adjusting the length parameter or combining it with other indicators for enhanced precision.

We invite you to try this screener on your ProRealTime platform and share your experiences with the community. Remember, the best way to refine a tool is through usage and feedback.

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

avatar
Register or

Likes

avatar
Related users ' posts
Razz Good morning What do I have to change in the code in line 30 to only see the current day? P...

Top