Login     Register

        Contact Us     Search

XLeratorDB/financial Documentation

History for SORTINO - 2008 (history as of 3/19/2015 10:42:15 AM)

SORTINO

Updated: 21 December 2012


Use SORTINO to calculate the Sortino ratio based upon return data. The Sortino ratio is calculated as the mean difference of the returns (R) and the minimum acceptable return (Rm) divided by the downside deviation. The downside return is calculated where R – Rm < 0.

XLeratorDB SORTINO formula
Syntax
SORTINO function for SQL Server
Arguments
@R
the return value; the percentage return in floating point format (i.e. 10% = .01). @R is an expression of type float or of a type that can be implicitly converted to float.
@Mar
the minimum acceptable return. @Mar is an expression of type float or of a type that can be implicitly converted to float.
Return Type
float
Remarks
·         If there are no negative returns, then SORTINO is NULL.
·         @Mar must be the same for all rows in the GROUP BY.
Examples
SELECT wct.SORTINO(R,cast(.15 as float)/cast(52 as float)) as SORTINO
FROM (VALUES
      ('IBM','2012-12-17',0.0157),
      ('IBM','2012-12-10',-0.001),
      ('IBM','2012-12-03',0.0099),
      ('IBM','2012-11-26',-0.0177),
      ('IBM','2012-11-19',0.035),
      ('IBM','2012-11-12',-0.0142),
      ('IBM','2012-11-05',-0.0153),
      ('IBM','2012-10-31',0.0008),
      ('IBM','2012-10-22',-0.0005),
      ('IBM','2012-10-15',-0.0695),
      ('IBM','2012-10-08',-0.0133),
      ('IBM','2012-10-01',0.0151),
      ('IBM','2012-09-24',0.0072),
      ('IBM','2012-09-17',-0.004),
      ('IBM','2012-09-10',0.0367),
      ('IBM','2012-09-04',0.0239),
      ('IBM','2012-08-27',-0.0148),
      ('IBM','2012-08-20',-0.0171),
      ('IBM','2012-08-13',0.0097),
      ('IBM','2012-08-06',0.0082),
      ('IBM','2012-07-30',0.0108),
      ('IBM','2012-07-23',0.0204),
      ('IBM','2012-07-16',0.0347),
      ('IBM','2012-07-09',-0.0282),
      ('IBM','2012-07-02',-0.0213),
      ('IBM','2012-06-25',0.0097),
      ('IBM','2012-06-18',-0.0271),
      ('IBM','2012-06-11',0.0203),
      ('IBM','2012-06-04',0.032),
      ('IBM','2012-05-29',-0.0268),
      ('IBM','2012-05-21',-0.0081),
      ('IBM','2012-05-14',-0.0263),
      ('IBM','2012-05-07',-0.0145),
      ('IBM','2012-04-30',-0.0088),
      ('IBM','2012-04-23',0.0361),
      ('IBM','2012-04-16',-0.0158),
      ('IBM','2012-04-09',-0.013),
      ('IBM','2012-04-02',-0.0152),
      ('IBM','2012-03-26',0.0154),
      ('IBM','2012-03-19',-0.0026),
      ('IBM','2012-03-12',0.0269),
      ('IBM','2012-03-05',0.0091),
      ('IBM','2012-02-27',0.0053),
      ('IBM','2012-02-21',0.0224),
      ('IBM','2012-02-13',0.0052),
      ('IBM','2012-02-06',-0.0024),
      ('IBM','2012-01-30',0.0167),
      ('IBM','2012-01-23',0.0103),
      ('IBM','2012-01-17',0.0523),
      ('IBM','2012-01-09',-0.0185),
      ('IBM','2012-01-03',-0.0073),
      ('IBM','2011-12-27',-0.0047),
      ('IBM','2011-12-19',0.0064),
      ('IBM','2011-12-12',-0.0565),
      ('IBM','2011-12-05',0.0258)
      )n(ticker,wDate,R)
This produces the following result.
               SORTINO
----------------------
     -0.07417864377595
 
See Also
  

|<< Back |    

Copyright 2008-2024 Westclintech LLC         Privacy Policy        Terms of Service