Trend Following Moving Averages

v11
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?

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

  1. Gert84 • 04/20/2020 #

    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 • 04/20/2020 #

    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 • 04/20/2020 #

      v11 is out since months, for free: https://www.prorealtime.com
      or with a trading account with IB, see the options available here: https://trading.prorealtime.com/en/InteractiveBrokers

  3. eva.g.forsgren • 04/20/2020 #

    Jag får felkod på rad 56?

    • Nicolas • 04/20/2020 #

      This indicator only works on PRTv11 onwards.

    • Jan • 04/20/2020 #

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

  4. MajorBasse • 04/20/2020 #

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

    • Nicolas • 04/20/2020 #

      Yes why not?

    • MajorBasse • 04/20/2020 #

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

    • MajorBasse • 04/20/2020 #

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

  5. leonardofranci • 04/20/2020 #

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

  6. leonardofranci • 04/20/2020 #

    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 • 04/20/2020 #

      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 • 04/20/2020 #

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

    • leonardofranci • 04/20/2020 #

      Just done Nicolas https://www.prorealcode.com/topic/screener_trend-following-moving-averages/

  7. pyhrus • 04/20/2020 #

    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 • 04/20/2020 #

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

  9. pyhrus • 04/20/2020 #

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

  10. Hasardeur • 04/20/2020 #

    Dear Nicolas,
    is there someting at the arry to modify in order to run the trend at the actual PRT version?
    Bset regards
    Hasardeur

  11. MALIMALO • 04/20/2020 #

    Dear Nicolas,
    just try touse your indicator with backtest but it’s not working.
    is anybody reach to use it?
    regards

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
Iván
3 weeks ago
Madrosat Bonjour ivan Quelle différence il y a t il entre Extra trend et ultra trend lequel est le p...
MaoRai54 dear Ivan, it seems to be very interesting but please clarify what are all the lines I see i...
Iván Hi! you have the answer in the last line of code... MacdMiddle as "histo" style(histogra...
kats Le Top , a utiliser avec le nuage violet et alerte TN pour plus de précision.
roccafragius Hello Ivan, very good job! May I ask you to translate teh script from TradingView named Tre...
Iván Hi! yes. You can ask for it here: https://www.prorealcode.com/free-code-conversion/
roccafragius Thank you so much Ivan! I created this request in english Translate from TradingView Indicat...
Regisnew très bel indicateur merci
Jean2139 Bonjour Yvan, Merci pour ton indicateur que je trouve très intéressant. Je suppose que tu ...
Suffi Hier eine kleine Korrektur: //-----Inputs-----------------------------------------// MALengt...
kats Bonjour, J'ai une question etes vous trader? Je m'explique , j'ai téléchargé tous les indi...
Faisalx Hola Ivan. Thanks for your great job. I would appreciate if you have look at my request http...
roccafragius Thank you for all these useful information!! Very great job Ivan! THank you so much
geroniman Merci Ivan, super travail. On peut toujours compter sur toi pour apporter des innovations su...
Stenozar Ciao mi restituisce errore line 1; forse è perchè utilizzo la versione 11 ? in questo caso d...
Stenozar Ciao IVAN , mi da errore per la riga 49 "print tema low"; puoi suggerirmi la modifica da met...
Iván Avete provato a scaricare il file .itf?
Iván Allora crei un nuovo post. Lo aspetterò.
Stenozar Ciao Ivan, ho inserito il post con la richiesta di traduzione. Se puoi vedere, grazie!
Iván perfect!
kats BONSOIR c bon merci j ai trouve ce weekend merci de votre reponse cdlt
the_giorgio Hi, nice work I would like to understand something about prorealtime code. With your ...
Iván Hello. When you use the drawcandle() instruction then in the configuration window you add ...
Gaspare Ciao Ivan si puo' inserire una strategia su questo indicatore per ottimizzare le variabil...
larouedegann TIMEFRAME(15minutes) apparemment ne fonctionne pas
Iván Bonjour Je ne comprends pas bien le problème. L'indicateur fonctionne dans n'importe quelle...
larouedegann OUI je le sais, il fonctionne dans toutes les unités de temps. Mais je souhaite utiliser l'i...
Iván
8 months ago
Iván Si lo descargas e importas en tu PRT verás que se han creado las variables para luego config...
WhyAskOZ Hi, Ivan As always you are doing great coding. The code works on my PRT, however the issu...
Iván You can delete in the last line (return) the configuration for color. Delete coloured(xx,xx,...
Bernard13 (Je réécris mon commentaire -français- en français car certains mots ne correspondaient pas ...
Iván 1000 indicateurs !!! brutaux
Lean Me parece muy buen indicador, y se complementa muy bien en mi sistema, ¿podrías crear un scr...
Iván Gracias! Para el screener sólo tienes que copiar el indicador y poner como condición de búsq...
Lean Muchas gracias Iván, ya lo he podido crear.
Doddge Hola Iván, ¿sería posible crear un screener que indique cuándo las velas coloreadas del indi...
RTR Ivan thank you for the pro-screener. I a trying to understand how to write the signals from ...
Iván Hi, Lines 62 and 63. These lines define buy and sell conditions.
Iván Hi You should delete from the indicator code all drawing functions and all variables not us...
Iván I've created a screener to show [longcondition or shortcondition]
Chrisinobi Hallo Ivan, Danke das ist Perfekt !! Kannst du bitte in der Screener-Bibliothek die itf. hoc...
MaoRai54 Thanks, now it's OK. in your first code at line 15-16 it's missing.
Madrosat Hello Ivan Did you try a strategy with this indicator
Iván Hi. No I didn't. This is a code translation requested by an user a few days ago.
Iván
9 months ago
cjr30 Simplemente modifica las lineas 19 y 21 por las siguientes: drawtext("▲",barindex,low-0.1*a...
groelandes Gracias!!
WhyAskOZ i copied the code into strategy and it gives error on line 21 and 23. it says " Line 1: ...

Top