Non-crossover of moving averages

Forums ProRealTime English forum ProScreener support Non-crossover of moving averages

Viewing 7 posts - 1 through 7 (of 7 total)
  • #115624

    Dear forum members,

    This is my first post on this forum.
    I am looking for help in programming proscreeners and in first place a non-crossover indicator between two moving averages.
    Let us cut it down into subcomponents and to start with in case of a bullish non-crossover the screener requires for a moving average – let’s take a standard 7-period moving average – to have a negative orientation in three successive period and to reverse higher during a fourth period.

    If forum members can help with this first piece we will then move to the next part of the screener.

    Thanks for help.

     

     

    #115629

    There you go (not tested):

     

    1 user thanked author for this post.
    #115640

    Thank you Roberto, seems the code is working.

    Could we now please add the following criteria:
    a) Standard 20-period moving average is positive (last value > previous value), and
    b) Last stock price close is above last M7 value

    Thank you.

    #115644

    There you go:

    adding ,0 to averages is useless, I added it just to show that there’s an optional parameter to calculate different types, see https://www.prorealcode.com/documentation/average/.

     

    1 user thanked author for this post.
    #115676

    Great. Thank you so much. Works perfectly.
    Have added lines of code to select minimum capital exchanged I had obtained long time ago.
    Although it works I am wondering if it can be streamlined.

    Happy 2020.

     

    #115679

    Some suggestions:

    • For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text from the code part!
    • Do NOT quote all posts, as it makes reading topics slower and more dificult. Do it when many people update that topic and you need to refer to someone specifically. This topic is just us two! Thank you  🙂

    As to streamlining it can always be done, depending on what are your goals. Post your details and myself or someone else may help you further.

    #115948

    Another topic for non-crossover of moving average: https://www.prorealcode.com/topic/codage-non-croisement-d-mm/

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

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