Moving Averages Exponential Scanner

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #35148 quote
    deltavictor28
    Participant
    New

    Hello trading friends,

    I am new to the Prorealtime programming. I am a programmer by professional. But I am not sure how to translate trading in to coding. If you can help me to learn, I would like to contribute here as well (Have few sparetime) 🙂

    My question:

    How to find my exponential moving average 8, 21, 50 are in numerical order or not?

    #35260 quote
    deltavictor28
    Participant
    New

    Hi Guys,

     

    I was curious on the first day here and I created this. Any improvements?

    
    
    
    TIMEFRAME(1 hour)
    
    ma8=average[8](close)
    ma21=average[21](close)
    ma50=average[50](close)
    
    c1 = ma8 > ma21
    c2 = ma21 > ma50
    up = c1 and c2
    
    
    c3 = ma50 > ma21
    c4 = ma21 > ma50
    down = c3 and c4
    
    
    
    SCREENER[up OR down](close as "close")
    
    
    #35272 quote
    Nicolas
    Keymaster
    Master

    Hi Delta, sorry for not answering earlier. You made a wrong typo at line 15 and 16 (conditions c3 and c4 : same MA but different order).
    It is not necessary to indicate a timeframe, unless you want to make a multitimeframe screener.
    If c1 and c2 are not true at the same time, you are “down”, so your “down” boolean variable is not necessary, just check if up is true or not and you’ll the bullish and bearish momentum in your screener.

    #35276 quote
    deltavictor28
    Participant
    New

    I m not sure I understand you.

    MA 8, 21, 50 is in proper order: i would say momentum is UP

    MA 50, 21, 8 is in proper order: i would say momentum is DOWN

    I want the screener to list either UP or DOWN

    This is what I tried to achieve in the above code.

    #35279 quote
    Nicolas
    Keymaster
    Master

    This is how it should be coded:

    ma8=average[8](close)
    ma21=average[21](close)
    ma50=average[50](close)
    
    c1 = ma8 > ma21
    c2 = ma21 > ma50
    up = c1 and c2
    down = not c1 and not c2
    
    SCREENER[up OR down](close as "close")

    If the moving averages are not in the proper order for “up”, they are obviously in the proper order for “down”.

    #35536 quote
    deltavictor28
    Participant
    New

    Thanks Nick!.. thats way better than original.. 😛

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Moving Averages Exponential Scanner


ProScreener: Market Scanners & Detection

New Reply
Author
Summary

This topic contains 5 replies,
has 2 voices, and was last updated by deltavictor28
8 years, 9 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 05/11/2017
Status: Active
Attachments: No files
Logo Logo
Loading...