Trend change + stochastic screen

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #227384 quote
    sgrech
    Participant
    Junior

    Hello and good afternoon.

    I wonder if someone here is able to help me please.

    What I would like to screen where:

    50 period MA has turned positive within the past n periods (variable but defaulted to 26), record in variable x how many periods ago the trend changed.

    AND

    Stochastic (12,2,2) for the current period is below 30.  However this must be the first time this has breached this level during the past x periods.

    Many thanks in advance.

     

    I hope this makes sense?

     

    Regards

    Simon

    #227407 quote
    sgrech
    Participant
    Junior

    Anyone able to help please  🙂

    #227414 quote
    JC_Bywan
    Moderator
    Master

    Hi,

    To be tested:

    N=26
    
    ma50=Average[50](close)
    sto=Stochastic[12,2](close)
    
    dir=sgn(ma50-ma50[1])
    
    if dir>0 and dir[1]<0 then
    mark=barindex
    endif
    x=barindex-mark
    
    c1= x<=N and dir>0
    
    c2= sto<30 and summation[X+1](sto crosses under 30)=1
    
    screener[c1 and c2]
    sgrech thanked this post
    #227419 quote
    sgrech
    Participant
    Junior

    Thank you so much, I will take a look.

    #232473 quote
    sgrech
    Participant
    Junior

    Hi sorry I went back to this and realised that I need to also check whether during the same look back period (26) whether the the Upper bollinger band was crossed.  And Finally check the current close market price is at  least 10% lower than the high within the look back period.

     

    Many thanks in advance.

    #232477 quote
    JC_Bywan
    Moderator
    Master

    Hi, the 2 conditions are added in c3 and c4 :

    N=26
    
    ma50=Average[50](close)
    sto=Stochastic[12,2](close)
    
    dir=sgn(ma50-ma50[1])
    
    if dir>0 and dir[1]<0 then
    mark=barindex
    endif
    x=barindex-mark
    
    c1= x<=N and dir>0
    
    c2= sto<30 and summation[X+1](sto crosses under 30)=1
    
    c3= summation[N](close crosses over BollingerUp[20](close))>=1
    
    c4= close<=0.9*highest[26](high)
    
    screener[c1 and c2 and c3 and c4]
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.

Trend change + stochastic screen


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
sgrech @sgrech Participant
Summary

This topic contains 5 replies,
has 2 voices, and was last updated by JC_Bywan
1 year, 10 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 02/04/2024
Status: Active
Attachments: No files
Logo Logo
Loading...