| 
 Oops!  Forgot to include another function. 
 
  
  SDF      = 
StDev(ROC(Close,    1),252); 
  
JOE  
  
----- Original Message ----- 
 
Sent: Tuesday, December 07, 2004 7:08 AM 
Subject: Re: [amibroker] Re: Sharpe Ratio  
  
Here's some raw material that may be 
useful.  Note that you need an array of a standard rate of return. That's 
calculated by the function below - Irate(5) for 5 %, the 
percentage is something you choose. 
 
  
Then in the last line used to calculate the 
Sharpe ratio, place your equity in there... in your case I'm thinking you are 
measuring the <~~~equity> from your backtesting.  
  
BTW - If you're using the AB AutoAnalyser 
routine. wouldn't  the backtesting report give you the Sharpe Ratio. 
 
  
Credit for these forumlas due to Bruce, and 
others.  Hope this helps. 
 JOE  
  
function Irate(interest_rate) { // This 
gets the log of the daily rate logbarfactor = log(1 + interest_rate / 100) / 
252; 
  
// Force the first bar to 0 logvect = 
IIf(BarIndex() == 0, 0, logbarfactor); 
  
// Sum the log of the daily gain factors 
and // convert back to get 
equity return(exp(Cum(logvect))); } 
  
//   Plot this in your testing to see 
if  you agree 
// Test with an APR of 5.%   vect = 
Irate(5); 
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
 // SHARPE PERFORMANCE INDEX a risk adjusted 
measure of the performance of an equity compared to the risk free benchmark 
standard rate of return eg = 5%      vect = 
Irate(5);   // use this intermediate step or place in the forumla 
below       SHARPE = ( MA(ROC(C,1),252) - 
MA(ROC(Vect,1),252) )/(SDF); 
  
  
  
  ----- Original Message -----  
  
  
  Sent: Tuesday, December 07, 2004 1:01 
  AM 
  Subject: Re: [amibroker] Re: Sharpe 
  Ratio 
  
  -----BEGIN PGP SIGNED MESSAGE----- Hash: 
  SHA1
  <re-sequenced for bottom posting>
  > --- In amibroker@xxxxxxxxxxxxxxx, 
  "danielwardadams" > <danielwardadams@x...> wrote: > 
  > Is there any way to programmatically access the Sharpe Ratio > > 
  resulting from a backtest? > > > > TIA, > > 
  Dan
  On Tue, 7 Dec 2004 17:44, Pal Anand wrote: > 
  Dan, > > This may help: > > http://finance.groups.yahoo.com/group/amibroker-ts/message/2369 > > 
  rgds, Pal
  The word 'sharpe' doesn't appear anywhere on that page.  
  If that's the page  you meant to reference, how does it help?
  - -- 
         Nigel 
  Rowe       
  rho@xxxxxxxxxxxxxxx
 
  -----BEGIN PGP SIGNATURE----- Version: GnuPG 
  v1.2.4 
  (GNU/Linux)
  iD8DBQFBtVU6BbmcM2pfckkRAvRlAKCIdU95mcj5VfAd/9Cbv7nhYuOvJACg8kwe hwRXucGcS3RFp3/9ISFJ41M= =hAyH -----END 
  PGP SIGNATURE-----
 
  Check AmiBroker web page at: http://www.amibroker.com/
  Check 
  group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  
 
  
  
Check AmiBroker web page at: 
http://www.amibroker.com/ 
 
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
  
 
| Yahoo! Groups Sponsor | 
 
  ADVERTISEMENT
 ![click here]()  |     | 
 
![]()  |  
 
 
 
Yahoo! Groups Links 
  |