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 • 321 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 • 321 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 • 321 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 • 320 days ago #

    Jag får felkod på rad 56?

    • Nicolas • 320 days ago #

      This indicator only works on PRTv11 onwards.

    • Jan • 319 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 • 269 days ago #

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

    • Nicolas • 269 days ago #

      Yes why not?

    • MajorBasse • 269 days ago #

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

    • MajorBasse • 269 days ago #

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

  5. leonardofranci • 201 days ago #

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

  6. leonardofranci • 201 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 • 201 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 • 201 days ago #

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

    • leonardofranci • 200 days ago #

      Just done Nicolas

  7. pyhrus • 198 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 • 198 days ago #

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

  9. pyhrus • 198 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 avatar avatar
Related users ' posts
Maxime Baudin Super travail !
Maxime Baudin Merci l'ami, passe une bonne semaine
IV Mcm Merci de même ;) "style(line,2)" C'è una guida ai parametri che si possono modificare ? Tipo stile della lin...
IV Mcm
IV Mcm
3 months ago
Nicolas Le plus simple est de télécharger le fichier itf présent sur cette page et de l'importer dan...
Daniele Maddaluno Le closedbar est simplement une variable de type boolean, et = t signifie qu'il est égal à t...
yanntorp merci pour vos réponses et le partage de ce code. Cela fonctionne très bien.
Nicolas c'est plus une méthode de contournement que l'utilisation réelle du timeframe monthly.
Manu L. Mais est-il possible de programmer en TF monthly alors que PRT propose max weekly ?
Nicolas c'est très complexe dans ProScreener et différent pour chaque code, peut être dans sa procha...
IV Mcm Line 68 and 70, you must delete the instruction at the end of the line "" Bordercolor(0,0,0,...
BoutDePain This instruction is for the V11 maybe that you are using V10.3 then you can safely remove it.
Protagonist Bonjour, Je vois l'instruction inRange mais je ne trouve pas sa signification. Pouvez-vous...
superprof salut merci pour ton indicateur. Pour bien comprendre , si suis acheteur à quelle comment j...
Nicolas A discrétion, bon courage dans ton apprentissage du trading.
Manu L. Bonjour Nicolas, j'ai créé un screener avec l'aide à la prog en TF weekly mais je voudrai...
5 months ago
Nicolas La définition des couleurs se situent entre les lignes 94 et 118. Selon le type de bougie (h...
Manu35250 Bonjour Nicolas, Est il possible de convertir cet indicateur en screener ? J'essaie depui...
Nicolas Bien s√Ľr, merci de formuler la demande dans le forum appropri√© en respectant les r√®gles de p...
IV Mcm
5 months ago
IV Mcm Vous devez faire un clic droit sur le prix > propriété > ajouter indicateur Si vous...
punch1 Fonctionne pas chez moi il s'affiche rien pourtant j'ai bien fait le clic droit sur le prix ...
punch1 Je peux te faire un screen d'ecran si tu as un email :)
IV Mcm V2 is coming
SudhirRN is this code working for on tradingview plartform?
Nicolas No. All our codes are made to be used with ProRealTime trading platform: https://www.proreal...
Juan Gonzalez Que buen contenido! No tienes alguno que me permita operar Order Flow? Gracias
jissey Bjr Nicolas, merci pour cet indicateur interessant, mais en le recopiant pour creer un progr...
Nicolas Il doit s'agir d'un mauvais copier/coller. Je suggère de télécharger le fichier itf contenu ...