Please correct my EMA crossover screener code

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #39421 quote
    Dimi.A
    Participant
    Average

    Hello Nic and all,

    I am trying to create a Proscreener for EMA 4 (CLOSE) crosses EMA 10 (CLOSE) and vice versa but my screener seems to be not working as it is showing results for all pairs.

    Could someone help me correct it please?

    indicator1 = ExponentialAverage[4](close)
    indicator2 = ExponentialAverage[10](close)
    c1 = summation [100] (indicator1 CROSSES OVER indicator2)
     
     
    SCREENER[c1]
    #39491 quote
    Nicolas
    Keymaster
    Master

    Do you want to test if a crossover occur now? on the last bar only? or to know if it occurred from now to X previous ago too?

    #39492 quote
    Dimi.A
    Participant
    Average

    Hello Nic,

    I would like to screen for crossover now. For both 4 ema crosses 10 ema and 10 ema crosses 4 ema.

    #39493 quote
    Nicolas
    Keymaster
    Master

    Ok, so it is easy as ABC 🙂 Your code is almost good.

    indicator1 = ExponentialAverage[4](close)
    indicator2 = ExponentialAverage[10](close)
    c1 = indicator1 CROSSES OVER indicator2 
     
    SCREENER[c1]
    #39497 quote
    Dimi.A
    Participant
    Average

    That’s awesome thanks Nic!

    Will that also screen and show results whenever indicator 2 crosses indicator 1? Or do I have to add in something else?

    #39499 quote
    Nicolas
    Keymaster
    Master

    No, you’ll have to change the c1 condition:

    indicator1 = ExponentialAverage[4](close)
    indicator2 = ExponentialAverage[10](close)
    c1 = indicator1 CROSSES OVER indicator2  OR indicator1 CROSSES UNDER indicator2
     
    SCREENER[c1]
    Dimi.A thanked this post
    #39504 quote
    Dimi.A
    Participant
    Average

    No, you’ll have to change the c1 condition:

    Thanks Nic, that’s perfect now. Got it!

    #56595 quote
    crolakstrading
    Participant
    Senior

    how can i add past x bars to show on the screener? please help..

    Let’s say if I want the screener show the resutls of past 10 bars after the crossover?

    #56606 quote
    Nicolas
    Keymaster
    Master

    You can change the screener condition this way, to get the last 10 bars results (if at least 1 crossover has occurred, the screener should give you this information)

    indicator1 = ExponentialAverage[4](close)
    indicator2 = ExponentialAverage[10](close)
    c1 = indicator1 CROSSES OVER indicator2  OR indicator1 CROSSES UNDER indicator2
     
    SCREENER[summation[10](c1)>0]
    #56773 quote
    crolakstrading
    Participant
    Senior

    Hi Nicolas.. Thank you very much for your reply! it works!! 🙂

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

Please correct my EMA crossover screener code


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
Dimi.A @dimi-a Participant
Summary

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

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