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

[amibroker] Accuracy of weekly ema calculation



PureBytes Links

Trading Reference Links

Out of curiosity I decided to compare the accuracy of weekly EMA 
calculations against other programs.  I had a niggling feeling that I 
would find a disagreement.  Not to my surprise the EMA values 
produced by AB did not agree with the values produced by three other 
programs.

The other three programs produced EMA values that agreed with each 
other but not with AB's results.  I am now trying to find an 
explanation for the discrepency.

Below,is the script I am using in AB to get weekly EMA values doing 
an explore on selected equities.  For this test I am calculating a 30-
week EMA.

Filter = 1;
 
ws = DayOfWeek() < Ref( DayOfWeek(), -1 );
we = DayOfWeek() > Ref( DayOfWeek(),1);

WCl = ValueWhen(we, Close);
wv = ValueWhen(we, Sum(V,5));

AddColumn(WCl, "Close");
AddColumn(EMA(WCl,150), "EMA");
AddColumn(Cross(WCl, EMA(WCl,150)), "Cross");

Do I have an error in the above?  Is there an inherent error in the 
process that I am unaware of?  After I discovered this problem, I no 
longer trust AB's results in so far as weekly calculations are 
concerned.  Note that what I am doing involves processing in both 
weekly and daily timeframes so setting AB's periodicity to weekly is 
not an option. Any comments would be appreiated.

Mike O.


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 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/