Click here to Login

                                                   Quality of fit of CLOSE to linear regression for last n bars.


Michael McNaughton
2013-05-10 04:11:54

I like stocks that have entered into a narrow trending channel. As such these stocks should conform closely to the linear regression line taken over period of
interest (probably the last n bars or so).
if the regression line is y=ax+b
and is the best fit over the period
//ref(close,period) would be the close at the beginning of the period
// b would be the value of the linear reg. line at the beginning of the period
For n=0 to period
linregr=b+n*a; value of linear regression line a point x

answer=sqrt(sumsq); // the smaller this number is, the closer the data is to the linear regression line

I hope somebody can understand this "structured english" rambling and point me in the right direction.

Any insights?

2013-05-13 14:08:42


Best Answer

Please use the following function: Standard Error of the Estimate of a Regression Line

Standard Error of the Estimate of a Regression Line (by QuantShare, uploaded several months ago)
No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads Notes Report an item

No more messages


No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"


Trading Items
High to low stock pattern for the close price
Weighted Linear Regression
Trading System based on the Linear Regression of the RSI Indicato...
% bars in last N trading days where stock close price increased
Adaptive Trading System - Percent Winning Trades for the Last N-D...

How-to Lessons
How to quickly select stocks based on the last value of a databas...
How to download EOD quotes for active and valid stocks only
How to add future bars to plan for market scenarios
How to get fundamental data for U.S. Stocks
How to download historical EOD data for penny stocks

Related Forum Threads
close above the highest high in the last 5 days
Replacing value for the last 100 bars (end of day data)
How do I find the close price for an entry matching a custom DB
Trading System based on the Linear Regression of the RSI Indicato...
Historical Daily High, Low, and Close for every single stock?

Blog Posts
How to Scan for Parallel Resistance and Support Lines
Custom Shortcuts - Move a Chart to Display the Last Quotes/Data
Different Ticker Symbols for Each Data Source
How to get buy and sell orders for a portfolio based on a trading...
How to Create Custom Metrics for Your Trading Positions

Create an account
Affiliate Program
Contact Us
Trading Forum
How-to Lessons
About Us
Terms of Use

Copyright 2021
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Follow us on Google+
RSS Trading Items

Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.