Nicolas

Fractals stock screener

Category: Screeners By: Nicolas Created: November 10, 2016, 10:16 AM
November 10, 2016, 10:16 AM
Screeners
12 Comments
Fractals stock screener

This is a stock screener that will fetch stocks that have made a new Fractal (calculated upon the last “p” period = 10 periods by default) in the last 5 days (“lookback” variable that can be modified at line 6 of the below code).

Some Fractals indicators can be downloaded too in the Library:

The Fractals code here do not respect completely the Bill Williams original description (FYI).

This screener has been coded by request.

 

//PRC_FractalsScreener | screener
//03.11.2016
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge

lookback = 5 //how much days in the past to scan for new fractal?
p = 10 //period to calculate new fractals

if high[p] >= highest[2*p+1](high) then
 fractalH = 1
 fractalL=0
else
 fractalH = 0
endif

if low[p] <= lowest[2*p+1](low)  then
 fractalL = -1
 fractalH=0
else
 fractalL = 0
endif

newhigh = summation[lookback](fractalH=1 and fractalH[1]=0)=1
newlow = summation[lookback](fractalL=-1 and fractalL[1]=0)=1

SCREENER [newhigh or newlow]

 

Download
Filename: PRC_FractalsScreener.itf
Downloads: 376
Nicolas
Nicolas Legend
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

haseluis
9 years ago
#

Thank you Niklas, I'm still looking for an indicator 123 or direct to Joe Ross, can you help me

 

haseluis
9 years ago
#

Hello Niklas, I would like to use the screener for the display in the m15, which changes to the settings I have to make

Nicolas
9 years ago
#

Nothing to change or you can play with different settings at lines 6 and 7.

bmentink
9 years ago
#

Hi,

I just tried this screener, but although I get some instruments returned, they all have "Citeria" set to "0", should they not be 1 or -1?

How do I know if they were new highs or lows?

Many thanks for the screener ..

SAM
SAM
10 years ago
#

Thanks for your answers!

SAM
SAM
10 years ago
#

Thanks!!
In your opinion,  make a screener with more condition filter could be interessting? Could be implemented by Proreal staff in the next time?

Nicolas
10 years ago
#

You can have already as much conditions as you want, it is only the multiple sorting criteria that is not present.

SAM
SAM
10 years ago
#

Dear Nicolas, thank-you for the screener.
I have a question, How should i do for add not one, but two filter condition?
So when i see the result windows i can have 2 separate columns
For Exemple:

newhigh = summation[lookback](fractalH=1 and fractalH[1]=0)=1
newlow = summation[lookback](fractalL=-1 and fractalL[1]=0)=1

criteria1= RSI[14](Close)
criteria2= Stochastic[14,3](Close)
SCREENER [newhigh or newlow](criteria1 as "My first")(criteri2 as "My Second")+... ecc

Nicolas
10 years ago
#

Sorry, but it's only possible to display one criteria column on proscreener.

century
10 years ago
#

nice screener, thanks

Assaf
10 years ago
#

Thank you Nicolas so much for that. I am trying to improve my coding in Pro-RealTime. Can you please advise for the following : For this line : summation[lookback](fractalH=1 and fractalH[1]=0)=1 Why do we want to check that this didn't happen on the previous bar fractalH[1]=0 ? In addition is the condition fractalH=1 the same like checking for fractalH[0] =1 (what is the difference between them)? What is its purpose ? Many Thanks, Assaf

Nicolas
10 years ago
#

fractalH and fractalL are variables that can take values 1 or 0 in this code. The summation statement check if a change of this value occurred between the current bar and the previous one through "lookback" bars. I encourage you to read the last ProBuilder documentation to learn the basic of prorealtime coding language here: https://www.prorealtime.com/en/pdf/probuilder.pdf

ProRealCode ProRealCode
Loading...