StockFetcher Forums · Filter Exchange · Sector Rotation<< >>Post Follow-up
snappyfrog
755 posts
msg #162165
Ignore snappyfrog
9/17/2026 6:37:16 PM

Any help on getting this to work? Result are "undefined results from undefined"

Fetcher[
apply to symlist(XLE, XLK, XLF, XLV, XLI, XLY, XLP, XLU, XLB, XLRE, XLC)

set{rs_line, close / ind(SPY, close)}

set{trend_rank, pctrank(rs_line, 250)}

set{momentum_rank, pctrank(rs_line - rs_line 10 days ago, 250)}

set{raw_score, (trend_rank * 0.6) + (momentum_rank * 0.4)}
set{Score_Today, intermediate(round(raw_score / 10))}

set{rs_line_historical, close 10 days ago / ind(SPY, close 10 days ago)}
set{trend_historical, pctrank(rs_line_historical, 250) 10 days ago}
set{mom_historical, pctrank(rs_line_historical - rs_line_historical 10 days ago, 250) 10 days ago}
set{raw_historical, (trend_historical * 0.6) + (mom_historical * 0.4)}
set{Score_2_Weeks_Ago, intermediate(round(raw_historical / 10))}

set{Rotation_Shift, Score_Today - Score_2_Weeks_Ago}

add column Score_Today
add column Score_2_Weeks_Ago
add column Rotation_Shift
sort by Rotation_Shift descending
]



push5280
203 posts
msg #162166
Ignore push5280
9/17/2026 7:40:43 PM


It may be this line: set{rs_line_historical, close 10 days ago / ind(SPY, close 10 days ago)}

specifically " ind(SPY, close 10 days ago)"

I sometimes have issues with xxx days ago in set statements and will have to build an alias, which I did here
set{spy10, ind(SPY, close 10 days ago)} and it still threw the same error.

but now I commented out the last four lines and the filter ran

interesting

snappyfrog
755 posts
msg #162167
Ignore snappyfrog
9/17/2026 8:25:48 PM

Thanks

styliten
353 posts
msg #162168
Ignore styliten
9/20/2026 4:04:14 PM

@ snappyfrog

Not sure whether intermediate() causes the problems or not. Are you trying to score it on a scale of 1 to 10?

More likely, there is a limit on the number of layers user defined indicators can be embedded into another one.

Fetcher[dow 30

set{rs_line, close divided by ind(SPY, close)}

set{trend_rank, pctrank(rs_line, 250) * 0.60}

set{momentum_rank, pctrank(rs_line minus rs_line 10 days ago, 250) * 0.40}

set{raw_score, trend_rank + momentum_rank}

/* set{Score_Today, intermediate(round(raw_score / 10))} */

set{trend_hist, pctrank(rs_line, 250) 10 days ago * 0.60}

set{momentum_hist, pctrank(rs_line minus rs_line 10 days ago, 250) 10 days ago * 0.40}

set{raw_hist, trend_hist + momentum_hist}

/* set{Score_Hist, intermediate(round(raw_hist / 10))} */

draw trend_rank

draw momentum_rank

draw raw_score

/*draw Score_Today*/

draw trend_hist

draw momentum_hist

draw raw_hist

/*draw Score_Hist*/
]



StockFetcher Forums · Filter Exchange · Sector Rotation<< >>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 2026 - 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


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.