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

[amibroker] Re: how do i calculate slope of a ma?



PureBytes Links

Trading Reference Links

j,

If you want the slope based on the value today and yesterday, I 
would use MA(close,x)-MA(ref(close,-1),x), where x is the length of 
the moving average. This is the old "rise over run" from algebra. 
However, you should normalize this value if you want to compare it 
to something else. Say stock A has a MA that was 100 yesterday and 
105 today. The slope would be 5. Stock B has a MA that was 10 
yesterday and 10.5 today. The slope would be 0.5. But both changed 
by the same percentage. So you could divide both values by the MA 
yesterday, then both would be 0.05, the same "slope".

Maybe one of the experts out there could clarify one thing:

Is MA(ref(close,-1),x) the same as ref(MA(close,x),-1) ?

For the buyprice question, it would be buyprice=MA(close,x)-0.25;

Hope that helps,

Jim


--- In amibroker@xxxxxxxxxxxxxxx, "jaykwok425" <jaykwok@xxxx> wrote:
> 2 Questions:
> 
> 1) How do I calculate the slope of a moving average?
> 
> 2) How would I set buyprice to be 1 tick under a moving average 
> (assuming ticksize = 0.25)?
> 
> Thanks for answering my newbie questions,
> 
> j


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/