Linear Regression Channel (Simple)

Here you can post and download custom indicators. PLEASE: Do not start topics unless you are posting your own indicator, they will be moved to appropriate section even if you do.

Moderator: admin

Linear Regression Channel (Simple)

Postby Apprentice » Tue Jul 27, 2010 5:04 am

llc.png


Linear Regression Line is a straight line that best fits the prices between a starting price point and an ending price point.

The indicator has two channel modes
1) Max Distance
The distance between Linear Regression Line and Linear Regression channel,
equals to the value of maximum close price Distance from the regression line.

2)Standard deviations
Default value is one Standard deviations from central line.
Linear Regression Channel.lua
(7.74 KiB) Downloaded 1874 times

Linear Regression Channel.png

Linear Regression Channel.lua
Multiple, deviation lines added.
(10.21 KiB) Downloaded 951 times


Data Filter version.
If the price is, beyond the default standard deviation, price is set to standard deviation.
if Price >Mid Line + STD*Multiplier then
Price = Mid Line + STD*Multiplier
elseif Price < Mid Line - STD*Multiplier then
Price = Mid Line - STD*Multiplier
end

Linear Regression Channel With Data Filter.lua
(9.49 KiB) Downloaded 1164 times


Complex version, can be found here.
http://fxcodebase.com/code/viewtopic.php?f=17&t=548&start=0&hilit=Linear+Regression
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36437
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Linear Regression Channel (Simple)

Postby Nikolay.Gekht » Tue Oct 05, 2010 7:46 pm

hi all!

Could you please take a look at auto fibonacci lines indicator. If the approach to manage lines in auto fib. indicator is ok, I can rewrite channel indicator, so you will be able to choose the from/to bar to calculate the channel. I think it would be a bit more useful.
Nikolay.Gekht
FXCodeBase: Site Admin
 
Posts: 1235
Joined: Wed Dec 16, 2009 6:39 pm
Location: Cary, NC

Re: Linear Regression Channel (Simple)

Postby zekelogan » Wed Jan 05, 2011 10:31 am

Is it possible to add in a tidbit of code in order to have the channel extend further than the current period? I suppose a toggle would be handy for those that did not want it...

Thanks!
zekelogan
FXCodeBase: Confirmed User
 
Posts: 56
Joined: Sun Jan 10, 2010 2:45 pm

Re: Linear Regression Channel (Simple)

Postby Nikolay.Gekht » Wed Jan 05, 2011 8:57 pm

Linear regression channel is made as an instrument in upcoming version of TS/Marketscope. So, just wait a few days to have these features "natively".
Nikolay.Gekht
FXCodeBase: Site Admin
 
Posts: 1235
Joined: Wed Dec 16, 2009 6:39 pm
Location: Cary, NC

Re: Linear Regression Channel (Simple)

Postby Blackcat2 » Fri Jan 07, 2011 8:02 am

Very nice indicator, I agree with zekelogan about the option to extend the line couple of bars and also to adjust line style...

Cheers..
BC
Blackcat2
FXCodeBase: Initiate
 
Posts: 118
Joined: Wed May 19, 2010 12:42 am

Re: Linear Regression Channel (Simple)

Postby Blackcat2 » Sun Jan 09, 2011 5:53 pm

I find the regression channel tool in the new version of marketscope difficult to use. I still use this indicator as it automatically update abd calculate the channels.. Is it possible to ask for option to change line style?

Thanks :)
Blackcat2
FXCodeBase: Initiate
 
Posts: 118
Joined: Wed May 19, 2010 12:42 am

Re: Linear Regression Channel (Simple)

Postby holly2011 » Thu Jan 20, 2011 1:52 pm

where can i find the linear regression channel so i can set it to 2 deviation? Because the standard one doesnt tell you what deviation it is set on.
Thank you
Holly
holly2011
 
Posts: 2
Joined: Thu Jan 20, 2011 1:35 pm

Re: Linear Regression Channel (Simple)

Postby Apprentice » Thu Jan 20, 2011 3:36 pm

Under the standard, do you think about the standard tools within the Platform.

This indicator, posted hire, i do not use a standard deviation.
But it is possible to add it.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36437
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Linear Regression Channel (Simple)

Postby Apprentice » Fri Jan 21, 2011 1:02 pm

Standard deviation, channel mode added.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36437
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Linear Regression Channel (Simple)

Postby BlueBloodedTrader » Wed Feb 16, 2011 4:46 am

Is it possible to refine this in such a way that outliers in the data set are ignored? For example , if the linear regression channel is based on a user defined 20 candles, but one of those candles sees an uncharacteristic spike in volatility that is completely out of line with all other candles then it should be removed from the data set used to calculate the linear regression channel and so only 19 periods will be used for the calculation in that case. Outliers may be removed from the dataset if perhaps they exceed 1.65 Standard Deviations or 2 standard deviations from other candles in the defined set.
BlueBloodedTrader
 
Posts: 11
Joined: Tue Feb 15, 2011 6:02 pm

Next

Return to Custom Indicators

Who is online

Users browsing this forum: Bing [Bot] and 35 guests