stockfetcher 980 posts msg #27374 |
7/15/2003 3:09:19 PM
This is a new screening feature which allows you to create screens based on how many times a particular screening event occurs. As a basic example, suppose you are interested in stocks that have set multiple 1 year highs over the last 30 days:
In the example above the count(...) phrase tells StockFetcher to return the number of times a stock has set the 1 year high over the last 30 days.
Syntax:
count(screening phrase , period)
Current Limitations:
You can only include a single screen within the count(...) text. That is, you can't include filters which have been joined with "and" inside of the count(...) text.
There is a limit of 100 days for accumulating the counts. This restriction is based on performance and hopefully we will be able to increase that value.
Weekly measures are not fully supported within the count() phrase.
Additional Examples:
Cases where the MA(10) has not crossed below the MA(50) in the last 60 trading days.
The CCI(14) has spent exactly 20 of the last 90 trading days below -100.
Display a column which shows the number of times the high has crossed above the upper Bollinger Band in the last 15 days. (You can sort on the resulting column.)
*** Advanced example *** Find stocks where the RSI(14) has spent more than 75% of the time either above 70 or below 30 within the last 45 days.
As always, if you notice any bugs with this new feature, or have any questions about it, please don't hesitate to let us know!
Thank you,
StockFetcher.com Support
|
zfetch 16 posts msg #27381 - Ignore zfetch |
7/15/2003 7:02:25 PM
I like the count feature, and tried to include a variable within the count(...) text. This may be used to count the occurances of events for a specific measure.
That didn't work for the filters tried, so it may be a current limitation for items in within the count(...) text. Could the use of variables in the count statement, be added at some time, to the count function?
Thanks,
zfetch
|
tomb 267 posts msg #27506 - Ignore tomb |
7/21/2003 3:24:45 PM
Hi,
If possible, could you provide an example that doesn't seem to recognize a variable within the 'count' phrasing. We will definitely look into this further!
Thank you,
Tom
StockFetcher.com Support
|
zfetch 16 posts msg #27513 - Ignore zfetch |
7/21/2003 11:40:41 PM
In the example 1, there is a ratio of a recent high divided by a previous x-day high. The count function counts the occurances where the ratio is between a low and a high.
In the example 2, the count function counts the occurances where the ratio is near a single value.
Example 1 didn't work, and example 2 did work.
The problem could be the use of "between" in a count statement, and not a problem with the variable.
Ex. 1
Ex. 2
|
tomb 267 posts msg #27514 - Ignore tomb |
7/22/2003 10:20:54 AM
Hi,
Thank you for the examples. There was definitely a bug on our end and that should be resolved now. Please let us know if you continue to have any problems with the examples, or have any other questions or comments.
Thank you again!
Tom
StockFetcher.com Support
|
TheRumpledOne 6,411 posts msg #32232 - Ignore TheRumpledOne |
6/2/2004 8:17:09 PM
I need to be able to do the following:
if x = 1, set y = 10
if x = 2, set y = 15
if x = 3, set y = 19
Is there a way? Have I missed/forgotten something?
If not, can you write us a WHEN command:
SET{WHEN(X,1,Y,10)}
SET{WHEN(X,2,Y,15)}
SET{WHEN(X,3,Y,19)}
If you don't like then name WHEN, I don't care what you call it.
THANKS FOR YOUR CONSIDERATION.
|
cegis 235 posts msg #32245 - Ignore cegis |
6/3/2004 2:10:37 PM
TheRumpledOne,
You're looking in the right place! Try:
set{y1,10 * count(x=1,1)}
set{y2,15 * count(x=2,1)}
set{y3,19 * count(x=3,1)}
set{ya,y1 + y2}
set{y,ya + y3}
Interpretation:
In Line 1, count(x=1,1) will equal 1 if the condition is true, or zero otherwise. Therefore y1 will equal 10 if x=1, otherwise it'll equal zero. Same thing is used for y2 and y3. Since the three conditions are mutually exclusive, you can just add y1, y2, and y3 to get your answer.
To put this in an illustrative filter:
HTH,
C
|
TheRumpledOne 6,411 posts msg #32250 - Ignore TheRumpledOne |
6/3/2004 2:44:27 PM
Thanks CEGIS...
Of course, duh! LOL!!
I appreciate your time and effort.
MAY ALL YOUR FILLS BE COMPLETE.
|
cegis 235 posts msg #32251 - Ignore cegis |
6/3/2004 2:50:39 PM
Glad I could help.
This technique is a good thing to point out in this thread anyway. Although not quite as "clean" as an IF(cond,val if true,val if false) function, count(cond,1) provides ALL of the same capabilities.
C
|
TheRumpledOne 6,411 posts msg #32252 - Ignore TheRumpledOne |
6/3/2004 3:05:07 PM
CEGIS
Please email me...
THERUMPLEDONE@HOTMAIL.COM
Thanks
|