Screener not working

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #233149 quote
    swingforyoursupper
    Participant
    New
    RSI8=RSI[8](Close)
    
    RSI15=RSI[15](Close)
    
    sma8 = average[8](close)
     
    sma14 = average[14](close)
    
    n = RSI8 > 70 AND RSI15 > 70 AND sma8 crosses over sma14
    
    c1 = n =< 15 and n >= 0
    
    c2 = (n AND c1)
    
    SCREENER[c2]

    Trying to find those stocks where these 3 conditions have been met on any day over the past 15 days

    Doesnt seem to work – what am I missing please?

    #233161 quote
    JC_Bywan
    Moderator
    Master

    Hi, “n” on line 9 is defined as a condition, so will always be equal to either 0 or 1

    and in line 11 when defining “c1=…” you ask for n between 0 (included) and 15 (included), that doesn’t feel like the same n as the one defined in line 9 being 0 or 1, or other possibility you actually meant the same n but wanted something else than checking it’s between 0 and 15… You’d have to explain what you expect from c1 for someone to make a translation into code suggestion

    #233164 quote
    swingforyoursupper
    Participant
    New
    RSI8=RSI[8](Close)
     
    RSI15=RSI[15](Close)
     
    sma8 = average[8](close)
     
    sma14 = average[14](close)
     
    c1 = RSI8 > 70 AND RSI15 > 70 AND sma8 crosses over sma14

    Hi,

    Im trying to find where the above condition (c1) has been met at some point over the past 15 days

    #233168 quote
    JC_Bywan
    Moderator
    Master

    Ok, then you can use the command “summation” on c1, either on 15 (current day + past 14) or on 16 (current+past 15), to check that sum is at least one and stored in c2:

    RSI8=RSI[8](Close)
    
    RSI15=RSI[15](Close)
    
    sma8 = average[8](close)
    
    sma14 = average[14](close)
    
    c1 = RSI8 > 70 AND RSI15 > 70 AND sma8 crosses over sma14
    
    c2= summation[15](c1)>=1
    
    screener[c2]
    #233170 quote
    JS
    Participant
    Senior

    Hi,

    If you want to know when the condition is true“, you can use the instruction BarsSince (Returns the number of candlesticks/bars passed since the last true condition). When you run the screener, you will see in the column “BSCondition” the number of days that have passed since the condition is true… These numbers range from zero (on current day the condition is true) to 14 (the condition was true 14 days ago) You will also see “-1” in the list and this means that the condition has NOT been true in the last 14 days…
    RSI8=RSI[8](Close)
    RSI15=RSI[15](Close)
    
    SMA8=Average[8,0](Close)
    SMA14=Average[14,0](Close)
    
    C1=RSI8>70 and RSI15>70 and SMA8 crosses over SMA14
    
    BSCondition=BarsSince(C1)
    
    Screener[BSCondition<15](BSCondition as "BSCondition")
    
    JC_Bywan thanked this post
    Scherm­afbeelding-2024-05-28-om-21.21.15.png Scherm­afbeelding-2024-05-28-om-21.21.15.png
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Screener not working


ProScreener: Market Scanners & Detection

New Reply
Summary

This topic contains 4 replies,
has 3 voices, and was last updated by JS
1 year, 9 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 05/28/2024
Status: Active
Attachments: 1 files
Logo Logo
Loading...