How to Highest[10](volume) but only of down bars???

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #29251 quote
    FreeYourself
    Participant
    New

    Hey guys, new to the forum and relatively new to coding in general.

    Hoping some of the seasons PRCode guys can help me out here please.

    How would i code a screener for : Highest[10](volume) but only of down bars/red closes?

    Im trying to write a modified pocket pivot type scan. basically a breakout from a short/medium term pullback or downtrend

    Thanks

    #29989 quote
    Nicolas
    Keymaster
    Master

    Highest[10](volume) but only of down bars/red closes?

    It would mean that you only want to detect the highest value of the last 10 bearish bars, is this right?

    #30215 quote
    FreeYourself
    Participant
    New

    Hi Nicolas, thanks for the reply and sorry for the delay in mine.

    I actually worked it out with the help of a friend that is a programmer. I was aiming to find the highest volume of the past 10 trading setups but omitting any up bar days from the highest. I am trying to make a screen for a pocket pivot Setup.

    Thanks

    #30216 quote
    Nicolas
    Keymaster
    Master
    Ok, so let me know if you need more help on this project, don’t hesitate.
    #34034 quote
    crashman111
    Participant
    New
    Hey FreeYourself… any chance I can get a copy of that code? you can PM me on tw|tter with the same username. cheers.
    #34047 quote
    Nicolas
    Keymaster
    Master
    Or post it here for the benefit of everyone! 😉
    #35479 quote
    Merls
    Participant
    New
    I am trying to write this exact screener. No luck so far. Also does anyone know how I can exclude “resources” companies from the screen?? The help would be greatly appreciated. Thanks
    #35595 quote
    crashman111
    Participant
    New
    // Today's volume should be larger than the volume of the highest down day over the last 10 days
    
    maxDay = 11
    
    maxDownDay = 0
    
    maxDown = 0
    
    FOR d = 1 TO maxDay DO
    
    r = Close[d] - Open[d]
    
    IF r < 0 and Volume[d] > maxDown THEN
    
    maxDown = Volume[d]
    
    maxDownDay = d
    
    ENDIF
    
    NEXT
    
    IF maxDownDay = 0 THEN
    
    maxDownDayVol = 0
    
    ELSE
    
    maxDownDayVol = Volume[maxDownDay]
    
    ENDIF
    
    cVol2 = (Volume > maxDownDayVol)
    #37413 quote
    George44
    Participant
    New
    I just tried using the code above to screen for pocket pivots and got the error message below. Any advice or tips as to where I have gone wrong?
    Error.png Error.png
    #37421 quote
    GraHal
    Participant
    Master
    @crashman111 is above the full code? Needs below (or something) else it’s not a screener? 🙂  …
    Screener (Volume > maxDownDayVol)
    #37468 quote
    George44
    Participant
    New
    Thanks for the reply. It was the full code as copied from the original post. My screenshot did not show the entire picture. I have added your line to the very top. I am now getting a different error message as per the screenshot attachment. Once again, if anyone has any advice or suggestions it would be greatly appreciated. I have only just started using this.
    Error-2.png Error-2.png
    #37477 quote
    GraHal
    Participant
    Master
    Try below, it works / gives results on my Platform, check results are what you want   …
    // https://www.prorealcode.com/topic/how-to-highest10volume-but-only-of-down-bars/
    // Today's volume should be larger than the volume of the highest down day over the last 10 days
    
    maxDay = 11
     
    maxDownDay = 0
     
    maxDown = 0
     
    FOR d = 1 TO maxDay DO
     
    r = Close[d] - Open[d]
     
    IF r < 0 and Volume[d] > maxDown THEN
     
    maxDown = Volume[d]
     
    maxDownDay = d
     
    ENDIF
     
    NEXT
     
    IF maxDownDay = 0 THEN
     
    maxDownDayVol = 0
     
    ELSE
     
    maxDownDayVol = Volume[maxDownDay]
     
    ENDIF
     
    cVol2 = (Volume > maxDownDayVol)// sample screener code
    
    SCREENER(cvol2)
    
    #37479 quote
    George44
    Participant
    New
    Great! That has worked. Thank you and much appreciated.
    #37939 quote
    @Dazzle101
    Participant
    Junior
    This is the one I have for Pocket Pivots; Cheers, Dale 🙂   P.s. And as an Indicator
    Nicolas thanked this post
    PP_Screener-1.pdf PP_Indicator.pdf
    #37948 quote
    Nicolas
    Keymaster
    Master
    @dalo

    >> Please update your country flag in your profile. Thank you 🙂 <<

    Thanks for the submitted code, it would be valuable things to add into the library 😉
    @Dazzle101 thanked this post
Viewing 15 posts - 1 through 15 (of 18 total)
  • You must be logged in to reply to this topic.

How to Highest[10](volume) but only of down bars???


ProScreener: Market Scanners & Detection

New Reply
Author
Summary

This topic contains 17 replies,
has 8 voices, and was last updated by Nicolas
6 years, 4 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 03/21/2017
Status: Active
Attachments: 4 files
Logo Logo
Loading...