emiliolb

Linear Regression Pendant

40 0 2
Remove from Favorite Scripts Add to Favorite Scripts
// Created by emiliolb -- Version 1.0
// Contact emiliolb@outlook.com 
study(title="Linear Regression Pendant", shorttitle="LRP", overlay=true)

src = close[0]
len = input(defval=150, minval=1, title="Linear Regression Length")
//selected_angle = input(defval=20, minval=0, title="Select the angle")
lrc = linreg(src, len, 0)
plot(lrc, color = red, title = "Linear Regression Curve", style = line, linewidth = 2)

lrprev = linreg(close[1], len, 0)
pendant = (lrc - lrprev)
data = (atan(pendant)) > 0

//Please if somebody have suggestions how show this better, let me know
codiff = pendant
plotarrow(codiff, colorup=teal, colordown=orange, transp=40)
This script was updated: Linear Regression Slope
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Billing Sign Out