RSI() crosses above 30 or RSI() crosses below 70
#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,
Alert(RSI crosses below Oversold, " Your Text Here ", Alert.Bar, Sound.Ring);
Alert(AO crosses below Zero, " Your Text Here ", Alert.Bar, Sound.Ring);
#
# TD Ameritrade IP Company, Inc. (c) 2007-2020
# Revised to add Alerts
declare lower;
input length = 14;
input over_Bought = 70;
input over_Sold = 30;
input price = close;
input averageType = AverageType.WILDERS;
input showBreakoutSignals = no;
def NetChgAvg = MovingAverage(averageType, price - price[1], length);
def TotChgAvg = MovingAverage(averageType, AbsValue(price - price[1]), length);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;
plot RSI = 50 * (ChgRatio + 1);
plot OverSold = over_Sold;
plot OverBought = over_Bought;
plot UpSignal = if RSI crosses above OverSold then OverSold else Double.NaN;
Alert(UpSignal, "Possible Long", Alert.BAR, Sound.Bell);
AddVerticalLine (UpSignal, "", Color.GREEN);
plot DownSignal = if RSI crosses below OverBought then OverBought else Double.NaN;
Alert(DownSignal, "Possible Short", Alert.BAR, Sound.Ring);
UpSignal.SetHiding(!showBreakoutSignals);
DownSignal.SetHiding(!showBreakoutSignals);
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);
Without checking into your email request let me inform you that a majority of email notifications are delayed and would only be worthwhile for longer timeframes... I have had emails to multiple addresses delayed from different Alerts for extended periods of time... I would imagine that the reason for this would be server priority related, meaning that email notifications have a lower priority than some more mission critical processes... Just a heads-up...Perhaps I express myself wrong ... I mean an alert via email ... that is ... to have the possibility of receiving an email when the RSI crosses the level 30 downwards. thinkorswim offers this option, which cancels the alert once it is fulfilled ... my question is if there is a possibility of having the alert indefinitely, having the possibility of receiving an email every time the RSI crosses level 30.
Explain how you mean "indefinite"...I take it into account ... but I want to know if an alarm that is notified by mail can be indefinite
Most alerts work that way... They aren't one-shot Alerts...I mean that the alert is constantly active, that is ... if they send me the alert because the RSI crossed 60 ... if the RSI falls again and after two hours it crosses it again ... well let me know again.
#
# TD Ameritrade IP Company, Inc. (c) 2007-2020
#
declare lower;
input length = 14;
input over_Bought = 70;
input over_Sold = 30;
input price = close;
input averageType = AverageType.WILDERS;
input showBreakoutSignals = no;
def NetChgAvg = MovingAverage(averageType, price - price[1], length);
def TotChgAvg = MovingAverage(averageType, AbsValue(price - price[1]), length);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;
plot RSI = 50 * (ChgRatio + 1);
plot OverSold = over_Sold;
plot OverBought = over_Bought;
def custom = 34;
def data = RSI crosses below custom;
Alert(data, "RSI crosses below 34", Alert.Bar, Sound.Chimes);
# SD_RSILabel
# Last Mod: December 14, 2020
##### Begin Code #####
declare upper;
input length = 14;
input RSIOverbought = 70;
input RSIOversold = 30;
input RSIPos = 60;
input RSINeg = 40;
input median = 50;
input RSI_to_Median = yes;
input RSI_Warning = yes;
input AlertHiLevel = 70;
input AlertLoLevel = 30;
def RSIlabel = reference RSI(length,price = close);
AddLabel(yes, if RSIlabel > RSIlabel[1] then " RSI RISING " else " RSI FALLING ", if RSIlabel > RSIlabel[1] then Color.GREEN else Color.RED);
AddLabel(yes, if RSIlabel >= RSIOverbought then " RSI OVERBOUGHT " else "", Color.RED);
AddLabel(yes, if RSIlabel <= RSIOversold then " RSI OVERSOLD " else "", Color.GREEN);
AddLabel(RSI_Warning, if RSIlabel >= RSIPos then " RSI HIGH WARNING " else "", Color.RED);
AddLabel(RSI_Warning, if RSIlabel <= RSINeg then " RSI LOW WARNING " else "", Color.GREEN);
AddLabel(RSI_to_Median, " RSI TO MEDIAN " + Round(RSILabel,0) + " ", if RSIlabel > median then Color.LIME else if RSIlabel <= median then Color.ORANGE else Color.WHITE);
Alert(RSILabel > AlertHiLevel, "", Alert.Bar, Sound.Ring);
Alert(RSILabel < AlertLoLevel, "", Alert.Bar, Sound.Ring);
##### End Code #####
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
![]() |
Moving Average Crossover RSI Indicator for ThinkorSwim | Custom | 40 | |
![]() |
Normalized Scale TMO w/ RSI Candles | Indicators | 0 | |
J | Add up arrow to this RSI condition | Questions | 2 | |
J | RSI HistoAlert Strategy for ThinkorSwim | Questions | 4 | |
R | Bollinger Band/Stochastic Momentum Index or RSI scan | Questions | 3 |