StockFetcher Forums · General Discussion · Less Results with phrase "within the last"<< >>Post Follow-up
ralf713
2 posts
msg #69235
Ignore ralf713
11/16/2008 5:00:28 AM

Hello,

I was trying to enlarge my results in creating a filter by using the phrase "within the last 5 days" but was getting less results:

high is above ema(20) -> 3353 results
high is above ema(20) within the last 5 days -> 1391 results

what 's wrong here? Thanks for any helping answers.

traderblues
195 posts
msg #69239
Ignore traderblues
modified
11/16/2008 8:39:38 AM

I think what is happening is that your filter requires that the high is above ema(20) in each of the last 5 days, not on just 1 of the last 5 days.

Try this:

Fetcher[
set{highaboveema20,count(high is above ema(20),5)}
highaboveema20 is above 0.5
]






decipherlinda
133 posts
msg #69289
Ignore decipherlinda
11/19/2008 10:05:32 AM

"high is above ema(20)" is the same as:

high is above ema(20) within the last 20 days


chetron
2,817 posts
msg #69294
Ignore chetron
11/19/2008 11:28:54 AM

nice lin, but i am seeing a 20% difference in the 2.

decipherlinda
133 posts
msg #69300
Ignore decipherlinda
11/19/2008 4:22:50 PM

Yeah, uh, no -- I got it wrong.

The user guide shows "within the last..." as applying to conditions like crossovers or reaching new highs -- something needs to have taken place within a certain period of time for it to work the way expected.

It does look like "high is above EMA(20)" is being taken as a condition and "within the last 5 days" is the time frame the condition has to be true for. I think it's equivalent to:

Show stocks where high has been above EMA(20) for the last 5 days.

In addition to traderblues' code, "within the past 5 days" code could be used as:

High crossed above EMA(20) within the past 5 days

Thanks for setting me straight Chetron!

ralf713
2 posts
msg #69312
Ignore ralf713
11/20/2008 10:45:58 AM

Hi everybody,

my question was about if there is a bug in the StockFetcher language or if I made some mistake. The User Guide tells me that the phrase "within the last 5 days" only requires the condition to be true in one of the last 5 days. The phrase "for the last 5 days" requires the condition to be true in all of the last 5 days. But this seems not to work in the above exampe:
"high is above ema(20) within the last 5 days" gets the same (less) results as "high is above ema(20) for the last 5 days". So to me there seems to be a bug in the Stockfetcher language.

@traderblues: thank you very much for that workaround. Your code really does the job.


stockfetcher
979 posts
msg #69313
11/20/2008 11:36:23 AM

Please note that the within the last is only related to specific phrases or "actions". For example, it is valid with "crossed above/below" and "reached a new high/low":

crossed above/below
reached a new

But it is not valid with the simple "is above/below" phrase:

above, below

To do what you are looking for, you will want to use the "count()" function:

Fetcher[count(high is above ema(20),5) is above 0]



StockFetcher Support

mystiq
650 posts
msg #75740
Ignore mystiq
6/24/2009 6:55:32 AM

how would you code:

rsi(2) greater than 85 within the last 2 weeks

chetron
2,817 posts
msg #75743
Ignore chetron
6/24/2009 7:59:20 AM

hope you don't mind.....


Fetcher[


rsi(2) above 85 last 2 weeks

]





StockFetcher Forums · General Discussion · Less Results with phrase "within the last"<< >>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.