TreL – Linear Regression Trend

v10.3
TreL – Linear Regression Trend

This indicator based on linear regression trend.
Blue line is a positive trend or buy/bullish trend. Red line trend is a negative trend or sell/bearish trend.

Upper and lower channel lines (in grey color) can be used as trailing stop or possible rebound of the price (revert to the mean).

Very simple and effective way to use linear regression in a different approach.

Converted from pinescript version as requested in this topic: https://www.prorealcode.com/topic/conversion-of-a-linear-regression-trend-indicator/

(all credits go to original author).

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. Paolo.B • 04/18/2021 #

    Hi Nicolas thanks … I’m new to programming I would like to use it with blue +1 and red -1 graph to try to code it for a strategy.
    Thank you
    I deleted this part.
    band = average [length] (AverageTrueRange [1] (close)) * 2
    endif
    Unfortunately I am unable to attach an image

    • Nicolas • 04/18/2021 #

      change the last line with: return v coloured(r,g,b) style(line,2), v+band coloured(168,168,168), v-band coloured(168,168,168), r
      and test if “r” is superior to 0, if it is the case, then the line is red and therefore the trend bearish.

  2. Paolo.B • 04/18/2021 #

    Thanks … works as i wanted.

  3. Kanamax • 04/18/2021 #

    Bonjour Nicolas, comme Paolo.B je souhaiterais utiliser cette indicateur au sein d’un code. Après avoir copier/coller le code ci dessus j’ai rajouté ceci:

    // Conditions pour ouvrir une position acheteuse
    if not onmarket and b=255 then
    BUY 1 CONTRACTS AT MARKET
    endif

    // Conditions pour fermer une position acheteuse
    if longonmarket and b=0 then
    SELL AT MARKET
    ENDIF

    Malheureusement les positions acheteuses sont beaucoup peu nombreuses et ne suivent pas du tout le fait d’acheter à chaque fois que la courbe est bleue.

    Un conseil pour finir le code correctement?
    Merci d’avance.

    Hi Paolo.B, I have some difficulties to do as you. It seems that works for you, could you share your code to compare coding?

    Thank you in advance.

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar

+3 more likes

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...
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.
Iván sería así //------------------Inputs------------------------------ linreglength = 11//i...
Doddge Muchísimas gracias Iván, está genial.
superfalcio holaaa, have you run some statistics?
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...

Top