Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Interactive Linear Regression Channel for Amibroker (AFL)

Rating:
4 / 5 (Votes 8)
Tags:
amibroker

A User-Interactive Linear Regression Channel

Screenshots

Similar Indicators / Formulas

Kavach Of Karna v2
Submitted by hbkwarez over 10 years ago
Advanced Elliott Waves
Submitted by MarcosEn almost 13 years ago
3_6Day GuaiLiLv
Submitted by motorfly almost 13 years ago
Williams Alligator System
Submitted by durgesh1712 about 13 years ago
*Level Breakout system*
Submitted by Tinych about 13 years ago
Horizontal Live Priceline Tool
Submitted by northstar about 13 years ago

Indicator / Formula

Copy & Paste Friendly
SetChartBkColor(ParamColor("Background Color",colorBlack));
SetChartOptions(0,chartShowDates);
SetBarFillColor(IIf(C>O,ParamColor("Candle UP
Color",colorGreen),IIf(C<=O,ParamColor("Candle Down
Color",colorRed),colorLightGrey)));

Plot(C,"Price",IIf(C>O,ParamColor("Wick UP
Color",colorDarkGreen),IIf(C<=O,ParamColor("Wick Down
Color",colorDarkRed),colorLightGrey)),64,0,0,0,0);

_SECTION_BEGIN("Linear Reg Channel");
//Plot(Close, "", 55, GetPriceStyle());
P        = ParamField("Price field", -1);
Daysback = Param("Period for Linear Regression Channel", 50, 1, 300, 1);
SDP1     = Param("Standard Deviation 1", 1.0, 0, 6, 0.05);
SDP2     = Param("Standard Deviation 2", 2.0, 0, 6, 0.05);
SDP3     = Param("Standard Deviation 3", 3.0, 0, 6, 0.05);
ext      = Param("extend Linear Regression Channel", 15, 0, 50, 1);
shift    = Param("Look back period", 0, 0, 240, 1); 
Collg    = ParamColor("Color Linear Reg Line", colorRed); 
Colsd1   = ParamColor("Color StDev 1", colorBlue);
Colsd2   = ParamColor("Color StDev 2", colorLime);
Colsd3   = ParamColor("Color StDev 3", colorGold);
SDP1     = SDP1/2;
SDP2     = SDP2/2;
SDP3     = SDP3/2;
pds      = Daysback;
x        = BarIndex() + 1;
sx       = SelectedValue(x)-shift;
aa       = SelectedValue(Ref(LinRegIntercept(P, pds), -shift));
bb       = SelectedValue(Ref(LinRegSlope(P, pds), -shift));
StDev0   = StDev(P, pds);
fd1      = SelectedValue(Ref(SDP1 * StDev0, -shift) );
fd2      = SelectedValue(Ref(SDP2 * StDev0, -shift) );
fd3      = SelectedValue(Ref(SDP3 * StDev0, -shift) );
ys       = SelectedValue(ValueWhen(x, aa, 1));
yi       = SelectedValue(ValueWhen(x, bb, 1));
xs       = sx - pds;
d        = ext;//Shift Line Right
xe       = xs + pds + d;
ye       = ys + yi * (xe - xs);
sty      = 1|32|2048;
Plot(LineArray(xs-d,ys,xe-d,ye,1),"",Collg,sty,0,0,d);
Plot(LineArray(xs-d,ys-fd1,xe-d,ye-fd1,1),"",Colsd1,sty,0,0,d);
Plot(LineArray(xs-d,ys+fd1,xe-d,ye+fd1,1),"",Colsd1,sty,0,0,d);
Plot(LineArray(xs-d,ys-fd2,xe-d,ye-fd2,1),"",Colsd2,sty,0,0,d);
Plot(LineArray(xs-d,ys+fd2,xe-d,ye+fd2,1),"",Colsd2,sty,0,0,d);
Plot(LineArray(xs-d,ys-fd3,xe-d,ye-fd3,1),"",Colsd3,sty,0,0,d);
Plot(LineArray(xs-d,ys+fd3,xe-d,ye+fd3,1),"",Colsd3,sty,0,0,d);
_SECTION_END();

3 comments

1. szgolyas

error in line 1

2. aborayyan

Thanks for this indicator

3. bsedoha

Thanks for sharing.__

Leave Comment

Please login here to leave a comment.

Back