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

[amibroker] Anyone have any ideas on how to calc an angle on a 34 EMA?



PureBytes Links

Trading Reference Links

In general, to calculate an angle on a line is just

atan(abs((y2-y1)/(x2-x1)) * 180 / pi

I would like to calculate the angle of a 34 ema, possibly the last 
10-15 bars.  I started off like this:

Take a linear regression line through the 34 ema:

array = LinearReg(EMA(Close, 34), 10);
angle = atan(abs(array[BarCount-1] - array[BarCount-11])/10.0) * 
180 / 3.1459;

What I'm finding is that the angle is way too small in comparison to 
that I'm seeing on the screen.  It's as though using the x-axis with 
just bar counts is throwing off the slope.

Any ideas greatly appreciated,

Steve



Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

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/