This is a similar valuation as the Sharpes Ratio , to determine the risk/return of a portfolio
(rp - rf)/δp
rp - portfolio return rf - risk free investment return δp - portfolio standard deviation
The greater a portfolio's Sharpe ratio, the better its risk-adjusted performance has been. A negative Sharpe ratio indicates that a risk-less asset would perform better than the security being analyzed. - investopedia
Lower partial momentum calculations. LPM, Return below for a price of a stock, above would use the portfio's initial value, versus final value perhaps for 1 year.
|
Rt = 100*((priceyesterday - pricetoday)/priceyesterday)
|
|
| mReturn = Σ Rt t=0 |
|
|
Also, R could simply be calculated as 100*(Pricefinal - Priceinitial ) / Priceinitial
Price Percent Change.
|
|
| Below we are going to substitute LPM for the Standard deviation of the price as follows: mLPM = 1/m * Σ [max(0, (h-Rt)) x] t=0 |
|
| m = time period e.g. 180 daysx - degree (default 2 similar to the Sharpes Ratioh - Target returns for this time periodt - time variable |
|
max(0, (h-Rt)) We only want to Sum the positive change across m, ignore down days, where the standard deviation would use the change in price for each day.
Finally, our calculation for Return over the LPM is
R/LPM - Returns over a period divided by the average change over the time period.
To follow: realcode for R and LPM, can be useful for sorting watchlist.
-What is needed is a R/LPM of a watchlist. So, you can create a Index of a watch list and modify the Realcode by dragging the Index into the realcode editor and substitute wl_index for price.()
Then you want to compare this to the return on CD's or Treasuries and modify the Watchlist to improve its R/LPM also may want to compare to sharpes ratio. 3mo, 6mo, 1yr, 2yr returns.
Eventually compare the actual return of the watch list to these returns over a managed period of time.
'LPM
'***************************************
'* Example:
'* Plot = 1/bars * sigma[ min(0,(h-Rt))^degree]
'***************************************
' 90 days @ 1.5% interest
'# bars = userinput.integer = 90
'# tReturn = userinput.single = 1.5
'# degree = userinput.single = 2
dim Rt as single
Dim sumTReturn As Single
dim tmp as single
Dim target = tReturn / bars
Rt = 0
sumTReturn = 0
for x as integer =1 to bars
Rt = 100 * (price.close(x-1) - price.close(x)) / price.close(x)
tmp = (target - Rt)
If ( 0 > tmp) Then ' Max 0, tmp
tmp = 0
end if
sumTReturn = sumTReturn + ( tmp ^ degree )
Next x
' m
' LPM = 1/m * Sigma [ ( max(0, (tReturn-Rt) ) ^ degree ]
' t=1
plot = (1 / bars) * (sumTReturn)
'# bars = userinput.integer = 90
dim Rt as single
Rt = 100 * (price.close(bars) - price.close) / price.close(bars)
' just use final price minus close price today or percent change.
plot = Rt