gabri

Modified SHARPE index

Category: Indicators By: gabri Created: September 19, 2017, 7:16 AM
September 19, 2017, 7:16 AM
Indicators
8 Comments
Modified SHARPE index

This modified SHARPE index indicator will be the base for a strategy I will publish after. The SHARPE index is simply a way to relate profits with volatility that was created in 1966. The higher the number the more “efficient” the title is. In my indicator, instead of using the simple volatility at the denominator (standard deviation) I used the volatility squared to give a slight better ramp to the curve and a better and more precise entry.

The Sharpe Ratio is a measure for calculating risk-adjusted return, and this ratio has become the industry standard for such calculations. It was developed by Nobel laureate William F. Sharpe. The Sharpe ratio is the average return earned in excess of the risk-free rate per unit of volatility or total risk. Subtracting the risk-free rate from the mean return, the performance associated with risk-taking activities can be isolated. One intuition of this calculation is that a portfolio engaging in “zero risk” investment, such as the purchase of U.S. Treasury bills (for which the expected return is the risk-free rate), has a Sharpe ratio of exactly zero. Generally, the greater the value of the Sharpe ratio, the more attractive the risk-adjusted return.
Read more: Sharpe Ratio http://www.investopedia.com/terms/s/sharperatio.asp#ixzz4t6Rh7t00 

Blue skies!!

//calcolo ritorni e volatilita' su base annuale
RitMensNoRiskTitle=0
a=log(close/close[1])
b=summation[periodo](a)
s=sqrt(254)*std[periodo](a)

//calcolo indice di sharpe
sharpe=(b-RitMensNoRiskTitle/100)/(s*s)


return  sharpe as "SHARPE index",0

Download
Filename: Mio-indice-di-Sharpe-PRT-Builder.itf
Downloads: 174
gabri
gabri Master
This author is like an anonymous function, present but not directly identifiable. More details on this code architect as soon as they exit 'incognito' mode.
Author’s Profile

Comments

christophe11560
4 years ago
#

Merci pour ton retour

christophe11560
4 years ago
#

salut gabri, Je n'ai pas de commentaire sur "s*s", c'est ton choix personnel. Je me posais la question sur "sqrt(254)". En principe, le code devrait être sqrt(periodo) puisque tu somme les rendements sur périodo. Pourrais tu m'expliquer l'utilité de cette modification du principe de calcul sharpe original? bien à toi

gabri
4 years ago
#

Hi, the SQRT(254) it is used to annualize the value. In terms of the "s*s" I just used the standard formula you can find anywhere (also here https://www.google.com/search?q=sharpe+ratio+formula&oq=sharpe+ratio+formula&aqs=chrome..69i57j0i512l8j0i390.6865j0j7&sourceid=chrome&ie=UTF-8). In my formula the expected return ( E[Rb - Ra]) is just computed using the past return in a specific period of time (past return computed using daily value, hence the need to multiply by SQRT(254). I hope this answer your question

gabri
8 years ago
#

JanWD, in the original sharpe formula (made for portfolios) this is the return for a no-risk investment (they used to put the value of a ten years bond return). This days you can use also the return of a bond or you can use 0 to make the formula disconnected from it.

JanWd
8 years ago
#

Dear Gabri, could you explain why you have used "RitMensNoRiskTitle" ? In the formula [ sharpe=(b-RitMensNoRiskTitle/100)/(s*s) ] it does nothing as far as I can see ( return RitMensNoRiskTitle always give always a zero value) Thanks in advance for your information. Kind regards, Jan

guillermus69
8 years ago
#

is not better to change this "a=log(close/close[1])" into this ? a= ((close / close [1]) -1 ) *100 ?? to get the daily % changes ??

jebus89
9 years ago
#

Maybe a stupid question but im getting syntax error, the following variable is undefined: Periodo. How to fix this?

JanWd
8 years ago
#

add it as a default variable, to be found on top if you make the indicator Kind regards, Jan

ProRealCode ProRealCode
Loading...