Note this indicator will REPAINT due to the nature of getting data from a higher time-frame. Repaints until the selected aggregation's time period ends.
MTF RSI of Symbol (default = VIX):
MTF RSI of Symbol (default = VIX):
Code:
# MTF RSI of Symbol
# by dart966 on 6.7.2025
declare lower;
# RSI
input customSymbol = "VIX"; # User-defined Symbol
input Aggregation1 = AggregationPeriod.FIVE_MIN;
input length = 14;
input over_Bought = 80;
input over_Sold = 20;
input averageType = AverageType.WILDERS;
def price1 = close(symbol = customSymbol, period = Aggregation1);
def NetChgAvg = MovingAverage(averageType, price1 - price1[1], length);
def TotChgAvg = MovingAverage(averageType, AbsValue(price1 - price1[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 lline = 50;
RSI.AssignValueColor(Color.RED);
OverSold.SetDefaultColor(GetColor(7));
OverBought.SetDefaultColor(GetColor(7));
lline.SetDefaultColor(GetColor(7));
# End script
Last edited: