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
Nicolas
9 months ago
Anthony2A Bjr, j ai des erreurs sur la ligne 69, 74, 78 et 80. sur drawcandle drawtext et endif. si ...
Lucas0000 Hello, Congratulations on this programming, it seems incredible to me, I am new to this but ...
plbourse Hello, I am trying to use this singal (in fact I have converted it to an indicateur giving B...
BriceE Bonjour Nicolas, Je suis a la recherche d'indicateurs pour me donner la meilleure indicatio...
Nicolas
11 months ago
Maxime Baudin Well done Nicolas, creative!
Stenozar Hi Nicolas, please can you explain how to read/use this indicator? thanks!
FXtonio @RICOU en 1 minutes avec un filtre de tendance ZLSMA 200 et eventuellement un rsi 7 , 69% de...
JC_Bywan For people interested in the screener: https://www.prorealcode.com/topic/screener-buy-sell-m...
octum Gracias NJicolas. Las lineas 35 y 36 dan fallo. (¿Es adrede para iniciados?) Puedes co...
Nicolas Yes, Magic if the variable that contains the value of the line, you can test if it goes up o...
dadah1987 Bonjour Nicolas, merci pour cet indicateur. Utilisant pour l'instant la création simplifié p...
Nicolas Merci d'ouvrir un sujet sur le forum avec une description complète du système.
GustavoLoboOrenstein Is it possible to add histogram with only increasing bars?
Nicolas Je ne rencontre pas ce problème avec le NASDAQ par exemple, ce serait plus simple d'ouvrir u...
YvesRobert Bonjour Nicolas, en effet ca marche, je me suis trompé, j'ai bien tout le tracé. C'est parce...
oliTR Bonjour, les conditions longCond et shortCond ne contiennent-elles pas une condition qui s'a...
Jiacky
2 years ago
Kalman Filter
Kalman Filter
0
Indicators
JohnScher Postscript: It's running in the live right now. One position after the other is opened. ...
ullle73 nice!! how's it been since your last post on going live? :)
thomas2004ch Hi, Is this strategy suitable for daily SPY? Regards
AndPar Buongiorno Nicolas, vorrei provare questo indicatore, ma quando lo inserisco in PRT mi vengo...
Nicolas Basta aggiungerlo al prezzo https://www.prorealcode.com/blog/video-tutorials/how-to-add-an-i...
Aragorna hello Nicolas, this indicator works with the last Beta version of PRT? Ive seen tha many in...
wally Hola soy nuevo en el mudo robots. Alguien seria tan amable de poner el archivo itf.file ya q...
Darren Nash I found this works well on the DOW
thomas2004ch Hi John, Is your strategy suitable for daily SPY? Regards
KAMJKAZE thanks, really interesting!
2c95 thanks, why do U prefer average than lowest ? to close under average does'nt mean another...
Stenozar Hi Sever, how can I visualize the coloured areas?
Sever Hi Stenozar, You need to add the color zones yourself , just go to Add Color Zone To set ...
atlante hi nicolas this indicator have 2 wrong borderline and islalastbarupdate. thank you can you h...
Nicolas That'"s because you are not using PRT v11? Just remove lines 59 to 62
Kanamax Hi Roberto, sorry for my confusing previous posts (forget them). My request is very simple,...
robertogozzi Please start a new topic in ProOrder support.
robertogozzi There you go: myMagicTrend = CALL “Magic Trend custom”[20, 14, 1, 5] alpha = 105 b = 0...
johann8 exactly :) Thank you all for the help!
max_92 Ciao Roberto, ho scaricato l'indicatore e come ti avevano già scritto sopra anch'io vedo la ...

Top