StockFetcher Forums · General Discussion · Numbering<< >>Post Follow-up
dashover
166 posts
msg #114380
Ignore dashover
7/9/2013 11:32:35 AM

Is there a way to rank stocks, (say 10 in watchlist)

1-10 over a time interval say last 30 days (change in price) and actually see 1 ,2, 3, etc.

...
Thx

Dash

Kevin_in_GA
4,553 posts
msg #114385
Ignore Kevin_in_GA
7/9/2013 1:38:23 PM

the easiest is to simply sort on a column ...

Fetcher[
symlist(xlb,xle,xlf,xli,xlk,xlp,xlu,xlv,xly)

add column roc(30,1)

sort on column 5 descending

]



If you want actual ranking (#1, #2, ...) then it is a little more complex. here is one I use for my TAA system.

Fetcher[
SET{perf1A, ma(3) 60 days ago}
SET{perf1b, MA(3) / perf1a}
SET{perf, perf1b - 1}
SET{var1, perf*100}
SET{rfr, ind(^irx,close)}
SET{RISKFREERETURN, rfr/100}
SET{perf63, perf - RISKFREERETURN}
SET{STD63, CSTDDEV(CLOSE,63)}
SET{VOL63a, STD63 / MA(63)}
SET{vol63, vol63a * 100}

/*CALCULATION OF SHARPE RATIO - ANNUALIZED*/
SET{SHARPE1a, perf63 / VOL63a}
set{sharpe, sharpe1a * 0.5}

set{var1a, IND(SPY, var1)}
set{var1b, IND(IWM, var1)}
set{var1c, IND(EFA, var1)}
set{var1d, IND(AGG, var1)}

SET{RANK1A, COUNT(var1 is above var1a,1)}
SET{RANK1B, COUNT(var1 is above var1b,1)}
SET{RANK1C, COUNT(var1 is above var1c,1)}
SET{RANK1D, COUNT(var1 is above var1d,1)}
SET{RANK1E, RANK1A + RANK1B}
SET{RANK1F, RANK1C + RANK1D}
SET{RANK1G, RANK1E + RANK1F}
SET{RANK, 4 - RANK1G}

set{var2a, IND(SPY, sharpe)}
set{var2b, IND(IWM, sharpe)}
set{var2c, IND(EFA, sharpe)}
set{var2d, IND(AGG, sharpe)}

SET{var3a, COUNT(var2a is above 0,1)}
SET{var3b, COUNT(var2b is above 0,1)}
SET{var3c, COUNT(var2c is above 0,1)}
SET{var3d, COUNT(var2d is above 0,1)}

SET{var4a, var2A * var3a}
SET{var4b, var2b * var3b}
SET{var4c, var2c * var3c}
SET{var4d, var2d * var3d}

set{var5a, var4a + var4b}
set{var5b, var4c + var4d}
set{var5c, var5a + var5b}

SET{allocation1, sharpe / var5c}
set{allocation2, allocation1 * count(sharpe above 0,1)}
set{allocation, allocation2 *100}


SYMLIST(IWM,EFA,SPY,AGG)
ADD COLUMN SEPARATOR
ADD COLUMN RANK {current rank}
ADD COLUMN SEPARATOR
ADD COLUMN var1 {3 month return (%)}
ADD COLUMN vol63 {volatility (%)}
add column sharpe {sharpe ratio}
add column allocation {Sharpe-based allocation (%)}
add column corr(spy,63, close) {correlation to S&P 500}

SORT ON COLUMN 6 ascending
CHART-TIME IS 60 days
draw MA(3)
draw sharpe line at 0
]



StockFetcher Forums · General Discussion · Numbering<< >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2016 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus