# 9 Day Exponential Moving Average Scanner

#### ahibbitts

##### New member
VIP
I would like to see if its possible and would like to help develop an indicator/scanner that can identify when two 5 min candle fills above the 9 Day MA and indicate a Green Up Arrow then two fills below will indicate Red Down Arrow. Would like to have both added to scanner watchlist when it occurs. If anyone has a starting point I would like to help to learn more.

So, rather than a simple crossover you want two candles to close either above or below the 9 MA line...??? It would be just 9 MA, not 9 days... You pick the timeframe independent of the 9 period logic...

Should this be SMA, EMA, other...??? Ah, says EMA in the title but not the text...

Correct, When two consecutive candles fill above the 9 Day Exponential Moving Average on a 5 min Chart it should indicate a Green Up Arrow and notify (sound) as well then when two consecutive candles fill below the 9 Day Exponential Moving Average it should indicate a Red Arrow Down. I would like to use this as a scanner to a watchlist as well.

Here is the basic logic...

Ruby:
plot twoUp = close is greater than MovAvgExponential()."AvgExp" and close[1] is greater than MovAvgExponential()."AvgExp"[1] and close crosses above MovAvgExponential()."AvgExp" within 2 bars;
twoUp.SetPaintingStrategy(PaintingStrategy.Boolean_Arrow_Up);
twoUp.SetLineWeight(3);
twoUp.SetDefaultColor(Color.GREEN);

plot twoDn = close is less than MovAvgExponential()."AvgExp" within 1 bar and close[1] is less than MovAvgExponential()."AvgExp"[1] and close crosses below MovAvgExponential()."AvgExp"  within 2 bars;
twoDn.SetPaintingStrategy(PaintingStrategy.Boolean_Arrow_Down);
twoDn.SetLineWeight(3);
twoDn.SetDefaultColor(Color.RED);

Looks like it worked... Yeah, I use Copy & Paste constantly throughout every day but have customers that I have to remind how almost every time I'm on a service call... It just never seems to stick in the gray matter... I couldn't function without Cut, Copy & Paste... Ctrl+X = Cut... Ctrl+C = Copy... Ctrl+V = Paste...

Found it!! Thanks again. I will continue to work on this.

Code:
#Plot Two Candle Fills Above MA
plot twoUp = close is greater than MovAvgExponential()."AvgExp" and close[1] is greater than MovAvgExponential()."AvgExp"[1] and close crosses above MovAvgExponential()."AvgExp" within 2 bars;
twoUp.SetPaintingStrategy(PaintingStrategy.Boolean_Arrow_Up);
twoUp.SetLineWeight(3);
twoUp.SetDefaultColor(Color.GREEN);

#Plot Two Candle Fills Below MA
plot twoDn = close is less than MovAvgExponential()."AvgExp" within 1 bar and close[1] is less than MovAvgExponential()."AvgExp"[1] and close crosses below MovAvgExponential()."AvgExp"  within 2 bars;
twoDn.SetPaintingStrategy(PaintingStrategy.Boolean_Arrow_Down);
twoDn.SetLineWeight(3);
twoDn.SetDefaultColor(Color.RED);

### Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
327 Online

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• Add-ons and resources
• 1 full year of unlimited support

### Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?