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

[amibroker] Re: Straight Trend Line



PureBytes Links

Trading Reference Links

Is this what you're looking for in pane 1 ?  
(you can find this under LINREGINTERCEPT in the Help menu).

// code start

Daysback = 30;  // set lookback
x = Cum(1);
lastx = LastValue( x ); 
aa = LastValue( LinRegIntercept( Close, Daysback) );
bb = LastValue( LinRegSlope( Close, Daysback ) );
y = Aa + bb * ( x - (Lastx - DaysBack) ); 
Plot( Close, "Close", colorBlack, styleCandle );
Plot( IIf( x >= (lastx - Daysback), y, -1e10 ), "LinReg", colorRed ); 

// code end


--- In amibroker@xxxxxxxxxxxxxxx, "Rick" <RickParsons@xxxx> wrote:
> Since I am mathematically challenged, can someone show my how to 
> create these two indicators:
> 
> PANE 1:
> 
> Price chart with STRAIGHT trendline going thru the "middle" of the 
> data for XX number of bars back.  This trend line should be 
> calculated to be equal distance for all high and low closing price 
> points for XX bars back.  
> 
> PANE 2:
> 
> Plot the STRAIGHT Trendline defined above straight across Pane 2 so 
> it does not slope up or down.
> 
> Now plot the Standard Deviation (SD) of price around this STRAIGHT 
> trendline.  The SD line will plot how many SD's the price deviates 
> from the Straight Trendline defined in PANE 1.
> 
> I know this will be a challenge.  It may be difficult to understand 
> just what I am asking and if so, please feel free to ask me 
questions.
> 
> I greatly appreciate the time and help on this great forum!
> 
> Thanks,
> Rick  :)




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Put more honey in your pocket. (money matters made easy).
http://us.click.yahoo.com/r7D80C/dlQLAA/cosFAA/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/