[amibroker] Re: Annualized Standard Deviation?

 

Hi Gregg


Appreciate the replies. You're right, it's an array, rather than a number which is what I want. I tried the lastvalue code there and it works thanks. However, I realise now I need the value in a percent, which is not what standard deviation does. So, as you point out ROC might be better. However, now I cant get that to work... I tried to just add ROC code in:

SetCustomBacktestProc( "" );
if ( Status( "action" ) == actionPortfolio )
 {
 bo = GetBacktesterObject();
 bo.Backtest();
 eq = bo.EquityArray;
 std = LastValue(StDev( ( ROC( eq, 1 )), BarCount-1 ); // returns a number
 std *= sqrt(252);
 bo.AddCustomMetric( "AnnStDev", std);
 }

but this doesnt work.


What I want it for is to create Perry Kaufman's Information Ratio which is CAR/Annualized SD. The resulting values show how likely the system is to be robust. Anything above 3.0 indicates an overfit system.


Also, I wondered why it wasnt working and added the following code to Explorations:

Filter = Buy;

roconeday = ROC( C, 1 );
std = StDev( roconeday, BarCount-1 );
annstd = std * sqrt(252);

AddColumn( roconeday, "roc1day" );
AddColumn( std, "std" );
AddColumn( annstd, "annstd" );


For some reason, both the std and annstd dont show any values at all in their columns. If I remove BarCount-1 and replace it with a number like 2300, then MOST of the values show up, but for some symbols there are no values. Any ideas?


Much thanks


CK


__._,_.___

Posted by: sladbrook@hotmail.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (4)
**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

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


.

__,_._,___

Related Posts


EmoticonEmoticon

:)
:(
=(
^_^
:D
=D
=)D
|o|
@@,
;)
:-bd
:-d
:p
:ng
:lv