Trend Following Moving Averages

Trend Following Moving Averages

On each bar it creates a channel by highest/lowest point of a MA. highest point is upper line and lowest point is lower line of the MA channel,
It gets highest and lowest point of last 300 bars, (say Price Channel )
If the width of MA channel is greater than certain rate of price channel then it decides there is trend
After it decided there is trend, it calculates the rate between channel and MA. Bigger result means stronger trend.
According to rate of MA channel and the¬†price channel¬†, MA Line becomes lighter/darker. so when you look at the MA Line’s color you can see the trend strength.

You can choose each of the available default MA type of the platform as source.

“Period to Check Trend” is the period to create MA channel. Bigger period cause more sensitivity.
“Trend Channel Rate %” is rate of¬†price channel¬†.¬†Price channel¬†created by using highest/lowest of last 300 bars. I did this to make the script works on all time frames correctly.
“Use Linear Regression” is used to get rid of noise. it may cause 1-2 bars latency.

(description from the original author LonesomeTheBlue, all credits go to him). Indicator converted from pinescript with some adaptation to make it works with ProRealTime.

This indicator only works on PRTv11 onwards.


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?

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

  1. Gert84 • 189 days ago #

    Hi Nicolas,

    Every time I download and import an indicator into my chart, I get the indicator at the bottom of my chart instead of on my price chart. Am I doing something wrong?
    I use V11.1

  2. Jan • 189 days ago #

    Good afternoon Nicolas,

    Could you hint me how I become version 11 of PRT ? (I believe I missed that one . . )
    And when will it be available in production ?
    Thanks in advance.

    • Nicolas • 188 days ago #

      v11 is out since months, for free:
      or with a trading account with IB, see the options available here:

  3. eva.g.forsgren • 187 days ago #

    Jag får felkod på rad 56?

    • Nicolas • 187 days ago #

      This indicator only works on PRTv11 onwards.

    • Jan • 186 days ago #

      If you start PRT via your trading account at, the PRT version 11 is not available yet, but their IT department is working on it to make it available,

  4. MajorBasse • 137 days ago #

    Hello Nicolas, is it possible to make a backtest with this moving average? For example “if trend = red then sellshort”.

    • Nicolas • 137 days ago #

      Yes why not?

    • MajorBasse • 137 days ago #

      I¬īm wondering which parameter decides the color of the average? Is the color decided by the “trend” input?

    • MajorBasse • 137 days ago #

      And also, the boolean “ulinreg” messes up the backtest, how do I define it?

  5. leonardofranci • 69 days ago #

    Hello Nicolas, it’s possible to make screener with this indicator ? Thanks a lot

  6. leonardofranci • 68 days ago #

    I would like a screener that highlights the color change of the indicator (from red to green and vice versa).
    Can you help me?
    Thanks again Nicolas

    • Nicolas • 68 days ago #

      Sure, please open a new topic in the indicator forum to ask your specific query, describe it as precisely as possible. Respect the posting rules too please.

    • leonardofranci • 68 days ago #

      Ok Nicolas apro il topic su “Supporto ProScreener” in italiano

    • leonardofranci • 68 days ago #

      Just done Nicolas

  7. pyhrus • 65 days ago #

    Pourriez-vous nous proposer une version adapt√©e pour PRT V13.0 , ou nous pr√©ciser les instructions √† remplacer ou modifier ou supprimer , dans le cas o√Ļ cela est possible , pour effectuer cette adaptation ?
    Merci .

  8. pyhrus • 65 days ago #

    Erratum : je veux parler de la version V10.3 , bien sur …

  9. pyhrus • 65 days ago #

    P.S : IG , que j’ai contact√© ,m’indique que la version V11 , ne sera pas disponible avant un certain temps ..

Register or


avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
Xtian Bonjour Nicolas, est-il possible de vous contacter en message privé pour une demande d'un dé...
Alai-n ;)
3 weeks ago
IV Mcm Indeed, copy-paste does not work. You must delete "floor" in the original code line 62 and ...
Canis Majoris Bonjour Nicolas, J'ai pas bien compris le principe de fonctionnement de ce range filter i...
Nicolas La définition des couleurs se situent entre les lignes 94 et 118. Selon le type de bougie (h...
toufikg Bonjour , je trouve cet indicateur vraiment trés intéressant , peut on le rajouter au graph...
Maxime Baudin Thank you! Great work
IV Mcm V2 is coming
KarlBenjamin Thankyou so much Nicholas! Hopefuly this is the last piece of the puzzle. Many thanks!
Juan Gonzalez Que buen contenido! No tienes alguno que me permita operar Order Flow? Gracias
Fabian Hi IV Mcm, have you drawn the rectangles (Dinamic, Range) by yourself in the chart or are...
IV Mcm Myself to illustrate ;)
oraclus Bonjour indicateur très intéressant existe t il un screener qui détecte les actions qui donn...
maxlys Merci IV Mcm pour ces screeners et indicateurs. Pourriez vous expliquer les différentes coul...
IV Mcm Hello, Blue dots indicate the start of an uptrend, gray dots indicate the start of a down...
utilisateur Bonjour, merci pour cet excellent outil.
mickey992 salut merci pour ton partage et ton travaille
patapouf Hi Vivien Ren√© I just discovered your ‚ÄúOrdered trend-following stocks Screener‚ÄĚ. Great work...
afanitro424 its not plotting on chart but instead as it's own histogram directly below chart? How to fix...
Nicolas by adding the indicator on the chart :)
geroniman bonjour Nicolas merci pour tous ces itf. J'utilsie une stratégie qui dépend d'un niveau de 5...
Nicolas Oui c'est possible. Merci de ne pas poster des demandes qui sont hors sujets. Pour les deman...
Dunstan I would like to get guidance_ How do I access and attach this indicator to my MT5 platform...
Nicolas You can't, use prorealtime, it's way better
Nicolas Le paramètre showcl doit être en true (égal à 1 )
Lednora Ah oui en effet c’est magique!j’étais resté bloqué sur la ligne 96^^. Merci beaucoup nicolas...
samsampop Merci Nicolas, c'est superb!
jaginho Bonjour, lorsque j'importe la dernière formule, j'ai un message d'erreur qui se met à ce niv...
IV Mcm Bonjour, Je ne reconnais pas cette ligne dans le code, essayer de télécharger directement le...
XXXXVII Fixed ITF Trend Background //Indicateur CCI ID2 = CCI[50] => 60 ID3 = CCI[100] => 60...
Sanglier thanks ! i have been looking forward to find something like this