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

[amibroker] Formula not working



PureBytes Links

Trading Reference Links

Any ideas on why this formula returns nothing for the variable "Mean
Return"?

_SECTION_BEGIN("Close-Close Volatility");
Filter = BarIndex() > 252;
nPeriods = Param("Volatility Period", 5, 5, 252, 5);
LogReturn = ln (Close / Ref(Close, -1));
MeanReturn = Sum (LogReturn, nPeriods) / (nPeriods -1);
ReturnVariance = Sum ((LogReturn - MeanReturn) ^ 2, nPeriods);
Volatility = sqrt ((252 / ( nPeriods - 2)) * ReturnVariance);
Plot(Volatility , "Volatility Periods (" + nPeriods + ")",
colorOrange, styleLine|styleOwnScale);
AddColumn(Close,"Close",1.4);
AddColumn(Ref(C,-1),"c-1",1.4);
AddColumn(LogReturn ,"LogReturn",1.9);
AddColumn(MeanReturn ,"MeanReturn",1.9);
AddColumn(ReturnVariance ,"ReturnVariance ",1.9);
AddColumn(Volatility ,"Volatility ",1.9);
_SECTION_END();

Many thanks for your help.

Drew Yallop



Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/