Hello,

 

Thanks for Rmetrics, a great package for R.  However I think there's a bug
in sharpeRatio function in fTrading package.  It assigns y <- diff(x), which
is the arithmetic difference.  I think you should use y <- x[-1]/x[-nrow(x)]
-1, or y <- diff(log(x)).  I suppose the input is intuitively the index
instead of log index.  The current version is close when the returns are
very small, but can be off by a lot when the return is volatile.  I was
puzzled why the sharpe ratio dropped so much after I increased the leverage
in the portfolio.  

 

 

Thanks,

Hui

 


	[[alternative HTML version deleted]]

