Range filter

v11
Range filter

Inspired by the QQE’s volatility filter, this filter applies the process directly to price rather than to a smoothed RSI.

This is an experimental study designed to filter out minor price action for a clearer view of trends.

First, a smooth average price range is calculated for the basis of the filter and multiplied by a specified amount.
Next, the filter is calculated by gating price movements that do not exceed the specified range.
Lastly the target ranges are plotted to display the prices that will trigger filter movement.

Custom bar colors are included. The color scheme is based on the filtered price trend.

Select the type you want to use via the “Filter Type” input. Type 1 is the original formula.
Multiple range sizing methods are available. You can choose from the following scales:

  1. Points
  2. Pips (Works best with forex pairs, obviously)3
  3. Ticks4
  4. % of Price
  5. ATR
  6. Average Change (Default. This is the original sizing method.)
  7. Standard Deviation

Range smoothing is optional, and you can specify your smoothing length. Smoothing only affects dynamic scales (ATR, Average Change, and Standard Deviation).
Filter movement can be determined using wicks or close. This can be specified via the “Movement Source” input.

(description from the original author of this indicator: Donowan Wall, all credits go to him).

 

 

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. eckaw • 10/06/2020 #

    Hi Nicolas, I get a syntax error message on line 62, 63, 64. Do you know how this can be fixed?

  2. IV Mcm • 10/06/2020 #

    For PRT Version V10.30

  3. IV Mcm • 10/06/2020 #

    //PRC_Range Filter | indicator
    //06.10.2020

    //Nicolas @ http://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 movsrc1 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=ll+r
    endif
    else //ftype1
    if hh>=rngfilt[1]+r then
    rngfilt=(rngfilt[1]) + (abs(hh – (rngfilt[1]))/r)*r
    elsif llrngfilt[1] then
    upward=1
    downward=0
    endif
    if rngfilt rngfilt) and (close > (close[1])) and (upward > 0) then
    br=5
    bg=255
    bb=155
    //#05ff9b
    elsif (close > rngfilt) and (close 0) then
    br=0
    bg=179
    bb=107
    //#00b36b
    elsif (close < rngfilt) and (close 0) then
    br=255
    bg=5
    bb=131
    //#ff0583
    elsif (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)
    drawtriangle(barindex[1],hiband[1],barindex[1],rngfilt[1],barindex[0],rngfilt[0]) coloured(0,179,107,85)
    drawtriangle(barindex[1],loband[1],barindex,rngfilt,barindex[0],loband[0]) coloured(184,0,93,85)
    drawtriangle(barindex[1],loband[1],barindex[1],rngfilt[1],barindex[0],rngfilt[0]) coloured(184,0,93,85)
    endif

    return rngfilt coloured(cr,cg,cb) style(line,3) as “Filter”

  4. parthapersonal • 10/06/2020 #

    Thanks Nicolas, however it is throwing errors as enclosed.

  5. parthapersonal • 10/06/2020 #

    if hh>rngfilt[1] then
    if (hh-r)rngfilt[1] then
    rngfilt=rngfilt[1]
    else
    rngfilt=ll+r
    endif
    else //ftype1
    if hh>=rngfilt[1]+r then
    rngfilt=(rngfilt[1]) + (abs(hh – (rngfilt[1]))/r)*r
    elsif llrngfilt[1] then
    upward=1
    downward=0
    endif
    if rngfilt rngfilt) and (close > (close[1])) and (upward > 0) then
    br=5
    bg=255
    bb=155
    //#05ff9b
    elsif (close > rngfilt) and (close 0) then
    br=0
    bg=179
    bb=107
    //#00b36b
    elsif (close < rngfilt) and (close 0) then
    br=255
    bg=5
    bb=131

  6. Nicolas • 10/06/2020 #

    This code is compatible only with PRT v11. Use this version with prior version of the platform: https://www.prorealcode.com/prorealtime-indicators/range-filter/#comment-10834

  7. BobFlynn • 10/06/2020 #

    Awesome Nicolas !! I’m glad you took the time to work on this. Can’t thank you enough ! 🙂

    • BobFlynn • 10/06/2020 #

      Unfortunately, the 10.3 code is missing some parts and cant compile. @IV MCM can you check ? I think the Copy Paste is broken in the comments… Merci d’avance 🙂

  8. IV Mcm • 10/06/2020 #

    Indeed, copy-paste does not work.

    You must delete “floor” in the original code line 62 and 64.
    You must also delete the “bordercolor (x,x,x,x)” line 122-123-124 and 125.

  9. Canis Majoris • 10/06/2020 #

    Bonjour Nicolas,

    J’ai pas bien compris le principe de fonctionnement de ce range filter indicator ?

    quelle est la signification de la bougie grise ? Je vois 3 couleurs de bougies possible ( vert, rose et gris ) !
    Merci

    • Nicolas • 10/06/2020 #

      La définition des couleurs se situent entre les lignes 94 et 118. Selon le type de bougie (haussière ou baissière), si elle situe dessus/dessous de la ligne centrale (le range filter) et si cette dernière est ascendante ou descendante. Je ne suis pas l’auteur de cet indicateur, j’ai réalisé une conversion de code suite à une demande.

  10. Manu35250 • 10/06/2020 #

    Bonjour Nicolas,

    Est il possible de convertir cet indicateur en screener ? J’essaie depuis plusieurs jours mais impossible.

    Merci de votre retour.

    • Nicolas • 10/06/2020 #

      Bien sûr, merci de formuler la demande dans le forum approprié en respectant les règles de publication et je serai en mesure de t’aider.

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
Nicolas
6 years ago
Trinity Impulse
Trinity Impulse
5
Indicators
ribou ah d'accord merci beaucoup
domenico nlevel1 non modifica la curva al variare del suo valore
tiger_man_no1 Very nice ; what is the best period input date for DAILY CHART ?
imokdesign Hi Everybody, when I look at the strategy I felt the need to implement a Moneymanagement-Sy...
Inertia newlevel then multiplier=multiplier+1 oldlevel=newlevel newlevel=strategyprofit+startequi...
Inertia Hi Bjoern, I was playing around with your code this morning (EUR/USD 5'). Thank you to the...
fabio407 Thanks, Nicolas. Very useful. Would you tell me where to find what result conveys the functi...
Nicolas This is not an instruction of the programming language but a variable from this indicator (l...
fabio407 OK. I didn't notice it. Many thanks, Nicolas!
Wilko And not only readable.... makes it much easier to iterate different entry/exit-conditions, d...
IGOSNELL Hi Interesting strategy, when I used $ M-R Dif EURUSD M15 Long if does not enter any positi...
ilvillans HI, I modified the system, from good results but from this error: Replace the variables wit...
Leo Hi Gabri, have you ever try this in a trading system?
gabri Leo, I used to crosscheck this indicator a long time ago. For the trading I was doing at tha...
Nolubok Bonjour Gabri, merci pour l'ensemble de vos publications, serait il possible d'avoir le scr...
Nicolas si il n'y a pas de stoploss définit dans le code, alors c'est normal :)
bertrandpinoy bonjour merci pour la réponse. Oui b sur ... est il possible que le SL soit coder sous une a...
Nicolas ok mais pourquoi poser la question ici ? Pour des questions non spécifique à cette article, ...
julien1978 The ADR value that is plotted intraday does not match the value of the regular ATR indicator...
Fab666 I've tried to get a fix for this also but no luck, it doesn't print the correct data as far ...
Seabiscuit Hi! With the new PRT update, this indicator does not work anymore
ellejoe Hi Ale, can you please share your live results and updated version with us? Was this strateg...
ALE Hello ellejoe,since 1th november 2016,I can confirm probacktest results, I cant run it in li...
David Thompson I'm new to PRT, and yet I know I need to take away the 'human emotion' from my trading - so ...
jeanphi0034 Hello, I would like to use the QQE indicator which is based on smooth RSI as far as I unders...
ilstefano Bonjour Nicolas, te serait il possible de rajouter la fast ATR manquante dans le code? Merci
Nicolas Désolé je ne comprends pas la question ?
Doctrading Hello,  The strategy should be improved, no doubt. But it was just one of my ideas, which h...
ALEALE Yes Nicolas is very difficult, macro economic data can destroy any work!!  
styrke depends which.. I personally think that it's much more easier to trade on XBTUSD, try to co...
David Thanks for the explanation Nicolas.
freecat1899 Hello, I wanted to create a percent ADR based on this indicator, so I wrote this code that I...
revstrat At first glance, I see this mistake. You shouldn't average the highs and the lows. You shoul...
GraHal Ooops got that excited I sent that last one twice! ha (and can't delete it, sorry) I got it...
Eric n = 3  dont forget to allow 3 contract in proorder
UkCoopDownUnder Tried EURUSD GMT and GMT -1, as far back as I can go, Nov 2018 on 15mn Tf, 22% loss
Nicolas
8 years ago
trabucaire Hello, what does it mean the 20 and 40 number on this code ? Thank you !
robertogozzi I modified it to make parameters customizable and to Draw a Grey candlestick when a range is...
Nicolas
8 years ago
robertogozzi Vous ne pouvez pas, car ProBuilder ne prend actuellement pas en charge MTF (Multiple Time Fr...
jeanguy Merci pour ce travail En quoi cette MM est elle différente d’une MM courte ?
Bern latest version pro real time not accepting code, same with Ehler's MAMA indicator. any idea...

Top