StockFetcher Forums · Filter Exchange · Above MA(5) for past 6 months?<< >>Post Follow-up
glgene
613 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
613 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
613 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.

Fetcher[
count(close < MA(50), 99) < 0.5
]



glgene
613 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
630 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.

Fetcher[

show stocks where Average Volume(90) is above 500000
set{ clsma, close - ma(50) }
set{ up100, count( clsma > 0.001, 100 ) }
set{under50, count(close < ma(50) ,1)}
draw under50
add column up100
sort column 5 descending
draw ma(50)
]



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:

Fetcher[
Count(close > MA(50),99) > 98
]



Theoretically, these two different approches should produce the same results.

Hope that helps

glgene
613 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

StockFetcher Forums · Filter Exchange · Above MA(5) for past 6 months?<< >>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.