Screener Range filter

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #156351 quote
    PRC_2021
    Participant
    Average

    Bonjour,

    J’essaie depuis un moment de convertir l’indicateur “Range Filter” en screener qui sélectionnera les actions passant du rouge au vert avec un minimum de volume échangé de 30 000 actions.

    J’ai un compte fin de journée et non en temps réel.

    Pour rappel, voici le code de l’indicateur

    //PRC_Range Filter | indicator
    //06.10.2020
    //Nicolas @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    
    // --- settings
    ftype = 1 //Filter Type (1 or 2?)
    rngqty   = 2.618 //Range Size
    rngscale = 6 //Range Scale (1=Points, 2=Pips, 3=Ticks, 4=% of Price, 5=ATR, 6=Average Change, 7=Standard Deviation
    rngper = 14 //Range Period (for ATR, Average Change, and Standard Deviation)
    smoothrange = 1 //Smooth Range (0=false ; 1=true)
    smoothper   = 27 //Smoothing Period
    movsrc = 1  //Movement Source (0=Wicks, 1=Close)
    //--- end of settings
    
    once rngfilt=close
    if barindex>max(rngper,smoothper) then
     //Range Size Function
     rngscale=max(1,min(rngscale,7))
     if rngscale=1 then
      scale = rngqty*pointsize
     elsif rngscale=2 then
      scale = rngqty*.0001
     elsif rngscale=3 then
      scale = rngqty*ticksize
     elsif rngscale=4 then
      scale = close*rngqty/100
     elsif rngscale=5 then
      scale = rngqty*average[rngper,1](tr)
     elsif rngscale=6 then
      scale = rngqty*average[rngper,1](abs(close-close[1]))
     elsif rngscale=7 then
      scale = STD[rngper](close)
     endif
    
     if smoothrange then
      r=average[smoothper,1](scale)
     else
      r=scale
     endif
    
     hh=close
     ll=close
     if movsrc<>1 then
      hh=high
      ll=low
     endif
      if ftype=1 then
       if hh>rngfilt[1] then
        if (hh-r)<rngfilt[1] then
         rngfilt=rngfilt[1]
        else
         rngfilt=hh-r
        endif
      elsif (ll+r)>rngfilt[1] then
       rngfilt=rngfilt[1]
      else
       rngfilt=ll+r
      endif
     else //ftype<>1
      if hh>=rngfilt[1]+r then
       rngfilt=(rngfilt[1]) + floor(abs(hh - (rngfilt[1]))/r)*r
      elsif ll<=rngfilt[1]-r then
       rngfilt=(rngfilt[1]) - floor(abs(ll - (rngfilt[1]))/r)*r
     else
      rngfilt=rngfilt[1]
     endif
    endif
    
    hiband    = rngfilt + r
    loband    = rngfilt - r
    
    if rngfilt>rngfilt[1] then
     upward=1
     downward=0
    endif
    if rngfilt<rngfilt[1] then
     upward=0
     downward=1
    endif
    
     //Direction Conditions & colors
     if upward then
      cr=5
      cg=255
      cb=155
     endif
     if downward then
      cr=255
      cg=5
      cb=131
     endif
    
     if (close > rngfilt) and (close > (close[1])) and (upward > 0) then
      br=5
      bg=255
      bb=155
      //#05ff9b
     elsif (close > rngfilt) and (close <= (close[1])) and (upward > 0) then
      br=0
      bg=179
      bb=107
      //#00b36b
     elsif (close < rngfilt) and (close < (close[1])) and (downward > 0) then
      br=255
      bg=5
      bb=131
      //#ff0583
     elsif (close < rngfilt) and (close >= (close[1])) and (downward > 0) then
      br=184
      bg=0
      bb=93
      //#b8005d
     else
      br=204
      bg=204
      bb=204
     endif
     drawcandle(open,high,low,close) coloured(br,bg,bb) bordercolor(0,0,0)
    
     //Band Fills
     drawtriangle(barindex[1],hiband[1],barindex,rngfilt,barindex[0],hiband[0]) coloured(0,179,107,85) bordercolor(0,179,107,0)
     drawtriangle(barindex[1],hiband[1],barindex[1],rngfilt[1],barindex[0],rngfilt[0]) coloured(0,179,107,85) bordercolor(0,179,107,0)
     drawtriangle(barindex[1],loband[1],barindex,rngfilt,barindex[0],loband[0]) coloured(184,0,93,85) bordercolor(184,0,93,0)
     drawtriangle(barindex[1],loband[1],barindex[1],rngfilt[1],barindex[0],rngfilt[0]) coloured(184,0,93,85) bordercolor(184,0,93,0)
    endif
    
    
    return rngfilt coloured(cr,cg,cb) style(line,3) as "Filter"

    Merci pour votre aide.

    Manu

    Indicateur-Range-Filter.png Indicateur-Range-Filter.png
    #156392 quote
    Nicolas
    Keymaster
    Master

    Tu trouveras ci-dessous le screener pour cet indicateur le range filter. Il détecte le passage du rouge au vert.

    //PRC_Range Filter | screener
    //06.10.2020
    //Nicolas @ www.prorealcode.com
    //Sharing ProRealTime knowledge
    
    // --- settings
    ftype = 1 //Filter Type (1 or 2?)
    rngqty   = 2.618 //Range Size
    rngscale = 6 //Range Scale (1=Points, 2=Pips, 3=Ticks, 4=% of Price, 5=ATR, 6=Average Change, 7=Standard Deviation
    rngper = 14 //Range Period (for ATR, Average Change, and Standard Deviation)
    smoothrange = 1 //Smooth Range (0=false ; 1=true)
    smoothper   = 27 //Smoothing Period
    movsrc = 1  //Movement Source (0=Wicks, 1=Close)
    //--- end of settings
    
    once rngfilt=close
    if barindex>max(rngper,smoothper) then
    //Range Size Function
    rngscale=max(1,min(rngscale,7))
    if rngscale=1 then
    scale = rngqty*pointsize
    elsif rngscale=2 then
    scale = rngqty*.0001
    elsif rngscale=3 then
    scale = rngqty*ticksize
    elsif rngscale=4 then
    scale = close*rngqty/100
    elsif rngscale=5 then
    scale = rngqty*average[rngper,1](tr)
    elsif rngscale=6 then
    scale = rngqty*average[rngper,1](abs(close-close[1]))
    elsif rngscale=7 then
    scale = STD[rngper](close)
    endif
    
    if smoothrange then
    r=average[smoothper,1](scale)
    else
    r=scale
    endif
    
    hh=close
    ll=close
    if movsrc<>1 then
    hh=high
    ll=low
    endif
    if ftype=1 then
    if hh>rngfilt[1] then
    if (hh-r)<rngfilt[1] then
    rngfilt=rngfilt[1]
    else
    rngfilt=hh-r
    endif
    elsif (ll+r)>rngfilt[1] then
    rngfilt=rngfilt[1]
    else
    rngfilt=ll+r
    endif
    else //ftype<>1
    if hh>=rngfilt[1]+r then
    rngfilt=(rngfilt[1]) + floor(abs(hh - (rngfilt[1]))/r)*r
    elsif ll<=rngfilt[1]-r then
    rngfilt=(rngfilt[1]) - floor(abs(ll - (rngfilt[1]))/r)*r
    else
    rngfilt=rngfilt[1]
    endif
    endif
    
    if rngfilt>rngfilt[1] then
    upward=1
    endif
    if rngfilt<rngfilt[1] then
    upward=0
    endif
    endif
    
    test = upward and not upward[1] and volume>30000
    
    screener[test]
    
    PRC_2021 thanked this post
    #156406 quote
    PRC_2021
    Participant
    Average

    Super Merci.

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

Screener Range filter


ProScreener : Scanners de Marché & Détection

New Reply
Author
author-avatar
PRC_2021 @manu35250 Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by PRC_2021
5 years, 1 month ago.

Topic Details
Forum: ProScreener : Scanners de Marché & Détection
Language: French
Started: 01/04/2021
Status: Active
Attachments: 1 files
Logo Logo
Loading...