Linear Regression (All Data)

The tool plots a linear regression line using the entire history of an instrument on chart. There are may be issues on intraday timeframes less then 1h. On daily, weekly and monthly charts it works without problem.

If an instrument has a lot of data points, you may not see the line (this is TV feature):

To fix that you need to scroll your chart to the left and find the starting point of the line:

And then do an auto-scroll to the last bar:
Notas de Lançamento:
  • Add fix for intraday resolutions
Notas de Lançamento:
  • Fix index
Notas de Lançamento:
  • Add license
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Quer usar esse script no gráfico?
A list of Free indicators:

A list of Paid indicators:

Earn $30:

Toss a coin to your witcher:


This publication will be featured in our "Best Scripts of The Month" selection. Thank you for your valuable contribution to the TradingView community, and congrats!
+5 Resposta
everget PineCoders
@PineCoders, wow PineCoders, how are you, gentleman?
+1 Resposta
PineCoders everget
@everget, ) Good! Very busy but good. Thx again for the script.
+2 Resposta
Wonderful! Thanks.
+1 Resposta
everget bharatTrader
@bharatTrader, you are welcome
you the best
+1 Resposta
everget giacomo.ferrari15
It is faulty for me on 1D XBTUSD. Oh wait, it only works on non log charts.
Very interesting.
+1 Resposta
Out of curiosity, is there any advantage in declaring "var int MAX_BARS_BACK = 5000" outside of the study line itself? I'm seeing this kind of application first time, so asking if you don't mind ^^
+1 Resposta
Início Rastreador de Fundamentos Rastreador Forex Rastreador de Criptomoedas Calendário Econômico Como Funciona Recursos gráficos Preços Indique um Amigo Regras da Casa Central de Ajuda Soluções para Sites & Corretoras Widgets Soluções em Gráficos Biblioteca de Gráficos Lightweight Blog & Notícias Twitter
Perfil Configurações de perfil Conta e Cobrança Amigos indicados Moedas Meus Tíquetes de Suporte Central de Ajuda Mensagens Privadas Conversa Deslogar