How to compute the Sharpe Ratio ?

Discussion in 'Technical Analysis' started by raghavmb2, Mar 15, 2012.

  1. raghavmb2

    raghavmb2

    How to compute the Sharpe Ratio ?

    I have written a small script to generate BUY,HOLD and SELL signals for a given stock in an equity market. I am confused as to how to compute the sharpe ratio. Below are the sample trades which i have simplified here. What is the correct way of computing the sharpe ratio on each day for the below scenario ?

    Abbrevations used:
    ~~~~~~~~~~~~~~~
    LTP: Last traded price.
    SN: Signal Number
    STB: Stocks Quantity To Buy
    STS: Stocks Quantity To Sell

    Trade History.

    Date__________LTP____SN____signal____STB____STS____Sharpe_Ratio
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1-Jun-2006____99____1____WAIT________0____0____?
    2-Jun-2006____97____2____WAIT________0____0____?
    3-Jun-2006____100____3____BUY________10____0____?
    4-Jun-2006____100____4____HOLD_______0____0____?
    5-Jun-2006____100____5____HOLD_______0____0____?
    6-Jun-2006____100____6____HOLD_______0____0____?
    7-Jun-2006____100____7____HOLD_______0____0____?
    8-Jun-2006____100____8____HOLD_______0____0____?
    9-Jun-2006____110____9____BUY________15____0____?
    10-Jun-2006____100____10____HOLD_____0____0____?
    11-Jun-2006____100____11____HOLD_____0____0____?
    12-Jun-2006____100____12____HOLD_____0____0____?
    13-Jun-2006____100____13____HOLD_____0____0____?
    14-Jun-2006____100____14____HOLD_____0____0____?
    15-Jun-2006____100____15____HOLD_____0____0____?
    16-Jun-2006____95____16____SELL________0____6____?
    17-Jun-2006____100____17____HOLD_____0____0____?
    18-Jun-2006____100____18____HOLD_____0____0____?
    19-Jun-2006____100____19____HOLD_____0____0____?
    20-Jun-2006____90____20____SELL________0____9____?
    21-Jun-2006____100____21____HOLD_____0____0____?
    22-Jun-2006____100____22____HOLD_____0____0____?
    23-Jun-2006____100____23____HOLD_____0____0____?
    24-Jun-2006____100____24____HOLD_____0____0____?
    25-Jun-2006____100____25____HOLD_____0____0____?
    26-Jun-2006____100____26____HOLD_____0____0____?
    27-Jun-2006____85____27____SELL________0____10____?
    28-Jun-2006____100____28____CLSD_____0____0____?
    29-Jun-2006____100____29____CLSD_____0____0____?
    30-Jun-2006____100____30____CLSD_____0____0____?

    Can someone help please ?

    Thanks!
     
  2. Get ninjatrader
     
  3. raghavmb2

    raghavmb2

    Thank you, but i am generating the signals in a custom built program so i wanted to plot the sharpe ratio also along with other parameters. What i have given as sample is a one session simulation, i have multiple sessions for which i want to plot the sharpe ratio.
     
  4. Did you try googling how to caculate sharpe ratio. There's a boat load of info on the interwebz I've been told....
     
  5. raghavmb2

    raghavmb2

    Yes, i did search on the web for a simple way to compute the sharpe ratio. Here's a link which explains very nicely and also the author gives an excel to check [http://investexcel.net/214/calculating-the-sharpe-ratio-with-excel/].

    Accordingly i have also used the same concept, for me riskfree returns are not there so i have assumed that as Zero, i hope that is not an issue.
     

  6. As you can see by looking at the components of the sharpe ratio you could be a blowup waiting to happen and it would be masked by the Sharpe formula because it doesn't give you the "true" risks that you took to achieve those excess returns....


    ....not to mention the fact that markets are constantly changing which could render useless a stellar sharpe ratio system that wasn't designed robustly...

    it's just a metric but definitely not the complete picture.....


    Edit: I missed the last sentence of your original statement. Not including the risk-free rate return defeats the purpose of the formula...does it not :confused:

    How are you going to know whether you would have been no better off keeping your money in a "safer" investment...and I placed quotes around the word safer because no investment is totally safe.