I am attempting to detect a crossover when the 20 day EMA goes above
the 50 day EMA. Sometimes the results include a stock that fulfilled
that requirement days and days ago. Obviously, that is not a valid
result. The code I wrote is:
// The 20 day moving average has crossed over the 50 day moving
average
output="20_Over_50macross.lst";
if EMovAvg(0,20,cl) > EMovAvg(0,50,cl) and // The 20 day MA is above
the 50 day ma today
EMovAvg(-1,20,cl) < EMovAvg(-1,50,cl) and // The 20 Day MA was below
the 50 day ma yesterday
Close(0) >= 25 and // At least a 25 dollar stock
AvgVol(0,-29) >= 250000 then // The average volume is at least
250,000 shares
println symbol,",",description;
endif;
------------------------ Yahoo! Groups Sponsor --------------------~-->
Try Online Currency Trading with GFT. Free 50K Demo. Trade
24 Hours. Commission-Free.
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/GHeqlB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/quotes-plus/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/