Simple breakout from consolidation screener

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #126669 quote
    APM2023
    Participant
    New

    Hello PRT community,

    I would very much appreciate some assistance with coding in PRT for a simple breakout screener. I have tried many ways to do this without success.

    I would like to code the following for a Daily System:

    For a long position:

    1. The Supertrend(5,15) to be above the high of the previous 7 days and
    2. The Supertrend (5,15) to be the same for the previous seven days; and
    3. The supertrend (5,15) of the current day is below the low of the current day; and
    4. The close of the current day is greater that the Supertrend(5,15) of the previous 7 days; and
    5. The close of the current day is greater than the open of the current day.

    The long position looks to identify the candle identified by the arrow in the chart below:

    The Short position is essentially the opposite of the Long position:

    1. The Supertrend(5,15) to be below the low of the previous 7 days and
    2. The Supertrend (5,15) to be the same for the previous seven days; and
    3. The supertrend (5,15) of the current day is above the high of the current day; and
    4. The close of the current day is less that the Supertrend(5,15) of the previous 7 days; and
    5. The close of the current day is less than the open of the current day.

    Thank you for your time and assistance.

    long-position.png long-position.png
    #126719 quote
    Nicolas
    Keymaster
    Master

    Here is the code for that breakout screener from consolidation. Signals are identified separately in the ProScreener sorting criteria column: 1 = bullish breakout ; -1 = bearish breakout

    st = Supertrend[5,15]
    
    b1 = summation[7](st>high)[1]=7
    b2 = summation[7](st=st[1])[1]=7
    b3 = st<low
    b4 = close>highest[7](st)[1]
    b5 = close>open
    
    buyc = b1 and b2 and b3 and b4 and b5
    
    s1 = summation[7](st<low)[1]=7
    s2 = summation[7](st=st[1])[1]=7
    s3 = st>high
    s4 = close<lowest[7](st)[1]
    s5 = close<open
    
    sellc = -(s1 and s2 and s3 and s4 and s5)
    
    screener[buyc or sellc<0](buyc+sellc)
    
    consolidation-breakout.png consolidation-breakout.png
    #127170 quote
    APM2023
    Participant
    New

    Nicolas,

    Thank you very much for your assistance. With all the attempts in the world I do not believe I would have been able to work out the coding.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Simple breakout from consolidation screener


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
APM2023 @antmenn Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by APM2023
5 years, 11 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 04/18/2020
Status: Active
Attachments: 2 files
Logo Logo
Loading...