RSI Crossover Alert for ThinkorSwim

A

Azzy19

New member
Hi,

I'm struggling to find and create an alert for RSI crossing 30 (Oversold), and 70(Overbought). Is their a way to set an alert for a security when it's RSI behaves like this?

Thanks!

 
Last edited:
theelderwand

theelderwand

Member
2019 Donor
VIP
Navigate to Marketwatch -> Alerts
Type the security you are interested in and click on Study Alert.
Go to thinkscript editor and enter the following

Code:
RSI() crosses above 30 or RSI() crosses below 70
You can edit it as you need it. There should be an RSI Crossover as well.
Below screenshot.

 
Last edited by a moderator:
D

Daughters Keeper

New member
Do you know how to make the script for sound? I want to make one for RSI under 30 and one for Awesome Oscillator crossing under the zero line. I made one for the MACD but can't figure these two out.

Code:
#wizard input: crossingType
#wizard text: Inputs: fast length:
#wizard input: fastLength
#wizard text: slow length:
#wizard input: slowLength
#wizard text: macd length:
#wizard input: MACDLength
#wizard text: average type:
#wizard input: AverageType

input fastLength = 12;
input slowLength = 26;
input MACDLength = 9;
input averageType = AverageType.EXPONENTIAL;
input crossingType = {default "Positive to Negative", "Negative to Positive"};

def Diff = MACD(fastLength, slowLength, MACDLength, averageType).Diff;

plot signal = Crosses(Diff, 0, crossingType == crossingType."Negative to Positive");

signal.DefineColor("Negative to Positive", GetColor(2));
signal.DefineColor("Positive to Negative", GetColor(3));
signal.AssignValueColor(if crossingType == crossingType."Negative to Positive" then signal.Color("Negative to Positive") else signal.Color("Positive to Negative"));

signal.SetPaintingStrategy(if crossingType == crossingType."Negative to Positive"
    then PaintingStrategy.BOOLEAN_ARROW_UP
    else PaintingStrategy.BOOLEAN_ARROW_DOWN);

Alert(signal[0], "MACD Alert", Alert.BAR, Sound.Ring);

# chimes, ding, bell,
 
P

Pensar

Active member
VIP
@Daughters Keeper You seem to already have the necessary method. :) So for the RSI, it would be something like
Code:
Alert(RSI crosses below Oversold, " Your Text Here ", Alert.Bar, Sound.Ring);
and for the Awesome Oscillator
Code:
Alert(AO crosses below Zero, " Your Text Here ", Alert.Bar, Sound.Ring);
 
D

Daughters Keeper

New member
@Daughters Keeper You seem to already have the necessary method. :) So for the RSI, it would be something like
Code:
Alert(RSI crosses below Oversold, " Your Text Here ", Alert.Bar, Sound.Ring);
and for the Awesome Oscillator
Code:
Alert(AO crosses below Zero, " Your Text Here ", Alert.Bar, Sound.Ring);
Perfect! I was missing something on those two that I couldn't figure out, it kept giving me an error message. Thanks for your help!
 

Similar threads

Top