PureBytes Links
Trading Reference Links
|
A Centered MA will be created if we shift an MA to the center of its
period.
For this reason the period must have a center which is equivalent to
have an odd period.
[per=2*k+1, k=integer]
A first AFL approach is
per=15;//odd period
m1=MA(C,per);//moving average
Cm1=Ref(m1,floor(per/2));//centered MA at first sight
Is it always accurate ?The answer is not positive.
The last 7 bars in the above example are unknown, they do not exist
yet and belong to the future.
AFL has an internal hypothesis to plot these 7 last bars, considering
them as equal to the last existing bar.
It may be convenient for graphs but it is not correct from the
mathematical point of view.
Especially if these last 7 bars will be used for further
calculations, then the confusion will pass to the next formulas and
it is not easy to estimate the spread of the inaccurate results.
If we make a multiple use of Ref(X,a), a>0 functions, then the
results will be quite unrealistic.
The correct AFL interpretation of the Centered MA sould be
x=Cum(1);L1=LastValue(Cum(1));
per=15;//odd period
m1=MA(C,per);
Cm1=Ref(m1,floor(per/2));
Cm1=IIf(x<=L1-floor(per/2),Cm1,Null);
The last 7 bars will be empty and will be filled as new data will
arrive.
Dimitris Tsokakis
------------------------ 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
---------------------------------------------------------------------~->
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 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/
|