52 Week High "X" days ago

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #80596 quote
    David M
    Participant
    New

    Hi All,

    New to ProRealCode and ProRealTime.

    Seeking to have a simple Market Screener that allows me to not only search for tickers making a new 52-week high, (i.e. previous daily close = 52-week high), but also to have a variable input for how many days ago it reached a 52-week high (i.e. 5-days ago, 10-days ago, 20-days ago etc.).

    Hope this is clear and imagine this is relatively easy…can anyone help?

    Thanks in advance!

    Best,

    Dave

    #80612 quote
    robertogozzi
    Moderator
    Master

    There you go:

    TIMEFRAME(weekly)
    MyHigh = highest[52](high)  //highest in 52 weeks
    TIMEFRAME(daily)
    x = (high[10] = MyHigh)     //10 days ago was true?
    TIMEFRAME(default)
    SCREENER [x]

    You can change lookback numbers as they best fit your requirements.

    David M, Nicolas and PGH thanked this post
    #81125 quote
    David M
    Participant
    New

    Roberto,

    Much appreciated!…Thank you!

    Wondering if you could help with two small refinements:

    (1) Can we add a variable/condition that filters based on volume (i.e. filter for stocks that have 20-day avg. daily volume greater than 1MM) with the idea being that the “1MM” can be modified?

    (2) Can we add a variable/condition that filters based on a price range (i.e. screen for stocks between X and Y such as $70-$100?)… and again, idea being that the range (or X’s and Y’s) can be modified?

    Thank you in advance!…Really appreciate your help!

    Best,

    Dave

    #81166 quote
    robertogozzi
    Moderator
    Master

    (1) Can we add a variable/condition that filters based on volume (i.e. filter for stocks that have 20-day avg. daily volume greater than 1MM) with the idea being that the “1MM” can be modified?
    (2) Can we add a variable/condition that filters based on a price range (i.e. screen for stocks between X and Y such as $70-$100?)… and again, idea being that the range (or X’s and Y’s) can be modified?

    On which TF would you like the filters to be applied, Weekly, Daily or Default?

    #81177 quote
    David M
    Participant
    New

    Not sure what “default” means but targeting “Daily”.

    appreciate your help Roberto, did go through the various trading videos and even numerous scans in the library to try and do it myself…just couldn’t make those refinements work.

    Thanks in advance!

    Dave

    #81212 quote
    robertogozzi
    Moderator
    Master

    This is the updated version (not tested):

    TIMEFRAME(weekly)
    MyHigh = highest[52](high)         //highest in 52 weeks
    
    TIMEFRAME(daily)
    x = (high[10] = MyHigh)            //10 days ago was true?
    y = average[20](Volume) > 1000000  //change both Periods and Volume to what best suits your needs
    z = close >= 0 AND close <= 99999  //change both values to fit your desired range
    a = x AND y AND z
    
    TIMEFRAME(default)                 //default TF is the one you select for the screener to be executed
    SCREENER [a]
    David M thanked this post
    #81630 quote
    David M
    Participant
    New

    Hi Roberto,

    Just played around with it and it seems to be working perfectly!

    Thanks again for this…greatly appreciated! 🙂

    Happy Trading,

    Dave

    #215999 quote
    OllieB
    Participant
    Junior

    Hi,

    Could i ask for a little help to refine this please?  The screener above returns stocks whose 52W high was EXACTLY 10 days ago.

    How can I return a list of stocks where the current price is under the 52W high but that 52W high didn’t appear in the last 10 days? I want to ignore stocks where the 52W high has appeared within the last 10days but the stock price is currently under the 52W high (of more than 10 days ago)?

    I’ve tried with summation but with no luck 🙁

    Thanks.

    #216000 quote
    OllieB
    Participant
    Junior

    I’ve tried this but couldn’t get it to work…

     

    hh = highest[250](high)   // Find the highest value in last 250 days
    c0 = summation[10](close < hh) = 10  // For last 10 days check that it is less than the highest 250D value

    screener[c0]

    #216037 quote
    robertogozzi
    Moderator
    Master

    There you go:

    TIMEFRAME(weekly)
    MyHigh = highest[52](high)             //highest in 52 weeks
    //
    TIMEFRAME(daily)
    x = (summation[10](high < MyHigh) = 10)//in the last 10 days MyHigh has not been reached
    y = average[20](Volume) > 1000000      //change both Periods and Volume to what best suits your needs
    z = close >= 1000 AND close <= 999999  //change both values to fit your desired price range
    w = close < MyHigh[11]                 //price below MyHigh for at least 11 days
    //
    TIMEFRAME(default)                     //default TF
    a = x AND y AND z AND w
    SCREENER [a]
    #216111 quote
    OllieB
    Participant
    Junior

    Hi Roberto,

    Thank you very much for the quick and concise reply.  It works like a dream.

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

52 Week High "X" days ago


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
David M @emaildmcgann Participant
Summary

This topic contains 10 replies,
has 2 voices, and was last updated by OllieB
2 years, 9 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 09/15/2018
Status: Active
Attachments: No files
Logo Logo
Loading...