AbsoluteStrength_v8 For ThinkOrSwim

cando13579

Active member
VIP
AbsoluteStrength_v8
is an advanced bull–bear pressure oscillator designed to measure directional dominance, momentum persistence, and exhaustion across multiple market regimes.
Unlike traditional oscillators that compress price into a single line, this study separately models bullish and bearish force, allowing traders to see who is in control rather than simply whether price is “overbought” or “oversold.”
The script integrates three mathematical engines (RSI-style, Stochastic-style, and DMI-style dominance), flexible multi-stage smoothing, and adaptive strength/weakness thresholds. This makes it suitable for trend continuation, pullback timing, reversals, and regime detection.
Key characteristics:
  • Dual-line structure (Bulls vs Bears) for true directional clarity
  • Optional dominance filtering to suppress non-controlling pressure
  • Multiple threshold methodologies (fixed, statistical, structural)
  • Designed to be non-intrusive, objective, and context-aware
This indicator is best used as a decision confirmation and trade management tool, not as a standalone entry trigger.

LTcwZzk.png


How to Read the Indicator
Core Components

  • BullsPlot (Cyan) → Positive directional pressure
  • BearsPlot (Red) → Negative directional pressure
  • Strength Line → Area where momentum is considered dominant
  • Weakness Line → Area where momentum is considered exhausted
  • Signal Lines (optional) → Momentum confirmation / smoothing layer
General Interpretation
  • Bulls > Bears → Buyers control tempo
  • Bears > Bulls → Sellers control tempo
  • Expansion above Strength → Trend acceptance
  • Compression near Weakness → Balance / rotation / exhaustion
Trading Examples by Setting
1. mathMode = RSI (Momentum Impulse Model)

Best Use:
  • Trend continuation
  • Pullback entries
  • Momentum confirmation
Example Trades
  • Long Continuation
    • BullsPlot > BearsPlot
    • Bulls rising and holding above StrengthLine
    • Price pulls back but Bulls remain dominant → buy continuation
  • Momentum Failure
    • Bulls cross below Bears near StrengthLine
    • Indicates trend fatigue → tighten stops or exit
Avoid: Pure reversal attempts without structure
2. mathMode = Stochastic (Range & Rotation Model)
Best Use:
  • Mean reversion
  • Range-bound sessions
  • Overnight or low-volatility markets
Example Trades
  • Range Long
    • Bulls near WeaknessLine
    • Bears begin flattening
    • Bulls turn up → buy rotation
  • Range Short
    • Bears near WeaknessLine
    • Bulls stall and roll over → fade highs
Key Insight:
This mode reacts faster and should be used with minimal smoothing.
3. mathMode = DMI (Dominance / Trend Filter)
Best Use:
  • Strong trend environments
  • Avoiding chop
  • Higher-timeframe alignment
Example Trades
  • Trend Entry
    • Only Bulls or Bears are printing (other side suppressed)
    • Confirms directional monopoly
  • Trend End Warning
    • Suppressed side begins to appear
    • Dominance erosion → prepare for transition
This mode is excellent as a trade filter.
Levels Mode – How to Use Each
Standard

  • Fixed proportional thresholds
  • Best for consistent instruments
  • Clean and predictable
Use When: You want repeatable signals across sessions
StdDevBands
  • Volatility-adaptive
  • Expands in fast markets, contracts in slow ones
Example
  • Trade only when Bulls exceed upper band → high-quality momentum
  • Avoid signals inside bands → noise
Best For: News days, index futures, volatile equities
HighLowChannel
  • Structural, range-aware thresholds
  • Excellent for contextual exhaustion
Example
  • Bulls fail near channel high → divergence
  • Bears fail near channel low → absorption
Signal Line Usage (Optional)
  • Use signal = 3–5for:
    • Momentum confirmation
    • Smoother trend holds
  • Ignore crossovers; instead use slope agreement
    • Bulls above signal + rising → trend healthy



Best Time Frames
🔥 Optimal Performance

5-Minute Chart
  • Best balance of structure and signal quality
  • Ideal for index futures, liquid equities
  • Matches the smoothing logic of the script
Also Works Well
  • 3-Minute → Faster scalping (reduce smoothing)
  • 15-Minute → Swing confirmation & bias
Not Recommended
  • Tick charts (too noisy)
  • Daily charts (indicator becomes lag-heavy)
Best Practical Workflow

  1. Higher TF (15m)
    • Identify dominance (Bulls vs Bears)
  2. Execution TF (5m)
    • Wait for pullback with dominance intact
Summary

AbsoluteStrength_v8 excels when used as:

A trend quality filter
A pullback timing tool
A regime identifier (trend vs range)
It rewards patience, context, and alignment—and performs best when combined with price structure, VWAP, or key levels, not used in isolation.

Code:
# AbsoluteStrength_v8

declare lower;

#-----------------------
# Inputs
#-----------------------
input mathMode = {default RSI, Stochastic, DMI};
input priceSource = close;
input length = 10;
input preSmooth = 1;
input smooth = 1;
input signal = 1;
input maMode = {default EMA, SMA, Wilder, LWMA};
input levelsMode = {default Standard, StdDevBands, HighLowChannel};
input strengthLevel = 70.0;
input weaknessLevel = 30.0;
input lookBackPeriod = 30;
input upperMultiplier = 1.0;
input lowerMultiplier = 1.0;

def _point = TickSize();

#-----------------------
# Pre-smoothing
#-----------------------
def price =
    if maMode == maMode.EMA then ExpAverage(priceSource, preSmooth)
    else if maMode == maMode.SMA then Average(priceSource, preSmooth)
    else if maMode == maMode.Wilder then WildersAverage(priceSource, preSmooth)
    else Inertia(priceSource, preSmooth);

def loPrice =
    if maMode == maMode.EMA then ExpAverage(low, preSmooth)
    else if maMode == maMode.SMA then Average(low, preSmooth)
    else if maMode == maMode.Wilder then WildersAverage(low, preSmooth)
    else Inertia(low, preSmooth);

#-----------------------
# Raw Bulls / Bears
#-----------------------
def diff = price - price[1];
def hi = Highest(high, length);
def lo = Lowest(low, length);

def bulls_raw =
    if mathMode == mathMode.RSI then
        0.5 * (AbsValue(diff) + diff) / _point
    else if mathMode == mathMode.Stochastic then
        (price - lo) / _point
    else
        Max(0, 0.5 * (AbsValue(diff) + diff)) / _point;

def bears_raw =
    if mathMode == mathMode.RSI then
        0.5 * (AbsValue(diff) - diff) / _point
    else if mathMode == mathMode.Stochastic then
        (hi - price) / _point
    else
        Max(0, 0.5 * (AbsValue(loPrice[1] - loPrice) + (loPrice[1] - loPrice))) / _point;

# DMI dominance filter
def bulls_dmi = if mathMode == mathMode.DMI and bulls_raw <= bears_raw then 0 else bulls_raw;
def bears_dmi = if mathMode == mathMode.DMI and bears_raw < bulls_raw then 0 else bears_raw;

#-----------------------
# Evaluation smoothing
#-----------------------
def len_eval = if mathMode == mathMode.Stochastic then 1 else length;

def lbulls =
    if maMode == maMode.EMA then ExpAverage(bulls_dmi, len_eval)
    else if maMode == maMode.SMA then Average(bulls_dmi, len_eval)
    else if maMode == maMode.Wilder then WildersAverage(bulls_dmi, len_eval)
    else Inertia(bulls_dmi, len_eval);

def lbears =
    if maMode == maMode.EMA then ExpAverage(bears_dmi, len_eval)
    else if maMode == maMode.SMA then Average(bears_dmi, len_eval)
    else if maMode == maMode.Wilder then WildersAverage(bears_dmi, len_eval)
    else Inertia(bears_dmi, len_eval);

#-----------------------
# Final smoothing
#-----------------------
def bulls =
    if maMode == maMode.EMA then ExpAverage(lbulls, smooth)
    else if maMode == maMode.SMA then Average(lbulls, smooth)
    else if maMode == maMode.Wilder then WildersAverage(lbulls, smooth)
    else Inertia(lbulls, smooth);

def bears =
    if maMode == maMode.EMA then ExpAverage(lbears, smooth)
    else if maMode == maMode.SMA then Average(lbears, smooth)
    else if maMode == maMode.Wilder then WildersAverage(lbears, smooth)
    else Inertia(lbears, smooth);

#-----------------------
# Signal lines
#-----------------------
def sigBulls =
    if signal <= 1 then Double.NaN
    else if maMode == maMode.EMA then ExpAverage(bulls, signal)
    else if maMode == maMode.SMA then Average(bulls, signal)
    else if maMode == maMode.Wilder then WildersAverage(bulls, signal)
    else Inertia(bulls, signal);

def sigBears =
    if signal <= 1 then Double.NaN
    else if maMode == maMode.EMA then ExpAverage(bears, signal)
    else if maMode == maMode.SMA then Average(bears, signal)
    else if maMode == maMode.Wilder then WildersAverage(bears, signal)
    else Inertia(bears, signal);

#-----------------------
# Levels
#-----------------------
def hiArr = Max(bulls, bears);
def loArr = Min(bulls, bears);

def strength =
    if levelsMode == levelsMode.Standard then
        (strengthLevel / 100) * (bulls + bears)
    else if levelsMode == levelsMode.StdDevBands then
        Average(hiArr, lookBackPeriod) + upperMultiplier * StDev(hiArr, lookBackPeriod)
    else
        Highest(hiArr, lookBackPeriod) -
        (Highest(hiArr, lookBackPeriod) - Lowest(loArr, lookBackPeriod)) *
        (1 - strengthLevel / 100);

def weakness =
    if levelsMode == levelsMode.Standard then
        (weaknessLevel / 100) * (bulls + bears)
    else if levelsMode == levelsMode.StdDevBands then
        Average(loArr, lookBackPeriod) - lowerMultiplier * StDev(loArr, lookBackPeriod)
    else
        Lowest(loArr, lookBackPeriod) +
        (Highest(hiArr, lookBackPeriod) - Lowest(loArr, lookBackPeriod)) *
        (weaknessLevel / 100);

#-----------------------
# Plots
#-----------------------
plot BullsPlot = bulls;
plot BearsPlot = bears;
plot SignalBullsPlot = sigBulls;
plot SignalBearsPlot = sigBears;
plot StrengthLinePlot = strength;
plot WeaknessLinePlot = weakness;

BullsPlot.SetDefaultColor(Color.CYAN);
BullsPlot.SetLineWeight(2);

BearsPlot.SetDefaultColor(Color.RED);
BearsPlot.SetLineWeight(2);

SignalBullsPlot.SetDefaultColor(Color.CYAN);
SignalBullsPlot.SetLineWeight(1);
SignalBullsPlot.HideBubble();
SignalBullsPlot.HideTitle();

SignalBearsPlot.SetDefaultColor(Color.RED);
SignalBearsPlot.SetLineWeight(1);
SignalBearsPlot.HideBubble();
SignalBearsPlot.HideTitle();

StrengthLinePlot.SetDefaultColor(Color.GRAY);
StrengthLinePlot.SetStyle(Curve.SHORT_DASH);
StrengthLinePlot.HideBubble();
StrengthLinePlot.HideTitle();

WeaknessLinePlot.SetDefaultColor(Color.GRAY);
WeaknessLinePlot.SetStyle(Curve.SHORT_DASH);
WeaknessLinePlot.HideBubble();
WeaknessLinePlot.HideTitle();
 
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
2369 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