ThinkOrSwim Market Internals/Indicators

Carl-not-Karl

ToS Expert
VIP
thinkorswim once had a Release Note webpage in 2013 of what they called Market Indicators, others would call them Market Internals.
The webpage is no longer available as Release Notes now only go back to February 15, 2020: https://toslc.thinkorswim.com/center/release/
Fortunately, years ago I copied the data to my tos platform as I wanted them on a Word document for further study/analysis offline.
Here they are for uTS' archives (the ?s are my questioning their statement "trading day’s close" as it should be "net change"):

Code:
# https://tlc.thinkorswim.com/center/release/rel-07-20-2013 | < 404 >
# Technical Notes
# We have added a huge number of new technical indicators.
# Here are all of the details:
# The New York Stock Exchange (NYSE) is a physical and electronic stock exchange, while NYSE Arca is an electronic communications network (ECN) used for matching orders.
# Definitions
# Composite Markets - traded anywhere
# Primary Markets – AMEX, ARCA, NASDAQ, NYSE
# Advancing issues – Issues that have a positive net change from previous "trading day’s close" (?)
# Declining issues – Issues that have a negative net change from previous "trading day’s close" (?)
# $TICK – Number of issues that have a positive change from previous trade minus number of issues that have a negative change from previous trade
# $TRIN – Volume of advancing issues divided by the volume of declining issues
#=======================================================================================================

# All USA stocks: Primary Markets only
# $ADUSD  AllUSA Advancing Issues - Declining Issues Difference
# $ADVUS  AllUSA Advanced issues
# $DECLUS AllUSA Declined issues
# $DVOLUS AllUSA Declined volume
# $TIKUS  AllUSA TICK
# $TRINUS AllUSA TRIN
# $TVOLUS AllUSA Total volume
# $UNCHUS AllUSA Unchanged issues
# $UVOLUS AllUSA Advanced volume
# $VOLUSD AllUSA Up Volume - Down Volume Difference

# All USA stocks: All Markets
# $ADUSDC  AllUSA Composite Advancing Issues - Declining Issues Difference
# $ADVUSC  AllUSA Composite Advanced issues
# $DECLUSC AllUSA Composite Declined issues
# $DVOLUSC AllUSA Composite Declined volume
# $TIKUSC  AllUSA Composite TICK
# $TRINUSC AllUSA Composite TRIN
# $TVOLUSC AllUSA Composite Total volume
# $UNCHUSC AllUSA Composite Unchanged issues
# $UVOLUSC AllUSA Composite Advanced volume
# $VOLUSDC AllUSA Composite Up Volume - Down Volume Difference

# AMEX listed: Primary Markets only
# $ADAD  NYSE MKT (AMEX) Advancing Issues - Declining Issues Difference
# $ADVA  NYSE MKT (AMEX) Advanced issues
# $DECA  NYSE MKT (AMEX) Declined issues
# $DVOA  NYSE MKT (AMEX) Declined volume
# $TICKA NYSE MKT (AMEX) TICK
# $TRINA NYSE MKT (AMEX) TRIN
# $TVOA  NYSE MKT (AMEX) Total volume
# $UNCA  NYSE MKT (AMEX) Unchanged issues
# $UVOA  NYSE MKT (AMEX) Advanced volume
# $VOLAD NYSE MKT (AMEX) Up Volume - Down Volume Difference

# AMEX listed: All Markets
# $ADADC  NYSE MKT (AMEX) Composite Advancing Issues - Declining Issues Difference
# $ADVAC  NYSE MKT (AMEX) Composite Advanced issues
# $DECAC  NYSE MKT (AMEX) Composite Declined issues
# $DVOAC  NYSE MKT (AMEX) Composite Declined volume
# $TICKAC NYSE MKT (AMEX) Composite TICK
# $TRINAC NYSE MKT (AMEX) Composite TRIN
# $TVOAC  NYSE MKT (AMEX) Composite Total volume
# $UNCAC  NYSE MKT (AMEX) Composite Unchanged issues
# $UVOAC  NYSE MKT (AMEX) Composite Advanced volume
# $VOLADC NYSE MKT (AMEX) Composite Up Volume - Down Volume Difference

# DJIA components: Primary Markets only
# $ADID  DJIA Advancing Issues - Declining Issues Difference
# $ADVI  DJIA Advanced issues
# $DECLI DJIA Declined issues
# $DVOLI DJIA Declined volume
# $TIKI  DJIA TICK
# $TRINI DJIA TRIN
# $TVOLI DJIA Total volume
# $UNCHI DJIA Unchanged issues
# $UVOLI DJIA Advanced volume
# $VOLID DJIA Up Volume - Down Volume Difference

# DJIA components: All Markets
# $ADIDC  DJIA Composite Advancing Issues - Declining Issues Difference
# $ADVIC  DJIA Composite Advanced issues
# $DECLIC DJIA Composite Declined issues
# $DVOLIC DJIA Composite Declined volume
# $TIKIC  DJIA Composite TICK
# $TRINIC DJIA Composite TRIN
# $TVOLIC DJIA Composite Total volume
# $UNCHIC DJIA Composite Unchanged issues
# $UVOLIC DJIA Composite Advanced volume
# $VOLIDC DJIA Composite Up Volume - Down Volume Difference

# NASDAQ listed: Primary Markets only
# $ADQD   NASDAQ Advancing Issues - Declining Issues Difference
# $ADVN/Q NASDAQ Advanced issues
# $DECN/Q NASDAQ Declined issues
# $DVOL/Q NASDAQ Declined volume
# $TICK/Q NASDAQ TICK
# $TRIN/Q NASDAQ TRIN
# $TVOL/Q NASDAQ Total volume
# $UNCN/Q NASDAQ Unchanged issues
# $UVOL/Q NASDAQ Advanced volume
# $VOLQD  NASDAQ Up Volume - Down Volume Difference

# NASDAQ listed: All Markets
# $ADQDC   NASDAQ Composite Advancing Issues - Declining Issues Difference
# $ADVNC/Q NASDAQ Composite Advanced issues
# $DECNC/Q NASDAQ Composite Declined issues
# $DVOLC/Q NASDAQ Composite Declined volume
# $TICKC/Q NASDAQ Composite TICK
# $TRINC/Q NASDAQ Composite TRIN
# $TVOLC/Q NASDAQ Composite Total volume
# $UNCNC/Q NASDAQ Composite Unchanged issues
# $UVOLC/Q NASDAQ Composite Advanced volume
# $VOLQDC  NASDAQ Composite Up Volume - Down Volume Difference

# NASDAQ 100 components: Primary Markets only
# $ADNDD  NASDAQ 100 Advancing Issues - Declining Issues Difference
# $ADVND  NASDAQ 100 Advanced issues
# $DECLND NASDAQ 100 Declined issues
# $DVOLND NASDAQ 100 Declined volume
# $TIKND  NASDAQ 100 TICK
# $TRINND NASDAQ 100 TRIN
# $TVOLND NASDAQ 100 Total volume
# $UNCHND NASDAQ 100 Unchanged issues
# $UVOLND NASDAQ 100 Advanced volume
# $VOLNDD NASDAQ 100 Up Volume - Down Volume Difference

# NASDAQ 100 components: All Markets
# $ADNDDC  NASDAQ 100 Composite Advancing Issues - Declining Issues Difference
# $ADVNDC  NASDAQ 100 Composite Advanced issues
# $DECLNDC NASDAQ 100 Composite Declined issues
# $DVOLNDC NASDAQ 100 Composite Declined volume
# $TIKNDC  NASDAQ 100 Composite TICK
# $TRINNDC NASDAQ 100 Composite TRIN
# $TVOLNDC NASDAQ 100 Composite Total volume
# $UNCHNDC NASDAQ 100 Composite Unchanged issues
# $UVOLNDC NASDAQ 100 Composite Advanced volume
# $VOLNDDC NASDAQ 100 Composite Up Volume - Down Volume Difference

# NYSE listed: listed on NYSE trades only on NYSE
# $ADD  NYSE Advancing Issues - Declining Issues Difference
# $ADVN NYSE Advanced issues
# $DECN NYSE Declined issues
# $DVOL NYSE Declined volume
# $TICK NYSE TICK
# $TRIN NYSE TRIN
# $TVOL NYSE Total volume
# $UNCN NYSE Unchanged issues
# $UVOL NYSE Advanced volume
# $VOLD NYSE Up Volume - Down Volume Difference

# NYSE listed: Listed on NYSE traded anywhere
# $ADDC  NYSE Composite Advancing Issues - Declining Issues Difference
# $ADVNC NYSE Composite Advanced issues
# $DECNC NYSE Composite Declined issues
# $DVOLC NYSE Composite Declined volume
# $TICKC NYSE Composite TICK
# $TRINC NYSE Composite TRIN
# $TVOLC NYSE Composite Total volume
# $UNCNC NYSE Composite Unchanged issues
# $UVOLC NYSE Composite Advanced volume
# $VOLDC NYSE Composite Up Volume - Down Volume Difference

# NYSE ARCA listed: Primary Markets only
# $ADARD  NYSE ARCA Advancing Issues - Declining Issues Difference
# $ADVAR  NYSE ARCA Advanced issues
# $DECAR  NYSE ARCA Declined issues
# $DVOAR  NYSE ARCA Declined volume
# $TICKAR NYSE ARCA TICK
# $TRINAR NYSE ARCA TRIN
# $TVOAR  NYSE ARCA Total volume
# $UNCAR  NYSE ARCA Unchanged issues
# $UVOAR  NYSE ARCA Advanced volume
# $VOLARD NYSE ARCA Up Volume - Down Volume Difference

# NYSE ARCA listed: All Markets
# $ADARDC  NYSE ARCA Composite Advancing Issues - Declining Issues Difference
# $ADVARC  NYSE ARCA Composite Advanced issues
# $DECARC  NYSE ARCA Composite Declined issues
# $DVOARC  NYSE ARCA Composite Declined volume
# $TICKARC NYSE ARCA Composite TICK
# $TRINARC NYSE ARCA Composite TRIN
# $TVOARC  NYSE ARCA Composite Total volume
# $UNCARC  NYSE ARCA Composite Unchanged issues
# $UVOARC  NYSE ARCA Composite Advanced volume
# $VOLARDC NYSE ARCA Composite Up Volume - Down Volume Difference

# The New York Stock Exchange (NYSE) is a physical and electronic stock exchange, while NYSE Arca is an electronic communications network (ECN) used for matching orders.

# RUSSELL 2000 components: Primary Markets only
# $ADRLD  RUSSELL 2000 Advancing Issues - Declining Issues Difference
# $ADVRL  RUSSELL 2000 Advanced issues
# $DECLRL RUSSELL 2000 Declined issues
# $DVOLRL RUSSELL 2000 Declined volume
# $TIKRL  RUSSELL 2000 TICK
# $TRINRL RUSSELL 2000 TRIN
# $TVOLRL RUSSELL 2000 Total volume
# $UNCHRL RUSSELL 2000 Unchanged issues
# $UVOLRL RUSSELL 2000 Advanced volume
# $VOLRLD RUSSELL 2000 Up Volume - Down Volume Difference
 
# RUSSELL 2000 components: All Markets
# $ADRLDC  RUSSELL 2000 Composite Advancing Issues - Declining Issues Difference
# $ADVRLC  RUSSELL 2000 Composite Advanced issues
# $DECLRLC RUSSELL 2000 Composite Declined issues
# $DVOLRLC RUSSELL 2000 Composite Declined volume
# $TIKRLC  RUSSELL 2000 Composite TICK
# $TRINRLC RUSSELL 2000 Composite TRIN
# $TVOLRLC RUSSELL 2000 Composite Total volume
# $UNCHRLC RUSSELL 2000 Composite Unchanged issues
# $UVOLRLC RUSSELL 2000 Composite Advanced volume
# $VOLRLDC RUSSELL 2000 Composite Up Volume - Down Volume Difference

# S&P 500 components: Primary Markets only
# $ADSPD  SNP 500 Advancing Issues - Declining Issues Difference
# $ADVSP  SNP 500 Advanced issues
# $DECLSP SNP 500 Declined issues
# $DVOLSP SNP 500 Declined volume
# $TIKSP  SNP 500 TICK
# $TRINSP SNP 500 TRIN
# $TVOLSP SNP 500 Total volume
# $UNCHSP SNP 500 Unchanged issues
# $UVOLSP SNP 500 Advanced volume
# $VOLSPD SNP 500 Up Volume - Down Volume Difference

# S&P 500 components: All Markets
# $ADSPDC  SNP 500 Composite Advancing Issues - Declining Issues Difference
# $ADVSPC  SNP 500 Composite Advanced issues
# $DECLSPC SNP 500 Composite Declined issues
# $DVOLSPC SNP 500 Composite Declined volume
# $TIKSPC  SNP 500 Composite TICK
# $TRINSPC SNP 500 Composite TRIN
# $TVOLSPC SNP 500 Composite Total volume
# $UNCHSPC SNP 500 Composite Unchanged issues
# $UVOLSPC SNP 500 Composite Advanced volume
# $VOLSPDC SNP 500 Composite Up Volume - Down Volume Difference

# AMEX New Highs/Lows
# $AMHI1W NYSE MKT (AMEX) New Highs 1W
# $AMHI2W NYSE MKT (AMEX) New Highs 2W
# $AMHI1M NYSE MKT (AMEX) New Highs 1M
# $AMHI3M NYSE MKT (AMEX) New Highs 3M
# $AMHI6M NYSE MKT (AMEX) New Highs 6M
# $AMHI9M NYSE MKT (AMEX) New Highs 9M
# $AMHGH  NYSE MKT (AMEX) New Highs 1Y
# $AMLO1W NYSE MKT (AMEX) New Lows  1W
# $AMLO2W NYSE MKT (AMEX) New Lows  2W
# $AMLO1M NYSE MKT (AMEX) New Lows  1M
# $AMLO3M NYSE MKT (AMEX) New Lows  3M
# $AMLO6M NYSE MKT (AMEX) New Lows  6M
# $AMLO9M NYSE MKT (AMEX) New Lows  9M
# $AMLOW  NYSE MKT (AMEX) New Lows  1Y

# NASDAQ New Highs/Lows
# $NAHI1W NASDAQ New Highs 1W
# $NAHI2W NASDAQ New Highs 2W
# $NAHI1M NASDAQ New Highs 1M
# $NAHI3M NASDAQ New Highs 3M
# $NAHI6M NASDAQ New Highs 6M
# $NAHI9M NASDAQ New Highs 9M
# $NAHGH  NASDAQ New Highs 1Y
# $NALO1W NASDAQ New Lows  1W
# $NALO2W NASDAQ New Lows  2W
# $NALO1M NASDAQ New Lows  1M
# $NALO3M NASDAQ New Lows  3M
# $NALO6M NASDAQ New Lows  6M
# $NALO9M NASDAQ New Lows  9M
# $NALOW  NASDAQ New Lows  1Y

# NYSE New Highs/Lows
# $NYHI1W NYSE New Highs 1W
# $NYHI2W NYSE New Highs 2W
# $NYHI1M NYSE New Highs 1M
# $NYHI3M NYSE New Highs 3M
# $NYHI6M NYSE New Highs 6M
# $NYHI9M NYSE New Highs 9M
# $NYHGH  NYSE New Highs 1Y
# $NYLO1W NYSE New Lows  1W
# $NYLO2W NYSE New Lows  2W
# $NYLO1M NYSE New Lows  1M
# $NYLO3M NYSE New Lows  3M
# $NYLO6M NYSE New Lows  6M
# $NYLO9M NYSE New Lows  9M
# $NYLOW  NYSE New Lows  1Y

# NYSE ARCA New Highs/Lows
# $ARHI1W NYSE ARCA New Highs 1W
# $ARHI2W NYSE ARCA New Highs 2W
# $ARHI1M NYSE ARCA New Highs 1M
# $ARHI3M NYSE ARCA New Highs 3M
# $ARHI6M NYSE ARCA New Highs 6M
# $ARHI9M NYSE ARCA New Highs 9M
# $ARHGH  NYSE ARCA New Highs 1Y
# $ARLO1W NYSE ARCA New Lows  1W
# $ARLO2W NYSE ARCA New Lows  2W
# $ARLO1M NYSE ARCA New Lows  1M
# $ARLO3M NYSE ARCA New Lows  3M
# $ARLO6M NYSE ARCA New Lows  6M
# $ARLO9M NYSE ARCA New Lows  9M
# $ARLOW  NYSE ARCA New Lows  1Y

# AMEX/ARCA/NASDAQ/NYSE ETFs New Highs/Lows
# $ETFHI1W ETF New Highs 1W
# $ETFHI2W ETF New Highs 2W
# $ETFHI1M ETF New Highs 1M
# $ETFHI3M ETF New Highs 3M
# $ETFHI6M ETF New Highs 6M
# $ETFHI9M ETF New Highs 9M
# $ETFHGH  ETF New Highs 1Y
# $ETFLO1W ETF New Lows  1W
# $ETFLO2W ETF New Lows  2W
# $ETFLO1M ETF New Lows  1M
# $ETFLO3M ETF New Lows  3M
# $ETFLO6M ETF New Lows  6M
# $ETFLO9M ETF New Lows  9M
# $ETFLOW  ETF New Lows  1Y
 
# Definitions
# Primary Markets – AMEX, ARCA, NASDAQ, NYSE
# Advancing issues – Issues that have a positive net change from previous trading day’s close
# Declining issues – Issues that have a negative net change from previous trading day’s close
# $TICK – Number of issues that have a positive change from previous trade minus number of issues that have a negative change from previous trade
# $TRIN – Volume of advancing issues divided by the volume of declining issues
 
Small selection of Market Internals/Indicators categorized:

Code:
# https://tlc.thinkorswim.com/center/release/rel-07-20-2013 | < 404 >

# TICK
# Symbol  | Symbol
# Primary | Composite | Description
# $TIKI   # $TIKIC    | DJIA TICK
# $TIKND  # $TIKNDC   | NASDAQ 100 TICK
# $TIKSP  # $TIKSPC   | SNP 500 TICK
# $TIKRL  # $TIKRLC   | RUSSELL 2000 TICK
# $TIKUS  # $TIKUSC   | AllUSA TICK
# $TICK/Q # $TICK/QC  | NASDAQ TICK
# $TICK   # $TICKC    | NYSE TICK

# TRIN
# Symbol  | Symbol
# Primary | Composite | Description
# $TRINI  # $TRINIC   | DJIA TRIN
# $TRINND # $TRINNDC  | NASDAQ 100 TRIN
# $TRINSP # $TRINSPC  | SNP 500 TRIN
# $TRINRL # $TRINRLC  | RUSSELL 2000 TRIN
# $TRINUS # $TRINUSC  | AllUSA TRIN
# $TRIN/Q # $TRIN/QC  | NASDAQ TRIN
# $TRIN   # $TRINC    | NYSE TRIN

# Advanced Issues
# Symbol  | Symbol
# Primary | Composite | Description
# $ADVI   # $ADVIC    | DJIA Advanced Issues
# $ADVND  # $ADVNDC   | NASDAQ 100 Advanced Issues
# $ADVSP  # $ADVSPC   | SNP 500 Advanced Issues
# $ADVRL  # $ADVRLC   | RUSSELL 2000 Advanced Issues
# $ADVUS  # $ADVUSC   | AllUSA Advanced Issues
# $ADVN/Q # $ADVN/QC  | NASDAQ Advanced Issues
# $ADVN   # $ADVNC    | NYSE Advanced Issues

# Declined Issues
# Symbol  | Symbol
# Primary | Composite | Description
# $DECLI  # $DECLIC   | DJIA Declined Issues
# $DECLND # $DECLNDC  | NASDAQ 100 Declined Issues
# $DECLSP # $DECLSPC  | SNP 500 Declined Issues
# $DECLRL # $DECLRLC  | RUSSELL 2000 Declined Issues
# $DECLUS # $DECLUSC  | AllUSA Declined Issues
# $DECN/Q # $DECN/QC  | NASDAQ Declined Issues
# $DECN   # $DECNC    | NYSE Declined Issues

# Advance - Decline Difference
# Symbol  | Symbol
# Primary | Composite | Description
# $ADID   # $ADIDC    | DJIA Advancing Issues - Declining Issues Difference
# $ADNDD  # $ADNDDC   | NASDAQ 100 Advancing Issues - Declining Issues Difference
# $ADSPD  # $ADSPDC   | SNP 500 Advancing Issues - Declining Issues Difference
# $ADRLD  # $ADRLDC   | RUSSELL 2000 Advancing Issues - Declining Issues Difference
# $ADUSD  # $ADUSDC   | AllUSA Advancing Issues - Declining Issues Difference
# $ADQD   # $ADQDC    | NASDAQ Advancing Issues - Declining Issues Difference
# $ADD    # $ADDC     | NYSE Advancing Issues - Declining Issues Difference

# Advanced Volume
# Symbol  | Symbol
# Primary | Composite | Description
# $UVOLI  # $UVOLIC   | DJIA Advanced Volume
# $UVOLND # $UVOLNDC  | NASDAQ 100 Advanced Volume
# $UVOLSP # $UVOLSPC  | SNP 500 Advanced Volume
# $UVOLRL # $UVOLRLC  | RUSSELL 2000 Advanced Volume
# $UVOLUS # $UVOLUSC  | AllUSA Advanced Volume
# $UVOL/Q # $UVOL/QC  | NASDAQ Advanced Volume
# $UVOL   # $UVOLC    | NYSE Advanced Volume

# Declined Volume
# Symbol  | Symbol
# Primary | Composite | Description
# $DVOLI  # $DVOLIC   | DJIA Declined Volume
# $DVOLND # $DVOLNDC  | NASDAQ 100 Declined Volume
# $DVOLSP # $DVOLSPC  | SNP 500 Declined Volume
# $DVOLRL # $DVOLRLC  | RUSSELL 2000 Declined Volume
# $DVOLUS # $DVOLUSC  | AllUSA Declined Volume
# $DVOL/Q # $DVOL/QC  | NASDAQ Declined Volume
# $DVOL   # $DVOLC    | NYSE Declined Volume

# Volume Difference
# Symbol  | Symbol
# Primary | Composite | Description
# $VOLID  # $VOLIDC   | DJIA Up Volume - Down Volume Difference
# $VOLNDD # $VOLNDDC  | NASDAQ 100 Up Volume - Down Volume Difference
# $VOLSPD # $VOLSPDC  | SNP 500 Up Volume - Down Volume Difference
# $VOLRLD # $VOLRLDC  | RUSSELL 2000 Up Volume - Down Volume Difference
# $VOLUSD # $VOLUSDC  | AllUSA Up Volume - Down Volume Difference
# $VOLQD  # $VOLQDC   | NASDAQ Up Volume - Down Volume Difference
# $VOLD   # $VOLDC    | NYSE Up Volume - Down Volume Difference
 
# Color price candles on a chart green, red, or leave them as the default color based on a simple scoring system. The scoring system looks at several market indicators to figure out if the market is acting "bullish" (likely to go up) or "bearish" (likely to go down).

# This code helps traders quickly see the market’s mood without digging into all the numbers. If the candles turn green, it’s a hint that multiple signs are pointing to a strong upward move. If they turn red, it suggests a strong downward move might be coming. If they stay the default color, the market isn’t showing a clear direction.

# In short, it’s like a traffic light for trading: green means "go" (bullish), red means "stop" or "watch out" (bearish), and the default color means "wait and see."

let me know if you find any issues. this only works from 9:30am-4pm eastern time.
ajitYF9.png


Code:
# Market Internals Candle Color
# Colors candles based on TICK, ADD ratio, VOLD ratio, TRIN, and VIX
# IPA

# 00.01: Initial concept code.
# 00.02: Added inputs to turn coloring off and or use as a label.

# Color price candles on a chart green, red, or leave them as the default color based on a simple scoring system. The scoring system looks at several market indicators to figure out if the market is acting "bullish" (likely to go up) or "bearish" (likely to go down).

# This code helps traders quickly see the market’s mood without digging into all the numbers. If the candles turn green, it’s a hint that multiple signs are pointing to a strong upward move. If they turn red, it suggests a strong downward move might be coming. If they stay the default color, the market isn’t showing a clear direction.

# In short, it’s like a traffic light for trading: green means "go" (bullish), red means "stop" or "watch out" (bearish), and the default color means "wait and see."

declare upper;

# Input parameters for customization

# TICK ($TICK/Q): This shows the difference between stocks going up and stocks going down at any moment. A high number (above 200) is good news for the market, while a low number (below -200) is bad news.
input tick_symbol = "$TICK/Q";

# Advance-Decline Ratio ($ADVN/Q ÷ $DECN/Q): This compares the number of stocks rising to those falling. If more stocks are rising (ratio > 1), it’s a positive sign; if more are falling (ratio < 1), it’s a negative sign.
input adv_symbol = "$ADVN/Q";
input dec_symbol = "$DECN/Q";

# Volume Ratio ($UVOL/Q ÷ $DVOL/Q): This looks at the volume of shares going up versus going down. More up volume (ratio > 1) is bullish, and more down volume (ratio < 1) is bearish.
input uvol_symbol = "$UVOL/Q";
input dvol_symbol = "$DVOL/Q";

# TRIN ($TRIN/Q): Also called the Arms Index, this measures market strength. A value below 1 suggests buying pressure (bullish), while above 1 suggests selling pressure (bearish).
input trin_symbol = "$TRIN/Q";

# VIX (VXN:CGI): This is a volatility index for the Nasdaq. The code compares it to its 10-period average. If the VIX is below the average, it might mean calmer, bullish conditions; above it means more fear and bearish conditions.
input vix_symbol = "VXN:CGI";
input vix_ma_length = 10; # Length of VIX moving average
input tick_high = 200; # Upper threshold for TICK
input tick_low = -200; # Lower threshold for TICK

# For each of these five indicators, the code checks if it’s bullish, bearish, or neutral: Bullish = +1 point Bearish = -1 point Neutral = 0 points. It then adds up all the points to get a total score, which can range from -5 (all bearish) to +5 (all bullish).
input score_high = 3; # Score threshold for green candles
input score_low = -3; # Score threshold for red candles

# New inputs for controlling candle painting and label display
input paint_candles = yes; # Set to 'yes' to paint candles based on score, 'no' to keep default colors
input show_label = yes; # Set to 'yes' to show a market condition label, 'no' to hide it

# Fetch data from market internals
def tick = close(tick_symbol);
def advn = close(adv_symbol);
def decn = close(dec_symbol);
def add_ratio = if decn != 0 then advn / decn else 1; # Avoid division by zero
def uvol = close(uvol_symbol);
def dvol = close(dvol_symbol);
def vold_ratio = if dvol != 0 then uvol / dvol else 1; # Avoid division by zero
def trin = close(trin_symbol);
def vix = close(vix_symbol);
def vix_ma = Average(vix, vix_ma_length); # 10-period MA for VIX

# Define bullish, bearish, and neutral conditions
def tick_bullish = tick > tick_high;
def tick_bearish = tick < tick_low;
def tick_neutral = !tick_bullish and !tick_bearish;

def add_bullish = add_ratio > 1;
def add_bearish = add_ratio < 1;
def add_neutral = add_ratio == 1;

def vold_bullish = vold_ratio > 1;
def vold_bearish = vold_ratio < 1;
def vold_neutral = vold_ratio == 1;

def trin_bullish = trin < 1;
def trin_bearish = trin > 1;
def trin_neutral = trin == 1;

def vix_bullish = vix < vix_ma;
def vix_bearish = vix > vix_ma;
def vix_neutral = vix == vix_ma;

# Calculate the total score
def score = (if tick_bullish then 1 else if tick_bearish then -1 else 0) +
(if add_bullish then 1 else if add_bearish then -1 else 0) +
(if vold_bullish then 1 else if vold_bearish then -1 else 0) +
(if trin_bullish then 1 else if trin_bearish then -1 else 0) +
(if vix_bullish then 1 else if vix_bearish then -1 else 0);

# Assign candle colors based on the score if paint_candles is yes
AssignPriceColor(if !paint_candles then Color.CURRENT
else if score >= score_high then Color.GREEN
else if score <= score_low then Color.RED
else Color.CURRENT);

# Add a label showing market condition if show_label is yes
AddLabel(show_label, if score >= score_high then "Bullish"
else if score <= score_low then "Bearish"
else "Neutral",
if score >= score_high then Color.GREEN
else if score <= score_low then Color.RED
else Color.GRAY);
 
Last edited by a moderator:

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
497 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