Coding a rise in the Moving Average

Forums ProRealTime English forum ProScreener support Coding a rise in the Moving Average

Viewing 6 posts - 1 through 6 (of 6 total)
  • #16601

    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.

    #16629

    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

    #16682

    Hi GraHal,

    Thanks for your reply!  Here’s the full code:

    I’m sure it’s something simple i’m missing.  But again, any help would be much appreciated.

    Thanks, David.

    #16708

    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?

    Cheers

    GraHal

    1 user thanked author for this post.
    #16719

    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

    #16749

    It works great now – many thanks.

    It was a case of noticing there are 2 ‘C1’s’ – Lesson learned for me.

    Thanks again.

Viewing 6 posts - 1 through 6 (of 6 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login