Stochastic down trend

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #212598 quote
    marco7630
    Participant
    New

    Hello,

    I have this code:

    TimeFrame(Daily)
    S1=Average[20](Close)
    C1=Summation[10](S1<S1[1])=10
    lengthRSI = 14 //RSI period
    lengthStoch = 14 //Stochastic period
    myRSI = RSI[lengthRSI](close)
    MinRSI = lowest[lengthStoch](myrsi)
    MaxRSI = highest[lengthStoch](myrsi)
    StochRSI = ((myRSI-MinRSI) / (MaxRSI-MinRSI))*100
    C2 = StochRSI[1] > 90
    C3 = StochRSI < 85
    C4 = Close > 5
    C5 = Average[7](Volume) > 500000
    C6 = S1 < 0.94 * S1[10]
    SCREENER[C1 and C2 and C3 and C4 and C5 and C6](Volume as "Volume")

     

     

    I would like to see only the assets that have a declining SMA20 between 5 and 10 days instead of the requirement that the SMA20 needs to be negative for at least 10 days.

    Can you adjust the code for me? Thanks

     

    gr Marco

    #212601 quote
    Nicolas
    Keymaster
    Master

    Change C1 with:

    C1=Summation[5](S1<S1[1])=5

    #212627 quote
    marco7630
    Participant
    New

    Hi Nicolas,

     

    Thanks, but i need it to be  between 5 and 10 days. Now i also get results that are already longer then 10 days in downtrend.

     

    gr Marco

    #212628 quote
    JC_Bywan
    Moderator
    Master

    C1= summation[5](S1<S1[1])=5 AND summation[11](S1<S1[1])<=10

    1. says S1<S1[1] happened 5 times most recently,
    2. and didn’t happen at least once:
      • either the 11th time (so… ok 10 days max)
      • or at least once before (so… ok less than 10 consecutive times)
    #212632 quote
    JS
    Participant
    Veteran

    Hi,

    I think a summation only says something about how often something occurs and nothing about WHERE it occurs…

    Suppose I have 11 elements and 10 meet a certain condition (and 1 does not), then you cannot say with certainty where that 1 element will occur, it can be the last element but also the first… In both cases, the summation is true…

    #212764 quote
    JC_Bywan
    Moderator
    Master
    Hi, agreed if summation[11](S1<S1[1])<=10 is on its own, then it doesn’t say where is at least one missing occurrence, my bullet point (2.) above says the same thing. When I combine it with “summation[5](S1<S1[1])=5 AND …”, then to have C1 true we need both summation subconditions to be true, and for this summation[5] subcondition to be true, it means none is missing in the latest 5 occurrences, so when C1 is true, both subconditions are true, necessarily the missing occurrence is between 6th and 11th. If it was in the latest 5, then the summation[5] subcondition would be false and C1 false with it.
    #212806 quote
    JS
    Participant
    Veteran

    Hi,

    Actually, it wasn’t a response to your correct code but more of a personal brain wave that I wanted to share… 😉

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

Stochastic down trend


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
marco7630 @marco7630 Participant
Summary

This topic contains 6 replies,
has 4 voices, and was last updated by JS
2 years, 11 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 03/31/2023
Status: Active
Attachments: No files
Logo Logo
Loading...