# beginning of code ———————- –
# current ADX as a label at top of the chart
#
# Label color changes according to value of ADX:
# . Green if >25
# . Gray if 20 to 25
# . Red if < 20
# . Red if < 20 # input length = 14; plot currentADX = ADX(length); currentADX.hide();
input length = 14;
plot currentADX = ADX(length);
currentADX.hide();
DefineGlobalColor(“ADXHigh”, CreateColor(50, 205, 50));
DefineGlobalColor(“ADXLow”, Color.RED);
DefineGlobalColor(“ADXMid”, Color.GRAY);
AddLabel (yes, (Concat(“ADX = “, Round(currentADX,1))),if currentADX > 25 then GlobalColor(“ADXHigh”) else if currentADX < 20 then GlobalColor("ADXLow") else GlobalColor("ADXMid")); # end of code ——————————-
# SimpleMovingAvg RSI label by Horsrider 10/10/2019
input length = 14;
input over_Bought = 70;
input over_Sold = 30;
input price = close;
input averageType = AverageType.WILDERS;
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);
AddLabel(yes, rsi, if rsi >= over_Bought or rsi <= over_Sold then Color.RED else Color.GREEN);
input n = 21;
def RSI_ = RSI(14, 70, 30, close, AverageType.WILDERS);
def RSIUP = RSI_ > RSI_[n];
def RSIDN = RSI_ < RSI_[n];
addlabel(1, "RSI : " + Round(RSI_,2) + (if RSIUP then " RISING [" + n + " BARS]"
else if RSIDN then " FALLING [" + n + " BARS]"
else " NEUTRAL"),
if RSIUP then Color.GREEN else if RSIDN then Color.PINK else Color.YELLOW);
@horserider Is it possible to make the label only paint the label green if the RSI value goes below 30 and only paint red if the value goes above 70? If not, can the label be colored grey if the value is currently between 30 and 70?
Thanks for a great script!
input n = 21;
def RSI = RSI(14, 70, 30, close, AverageType.WILDERS);
def rsiUP = RSI < 30;
def rsiDN = RSI > 70;
def rsinet = !rsiUP and !rsiUP;
AddLabel(rsiUP, " RSI < 30 ", Color.GREEN);
AddLabel(rsiDN, " RSI > 70 ", Color.RED);
AddLabel(rsinet, " RSI between 30 & 70", Color.GRAY);
# SimpleMovingAvg RSI label by Horsrider 10/10/2019
input length = 14;
input over_Bought = 70;
input over_Sold = 30;
input price = close;
input averageType = AverageType.WILDERS;
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);
AddLabel(RSI < over_Sold or RSI > over_Bought, RSI, if RSI < over_Sold then Color.GREEN else Color.RED);
#RSI label for upper study
input length = 14;
input over_Bought = 70;
input over_Sold = 30;
input price = close;
input avg_type = AverageType.WILDERS;
def NetChgAvg = MovingAverage(avg_type, price - price[1], length);
def TotChgAvg = MovingAverage(avg_type, AbsValue(price - price[1]), length);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;
def RSI = round(50 * (ChgRatio + 1),2);
AddLabel(1, (if avg_type == 0 then "RSI SMA" else if avg_type == 1 then "RSI EMA" else if avg_type == 2 then "RSI WMA" else if avg_type == 3 then "RSI Wldr" else "RSI Hull") + ": "+rsi+""+ if rsi==rsi[1] then " NC" else if rsi>rsi[1] then " UP" else " DN", if between(rsi,30,70) then color.yellow else if rsi > 50 then if rsi<rsi[1] then color.dark_green else Color.GREEN else if rsi < 50 then if rsi>rsi[1] then color.dark_red else Color.RED else Color.DARK_GRAY);
#addlabel(yes,"RSI " +rsiavg, if rsiavg>70 then color.green else if rsiavg<30 then color.red else color.yellow);
######
Whipped one up real quick.. thank god for copy paste because I did not know the calculations for RSI off top hahaDoes anyone have an RSI Label I can add to the chart ?
Thanks
#RSILabel
input RSILength = 14;
input price = close;
input averageType = AverageType.WILDERS;
def NetChgAvg = MovingAverage(averageType, price - price[1], RSILength);
def TotChgAvg = MovingAverage(averageType, AbsValue(price - price[1]), RSILength);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;
def RSI = 50 * (ChgRatio + 1);
AddLabel(yes, Concat("RSI=", RSI), Color.YELLOW);
# ItsMeKola 08/2020
# Label color changes according to value of ATR:
# . Green if > 2
# . Lime if .50 to 1.99
# . Red if < .49
#
declare upper;
input ATRLength = 14;
input averagetype = AverageType.simple;
input BasePeriod = AggregationPeriod.DAY;
input showlabel = yes;
def ATR = MovingAverage (averagetype, TrueRange(high(period = BasePeriod)[1], close(period = BasePeriod)[1], low(period = BasePeriod)[1]), ATRLength);
DefineGlobalColor("ATRHigh", color.green);
DefineGlobalColor("ATRLow", Color.red);
DefineGlobalColor("ATRMid", Color.lime);
AddLabel (yes, (Concat("ATR: ", Round(ATR, 2))), if ATR > 2 then GlobalColor("ATRHigh") else if ATR < .49 then GlobalColor("ATRLow") else GlobalColor("ATRMid"));
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
Mobius Volume Wave, Trend Pivots and RSI Laguerre | Strategies | 4 | ||
V | RSI / VWAP Strategy request | Questions | 1 | |
U | RSI outcome in different timeframes | Questions | 1 | |
Dominant Cycle + RSI = Cyclic RSI for ThinkOrSwim | Indicators | 26 | ||
Volume Weighted RSI: Extending The Power (TradingView) | Questions | 7 |