StockFetcher Forums · Filter Exchange · Use of a variable in where clause is causing issues<< >>Post Follow-up
rudeStock
6 posts
msg #161750
Ignore rudeStock
3/29/2025 6:15:23 PM

The following 2 expressions are producing different results even though the only difference is that where clause is using a variable (i.e. 5_week_high) vs non-variable (5 week high). Can't seem to figure out what the reason is. What am I doing wrong?

set{market_cap, shares outstanding * close}
set{current_week_high, weekly high}
set{5_week_high, 5 week high}
show stocks where weekly high is equal to 5_week_high
and chart-display is weekly
and market_cap is above 250
and volume is above 100000
and market is not ETF
and add column market_cap
and add column current_week_high
and add column 5_week_high
sort column 1 descending


set{market_cap, shares outstanding * close}
set{current_week_high, weekly high}
set{5_week_high, 5 week high}
show stocks where weekly high is equal to 5 week high
and chart-display is weekly
and market_cap is above 250
and volume is above 100000
and market is not ETF
and add column market_cap
and add column current_week_high
and add column 5_week_high
sort column 1 descending

nibor100
1,068 posts
msg #161751
Ignore nibor100
3/29/2025 7:38:42 PM

Not sure you are doing anything wrong, but SF is picking up the high for Friday as the 5 week high in your 2nd filter, for all stocks, even though in many cases it is not even the actual high for last week.

Ed S.

rudeStock
6 posts
msg #161752
Ignore rudeStock
3/29/2025 9:23:30 PM

Yeah, I noticed that too. "5 week high" is not giving the highest weekly high value over the last 5 weekly high values. Not sure how to get that! The example for 52-week high value clearly says '52 week high" in it.

rudeStock
6 posts
msg #161753
Ignore rudeStock
3/29/2025 9:38:04 PM

Ah, figured out. The expression "5 week high" does not represent the highest value of the 5 week high values. It should have been "high 5 week high".

TheRumpledOne
6,499 posts
msg #161754
Ignore TheRumpledOne
modified
3/30/2025 11:01:57 AM

Fetcher[

symlist(MLGO, HOLO, QQQ, SPY)

and add column weekly high {wh}
and add column open 5 week high {o5wh}
and add column high 5 week high {h5wh}
and add column low 5 week high {l5wh}
and add column close 5 week high {c5wh}
and add column 5 week high {5wh} // this line is in error
]





StockFetcher Forums · Filter Exchange · Use of a variable in where clause is causing issues<< >>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 2022 - 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.