The original script was posted on ProRealCode by user Nicolas. This is an indicator made of the linear regression applied to the rate of change of price (or momentum). I made a simple signal line just by duplicating the first one within a period decay in the past, to make those 2 lines cross. You can add more periods decay to made signal smoother with less false entry.
experimental: draws a line from 2 vectors(price, time) update: reformatted the function, added automatic detection of the period multiplier by approximation(gets a bit goofy with stocks/week time), example using timestamp() function. offsetting is still bugged, i cant find a way around it atm.
Method to draw linear regression lines from average price advance&decline range
Version 2 - Linear Regression Slope. This version will have more freedom on picking your own length for all the Inputs. One of the main reason I changed it is because, Slope calculation on transition period was not being computed properly. Because the Version 1, looks back the length assigned, and compute the slope based on two candle readings, could be 10 days...
Corrected Version, for VERSION - 2 () updated for Custom Length, and fixed some formula glitches.
This is version 1 of the Linear Regression Slope. In ideal world the Linear regression slope values will remain same for any time period length. because the equation is y = mx+b, where m is the slope. All I did here is m = y/x The Main Purpose of this indicator is to see, if the Trend is accelerating or decelerating. The first Blue bar will caution when a...