Hi all,
I’ve scoured the forum to try and find the answer to this, tried a few methods, but couldn’t get a narrower search on ProScreener.
Basically I want to display markets where the 200 day Simple Moving Average is higher than it was 21 bars ago (as an example)
I’ve tried this:
indicator3 = Average[200](close)
c1 = (indicator3 > indicator3[21])
I found that this either displayed Simple Moving Averages that were also DEclining or it increased the number of results it displayed!
Any help would be much appreciated – I’m still a bit new to the coding world.
Many thanks, David.
Good Morning David
If you put your full Screener code up on here then I / others could try it on our Platforms and see what we get as a result.
I’m sure you included ‘SCREENER’ at the end of your code? Somebody would spot the error (even I might! ha) in an instant if they see the full code.
Cheers
GraHal
Hi GraHal,
Thanks for your reply! Here’s the full code:
indicator1 = ExponentialAverage[5](close)
indicator2 = ExponentialAverage[21](close)
c1 = summation[2](indicator1 CROSSES OVER indicator2)
indicator3 = Average[200](close)
c1 = (indicator3 > indicator3[21])
SCREENER[c1] ((close/DClose(1)-1)*100 AS "%Chg yest.")
I’m sure it’s something simple i’m missing. But again, any help would be much appreciated.
Thanks, David.
Hi David
Try below. You had 2 x C1.
Summation[2] gives indicator1 CROSSES OVER indicator2 2 days ago? Without summation[2] the Screener gives the cross yesterday … is that what you want?
indicator1 = ExponentialAverage[5](close)
indicator2 = ExponentialAverage[21](close)
c1 = (indicator1 CROSSES OVER indicator2)
indicator3 = Average[200](close)
c2 = (indicator3 > indicator3[21])
SCREENER[c1 and C2] ((close/DClose(1)-1)*100 AS "%Chg yest.")
Cheers
GraHal
Mmm I edited my original message above and it has screwed the PRT Code, sorry about that. Ohh its back okay again now … Nicolas must have fixed it? Thank you Nicolas!
You were probably just ‘too close to it’ to spot the 2 instances of C1?
Happy to Help
GraHal
It works great now – many thanks.
It was a case of noticing there are 2 ‘C1’s’ – Lesson learned for me.
Thanks again.