Stock screener Sharp Value
Forums › ProRealTime English forum › ProScreener support › Stock screener Sharp Value
- This topic has 7 replies, 3 voices, and was last updated 5 years ago by Abz.
Tagged: Sharp ratio, Stock
-
-
09/23/2018 at 11:08 PM #81140
Hello
attached is a stock screener posted by Gabri. I am monitoring 25 stocks with this screener and want to know the sharp value on certain historical dates is it a easy way modify this screener code to get that ? or do i need to use it as a indicatior then i need to check it on every stock and a list view in screener windows is much more appreciated.
12345678periodo=254RitMensNoRiskTitle=0a=log(close/close[1])b=summation[periodo](a)s=sqrt(254)*std[periodo](a)//computation of modified Sharpe indexsharpe=(b-RitMensNoRiskTitle/100)/(s*s)09/24/2018 at 12:22 AM #81141Screeners cannot scan past data, so you’ll have to use it as an indicator, changing dates as they suit you best (not tested):
1234567891011periodo=254RitMensNoRiskTitle=0IF date >= 20150101 AND date <= 20150331 THEN //dates Jan.1st, 2015 - march 31st,2015a=log(close/close[1])b=summation[periodo](a)s=sqrt(254)*std[periodo](a)//computation of modified Sharpe indexsharpe=(b-RitMensNoRiskTitle/100)/(s*s)elsesharpe=0return Sharpe09/24/2018 at 9:38 AM #8116509/24/2018 at 12:46 PM #8118009/24/2018 at 1:51 PM #81194Ok, so let’s introduce a X setting and screen Sharpe variable within this offset in the past:
12345678910111213periodo=254X = 10periodo=periodo-XRitMensNoRiskTitle=0a=log(close/close[1])b=summation[periodo](a)s=sqrt(254)*std[periodo](a)//computation of modified Sharpe indexsharpe=(b-RitMensNoRiskTitle/100)/(s*s)screener (sharpe[x])09/24/2018 at 7:51 PM #8124009/25/2018 at 7:24 AM #81253Because original code used 254 bars of history for the calculation (data limit for ProScreener), I changed the way it is calculated by the subtracting the desired lookback of 254.
Just found that I made an error too:
12345678910111213periodo=254X = 10periodo=periodo-XRitMensNoRiskTitle=0a=log(close/close[1])b=summation[periodo](a)s=sqrt(periodo)*std[periodo](a)//computation of modified Sharpe indexsharpe=(b-RitMensNoRiskTitle/100)/(s*s)screener (sharpe[x])1 user thanked author for this post.
05/03/2019 at 12:48 AM #97590 -
AuthorPosts
Find exclusive trading pro-tools on