AO, MACD and RSI of VIX in SPY chart

rajaodu1

Member
VIP
Hi Script gurus, I am looking for Awesome oscillator, MACD and RSI of VIX to be shown in lower charts of SPY candle chart. This will help me to see AO of SPY and VIX in same chart. Can you please help to give me a scrip.
 
I am looking for separate AO of VIX in SPY chart, MACD of VIX in SPY chart and RSI of VIS in SPY chart. If possible please give an option of MTF. Such as I can add five min vix data in one min SPY chart. Thanks for your help
 
Note that these indicators REPAINT due to the nature of getting data from a higher time-frame. Repaints until the selected aggregation's time period ends.

Symbol in Lower (default symbol = VIX and default Chart Type = Candlesticks):

Code:
# MTF_Symbol_CandleSticks_Lower
# by dart966 on 06.07.2025

declare lower;

input customSymbol = "VIX"; # User-defined symbol
input aggregationPeriod = AggregationPeriod.FIVE_MIN;
input charttype = ChartType.CANDLE;

# Retrieve OHLC data for the input symbol
def customOpen = open(symbol = customSymbol, period = aggregationPeriod);
def customHigh = high(symbol = customSymbol, period = aggregationPeriod);
def customLow = low(symbol = customSymbol, period = aggregationPeriod);
def customClose = close(symbol = customSymbol, period = aggregationPeriod);

# Create candlesticks

# Candle/Bar trend direction logic
def UpCandle = customClose > customOpen;
def DnCandle = customClose < customOpen;
def doji = customClose == customOpen;

# GlobalColor Colors

DefineGlobalColor("UpCandle", Color.GREEN);
DefineGlobalColor("DnCandle", Color.RED);
DefineGlobalColor("Doji", Color.WHITE);

# Paint Candles using separate AddChart() function calls

AddChart(high = if UpCandle then customLow else Double.NaN, low = customHigh, open = customClose,  close = customOpen, type = ChartType.CANDLE, growcolor = GlobalColor("UpCandle"));

AddChart(high = if DnCandle then customHigh else Double.NaN, low = customLow, open = customOpen,  close = customClose, type = ChartType.CANDLE, growcolor = GlobalColor("DnCandle"));

AddChart(high = if doji then customHigh else Double.NaN, low = customLow, open = customOpen,  close = customClose, type = ChartType.CANDLE, growcolor = GlobalColor("Doji"));


# end script


MTF MACD of Symbol (default symbol = VIX):

Code:
# MTF_MACD_OF_Symbol
# by dart966 on 6.7.2025

declare lower;

input customSymbol = "VIX"; # 'Index symbol'

#MACD
input Aggregation1 = AggregationPeriod.FIVE_MIN;
input fastLength = 12;
input slowLength = 26;
input MACDLength = 9;
input averageType = AverageType.EXPONENTIAL;

def price1 = close(symbol = customSymbol, period = Aggregation1);

plot Value1 = MovingAverage(averageType, price1, fastLength) - MovingAverage(averageType, price1, slowLength);
plot Avg1 = MovingAverage(averageType, Value1, MACDLength);

plot Diff1 = Value1 - Avg1;
plot ZeroLine = 0;

plot UpSignal = if Diff1 crosses above ZeroLine then ZeroLine else Double.NaN;
plot DownSignal = if Diff1 crosses below ZeroLine then ZeroLine else Double.NaN;



Value1.SetDefaultColor(GetColor(1));
Avg1.SetDefaultColor(GetColor(8));
Diff1.SetDefaultColor(GetColor(5));
Diff1.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Diff1.SetLineWeight(3);
Diff1.DefineColor("Positive and Up", Color.GREEN);
Diff1.DefineColor("Positive and Down", Color.DARK_GREEN);
Diff1.DefineColor("Negative and Down", Color.RED);
Diff1.DefineColor("Negative and Up", Color.DARK_RED);
Diff1.AssignValueColor(if Diff1 >= 0 then if Diff1 > Diff1[1] then Diff1.color("Positive and Up") else Diff1.color("Positive and Down") else if Diff1 < Diff1[1] then Diff1.color("Negative and Down") else Diff1.color("Negative and Up"));
ZeroLine.SetDefaultColor(GetColor(0));


# End Script


RSI of Symbol (default symbol = VIX):

Code:
# MTF RSI of Symbol
# by dart966 on 6.7.2025

declare lower;
#RSI
input customSymbol = "VIX"; # 'Index 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:
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.

I converted "TrueMomentumOscilWithFisher_v04_JQ" to MTF since I really like this indicator ;)
Thanks to Mobius and JohnnyQuotron for the indicator:

Code:
## Archive Name: TrueMomentumOscilWithFisher_v04_JQ
## Archive Section:
## Suggested Tos Name: TrueMomentumOscilWithFisher_v04_JQ
## Archive Date: 10.6.2018
## Archive Notes:

#  v02 JQ added FE code to generate points
#  v03 JQ added FisherTransform crossover arrows to confirm TMO
#  v04 JQ Remoed all Fractal Energy code
## "##" indicates an addition by the Archivist
#  dart966 added MTF


# TMO ((T)rue (M)omentum (O)scilator)
# Mobius
# V01.05.2018
#hint: TMO calculates momentum using the delta of price. Giving a much better picture of trend, tend reversals and divergence than momentum oscillators using price.

declare lower;

input customSymbol = "VIX"; # 'Index symbol'
input Aggregation1 = AggregationPeriod.FIVE_MIN;

input length = 14;
input calcLength = 5;
input smoothLength = 3;
input displayFisherLabels = no;


def o = open(symbol = customSymbol, period = Aggregation1);
def c = close(symbol = customSymbol, period = Aggregation1);
def data = fold i = 0 to length
with s
do s + (if c > GetValue(o, i)
then 1
else if c < GetValue(o, i)
then - 1
else 0);
def EMA5 = ExpAverage(data, calcLength);
plot Main = ExpAverage(EMA5, smoothLength);
plot Signal = ExpAverage(Main, smoothLength);
Main.AssignValueColor(if Main > Signal
then Color.GREEN
else Color.RED);
Signal.AssignValueColor(if Main > Signal
then Color.GREEN
else Color.RED);
Signal.HideBubble();
Signal.HideTitle();
AddCloud(Main, Signal, Color.GREEN, Color.RED);
plot zero = if IsNaN(c) then Double.NaN else 0;
zero.SetDefaultColor(Color.GRAY);
zero.HideBubble();
zero.HideTitle();
plot ob = if IsNaN(c) then Double.NaN else Round(length * .7);
ob.SetDefaultColor(Color.GRAY);
ob.HideBubble();
ob.HideTitle();
plot os = if IsNaN(c) then Double.NaN else -Round(length * .7);
os.SetDefaultColor(Color.GRAY);
os.HideBubble();
os.HideTitle();
AddCloud(ob, length, Color.LIGHT_RED, Color.LIGHT_RED, no);
AddCloud(-length, os, Color.LIGHT_GREEN, Color.LIGHT_GREEN);


# End Code TMO



#    JQ_FisherTransform_wLabels  v02
#    assistance provided by AlphaInvestor, amalia, randyr and nube

# v02 9.23.2018  JQ added arrows

input Fisherprice = hl2;
input FisherLength = 10;
input TriggerLineOffset = 1;  # Ehler's value of choice is 1
input TriggerLine_Color_Choice = {"magenta", "cyan", "pink", default "gray", "Mustard", "red", "green", "dark_gray", "Pale Yellow", "white"};
input deBug = no;

input BuyLabelText = " FisherTransform Buy ";
input SellLebelText = " FisherTransform Sell ";

def maxHigh = Highest(Fisherprice, FisherLength);
def minLow = Lowest(Fisherprice, FisherLength);
def range = maxHigh - minLow;
def value = if IsNaN(Fisherprice)
    then Double.NaN
    else if IsNaN(range)
        then value[1]
        else if range == 0
            then 0
            else 0.66 * ((Fisherprice - minLow) / range - 0.5) + 0.67 * value[1];
def truncValue = if value > 0.99 then 0.999 else if value < -0.99 then -0.999 else value;
def fish = 0.5 * (Log((1 + truncValue) / (1 - truncValue)) + fish[1]);
def FTOneBarBack = fish[TriggerLineOffset];
def FT = fish;

plot FisherBullCross = if FT crosses above FTOneBarBack then lowestall(Main) else Double.NaN;
FisherBullCross.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
FisherBullCross.SetDefaultColor(Color.UPTICK);

plot FisherBearCross = if FT crosses below FTOneBarBack then highestall(Main) else Double.NaN;
FisherBearCross.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
FisherBearCross.SetDefaultColor(Color.DOWNTICK);



AddLabel (displayFisherLabels, "" + if FT >= FTOneBarBack then BuyLabelText else SellLebelText + "       ",
    (if FT > FTOneBarBack
    then Color.LIGHT_GREEN
    else if FT  < FTOneBarBack
    then Color.LIGHT_RED
    else Color.GRAY));



    # End Fisher Transform Code
 
Last edited:

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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