# Help coding RSI EMA conditions

#### jygoli

##### Member
VIP
Can anyone help me to create indicator for this ?
Help coding when RSI >70 and RSI>ema 10 , RSI<30 and RSI <EMA 10. arrows or wedges

Solution
Wouldn’t it be:

Code:
``````def RSI = reference RSI();
def RSIema = movingaverage(averagetype.exponential, RSI,10);
Plot ob = if RSI>70 and RSI>RSIema then low else double.nan;
Plot os = if RSI<30 and RSI<RSIema then high else double.nan;
ob.setpaintingstrategy(paintingstrategy.arrow_down);
os.setpaintingstrategy(paintingstrategy.arrow_up);
ob.setdefaultcolor(color.red);
os.setdefaultcolor(color.green);``````

Typed on my phone but I think that will work if it’s what you had in mind.
Wouldn’t it be:

Code:
``````def RSI = reference RSI();
def RSIema = movingaverage(averagetype.exponential, RSI,10);
Plot ob = if RSI>70 and RSI>RSIema then low else double.nan;
Plot os = if RSI<30 and RSI<RSIema then high else double.nan;
ob.setpaintingstrategy(paintingstrategy.arrow_down);
os.setpaintingstrategy(paintingstrategy.arrow_up);
ob.setdefaultcolor(color.red);
os.setdefaultcolor(color.green);``````

Typed on my phone but I think that will work if it’s what you had in mind.

Wouldn’t it be:

Code:
``````def RSI = reference RSI();
def RSIema = movingaverage(averagetype.exponential, RSI,10);
Plot ob = if RSI>70 and RSI>RSIema then low else double.nan;
Plot os = if RSI<30 and RSI<RSIema then high else double.nan;
ob.setpaintingstrategy(paintingstrategy.arrow_down);
os.setpaintingstrategy(paintingstrategy.arrow_up);
ob.setdefaultcolor(color.red);
os.setdefaultcolor(color.green);``````

Typed on my phone but I think that will work if it’s what you had in mind.
so much thankful to you . this is what i am looking for ..working perect

87k+ Posts
173 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
• 1 full year of unlimited support

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?