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
Gaspare Ciao Ivan si puo' inserire una strategia su questo indicatore per ottimizzare le variabil...
Iván
2 weeks ago
groelandes Cuando te descargas el fichero itf, en su código no aparece toda la configuración de alertas...
Iván Si lo descargas e importas en tu PRT verás que se han creado las variables para luego config...
P. Marlowe Quite an impressive work, Iván. Extremely useful and accurate. Congratulations. Keep it up¡
lkiklkik i love it !!! thanks.
Stenozar Hi Ivan, can you translate from tradingviwe the EMA TREND METER INDICATOR? It couid be inte...
Iván Hi Yes I can. Please, create a new topic for that I will translate it.
Stenozar Hi Ivan, I've created a new topic about the indicator: https://www.prorealcode.com/topic/ema...
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...
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
2 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: ...
Iván
2 months ago
Madrosat Hello Ivan You have interesting topics on indicators , smart supertrend, optimised trend t...
Iván Hi! thanks. All of these codes are translations requested in the forum. I've on mind to back...
Raspete01 Buenos días Iván, estoy intentando llevar el código eliminando los colores y pasando un Back...
Iván
3 months ago
ARLEQUIN49 Hello Ivan, Would it be possible to convert the code of this QQE MOD indicator which accomp...
ARLEQUIN49 here is the code: //@version=4 //By Glaz, Modified // study("QQE MOD") RSI_Period = i...
Iván Hi, Yes I can translate it but please, create a new topic for it.
Fgats quelques explications en Français ici : Some explanations in French here : https://www.p...
Nicolas Merci pour cette contribution, j'apprécie ! :)
Fgats Merci Nicolas pour ces encouragements et merci aussi pour le commentaire en Anglais accompa...
Msport71 Thank You very much
Alai-n I really like it when you develop ideas around price movement! I am much less a fan of all t...
elcortijoverde Muy buen trabajo.Intuitivo y claro.Gracias por tu dedicación y aportación.
Nicolas
9 months ago
B-Xtrender
B-Xtrender
7
Indicators
Fgats I suspected something like this but in the PRT documentation I couldn't find anything to exp...
616248 Bonjour Nicolas, Peux tu nous expliquer le principe de fonctionnement ? Ou nous mettre un...
Nicolas Le lien vers l'article IFTA de l'auteur est dans le post déjà :)
JS
9 months ago
Trendilo
Trendilo
0
Indicators

Top