Volatility contraction screener help

Forums ProRealTime English forum ProScreener support Volatility contraction screener help

Viewing 12 posts - 1 through 12 (of 12 total)
  • #58789

    Hi all,

     

    I’m looking to write a basic volatility contraction screener.  The idea is to find stocks in a trend by looking at the relationships between the various moving average.  I would then find those that have moved into a pattern of consolidation by looking for stocks that have moved through the 9 day moving average multiple times over a 2 week period (e.g., the high-low range of 3 daily candles goes through the 9 day MA  in a 10 day period).  I’ve been trying to write the step that will count the number of times the range passes through the 9 day moving average but keep getting an error.  The code I’ve written is as follows.

     

     

    I have had a look through other code where people have used the FOR TO DO but am not sure if I’ve missed some logic in the argument.

    Thanks for any assistance,

     

    David

    #58940

    HI,

     

    I realised I didn’t actually say what my problem was with the code.  Basically, it doesn’t run.  I get an error message telling me to complete the syntax of line 14, which is the final line.   I’ve spent another hour or so trying to get this code to run, so any suggestions would be appreciated.  (I have fixed having the < and > the wrong way around as well).  Error message pictured below.

     

    PRC-error

    #58943

    You need to put a NEXT in your code for the loop to work.

    2 users thanked author for this post.
    #58945

    Thanks Vonasi, I had just worked that out and was coming on here to update the post.  I have to admit, coming from a very limited programming background, I find this a little slow to get through.  The help on these forums has been great though and I do appreciate people taking the time to assist relatively inexperienced people like myself.  I will continue to try reading other people’s screeners and the PRT screener manual before bothering people on the forum though 🙂

    #58947

    No problem – the Help > Probuilder language documentation I always find to be a great reference tool with quite a few examples that help clarify things.

    1 user thanked author for this post.
    #58952

    Good evening David.

    If I understood what you were doing, your idea looks very interesting to detect certain phases of range.

    Could you post your code once the problems have been solved ..

    Thank you

    #59129

    Hi Alain,

     

    I’m happy to share the code, though it feels simplistic compared to some of the things I’ve seen posted on these forums.   I’ve defined an uptrend as any stock that has had the 100 day simple moving average rise each day for 3 months (60 days).  I’ve then looked for a contraction of the trend by looking for stocks where the candles have a low that is below the 9 day moving average and a high above the 9 day moving average.  The screener requires more than 3 of these crosses to occur in a 10 day period.  If you have any experience with coding you can probably easily improve what I’ve written.  If you’re new, I have included comments about what each section does so you can modify it to suit your needs.

     

     

    I’ve been reasonably happy with what this screener has returned as some of the stocks look like they are setting up and are worth watching.

     

    I am planning to write a similar screener that looks for a contraction in the range of the candles, eg the previous 10 candles have an average range that is perhaps 70% of the 3 month average.  I think volatility contraction patterns are interesting but am not sure of the best way to find them without simply looking through lots of charts 🙂

     

    Regards,

    David

    #59132

    10 period ATR as percent of 60 period atr and its done , easy screener . Make everything variable to increases versatility

    2 users thanked author for this post.
    #59133

    Thanks Brisvegas, that sounds like a good way to do it 🙂

    #91546

    Hello,

    Could you share the code for this “10 period ATR as percent of 60 period atr  Make everything variable to increases versatility”

    Thank you, new and still learning.

    Andy

    #91606

    I think that Brisvegas was talking about a code like this:

    The “volat” variable returns the volatility over the last 10 days as a coefficient of the volatility over the last 60 days (periods).

    #92121

    Thank you

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

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