Moving average cross over

Need help writing a scan for stocks that meet the criteria when the 8ema, 21ema & 50sma intersect one day ago.

Answers