Hello guys, I’m having problems with this proscreener and I don’t know the reason why.
Here’s the code:
timeframe (daily)
indicator=((close-close[252])/(highest[252](high)-lowest[252](low)))*100
smooth=average[5](indicator)
signal=average[5](smooth)
c1=smooth>signal
c2=smooth>50 and smooth>80
SCREENER [C1 and c2]
As you see I’ve put an operation in the condition “indicator”, then i apply a smoothing to it with the condition “smooth”, and then a further smoothing of “smooth” that gives me the “signal” line.
This indicator sets possible results that runs from -100 to +100.
In this screener for example i want to research stocks with results from 50 to 80, and with the smooth> of the signal line (c1 and c2).
The fact is that it gives me no results, while if I just search for “indicator”, proscreener works.
I don’t know why it doesn’t work with the averages applied to indicator.
I have also tried with the instruction “call” but it doesnt’ work the same.
Does anyone know the reason why or can suggests me how can I make it work?
Thanks in advance
Max
Shouldn’t line 8 be:
c2=smooth>50 and smooth<80
otherwise you are looking for over 80 and above signal line and not between 50 and 80 and above signal line?
Ah yes Vonasi,
sorry i’ve mistaken rewriting the code here but it doesn’t work even with
c2=smooth>50 and smooth<80….
so it’s not that, I really don’t know what might it be
max
Are you sure that any of the instruments that you screen actual meet the criteria?
Convert the screener to an indicator like this and find an instrument that meets the conditions today to test it on. I tested it on the DJI and it last met both conditions in September 2018.
indicator=((close-close[252])/(highest[252](high)-lowest[252](low)))*100
smooth=average[5](indicator)
signal=average[5](smooth)
c1=smooth>signal
c2=smooth>50 and smooth<80
flag = 0
if c1 and c2 then
flag = 1
endif
return flag coloured(0,0,255) style(histogram,2)
Yes Vonasi, I did, I’ve also used your indicator now, I found there’s stocks that right now meets the criteria as you see in the pic.
Actually as i wrote proscreener seems to not be able to find results of the condition “smooth” and “signal”,
so the moving averages applied, because if I only use “indicator”, it works.
That may be a bug of proscreener?
It is because of the number of bars that you are using in the indicator calculation. Change 252 to 246 and it works.
Ah ok Vonasi, thanks a lot!
So proscreener has the limitation that doesn’t calculates above 246 periods!
Max
254 bars but you have to allow for the bars needed for the averaging within that.
I also have an issue regarding “no results” when exercising proscreener. In the following examples nothing happens:
REM Calculate the RSI indicator on 14 day bars
myRSI = RSI[14]
REM Our filter condition: RSI < 30
Filter = myRSI < 50
REM Sorting criteria: myRSI
SCREENER [ Filter ] (myRSI AS "RSI")
Same if I simplify the code to this:
Filter = (close[0]/close[1])<0.9
REM We keep the most serious advances
SCREENER [ Filter ]
All boxes of shares and indices are checked.
Thanks for your help!
0.9 is way too much!
It’s a huge difference (10% in just one candle!). In DAX it would be almost 1K pips!!!
Some stocks drop 10% overnight. That’s something I would like to filter. But is doesn’t matter because if choose 0.99 or whatever still no results. Just an empty screen.
With your first screener (MyRsi) I am reported so many results!
The second screener returns less than 50 items on NASDAQ using <0.95, while it still returms nothing on italian shares and forex.
The screeners are correct. It’s just a question of settings.