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

Re: [amibroker] Linear Regression lines compressing the charts?



PureBytes Links

Trading Reference Links

Is there any need for the paramstyle for the lkinreg lines?
Could you just make them StyleLine|stylenorescale

eg
Plot( LRLine , "LinReg", LRCOLOR, StyleLine|styleNoRescale );

or if you need the paramstlye add it ot the param option list, or add
tot he plot line
Plot( LRLine , "LinReg", LRCOLOR, LRSTYLE|styleNoRescale );

I have assumed your original problem was that the price chart was
compressed on the Yaxis(price) creating larger space above and below
the price chart.
to see the chart I added Plot(C,"",colorGrey50,styleBar); to the first
line of the code, I assume yu add this to a price chart by drag-drop
method
Another thought if you do not need to actually change the line colours
then maybe make them set colours and remove the paramcolor. This can
make it much simpler to write the code and less onerous when you want
to plot it havng to change colours all the time


On 7/23/05, Mark Keitel <mkeitel@xxxxxxxxxxxxxxx> wrote:
> 
> 
> Graham,
> 
>  
> 
> Thank you
> 
> Where would you suggest I add it in this formula?   I have tried adding it
> in different locations but keep getting syntax errors
> 
>  
> 
>  
> 
>  
> 
>  
> 
> P = ParamField("Price field",-1);
> 
> Daysback = Param("Period for Liner Regression Line",21,1,240,1);
> 
> shift = Param("Look back period",0,0,240,1); 
> 
>  
> 
>  
> 
> //  =============================== Math Formula
> =============================================================
> 
>  
> 
> x = Cum(1);
> 
> lastx = LastValue( x ) - shift; 
> 
> aa = LastValue( Ref(LinRegIntercept( p, Daysback), -shift) ); 
> 
> bb = LastValue( Ref(LinRegSlope( p, Daysback ), -shift) ); 
> 
> y = Aa + bb * ( x - (Lastx - DaysBack +1 ) ); 
> 
>  
> 
>  
> 
> // ==================Plot the Linear Regression Line
> ==========================================================
> 
>  
> 
>  
> 
> LRColor = ParamColor("LR Color", colorCycle ); 
> 
> LRStyle = ParamStyle("LR Style");
> 
>  
> 
> LRLine =  IIf( x > (lastx - Daysback) AND BarIndex() < Lastx, y, Null );
> 
> Plot( LRLine , "LinReg", LRCOLOR, LRSTYLE ); //  styleDots ); 
> 
>  
> 
> // ==========================  Plot 1st SD Channel
> ===============================================================
> 
>  
> 
> SDP = Param("Standard Deviation", 1.5, 0, 6, 0.1);
> 
> SD = SDP/2;
> 
>  
> 
> width = LastValue( Ref(SD*StDev(p, Daysback),-shift) );   // THIS IS WHERE
> THE WIDTH OF THE CHANELS IS SET  
> 
> SDU = IIf( x > (lastx - Daysback) AND BarIndex() < Lastx, y+width , Null ) ;
> 
> SDL = IIf( x > (lastx - Daysback) AND BarIndex() < Lastx, y-width , Null ) ;
> 
>  
> 
> SDColor = ParamColor("SD Color", colorCycle ); 
> 
> SDStyle = ParamStyle("SD Style");
> 
>  
> 
> Plot( SDU , "Upper Lin Reg", SDColor,SDStyle ); 
> 
> Plot( SDL , "Lower Lin Reg", SDColor,SDStyle ); 
> 
>  
> 
> //  ==========================  Plot 2d SD Channel
> ===============================================================
> 
>  
> 
> SDP2 = Param("2d Standard Deviation", 2.0, 0, 6, 0.1);
> 
> SD2 = SDP2/2;
> 
>  
> 
> width2 = LastValue( Ref(SD2*StDev(p, Daysback),-shift) );   // THIS IS WHERE
> THE WIDTH OF THE CHANELS IS SET  
> 
> SDU2 = IIf( x > (lastx - Daysback) AND BarIndex() < Lastx, y+width2 , Null )
> ;
> 
> SDL2 = IIf( x > (lastx - Daysback) AND BarIndex() < Lastx, y-width2 , Null )
> ;
> 
>  
> 
> SDColor2 = ParamColor("2 SD Color", colorCycle ); 
> 
> SDStyle2 = ParamStyle("2 SD Style");
> 
>  
> 
> Plot( SDU2 , "Upper Lin Reg", SDColor2,SDStyle2 ); 
> 
> Plot( SDL2 , "Lower Lin Reg", SDColor2,SDStyle2 ); 
> 
>  
> 
> // ============================ End Indicator Code
> ==============================================================
> 
>  
> 
>  
> 
> Mark
> 
>  
> 
> 
> 
> 
>  
> 
>  
> ________________________________
> 
> 
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
> Of Graham
> Sent: Friday, July 22, 2005 6:37 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: Re: [amibroker] Linear Regression lines compressing the charts?
> 
>  
> 
> try adding 
> +stylenorescale
> to the plot of linreg line
> On 7/22/05, Mark Keitel <mkeitel@xxxxxxxxxxxxxxx> wrote:
> > 
> > 
> > I was curious why when I place a set of linear regression lines on the
> > candle-stick charts it compresses the candles and the whole chart making
> it
> > look different when there were no lines there
> > 
> >  
> > 
> > Took the same line configurations from Telechart2005 where it did not do
> > this to the chart
> > 
> >  
> > 
> > Was curious as to why this may happen and if there is s fix for it?
> > 
> >  
> > 
> > Thank you
> > 
> >  
> > 
> > Mark
> > ________________________________
> > 
> > 
> > Please note that this group is for discussion between users only.
> > 
> > To get support from AmiBroker please send an e-mail directly to 
> > SUPPORT {at} amibroker.com
> > 
> > For other support material please check also:
> > http://www.amibroker.com/support.html
> > 
> > 
> > 
> > 
> > 
> > SPONSORED LINKS 
> > Investment management software Investment property software Investment
> > software 
> > Investment tracking software Return on investment software Stock
> investment
> > software 
> > ________________________________
> > YAHOO! GROUPS LINKS 
> > 
> >  Visit your group "amibroker" on the web.
> >   
> >  To unsubscribe from this group, send an email to:
> >  amibroker-unsubscribe@xxxxxxxxxxxxxxx
> >   
> >  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
> >  To unsubscribe from this group, send an email to:
> >  amibroker-unsubscribe@xxxxxxxxxxxxxxx
> >   
> >  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
> >  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
> > ________________________________
> > 
> 
> 
> -- 
> Cheers
> Graham
> AB-Write AFL Writing Service
> http://e-wire.net.au/~eb_kavan/ab_write.htm
> 
> 
> 
> Please note that this group is for discussion between users only.
> 
> To get support from AmiBroker please send an e-mail directly to 
> SUPPORT {at} amibroker.com
> 
> For other support material please check also:
> http://www.amibroker.com/support.html
> 
> 
> 
> 
> 
> SPONSORED LINKS 
> Investment management software Investment property software Investment
> software 
> Investment tracking software Return on investment software Stock investment
> software 
> ________________________________
> YAHOO! GROUPS LINKS 
> 
>  Visit your group "amibroker" on the web.
>   
>  To unsubscribe from this group, send an email to:
>  amibroker-unsubscribe@xxxxxxxxxxxxxxx
>   
>  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
>  To unsubscribe from this group, send an email to:
>  amibroker-unsubscribe@xxxxxxxxxxxxxxx
>   
>  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
>  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
> ________________________________
> 
> 
> 


-- 
Cheers
Graham
AB-Write AFL Writing Service
http://e-wire.net.au/~eb_kavan/ab_write.htm


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/DldnlA/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html

 
Yahoo! Groups Links

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

<*> 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/