[amibroker] Re: Annualized Standard Deviation?

 

Also, that Information Ratio is just the Sharpe with a target return value of zero. In conjunction with the two functions I shared earlier, you can use this one to calculate the Sharpe. If you are doing this in the CBT, you can skip the DailyCompounding steps and just retrieve CAR from the stats object. Also, in PortfolioSharpe, your measureperiod would be barCount - 1, your report period is 252, and you can just pass in 0 for tr to get the Information Ratio:


function DailyCompounding(sourceArray, period) { //Begin DailyCompounding
// Computes what the daily compound growth rate is between two values separated by periods

// compute daily compounding, corrected for divide by zero
// Using standard formula for recovering the compounding rate expressed
// in terms of a specified time frame.
// The standard formula is: (LaterValue/EarlierValue)^(1/# of compounding periods)-1

num = sourceArray;
denom = Nz(Ref(sourceArray, -period));
 //avoid div by zero warning
denom = IIf(AlmostEqual(denom, 0), 0.001, denom);
result = Nz(((num/denom)^(1/period))-1);

return result;
} // End DailyCompounding

function PortfolioSharpe(sourceArray, measurePeriod, reportPeriod, tr) { //begin PortfolioSharpe
// Computes the Sharpe ratio of sourceArray over measurePeriod and adjusts the return value
// to represent reportPeriod.
// Compute the daily rate of compounding 
// And adjust to represent excess returns.
compoundingRate = DailyCompounding(sourceArray, measurePeriod);
excessCompounding = compoundingRate - tr; // Excess compounding power
scaledExcessReturn = ((1 + excessCompounding)^reportPeriod)-1;
//Volatility(watchListName, sourceArray, measurePeriod, reportPeriod) 
vol = Volatility(watchListName, sourceArray, measurePeriod, reportPeriod); 

result = scaledExcessReturn/vol;

return Nz(result);
} //end PortfolioSharpe

__._,_.___

Posted by: rosenberggregg@yahoo.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (6)
**** 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