top of page
Search

Exploring the NASDAQ 52-Week Highs and Lows Indicator for ThinkorSwim

Technical analysis plays a crucial role in helping traders identify market trends and make informed trading decisions. One of the popular tools to analyze market trends is the New 52-Week Highs and Lows Indicator for ThinkorSwim. This powerful indicator measures the number of stocks hitting new highs or lows on a specified index, such as NASDAQ. In this article, we'll take a closer look at the NASDAQ 52-Week Highs and Lows Indicator, its various applications, and how to effectively use it in your trading strategy.


The NASDAQ 52-Week Highs and Lows Indicator


The NASDAQ 52-Week Highs and Lows Indicator is an essential tool for traders to gauge market sentiment and determine the balance of power between bulls and bears. By comparing the number of stocks reaching new highs to those reaching new lows, traders can gain insights into the overall health of the NASDAQ market.


INDICATOR IMPLICATIONS


Determining Market Dominance


The 52-Week Highs and Lows Indicator can be used to determine which side of the market has the upper hand. When the value is above 0, it indicates that the bulls are in control, as more stocks are reaching new 52-week highs. Conversely, when the value falls below 0, it suggests that bears have taken control, as more stocks are hitting new 52-week lows.


NQ, 2020 - 2021: Bullish Dominance


Contrarian Indicator for Market Sentiment


Another valuable use of the NH-NL indicator is to detect extreme market sentiments among bullish and bearish investors. When the indicator reaches extreme levels in either direction, it could signify a potential reversal in the market. This contrarian approach helps traders identify potential turning points and capitalize on changes in market sentiment.


NQ, 2018 and 2020 Bottoms - Extreme Sentiment


Identifying Bullish and Bearish Divergences


The 52-Week Highs and Lows Indicator can also be used to spot divergences between the indicator and the underlying index price. A negative (bearish) divergence occurs when the index continues to move higher while fewer stocks are making new highs. This may signal a weakening trend and a potential reversal in the market. Similarly, a positive (bullish) divergence occurs when the index is moving lower, but the number of new lows is decreasing, suggesting a potential trend reversal to the upside.


NQ, 2022 -- Bullish Divergences


The NASDAQ 52-Week Highs and Lows Indicator for ThinkorSwim is an essential tool for traders seeking to gain insights into the overall health of the market and identify potential trading opportunities. By utilizing this indicator to determine market dominance, detect extreme market sentiment, and identify bullish and bearish divergences, traders can develop more informed trading strategies and improve their overall success in the market. The provided code for the two NASDAQ indicators will enable readers to implement these powerful tools in their ThinkorSwim platform and enhance their trading experience.


TOS SCRIPTS


Indicator 1


# 52-week Highs - Lows Indicator for Nasdaq by daytraderplaybook.com


# Declare lower study area

declare lower;


# Define aggregation period as daily

def period = AggregationPeriod.DAY;


# Calculate the difference between NASDAQ 52-week high and 52-week low

def difference = close(Symbol = "$NAHGH", period = period) - close(Symbol = "$NALOW", period = period);


# Plot the difference as a histogram

plot indicator = if IsNaN(close) then Double.NaN else difference;

indicator.EnableApproximation(); # Enable approximation for smoother rendering

indicator.SetPaintingStrategy(PaintingStrategy.HISTOGRAM); # Set the painting strategy as a histogram

indicator.SetLineWeight(5); # Set the line weight for the histogram bars


# Assign colors to the histogram bars based on positive, negative or zero values

indicator.AssignValueColor(

if indicator < 0 then Color.RED

else if indicator > 0 then Color.GREEN

else Color.CYAN

);


# Plot a zero line for reference

plot zero = 0.0;

zero.SetDefaultColor(Color.WHITE); # Set the zero line color to white

zero.SetLineWeight(1); # Set the zero line weight

zero.HideBubble(); # Hide the bubble for the zero line

zero.HideTitle(); # Hide the title for the zero line


Indicator 2


# Declare lower study area

declare lower;


# Input parameters

input length = 10;

input OverSold = 20;

input OverBought = 80;

input AvgType = AverageType.Hull;


# Define the aggregation period as daily

def agg = AggregationPeriod.Day;


# Get NASDAQ 52-week high and 52-week low

def NASDQH = close(Symbol = "$NAHGH", period = agg);

def NASDQL = close(Symbol = "$NALOW", period = agg);


# Calculate the percentage of NASDAQ 52-week high

def P = NASDQH / (NASDQH + NASDQL) * 100;


# Fill missing values with the previous value

def price = if isNaN(P) then price[1] else P;


# Plot the percentage data

plot data = if isNaN(close) then double.nan else price;

data.EnableApproximation();

data.SetDefaultColor(Color.Cyan);


# Plot the moving average of the percentage data

plot avg = MovingAverage(AvgType, data, length);

avg.EnableApproximation();

avg.AssignValueColor(

if between(avg, OverSold, OverBought) then Color.yellow

else if avg >= OverBought then Color.Green

else Color.Red

);

avg.SetLineWeight(2);


# Plot OverBought and OverSold lines

plot OB = if isNaN(close) then double.nan else OverBought;

OB.SetDefaultColor(Color.Red);


plot OS = if isNaN(close) then double.nan else OverSold;

OS.SetDefaultColor(Color.Green);


# Plot the neutral line at 50

plot neutral = if isNaN(close) then double.nan else 50;

neutral.SetdefaultColor(Color.Dark_Gray);


# Add color-coded clouds between the lines

addCloud(0, OS, CreateColor(250,0,0), CreateColor(250,0,0));

addCloud(OS, neutral, createColor(50,0,0), createColor(50,0,0));

addCloud(neutral, OB, createColor(0,50,0), createColor(0,50,0));

addCloud(OB, 100, CreateColor(0,250,0), createColor(0,250,0));

1,164 views1 comment

Recent Posts

See All

1 Comment


Tom Sirois
Tom Sirois
Apr 29, 2023

I so very much appreciate you sharing your scipts (for TOS). Is it possible for you to share it via a link (that we can simply import into TOS)? Thank you.

Like
bottom of page