To build a screener for any time frames using structure breaks

Forums ProRealTime English forum ProScreener support To build a screener for any time frames using structure breaks

Viewing 4 posts - 1 through 4 (of 4 total)
  • #229976

    Hi Nicolas or Anyone,

    Can you please help me build this below logic into a screener for pro real time. I want the screener to give me if triangle appears on current or previous candle for any timeframes. Mostly I will using it on Weekly timeframes. Can anyone please help. Many thanks!



    // This source code is subject to the terms of the Mozilla Public License 2.0 at
    // © VenugopalAru
    indicator(“Structural breaks”, overlay = true, max_boxes_count=500, max_lines_count=500)
    pivotLookup  =, minval=1, maxval=5,title=’Pivot Lookup’, group=’Pivots’, tooltip=’Minimum = 1, Maximum = 5′)
    plotPPDD = input.bool(defval=true, title=”Plot PPDD OB’s”, group=’Qualitative indicators’, tooltip=’Premium Premium Discount Discount (PPDD) is an OB formed after liquidity sweep. It will show up by default as a triangle (Bull ▲ / Bear ▼). Also PPDD1 (by deafult maked with a x-cross ⨯) which is a weak OB formed after liquidity sweep, that fails to completely engulf the high/low, but closes beyond the trapped candles open price.’)
    ppddBullColor = input.color(, 0), title=”Bullish PPDD OB’s Color”, group=’Qualitative indicators’, inline=’PPDD Color’)
    ppddBearColor = input.color(, 0), title=”Bearish PPDD OB’s Color”, group=’Qualitative indicators’, inline=’PPDD Color’)
    isUp(index) =>
        close[index] > open[index]
    isDown(index) =>
        close[index] < open[index]
    isObUp(index) =>
        isDown(index + 1) and isUp(index) and close[index] > high[index + 1]
    isObDown(index) =>
        isUp(index + 1) and isDown(index) and close[index] < low[index + 1]
    //////////////////// Pivots ////////////////////
    hih = ta.pivothigh(high, pivotLookup, pivotLookup)
    lol = ta.pivotlow(low , pivotLookup, pivotLookup)
    top = ta.valuewhen(hih, high[pivotLookup], 0)
    bottom = ta.valuewhen(lol, low [pivotLookup], 0)
    //////////////////// Premium Premium & Discount Discount //////////////////
    brearishTriangle = plotPPDD and isObDown(0) and ((math.max(high, high[1]) > top and close < top) or (math.max(high, high[1]) > top[1] and close < top[1]))
    bullishTriangle = plotPPDD and isObUp(0) and ((math.min(low, low[1]) < bottom and close > bottom) or (math.min(low, low[1]) < bottom[1] and close > bottom[1]))
    plotshape(brearishTriangle, “Bearish PPDD OB”, style=shape.triangledown , location=location.abovebar, color=ppddBearColor, size=size.tiny)
    plotshape(bullishTriangle, “Bullish PPDD OB”, style=shape.triangleup , location=location.belowbar, color=ppddBullColor, size=size.tiny)




    Here is the code:


    Here is the code:

    Hi Ivan, thanks for responding. I tried running this screener looks like its not working, it is not returning me any stocks both on weekly or daily. Can you please check it.




    The code works properly.
    You can see in this post the results in USA Tech 600.

Viewing 4 posts - 1 through 4 (of 4 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login