Question on alerts

hrd

New member
I have seen an alert like this work successfully:

Alert(RSI > 70, + RSI, Alert.BAR,Sound.Bell);

And I have used this alert successfully:

Alert(Trend_bull_value > 0 and RSI < 30,"Buy AAPL",Alert.BAR,Sound.Ding);

But when I try adding in the "+ RSI," like this: Alert(Trend_bull_value > 0 and RSI < 30, + RSI, "Buy AAPL",Alert.BAR,Sound.Ding);

I get the error message that four parameters are the limit and I have put in five.

I'd like to get the value of RSI displayed and also be able to get a message like "Buy AAPL" because I am following more than one stock and it is easier to tell which stock the signal is referring to if I can put in my own message.

Is there a correct way to add in the RSI value I get in "Alert(RSI > 70, + RSI, Alert.BAR,Sound.Bell);" to my second alert?
 
Code:
#@hrd please match the alert call params as follows
# Alert(condition                         ,text             ,alert type ,sound ) ;
Alert(Trend_bull_value > 0 and RSI < 30  ,RSI + "Buy AAPL" ,Alert.BAR   ,Sound.Ding);
 

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

Hi, @Florida,

Could you help me create an alert for the RSI Crossover? This is what I have so far but I have not been able to get it to work.

Code:
input length = 14;
input crossingType = {default above, below};
input threshold = 30;
input averageType = AverageType.WILDERS;

plot signal = crosses(RSI(length=length, averageType=averageType).RSI, threshold, crossingType == CrossingType.above);

signal.DefineColor("Above", GetColor(7));
signal.DefineColor("Below", GetColor(8));
signal.AssignValueColor(if crossingType == CrossingType.above then signal.color("Above") else signal.color("Below"));

signal.SetPaintingStrategy(if crossingType == CrossingType.above
    then PaintingStrategy.BOOLEAN_ARROW_UP
    else PaintingStrategy.BOOLEAN_ARROW_DOWN);

Alert(crossingtype.above, "", Alert.BAR, Sound.Bell);

I've tried: "Alert(threshold crosses above .70, "", Alert.BAR, Sound.Bell);" but so far I have been unsuccessful.

Thank you for your help.
 
Code:
@trashcompactor please see the following

#Alert(crossingtype.above, "", Alert.BAR, Sound.Bell);

# you have defined the condition above. just employ that
Alert (signal, "Got signal "+round(close,2), alert.Bar, sound.Ding)  ;
 
Last edited:
@Florida

Thank you for the help. Adding your code right now. What does "+round(close,2)" mean?
Just so I am learning. I did not understanding that portion of the code.

Thank you very much, Florida.
It rounds the close to two decimals. I wasn't even using it before, but after you asked Florida what it did, and my many decades in Information Technology let me know exactly what it was, I put it into my code and now have RSI showing up as 29.62 instead of as RSI 29.6284 in my alert.

Here's my alert:

Alert(Trend_bull_value > 0 and RSI < 30,
Round(RSI,2) + " Buy ESH23 Buy ESH23",
Alert.BAR,
Sound.DING);

Debating whether to eliminate the two decimals entirely, but it shows up a bit easier to read at 29 .62 than at 29.
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
366 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