StockFetcher Forums · Filter Exchange · Sector Rotation<< >>Post Follow-up
snappyfrog
757 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
757 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*/
]



nibor100
1,105 posts
msg #162169
- Ignore nibor100
9/22/2026 11:12:33 AM

@snappyfrog,

did u get it to work yet?

Thanks,
Ed S.

snappyfrog
757 posts
msg #162170
- Ignore snappyfrog
9/25/2026 10:08:58 PM

Styliten, trying to give it a value and sort by the last line. Thanks


snappyfrog
757 posts
msg #162171
- Ignore snappyfrog
9/25/2026 10:10:17 PM

nibor100, not yet, thank you.


nibor100
1,105 posts
msg #162174
- Ignore nibor100
9/29/2026 10:45:16 AM

@snappyfrog,

Whew! that was a bit of a challenge....the running version is below:

I got rid of the "immediate" phrase because neither I nor SF knew what it did.

In your Raw Score calc lines I got rid of the parentheses and changed "+" to "plus"

In places where you had use the division sign "/" I replaced with "divided by"

I added > -100 to your add column rotation_shift so I could see a chart drawn of rotation_shift

I had to sort by column number and not by column name; its column 7 because the first user column is column #5.

Most of the time , to get it to run, I have to hit "Fetch Stocks!" twice or once and then hit the Less Than box.
Ed S.

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 plus momentum_rank * 0.4}
set{Score_Today, round(raw_score divided by 10)}

set{rs_line_historical, close 10 days ago divided by 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 plus mom_historical * 0.4}
set{Score_2_Weeks_Ago, round(raw_historical divided by 10)}

set{Rotation_Shift, Score_Today - Score_2_Weeks_Ago}

add column Score_Today
add column Score_2_Weeks_Ago
add column Rotation_Shift > -100
sort by column 7 descending
]



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.