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:
|
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 980 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:
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.....
|