Calculating Sharpe Ratio

Discussion in 'Strategy Building' started by fan27, Jun 3, 2018.

  1. fan27

    fan27

    Sharpe ratio = (Average Portfolio Return - Risk free rate of return) / STDEV of returns

    From my research, it looks like the 3 month T-bills rate is considered the risk free rate of return. My question is do I need to determine the T-bill rate for each time period in the calculation? Looking at this website, they are using a constant risk free rate of return for each time period. Seems like it should be different for each period?

    https://corporatefinanceinstitute.com/resources/templates/excel-modeling/sharpe-ratio-calculator/

    I have custom backtesting software and need to calculate the Sharpe ratio and want to do it in the same way it is done by the major backtesting software vendors (Tradestation, Ninjatrader, etc).

    Thanks!
     
  2. Nighthawk

    Nighthawk

    And what happens when your "risk free rate of return" is negative like in good, old Europe and some other places, too?

    You are allowed to THINK outside of the box!
     
  3. fan27

    fan27

    Assuming different values for "risk free rate of return" were used for each period, then the rate would be a negative value in that case. I am less concerned with having a theoretically "pure" calculation of the Sharpe ratio then matching what other platforms do (Tradestation, etc..) so that results from my platform will be able to match the same backtest results run in those platforms.
     
  4. Millionaire

    Millionaire

    Most probably the other platforms come up with slightly different values for the ratio on the same system from each other. As they will likely be using slightly different risk free numbers.

    Are you looking to be a platform vendor? Otherwise it is not exactly required to be super accurate when calculating the ratio. If you are using Sharpe as a metric for your own systems, you will be using it to compare two competing systems. Using a fixed value for the risk free rate should be fine for that.
     
    Last edited: Jun 3, 2018
    fan27 likes this.
  5. sle

    sle

    For the Sharpe ratio, the industry norm is to ignore the interest rates, actually since most market-neutral strategies can be thought of as self-financing (there is a little residual interest on the margin, but it's effect is very small). So just take the mean of the strategy and divide it by the standard deviation and you got your Sharpe.

    PS. What to do about the Sortino ratio is less clear, actually, since there is no standard way to define downward deviation
     
    shatteredx and fan27 like this.
  6. fan27

    fan27

    Thanks for the responses. I will ignore interest rates of the risk free return. I plan to commercialize my platform so industry standard is what I am looking for.

    Thanks!
     
  7. jbusse

    jbusse

    Typically, the Sharpe ratio is annualized. If using daily returns, i.e., the mean daily return divided by the standard deviation of daily returns, you annualize by multiplying by the square root of 252, where 252 represents the number of daily trading days in a year. If using monthly returns, you multiply by the square root of 12.
     
  8. traider

    traider

    Can you clarify why mkt neutral is self financing?
    For IB, shorting 10000 will incur interest charge on 10000 of around 2% right now, stock borrowing cost is say 0.2% for very liquid stuff
    Long 10000 will also incur a cost of interest of 2% on 10000
     
  9. sle

    sle

    First, here is the theory. In the world of spherical horses, whenever you sell the stock you get the proceeds of the sale and can turn around and buy another asset. That's what self-financing is really all about.

    In real life, of course, that's a bit more tricky due to various issues. Primarily that you have to post the generated cash as collateral, creating a funding discrepancy - cash as collateral usually generates less interest than your long margin interest. Borrow rates, that you have mentioned, are part of your stock-specific risk and have to be accounted for in the strategy returns as opposed to financing. Again, in the world of big players, you frequently get negative borrow rates on easy to borrow names because of funding discrepancies.

    However, the self-funding assumption still sort-of holds for the grownup players in this business. First, let's take an example. If you trade a futures on S&P, you have some exposure to the interest rate since you are implicitly financing some index arbitrageur out there. However, if you turn around and sell Dow Jones futures against it, you only going to have a tiny exposure on the margin amount. Now you can see how a market neutral combination of futures is self-financing, right? Similar to this example, most quant funds trade all securities on swap, which makes them effectively funding neutral (besides some tiny bid/offer).


    Does that make sense?
     
    jbusse likes this.
  10. traider

    traider

    Yeah I know the theory, but I was hoping that you can point out how to do equity long short practically as a small player with minimal funding costs if you do have such experience.
    Futures are awesome for funding but the limited universe and large contract exposure make it less than ideal for trading for me.
    It will help sharpe ratio significantly if for every 100 basis points reduced.
     
    #10     Jun 4, 2018