Louis, I am not quite sure what you mean by "a smooth slope".
Do you want to have a plot of prices that are smoothed ... as you would gt with a filter?? OR do you want a computed value of slope at some particular point? ... if so at what point ... or do you want a plot of the slope ... etc If you can be moe specific that would be halpful! A ----- Original Message ----- From: Louis P. To: [email protected] Sent: Friday, September 05, 2008 8:41 AM Subject: Re: [amibroker] How to calculate a slope % with Rsquared without a loop? Hi, Linear function is my big problem. I'm so weak using that. What is the difference between using this and doing it the other way? BTW, how would you set the number of bars in the current: HHVBars(Var,period); // Find number of bars - distance from HHV to current bar %slope = ((Highest high - currentclose) / Highest high) / number of bars * 100; Thanks, Louis 2008/9/4 Ara Kaloustian <[EMAIL PROTECTED]> You can also use linearray to draw a stright line from HHV to current point. Look up LinearReg function ----- Original Message ----- From: Ara Kaloustian To: [email protected] Sent: Thursday, September 04, 2008 10:37 AM Subject: Re: [amibroker] How to calculate a slope % with Rsquared without a loop? Try this: HHV(Var,period); // find value of highest high HHVBars(Var,period); // Find number of bars - distance from HHV to current bar %slope = ((Highest high - currentclose) / Highest high) / number of bars * 100; You may choose to define slope in a different way, but this is the basic structure A ----- Original Message ----- From: Louis P. To: [email protected] Sent: Thursday, September 04, 2008 9:34 AM Subject: Re: [amibroker] How to calculate a slope % with Rsquared without a loop? Hi, Thanks for your response. I should have said I want to calculate a slope from a high point; I'd like to get a smooth slope from a HHV... How would you do that? Thanks a lot! Louis 2008/9/4 Ara Kaloustian <[EMAIL PROTECTED]> %slope = (variable - Ref(Variable,-x) ) / Ref(Variable,-x) * 100; ----- Original Message ----- From: Louis P. To: [email protected] Sent: Thursday, September 04, 2008 9:20 AM Subject: [amibroker] How to calculate a slope % with Rsquared without a loop? Hi, I was wondering how to calculate the % of a slope without doing any loop. Anybody has any idea? Thanks, Louis
