SMA50 is above SMA200 but for less than 3 weeks

Forums ProRealTime English forum ProScreener support SMA50 is above SMA200 but for less than 3 weeks

  • This topic has 3 replies, 2 voices, and was last updated 1 year ago by avatarJS.
Viewing 4 posts - 1 through 4 (of 4 total)
  • #217696

    Hi,

    here is my code :

    How would you do to only report stocks for which the SMA50 is above SMA200 but for less than 3 weeks ? the idea is to get stocks that recently started to go up

    another question but related to the 1st one :
    today is July 15th. To get the average between July 1st and July 15th, I would do that : average[15](close). Now, if I want the average between July 1st and July 10th, how should I do ?

    regards

    #217704
    JS

    Hi,

    You can always use the “Summation” function…

    C2=Summation[15](SMA50>SMA200)=15

    What it says here is: count the days over the last 15 days where the SMA50 is above the SMA200 and this number of days must be equal to 15.

    The number of (trading) days between the 1st and the 15th of July is equal to 10, so Average[10](Close)…

    The number of (trading) days between the 1st and the 10th of July is equal to 5 or 6 so Average[5](Close)…

    #217705

    thanks for the idea, but this won’t do it. What I want is the SMA50 to be above SMA200 for less than 3 weeks. So, 3 weeks ago (at the most), I want SMA200 to be above SMA50

    #217706
    JS

    Hi,

    That’s right, that wasn’t foolproof…

    You can add an extra condition that calculates the day of the crossing between SMA50 & SMA200…

    1 user thanked author for this post.
Viewing 4 posts - 1 through 4 (of 4 total)

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