Two Ema superior to an SMA during the last 30 periods

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #82556 quote
    Allonso
    Participant
    New

    I have been trying to set up a Proscreener to find stocks when a 10 and 21 EMA is still > than a 200 SMA after 30 periods have past. Should be simple but the imput screen goes into shock and starts to shake when I try to set the 30 periods.

    Anyone who can give me a clue whats going wrong.

    Allonso

    #82558 quote
    Nicolas
    Keymaster
    Master

    You can do that by summarize all the boolean “true” value other the last 30 periods, if the result is 30, the screener will return you the shares:

    condition = exponentialaverage[10]>average[200] and exponentialaverage[21]>average[200]
    a = summation[30](condition)=30
    
    screener[a]
    #82783 quote
    Allonso
    Participant
    New

    Hi Nicholas,

    My aplogies for not thanking you earlier for your help, been somewhat overwhelmed with work. It all worked well, the problem is that althougth the conditions were met, the current situation had changed and therefor did not indicate future direction as I had thought.

    I have tried another tack the initial condition being that the price close CROSSES OVER the Average(200) 5 Days previously from the current date. However what is happening is that those stocks it finds where the price Crosses above the Average can be anything from 1 to 15. I developed the code using simplified creation. Can you suggest how I can get it to do what I want.

    Thank you in advance for any assistance.

    Allonso

    #82791 quote
    Nicolas
    Keymaster
    Master

    However what is happening is that those stocks it finds where the price Crosses above the Average can be anything from 1 to 15.

    Sorry but ‘from 1 to 15’ what?

    Anyway, this is the code you should use about your new query:

    a = close crosses over average[200]
    
    test = summation[5](test)>0
    
    screener[test]
    #82797 quote
    Allonso
    Participant
    New

    Hi Nicholas,

    Sorry but as I mentioned 5 days from the current date previously I assumed you would understand that I meant that it was showing stocks with crosses from 1 day to 15 days from current date, my apologies and thanks for the code. will test and see what I get.

    Is there a limit on the number of times “summation” can be used I any program.

    My thanks again      Allonso

    #82799 quote
    Nicolas
    Keymaster
    Master

    oh yes sorry, but I’m jumping from a question to another, so sometimes I should also read between the lines..

    You can use use SUMMATION as many times you want in the same code.

    #82800 quote
    Allonso
    Participant
    New

    Hi Nicholas,

    For some reason the code is not being accepted. It says (“Syntax Error ” This variable is not used in the code: a)

    Allonso

    #82802 quote
    Vonasi
    Moderator
    Master

    I think there is a typo and it should be:

    a = close crosses over average[200]
     
    test = summation[5](a)>0
     
    screener[test]
    Nicolas thanked this post
    #82805 quote
    Allonso
    Participant
    New

    Hi,

    Just tried the correction by Vonasi, It fetches all stocks even those below the AVG 200, and so far I cannot locate any stock that has crossed above the AVG 200 in the last 5 days from the current day. No idea why, hope you can Help.

    Thanks Allonso

    #82810 quote
    Nicolas
    Keymaster
    Master

    Despite the fact that the shares has crossed at least one time during the last 5 candles, it doesn’t mean that the price is still above the MA200, you can add a condition to test it too:

    a = close crosses over average[200]
     
    test = summation[5](a)>0 and close>average[200]
     
    screener[test]
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.

Two Ema superior to an SMA during the last 30 periods


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
Allonso @allonso Participant
Summary

This topic contains 9 replies,
has 3 voices, and was last updated by Nicolas
7 years, 5 months ago.

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