Chart label: ADX, VIX, UVXY, TICK

KCLLive

New member
Sorry I don't remember who the original author was of the volatility using ATR script but the indicator is in here somewhere. I basically modified their script to show the ADX, VIX, UVXY, TICK to monitor current market conditions. It's sloppy but it works. Still learning.

https://ibb.co/Fx6JGJD for a preview.

Code:
# Modified July 20, 2021
# Volatility uses ATR

input length = 14;

input atrlength = 14;

input avglength = 500;

input plotlower = {default "yes", "no"};

def c = close(Symbol = "vix");
def s = close(Symbol = "spy");
def u = close(Symbol = "uvxy");
def t = close(Symbol = "$tick");

def vol = reference ATR(atrlength, averageType = AverageType.SIMPLE);

def avgvol = Average(vol, avglength);

def calm = vol < avgvol - (avgvol * .1);

def neutral = avgvol + (avgvol * .1) > vol > avgvol - (avgvol * .1);

def Volatile = vol > avgvol + (avgvol * .1);

AddLabel(yes, Concat("Market is Currently ", (if calm then "Calm" else if neutral then "Neutral" else if Volatile then "Volatile" else "Neutral")),  if calm then Color.GREEN else if neutral then Color.BLUE else if Volatile then Color.RED  else Color.GRAY);

# If the ADX is above 25 this indicates a strong trend, above 35 indicates a very strong trend

plot currentADX = ADX(length);

currentADX.hide();

DefineGlobalColor("High", Color.GREEN); DefineGlobalColor("Chop", Color.RED); DefineGlobalColor("Low", Color.GRAY);

#input Label_Color_Choice =  {default "gray", "white"};

AddLabel (currentADX > 35, "Strong Trend",
(color.GREEN));

AddLabel (yes, (Concat("ADX = ", Round(currentADX,1))),if currentADX > 25 then GlobalColor("High") else if currentADX < 20 then GlobalColor("Low") else GlobalColor("Chop"));

## vix Label
AddLabel(1, "VIX = " + c);
## UVXY Label
AddLabel(1, "UVXY = " + u);
## TICK and TIKI
AddLabel(1, "TICK = " + close(Symbol = "$TICK"));
 

Similar threads

Top