EMA - RSI Alert

Sinatra

New member
I am trying to create 1 alert for long and 1 alert for short but neither seem to work is ot possible to have scripts written?

My alerts would be as follows:
On the 5 min chart i use the following ema's
9 13 34 50 72 89

The long alert is

If the 34 is above the 50 and
50 is above the 72 and the
72 is above the 89 and
The RSI is below 60 and
The RSI is above 30
Send Long alert if the last price is = to the 89 ema

The short alert is as follows:
If the 89 is above the 72 and
The 72 is above the 50 and
The 50 is above the 34 and
Rsi is below 60
Send short alert is last price is = to the 89 ema


Is it possible to have these alerts written with text and sound? Is it possible to have them permanently on in other words when they are triggered they stay active?

Thank you so much in advance for your help
 
Solution
I am trying to create 1 alert for long and 1 alert for short but neither seem to work is ot possible to have scripts written?

My alerts would be as follows:
On the 5 min chart i use the following ema's
9 13 34 50 72 89

The long alert is

If the 34 is above the 50 and
50 is above the 72 and the
72 is above the 89 and
The RSI is below 60 and
The RSI is above 30
Send Long alert if the last price is = to the 89 ema

The short alert is as follows:
If the 89 is above the 72 and
The 72 is above the 50 and
The 50 is above the 34 and
Rsi is below 60
Send short alert is last price is = to the 89 ema


Is it possible to have these alerts written with text and sound? Is it possible to have them permanently on in other words when they are...
I am trying to create 1 alert for long and 1 alert for short but neither seem to work is ot possible to have scripts written?

My alerts would be as follows:
On the 5 min chart i use the following ema's
9 13 34 50 72 89

The long alert is

If the 34 is above the 50 and
50 is above the 72 and the
72 is above the 89 and
The RSI is below 60 and
The RSI is above 30
Send Long alert if the last price is = to the 89 ema

The short alert is as follows:
If the 89 is above the 72 and
The 72 is above the 50 and
The 50 is above the 34 and
Rsi is below 60
Send short alert is last price is = to the 89 ema


Is it possible to have these alerts written with text and sound? Is it possible to have them permanently on in other words when they are triggered they stay active?

Thank you so much in advance for your help

your words mention ema9 an ema13, but they aren't used in your code?
the short rsi rule is different than long rsi rule ( i made them the same)

when a long rule or the short rule is true,
..it draws arrows
..alerts are triggered

Code:
#alert_ema_rsi

#https://usethinkscript.com/threads/ema-rsi-alert.17996/
#EMA - RSI Alert

# alerts would be as follows:
# On the 5 min chart i use the following ema's
# 9 13 34 50 72 89

#The long alert is

#If the 34 is above the 50 and
#50 is above the 72 and the
#72 is above the 89 and
#The RSI is below 60 and
#The RSI is above 30
#Send Long alert if the last price is = to the 89 ema

#The short alert is as follows:
#If the 89 is above the 72 and
#The 72 is above the 50 and
#The 50 is above the 34 and
#Rsi is below 60
#Send short alert is last price is = to the 89 ema


def na = Double.NaN;
def bn = BarNumber();
def data = close;

# EMA 9 13 34 50 72 89
input avg1_type = AverageType.EXPONENTIAL;
#input avg1_type = AverageType.SIMPLE;
input avg1_length = 9;
def avg1 = MovingAverage(avg1_type, data, avg1_length );

input avg2_type = AverageType.EXPONENTIAL;
input avg2_length = 13;
def avg2 = MovingAverage(avg2_type, data, avg2_length );

input avg3_type = AverageType.EXPONENTIAL;
input avg3_length = 34;
def avg3 = MovingAverage(avg3_type, data, avg3_length );

input avg4_type = AverageType.EXPONENTIAL;
input avg4_length = 50;
def avg4 = MovingAverage(avg4_type, data, avg4_length );

input avg5_type = AverageType.EXPONENTIAL;
input avg5_length = 72;
def avg5 = MovingAverage(avg5_type, data, avg5_length );

input avg6_type = AverageType.EXPONENTIAL;
input avg6_length = 89;
def avg6 = MovingAverage(avg6_type, data, avg6_length );

input show_average_lines = yes;
plot zavg1 = if show_average_lines and 0 then avg1 else na;
plot zavg2 = if show_average_lines and 0 then avg2 else na;
plot zavg3 = if show_average_lines then avg3 else na;
plot zavg4 = if show_average_lines then avg4 else na;
plot zavg5 = if show_average_lines then avg5 else na;
plot zavg6 = if show_average_lines then avg6 else na;

zavg1.SetDefaultColor(Color.gray);
zavg1.SetLineWeight(1);
zavg1.HideBubble();
zavg2.SetDefaultColor(Color.gray);
zavg2.SetLineWeight(1);
zavg2.HideBubble();
zavg3.SetDefaultColor(Color.gray);
zavg3.SetLineWeight(1);
zavg3.HideBubble();
zavg4.SetDefaultColor(Color.gray);
zavg4.SetLineWeight(1);
zavg4.HideBubble();
zavg5.SetDefaultColor(Color.gray);
zavg5.SetLineWeight(1);
zavg5.HideBubble();
zavg6.SetDefaultColor(Color.cyan);
zavg6.SetLineWeight(1);
zavg6.HideBubble();

#----------------------------
# rsi

input rsi_length = 14;
input rsi_over_Bought = 70;
input rsi_over_Sold = 30;
input rsi_price = close;
input rsi_averageType = AverageType.WILDERS;

def NetChgAvg = MovingAverage(rsi_averageType, rsi_price - rsi_price[1], rsi_length);
def TotChgAvg = MovingAverage(rsi_averageType, AbsValue(rsi_price - rsi_price[1]), rsi_length);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;

def RSI1 = 50 * (ChgRatio + 1);
def OverSold = rsi_over_Sold;
def OverBought = rsi_over_Bought;
def UpSignal = if RSI1 crosses above OverSold then OverSold else Double.NaN;
def DownSignal = if RSI1 crosses below OverBought then OverBought else Double.NaN;

#RSI.DefineColor("OverBought", GetColor(5));
#RSI.DefineColor("Normal", GetColor(7));
#RSI.DefineColor("OverSold", GetColor(1));
#RSI.AssignValueColor(if RSI > over_Bought then RSI.color("OverBought") else if RSI < over_Sold then #RSI.color("OverSold") else RSI.color("Normal"));
#OverSold.SetDefaultColor(GetColor(8));
#OverBought.SetDefaultColor(GetColor(8));
#UpSignal.SetDefaultColor(Color.UPTICK);
#UpSignal.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
#DownSignal.SetDefaultColor(Color.DOWNTICK);
#DownSignal.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
#

#----------------------------

# long
# If the 34 is above the 50 and
# 50 is above the 72 and the
# 72 is above the 89 and
# The RSI is below 60 and
# The RSI is above 30
# last price is = to the 89 ema

def long1 =
    avg3 > avg4
and avg4 > avg5
and avg5 > avg6
and rsi1 < 60
and rsi1 > 30
and (low < avg6 and high > avg6);

plot zup = if long1 then low*0.999 else na;
zup.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
zup.SetDefaultColor(Color.green);
zup.setlineweight(3);
zup.hidebubble();

#addverticalline(long1, "long", color.green);

addchartbubble(0, low*0.997,
(avg3 > avg4) + "\n" +
(avg4 > avg5) + "\n" +
(avg5 > avg6) + "\n" +
(rsi1 < 60) + "\n" +
(rsi1 > 30) + "\n" +
#and data crosses avg6;
(low < avg6 and high > avg6)
, color.yellow, no);

#----------------------------

# short
# If the 34 is below the 50 and
# 50 is below the 72 and the
# 72 is below the 89 and
# The RSI is below 60 and
# The RSI is above 30
# last price is = to the 89 ema

def short1 =
    avg3 < avg4
and avg4 < avg5
and avg5 < avg6
and rsi1 < 60
and rsi1 > 30
and (low < avg6 and high > avg6);

plot zdwn = if short1 then high*1.001 else na;
zdwn.SetPaintingStrategy(PaintingStrategy.ARROW_down);
zdwn.SetDefaultColor(Color.red);
zdwn.setlineweight(3);
zdwn.hidebubble();
#
alert(long1, "up" ,alert.BAR, sound.DING);
alert(short1, "down" ,alert.BAR, sound.bell);
#
 
Solution

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
353 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • 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?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top