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

[amibroker] Re: Accuracy of weekly ema calculation



PureBytes Links

Trading Reference Links

Tomasz,

Thank you for pointing out where my problem was and making me aware 
of the timeframe.dll module.  I quickly looked at the dll at it 
indeed appears to provide me with the functionality that I need for 
my project.  As I had mentioned in my post I need to do processing 
using both daily and weekly data and using a weekly chart 
periodicity is not an option for me.

Mike O.

--- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@xxxx> 
wrote:
> Hello,
> 
> Yes you are doing the error.
> 
> You should switch the chart to weekly interval
> to calculate weekly EMA.  
> ====================================
> 
> Weekly EMA must be calculated from weekly data
> ======================================
> and only then you can compare it to output of other programs.
> Also -- different programs differently "initialize" EMA.
> Since EMA is recursive the first value (after the first period-
elements)
> must be initialized somehow. MS and AB use simple MA to initialize
> first element of EMA, but some other packages work differently.
> 
> Calculating weekly EMA from daily data without switching
> to weekly interval is possible however requires much more complex
> code that yours. It is better for you to take a look at 
TimeFrame.dll
> that will do this for you:
> http://www.amibroker.net/3rdparty.php
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
> ----- Original Message ----- 
> From: "Michael Orlyk" <bmwrider@xxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Friday, March 14, 2003 11:59 AM
> Subject: [amibroker] Accuracy of weekly ema calculation
> 
> 
> > 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@xxxx
> > Send SUGGESTIONS to suggest@xxxx
> > -----------------------------------------
> > 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/ 
> > 
> > 
> >


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/