[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Linear Regression Line Array not plotting, please help


  • Date: Sun, 31 Jan 2010 19:11:26 -0000
  • From: "wooziwog" <xcitemint@xxxxxxx>
  • Subject: [amibroker] Linear Regression Line Array not plotting, please help

PureBytes Links

Trading Reference Links

The following formula plots the Linear Regression.  I have created the start and ending points for the linearray as well as the starting and ending y values.  When I press the "apply indicator" the line array appears for a moment and then disappears.  Any help in identifying my coding error is appreciated.

Thanks,

David K.

//Linear Regression Line Array

GraphXSpace=5;
Plot(C,"",29,128|4);

pds=20;
lbk=0;
bi = BarIndex()+1;
sb = SelectedValue(BarIndex());
sx = SelectedValue(bi)-lbk;
aa = SelectedValue(Ref(LinRegIntercept(C,pds),-lbk));
bb = SelectedValue(Ref(LinRegSlope(C,pds),-lbk));
yy = aa + bb * (bi-(sx - pds+1));
xs = sb - pds - lbk;//Linearray starting point
ys = SelectedValue(Ref(yy, -pds-lbk));//Linearray starting value
xe = sb - lbk;//Linearray ending point
ye = ys + bb *(xe - xs);//Linearray starting value
LR = IIf(bi >= (sx - pds) AND bi <= sx, yy, Null);//standard LR line 
Plot(LR, "LR", 10, 1);//plot Linear Regression Line

Plot(IIf(bi>xs,ys,Null),"",36,8);//Linearray starting Value from "xs"
Plot(IIf(bi>xe,ye,Null),"",36,8);//Linearray ending Value from "xe"
Plot(LineArray(xs,ys,xe,ye,1),"LR",25,1);//This line only plots for a moment when "apply indicator" is pressed and then disappears



------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    amibroker-digest@xxxxxxxxxxxxxxx 
    amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/