Is it possible to do various calculations on results returned by screener?
So for example, if I have a custom list to scan which contains the 30 Dax Index stocks, and I want to check simply the number of stocks that are up today and the number that are down today. I use something like:
1
2
3
yesterdayClose=Dclose(1)
priceCurrent=close
SCREENER(priceCurrent>yesterdayClose)
If I run the screener say at 9am and there are 10 stocks higher than yesterday and 20 stocks lower than yesterday, this screen should return a list of the 10 stocks that are higher today. Now is there a way to get this value in the code, so can I somehow get the value that 10 are up and 20 down somehow in the screener code? Is this possible?
No because the screener returns individual test and can’t be compared to any other result produced before or after.
I think you might have made a mistake in your code? condition of a screener must be in brackets, the sorting criteria is in parenthesis, so actually the screener should return all stocks but sorting them with a “1” for up stocks and a “0” for down ones.
Thank you for getting back to me. Much appreciated.
I had a feeling that what I was trying to do could not be done via the screener. You are absolutely correct about the parentheses in the code, it was my mistake. I am very new to prorealcode.
Is there any way to achieve what I’m trying to do? Perhaps code it as an indicator – is it possible to create the indicator and reference each of the 30 stocks in the code, get the closing values and perform the calculation that way?
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue