glgene 616 posts msg #83487 - Ignore glgene |
11/25/2009 2:51:58 PM
How to include a line that says....Stock must be above MA(5) for past 6 months?
Zack
|
straken 469 posts msg #83489 - Ignore straken |
11/25/2009 3:07:23 PM
MA(5) above [MA(5)180]
|
glgene 616 posts msg #83490 - Ignore glgene |
11/25/2009 3:22:18 PM
Wonderful. I meant to say MA(50), not MA(5). But, your 180 reference is what I needed.
Thanks!
Zack
|
glgene 616 posts msg #83492 - Ignore glgene |
11/25/2009 3:33:02 PM
I did this 2-line script,
show stocks where Average Volume(90) is above 500000
ma(50) above [MA(50)180]
And it came up with 7 stocks. But some of the 7 stocks dipped below their 50-day MA during the past 180 days.
???
Zack
|
trendscanner 265 posts msg #83493 - Ignore trendscanner |
11/25/2009 3:47:29 PM
I don't think SF allows for specifying a condition such as what you're looking for with a duration of 6 months. I think 99 or 100 days may be the maximum.
|
glgene 616 posts msg #83496 - Ignore glgene |
11/25/2009 3:53:46 PM
You said (in part)...
count(close < MA(50), 99) < 0.5
Wouldn't it be
count(close>MA(50),99)
What does the final <.05 mean?
Zack
|
SAFeTRADE 644 posts msg #83497 - Ignore SAFeTRADE modified |
11/25/2009 3:59:01 PM
Try this. It will get you back 100 days and some go back the whole six months.
|
trendscanner 265 posts msg #83508 - Ignore trendscanner |
11/25/2009 8:54:15 PM
Hi Zack
In English, the line of code Count(close < MA(50),99) < 0.5
says "count the number of days that the close has been below the MA(50) in the last 99 days and return stocks for which that count is less than 0.5."
Since SF counts in integers, this would only return stocks that closed zero times below the MA(50)
You could also write it similary to what you did but it would look like this:
Theoretically, these two different approches should produce the same results.
Hope that helps
|
glgene 616 posts msg #83517 - Ignore glgene |
11/26/2009 7:57:20 AM
Thanks to all who helped me with my project. Sure wish I had your SF script-writing capabilities. But then, I didn't do well in college statistics either .
Happy Thanksgiving.
Zack
|