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
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?
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
Ok, so let me know if you need more help on this project, don’t hesitate.
Hey FreeYourself… any chance I can get a copy of that code?
you can PM me on tw|tter with the same username. cheers.
Or post it here for the benefit of everyone! 😉
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
// 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)
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?
@
crashman111 is above the full code? Needs below (or something) else it’s not a screener? 🙂 …
Screener (Volume > maxDownDayVol)
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.
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)
Great! That has worked.
Thank you and much appreciated.
This is the one I have for Pocket Pivots;
Cheers,
Dale 🙂
P.s. And as an Indicator
@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 😉