Candle Wick Sentiment Indicator for ThinkorSwim

mashume

Expert
VIP
Lifetime
This gives bullish / bearish sentiment by looking at wick length vs body size. Potential pivots are indicated with green or red dots.

67aIEaj.png


Code:
# Experiment # 3
# Candle Wick Sentiment Indicator
# Seth Urion
# November 2019

declare lower;

input reversal = 33;
input trend_length = 5;

def total = high - low;
def upper_candle = high - Max(open, close);
def lower_candle = Min(open, close) - low;
def trend_mult = if close >= open then 1 else -1;

plot zero = 0;
zero.SetLineWeight(1);
zero.AssignValueColor(Color.WHITE);
zero.SetStyle(Curve.MEDIUM_DASH);

def Upper_Sentiment = if total != 0 then 100 - ((upper_candle / total) * 100) else 0;
def Lower_Sentiment = if total != 0 then -100 + (( lower_candle / total) * 100) else 0;

plot Trend = ExpAverage(Upper_Sentiment + Lower_Sentiment, length = trend_length);
Trend.SetLineWeight(3);
Trend.AssignValueColor(Color.WHITE);

plot UpperWickReversal = if Upper_Sentiment <= reversal and Upper_Sentiment != 0 then Upper_Sentiment else Double.NaN;
UpperWickReversal.SetPaintingStrategy(PaintingStrategy.POINTS);
UpperWickReversal.SetLineWeight(4);
UpperWickReversal.AssignValueColor(Color.RED);

plot LowerWickReversal = if Lower_Sentiment >= -reversal and Lower_Sentiment != 0 then Lower_Sentiment else Double.NaN;
LowerWickReversal.SetPaintingStrategy(PaintingStrategy.POINTS);
LowerWickReversal.SetLineWeight(4);
LowerWickReversal.AssignValueColor(Color.Green);


I got tired of looking at candles and wondering if they should be telling me something. This is not perhaps the clearest indicator and should not be used in isolation, but the turning points can be good indications that something is about to happen.

Happy Trading!
 

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

@marine, I generally use RSI in Laguerre time with Fractal Energy for entry points. This is my 'early warning' system to potential changes in the mood of the market.

I can walk you through the day illustrated above and what each signal might mean to me...
  1. The green dot just after 7:00 (remember I'm on a tick chart) with a generally positive sentiment tells me that the bears are losing control of the trade.
  2. The sentiment remains somewhat negative even as price rises through about 9:00 telling me that there is either some profit taking, or some reluctance to move higher. This sentiment is reversed just after 9:00 when the trend crosses into positive territory and price then rockets up.
  3. The red dot at 9:45, before the downward move, alerts me that there may be some move to the downside as the bulls have lost control of that candle.
  4. Bears lose control themselves just before 10:00 and the price is free to move higher again.
  5. Positive sentiment after 11:15 paired with decreasing prices sends a BIG warning sign that some downturn is on the way.
  6. The bulls lose control at the red dot at 12:00, setting off (but preceding) the precipitous plunge over lunch between 12 and 12:30.
This is how I read it. It's not generating buy and sell signals (other indicators do that well). It does give me some sense of the tug-of-war between bears and bulls on a candle-by-candle basis.

Change up the smoothing length, or the threshold (this sets the point at which dots are drawn).

The idea for the indicator was born after reading this article:
https://admiralmarkets.com/analytic...s-a-key-shortcut-during-forex-and-cfd-trading

Hope that helps you understand a bit of what this one is showing you. As always, your read of the market is your own.

Happy Trading
 
hello trying to get a scan where the high is very extreme from the open of a candlestick. In other words a very tall wick from the body of the candle
 
hello trying to get a scan where the high is very extreme from the open of a candlestick. In other words a very tall wick from the body of the candle
you need to specify what constitutes "Very extreme", as a percentage of close or something similar, before anybody anybody can help ya out
 
I have modified the script to my personal style but need help plotting arrows and alerting only at the last second of every candle (1m or 5m). Current errors:
1) the arrow appears and disappear
2) wicks appears in first 5 seconds but disappears last seconds
3) alerts is set to once per bar but since wick disapear it is a fake alert

I only want to plot (LowerWickReversal and UpperWickReversal ) and alert at the last second of every candle.

Here is my script:

input reversal = 33;
input trend_length = 5;

def total = high - low;
def upper_candle = high - Max(open, close);
def lower_candle = Min(open, close) - low;
def trend_mult = if close >= open then 1 else -1;


def Upper_Sentiment = if total != 0 then 100 - ((upper_candle / total) * 100) else 0;
def Lower_Sentiment = if total != 0 then -100 + (( lower_candle / total) * 100) else 0;


plot UpperWickReversal = (if Upper_Sentiment <= reversal and Upper_Sentiment != 0 then high+0.3 else Double.NaN);
UpperWickReversal.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
UpperWickReversal.SetLineWeight(2);
UpperWickReversal.AssignValueColor(Color.RED);

Alert(UpperWickReversal > 0, "SPY Puts", Alert.bar, Sound.ding);

plot LowerWickReversal = (if Lower_Sentiment >= -reversal and Lower_Sentiment != 0 then low-0.30 else Double.NaN);
LowerWickReversal.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
LowerWickReversal.SetLineWeight(2);
LowerWickReversal.AssignValueColor(Color.GREEN);

Alert(LowerWickReversal < 0, "SPY Calls", Alert.bar, Sound.ding);
 
Probably not.
You can change the conditions around so that it triggers if bar[1] meets the condition, that way only once the bar closes would there be an arrow. But I'm not sure this would really do it:

Code:
plot UpperWickReversal = (if Upper_Sentiment[1] <= reversal[1] and Upper_Sentiment[1] != 0 then high+0.3 else Double.NaN);

That probably won't do what I think it might. Life is crazy at the moment. I haven't been awake enough to take a trade in more than a week... just that much of my day job to do.

-mashume
 
My take on the wick sentiment

Code:
# Experiment # 3
# Candle Wick Sentiment Indicator
# Seth Urion
# November 2019

# ENHANCED ANTWERKS

declare lower;

# ============================================
# OPERATIONAL WICK IMBALANCE ENGINE V2
# Sponsorship + Absorption + Rejection Engine
# ============================================

input wickThresholdPct = 25.0;
input trendLength = 5;

input fastLength = 8;
input slowLength = 20;

input atrLength = 14;

input volLength = 20;
input useVolumeFilter = yes;
input volumeMultiplier = 1.2;

input persistenceBars = 5;
input persistenceThreshold = 2;

input useATRWeighting = yes;
input useLocationFilter = yes;
input useSlopeFilter = yes;
input usePersistenceFilter = yes;

input locationATRFactor = 0.5;

input showZeroLine = yes;
input showTrendLine = yes;
input showRawImbalance = yes;
input showWeightedImbalance = yes;
input showPressure = yes;
input showSignals = yes;
input showLabels = yes;
input showDebugLabels = no;

def na = Double.NaN;

# ============================================
# CORE CANDLE STRUCTURE
# ============================================

def totalRange = high - low;

def bodyHigh = Max(open, close);
def bodyLow = Min(open, close);

def upperWick = high - bodyHigh;
def lowerWick = bodyLow - low;

def upperWickPct =
    if totalRange > 0
    then 100 * upperWick / totalRange
    else 0;

def lowerWickPct =
    if totalRange > 0
    then 100 * lowerWick / totalRange
    else 0;

def bodyPct =
    if totalRange > 0
    then 100 * AbsValue(close - open) / totalRange
    else 0;

# ============================================
# RAW IMBALANCE
# ============================================

def wickImbalance =
    lowerWickPct - upperWickPct;

# ============================================
# ATR WEIGHTING
# ============================================

def atr =
    Average(TrueRange(high, close, low), atrLength);

def rangeFactor =
    if atr > 0
    then totalRange / atr
    else 1;

def weightedImbalance =
    if useATRWeighting
    then wickImbalance * rangeFactor
    else wickImbalance;

def smoothImbalance =
    ExpAverage(weightedImbalance, trendLength);

# ============================================
# EMA STRUCTURE
# ============================================

def emaFast =
    ExpAverage(close, fastLength);

def emaSlow =
    ExpAverage(close, slowLength);

# ============================================
# EMA SLOPE
# ============================================

def fastSlopeUp =
    emaFast > emaFast[1];

def fastSlopeDown =
    emaFast < emaFast[1];

def slowSlopeUp =
    emaSlow > emaSlow[1];

def slowSlopeDown =
    emaSlow < emaSlow[1];

# ============================================
# REGIME STATES
# ============================================

def bullTrend =
    close > emaFast and
    emaFast > emaSlow and
    (!useSlopeFilter or (fastSlopeUp and slowSlopeUp));

def bearTrend =
    close < emaFast and
    emaFast < emaSlow and
    (!useSlopeFilter or (fastSlopeDown and slowSlopeDown));

def repair =
    close > emaFast and
    emaFast <= emaSlow and
    fastSlopeUp;

def bearCross =
    close < emaFast and
    emaFast >= emaSlow and
    fastSlopeDown;

# ============================================
# LOCATION FILTER
# ============================================

def nearSlowEMA =
    AbsValue(close - emaSlow) <= atr * locationATRFactor;

def nearFastEMA =
    AbsValue(close - emaFast) <= atr * locationATRFactor;

def locationBull =
    if useLocationFilter
    then nearFastEMA or nearSlowEMA
    else yes;

def locationBear =
    if useLocationFilter
    then nearFastEMA or nearSlowEMA
    else yes;

# ============================================
# VOLUME FILTER
# ============================================

def avgVol =
    Average(volume, volLength);

def volOkay =
    if useVolumeFilter
    then volume >= avgVol * volumeMultiplier
    else yes;

# ============================================
# WICK DETECTION
# ============================================

def bullishWick =
    lowerWickPct >= wickThresholdPct and
    wickImbalance > 0;

def bearishWick =
    upperWickPct >= wickThresholdPct and
    wickImbalance < 0;

# ============================================
# PERSISTENCE ENGINE
# ============================================

def bullPressure =
    Sum(bullishWick, persistenceBars);

def bearPressure =
    Sum(bearishWick, persistenceBars);

def persistentBull =
    bullPressure >= persistenceThreshold;

def persistentBear =
    bearPressure >= persistenceThreshold;

# ============================================
# FINAL OPERATIONAL SIGNALS
# ============================================

def bullishSignal =
    bullishWick and
    volOkay and
    locationBull and
    (bullTrend or repair) and
    (!usePersistenceFilter or persistentBull);

def bearishSignal =
    bearishWick and
    volOkay and
    locationBear and
    (bearTrend or bearCross) and
    (!usePersistenceFilter or persistentBear);

# ============================================
# ZERO LINE
# ============================================

plot ZeroLine =
    if showZeroLine then 0 else na;

ZeroLine.SetDefaultColor(Color.GRAY);
ZeroLine.SetStyle(Curve.MEDIUM_DASH);
ZeroLine.SetLineWeight(1);

# ============================================
# RAW IMBALANCE
# ============================================

plot RawImbalance =
    if showRawImbalance
    then wickImbalance
    else na;

RawImbalance.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
RawImbalance.SetLineWeight(2);

RawImbalance.AssignValueColor(
    if wickImbalance > 0 then Color.DARK_GREEN
    else if wickImbalance < 0 then Color.DARK_RED
    else Color.GRAY
);

# ============================================
# WEIGHTED IMBALANCE
# ============================================

plot WeightedImbalance1 =
    if showWeightedImbalance
    then weightedImbalance
    else na;

WeightedImbalance1.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
WeightedImbalance1.SetLineWeight(4);

WeightedImbalance1.AssignValueColor(
    if weightedImbalance > 0 then Color.GREEN
    else if weightedImbalance < 0 then Color.RED
    else Color.GRAY
);

# ============================================
# SMOOTHED TREND
# ============================================

plot Trend =
    if showTrendLine
    then smoothImbalance
    else na;

Trend.SetLineWeight(3);

Trend.AssignValueColor(
    if smoothImbalance > 0 then Color.CYAN
    else if smoothImbalance < 0 then Color.MAGENTA
    else Color.GRAY
);

# ============================================
# PRESSURE PLOTS
# ============================================

plot BullPressurePlot =
    if showPressure
    then bullPressure
    else na;

BullPressurePlot.SetDefaultColor(Color.GREEN);
BullPressurePlot.SetLineWeight(2);

plot BearPressurePlot =
    if showPressure
    then -bearPressure
    else na;

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

# ============================================
# SIGNAL POINTS
# ============================================

plot BullSignal =
    if showSignals and bullishSignal
    then weightedImbalance
    else na;

BullSignal.SetPaintingStrategy(PaintingStrategy.POINTS);
BullSignal.SetLineWeight(5);
BullSignal.SetDefaultColor(Color.CYAN);

plot BearSignal =
    if showSignals and bearishSignal
    then weightedImbalance
    else na;

BearSignal.SetPaintingStrategy(PaintingStrategy.POINTS);
BearSignal.SetLineWeight(5);
BearSignal.SetDefaultColor(Color.MAGENTA);

# ============================================
# LABELS
# ============================================

AddLabel(
    showLabels,
    "WICK FLOW: "
    + Round(weightedImbalance, 1),
    if weightedImbalance > 0
    then Color.GREEN
    else if weightedImbalance < 0
    then Color.RED
    else Color.GRAY
);

AddLabel(
    showLabels,
    "RAW: "
    + Round(wickImbalance, 1)
    + " | LWR: " + Round(lowerWickPct, 1)
    + "% | UPR: " + Round(upperWickPct, 1) + "%",
    if wickImbalance > 0
    then Color.GREEN
    else if wickImbalance < 0
    then Color.RED
    else Color.GRAY
);

AddLabel(
    showLabels,
    "REGIME: "
    + (if bullTrend then "BULL TREND"
       else if bearTrend then "BEAR TREND"
       else if repair then "REPAIR"
       else if bearCross then "BEAR CROSS"
       else "NEUTRAL"),
    if bullTrend then Color.GREEN
    else if bearTrend then Color.RED
    else if repair then Color.CYAN
    else if bearCross then Color.ORANGE
    else Color.GRAY
);

AddLabel(
    showLabels,
    "PRESSURE: BULL "
    + bullPressure
    + " | BEAR "
    + bearPressure,
    if bullPressure > bearPressure
    then Color.GREEN
    else if bearPressure > bullPressure
    then Color.RED
    else Color.GRAY
);

AddLabel(
    showLabels,
    "VOLUME: "
    + (if volOkay then "CONFIRMED" else "WEAK"),
    if volOkay
    then Color.GREEN
    else Color.DARK_GRAY
);

AddLabel(
    showLabels,
    "SIGNALS: "
    + (if bullishSignal then "BULLISH ABSORPTION"
       else if bearishSignal then "BEARISH REJECTION"
       else "NONE"),
    if bullishSignal
    then Color.CYAN
    else if bearishSignal
    then Color.MAGENTA
    else Color.GRAY
);

# ============================================
# DEBUG
# ============================================

AddLabel(
    showDebugLabels,
    "ATR: " + Round(atr, 2)
    + " | RANGE FACTOR: " + Round(rangeFactor, 2)
    + " | BODY%: " + Round(bodyPct, 1),
    Color.YELLOW
);

AddLabel(
    showDebugLabels,
    "EMA FAST: " + Round(emaFast, 2)
    + " | EMA SLOW: " + Round(emaSlow, 2),
    Color.WHITE
);

AddLabel(
    showDebugLabels,
    "FAST SLOPE: "
    + (if fastSlopeUp then "UP" else "DOWN")
    + " | SLOW SLOPE: "
    + (if slowSlopeUp then "UP" else "DOWN"),
    Color.LIGHT_GRAY
);

sentiment
 
Last edited:
My take on the wick sentiment

Code:
# Experiment # 3
# Candle Wick Sentiment Indicator
# Seth Urion
# November 2019

# ENHANCED ANTWERKS

declare lower;

# ============================================
# OPERATIONAL WICK IMBALANCE ENGINE V2
# Sponsorship + Absorption + Rejection Engine
# ============================================

input wickThresholdPct = 25.0;
input trendLength = 5;

input fastLength = 8;
input slowLength = 20;

input atrLength = 14;

input volLength = 20;
input useVolumeFilter = yes;
input volumeMultiplier = 1.2;

input persistenceBars = 5;
input persistenceThreshold = 2;

input useATRWeighting = yes;
input useLocationFilter = yes;
input useSlopeFilter = yes;
input usePersistenceFilter = yes;

input locationATRFactor = 0.5;

input showZeroLine = yes;
input showTrendLine = yes;
input showRawImbalance = yes;
input showWeightedImbalance = yes;
input showPressure = yes;
input showSignals = yes;
input showLabels = yes;
input showDebugLabels = no;

def na = Double.NaN;

# ============================================
# CORE CANDLE STRUCTURE
# ============================================

def totalRange = high - low;

def bodyHigh = Max(open, close);
def bodyLow = Min(open, close);

def upperWick = high - bodyHigh;
def lowerWick = bodyLow - low;

def upperWickPct =
    if totalRange > 0
    then 100 * upperWick / totalRange
    else 0;

def lowerWickPct =
    if totalRange > 0
    then 100 * lowerWick / totalRange
    else 0;

def bodyPct =
    if totalRange > 0
    then 100 * AbsValue(close - open) / totalRange
    else 0;

# ============================================
# RAW IMBALANCE
# ============================================

def wickImbalance =
    lowerWickPct - upperWickPct;

# ============================================
# ATR WEIGHTING
# ============================================

def atr =
    Average(TrueRange(high, close, low), atrLength);

def rangeFactor =
    if atr > 0
    then totalRange / atr
    else 1;

def weightedImbalance =
    if useATRWeighting
    then wickImbalance * rangeFactor
    else wickImbalance;

def smoothImbalance =
    ExpAverage(weightedImbalance, trendLength);

# ============================================
# EMA STRUCTURE
# ============================================

def emaFast =
    ExpAverage(close, fastLength);

def emaSlow =
    ExpAverage(close, slowLength);

# ============================================
# EMA SLOPE
# ============================================

def fastSlopeUp =
    emaFast > emaFast[1];

def fastSlopeDown =
    emaFast < emaFast[1];

def slowSlopeUp =
    emaSlow > emaSlow[1];

def slowSlopeDown =
    emaSlow < emaSlow[1];

# ============================================
# REGIME STATES
# ============================================

def bullTrend =
    close > emaFast and
    emaFast > emaSlow and
    (!useSlopeFilter or (fastSlopeUp and slowSlopeUp));

def bearTrend =
    close < emaFast and
    emaFast < emaSlow and
    (!useSlopeFilter or (fastSlopeDown and slowSlopeDown));

def repair =
    close > emaFast and
    emaFast <= emaSlow and
    fastSlopeUp;

def bearCross =
    close < emaFast and
    emaFast >= emaSlow and
    fastSlopeDown;

# ============================================
# LOCATION FILTER
# ============================================

def nearSlowEMA =
    AbsValue(close - emaSlow) <= atr * locationATRFactor;

def nearFastEMA =
    AbsValue(close - emaFast) <= atr * locationATRFactor;

def locationBull =
    if useLocationFilter
    then nearFastEMA or nearSlowEMA
    else yes;

def locationBear =
    if useLocationFilter
    then nearFastEMA or nearSlowEMA
    else yes;

# ============================================
# VOLUME FILTER
# ============================================

def avgVol =
    Average(volume, volLength);

def volOkay =
    if useVolumeFilter
    then volume >= avgVol * volumeMultiplier
    else yes;

# ============================================
# WICK DETECTION
# ============================================

def bullishWick =
    lowerWickPct >= wickThresholdPct and
    wickImbalance > 0;

def bearishWick =
    upperWickPct >= wickThresholdPct and
    wickImbalance < 0;

# ============================================
# PERSISTENCE ENGINE
# ============================================

def bullPressure =
    Sum(bullishWick, persistenceBars);

def bearPressure =
    Sum(bearishWick, persistenceBars);

def persistentBull =
    bullPressure >= persistenceThreshold;

def persistentBear =
    bearPressure >= persistenceThreshold;

# ============================================
# FINAL OPERATIONAL SIGNALS
# ============================================

def bullishSignal =
    bullishWick and
    volOkay and
    locationBull and
    (bullTrend or repair) and
    (!usePersistenceFilter or persistentBull);

def bearishSignal =
    bearishWick and
    volOkay and
    locationBear and
    (bearTrend or bearCross) and
    (!usePersistenceFilter or persistentBear);

# ============================================
# ZERO LINE
# ============================================

plot ZeroLine =
    if showZeroLine then 0 else na;

ZeroLine.SetDefaultColor(Color.GRAY);
ZeroLine.SetStyle(Curve.MEDIUM_DASH);
ZeroLine.SetLineWeight(1);

# ============================================
# RAW IMBALANCE
# ============================================

plot RawImbalance =
    if showRawImbalance
    then wickImbalance
    else na;

RawImbalance.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
RawImbalance.SetLineWeight(2);

RawImbalance.AssignValueColor(
    if wickImbalance > 0 then Color.DARK_GREEN
    else if wickImbalance < 0 then Color.DARK_RED
    else Color.GRAY
);

# ============================================
# WEIGHTED IMBALANCE
# ============================================

plot WeightedImbalance1 =
    if showWeightedImbalance
    then weightedImbalance
    else na;

WeightedImbalance1.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
WeightedImbalance1.SetLineWeight(4);

WeightedImbalance1.AssignValueColor(
    if weightedImbalance > 0 then Color.GREEN
    else if weightedImbalance < 0 then Color.RED
    else Color.GRAY
);

# ============================================
# SMOOTHED TREND
# ============================================

plot Trend =
    if showTrendLine
    then smoothImbalance
    else na;

Trend.SetLineWeight(3);

Trend.AssignValueColor(
    if smoothImbalance > 0 then Color.CYAN
    else if smoothImbalance < 0 then Color.MAGENTA
    else Color.GRAY
);

# ============================================
# PRESSURE PLOTS
# ============================================

plot BullPressurePlot =
    if showPressure
    then bullPressure
    else na;

BullPressurePlot.SetDefaultColor(Color.GREEN);
BullPressurePlot.SetLineWeight(2);

plot BearPressurePlot =
    if showPressure
    then -bearPressure
    else na;

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

# ============================================
# SIGNAL POINTS
# ============================================

plot BullSignal =
    if showSignals and bullishSignal
    then weightedImbalance
    else na;

BullSignal.SetPaintingStrategy(PaintingStrategy.POINTS);
BullSignal.SetLineWeight(5);
BullSignal.SetDefaultColor(Color.CYAN);

plot BearSignal =
    if showSignals and bearishSignal
    then weightedImbalance
    else na;

BearSignal.SetPaintingStrategy(PaintingStrategy.POINTS);
BearSignal.SetLineWeight(5);
BearSignal.SetDefaultColor(Color.MAGENTA);

# ============================================
# LABELS
# ============================================

AddLabel(
    showLabels,
    "WICK FLOW: "
    + Round(weightedImbalance, 1),
    if weightedImbalance > 0
    then Color.GREEN
    else if weightedImbalance < 0
    then Color.RED
    else Color.GRAY
);

AddLabel(
    showLabels,
    "RAW: "
    + Round(wickImbalance, 1)
    + " | LWR: " + Round(lowerWickPct, 1)
    + "% | UPR: " + Round(upperWickPct, 1) + "%",
    if wickImbalance > 0
    then Color.GREEN
    else if wickImbalance < 0
    then Color.RED
    else Color.GRAY
);

AddLabel(
    showLabels,
    "REGIME: "
    + (if bullTrend then "BULL TREND"
       else if bearTrend then "BEAR TREND"
       else if repair then "REPAIR"
       else if bearCross then "BEAR CROSS"
       else "NEUTRAL"),
    if bullTrend then Color.GREEN
    else if bearTrend then Color.RED
    else if repair then Color.CYAN
    else if bearCross then Color.ORANGE
    else Color.GRAY
);

AddLabel(
    showLabels,
    "PRESSURE: BULL "
    + bullPressure
    + " | BEAR "
    + bearPressure,
    if bullPressure > bearPressure
    then Color.GREEN
    else if bearPressure > bullPressure
    then Color.RED
    else Color.GRAY
);

AddLabel(
    showLabels,
    "VOLUME: "
    + (if volOkay then "CONFIRMED" else "WEAK"),
    if volOkay
    then Color.GREEN
    else Color.DARK_GRAY
);

AddLabel(
    showLabels,
    "SIGNALS: "
    + (if bullishSignal then "BULLISH ABSORPTION"
       else if bearishSignal then "BEARISH REJECTION"
       else "NONE"),
    if bullishSignal
    then Color.CYAN
    else if bearishSignal
    then Color.MAGENTA
    else Color.GRAY
);

# ============================================
# DEBUG
# ============================================

AddLabel(
    showDebugLabels,
    "ATR: " + Round(atr, 2)
    + " | RANGE FACTOR: " + Round(rangeFactor, 2)
    + " | BODY%: " + Round(bodyPct, 1),
    Color.YELLOW
);

AddLabel(
    showDebugLabels,
    "EMA FAST: " + Round(emaFast, 2)
    + " | EMA SLOW: " + Round(emaSlow, 2),
    Color.WHITE
);

AddLabel(
    showDebugLabels,
    "FAST SLOPE: "
    + (if fastSlopeUp then "UP" else "DOWN")
    + " | SLOW SLOPE: "
    + (if slowSlopeUp then "UP" else "DOWN"),
    Color.LIGHT_GRAY
);

sentiment
Hi @antwerks

Can you run through what your mods are intended to do? I haven't really looked through it with a lot of intensity, but I'd be curious to know what of the original is working for you and where you want to make changes. As always, changes are good and I encourage people to run with kernels of ideas and make them work in a given situation or style!
Cheers,
mashume
 
Hi @antwerks

Can you run through what your mods are intended to do? I haven't really looked through it with a lot of intensity, but I'd be curious to know what of the original is working for you and where you want to make changes. As always, changes are good and I encourage people to run with kernels of ideas and make them work in a given situation or style!
Cheers,
mashume
This version is I think is a step up from the original wick script because it stops acting like a simple candle-shape detector and starts acting like a filtered operational context engine. The original version mostly asked one narrow question: which wick was bigger, upper or lower, and did that exceed a threshold? That was fine for visual context, but it treated every wick event too similarly. This new script adds a lot more structure around whether the wick actually matters. First, it keeps the core wick-imbalance idea, but then it weights the imbalance by ATR-relative candle size, which is important because a dramatic rejection bar should count more if it is large relative to the instrument’s normal movement, not just large inside its own candle. Second, it overlays 8/20 EMA regime state and also adds an optional EMA slope filter, so a bullish lower-wick event inside a rising bull-trend regime gets treated differently from the exact same candle inside a weak or deteriorating tape. Third, it adds a location filter, which makes the signal more honest by asking whether price is near the fast or slow EMA rather than in the middle of nowhere. Fourth, it adds an optional volume confirmation filter, which is a good upgrade because a wick on weak participation often means much less than a wick formed on sponsored volume. Finally, the biggest conceptual difference is the persistence engine. Instead of only reacting to the current bar, it counts how many bullish or bearish wick events have occurred over a recent window and can require a minimum threshold before qualifying the current signal. That turns the script from “one bar did something interesting” into more of a sponsorship / absorption / repeated-defense detector, which is much closer to how a swing trader should think about building evidence.

Operationally, I’d treat this script as a decision-support layer, not a standalone trigger. The lower histogram gives you two related but different reads. The raw imbalance shows the immediate wick character of the current candle, while the weighted imbalance tells you how meaningful that wick was after adjusting for ATR-relative size. The smoothed trend line helps you see whether the wick-flow pressure is building in one direction over several bars rather than just flashing for one candle. The bull and bear pressure plots add another useful layer by showing whether repeated bullish or bearish wick events are clustering over your chosen persistence window. The cyan and magenta signal points are the most selective output, because they only print when wick structure, trend regime, location, volume, and persistence all align, depending on which toggles you leave on. In practice, for a swing-style workflow, I’d use it like this: if you see positive weighted imbalance, rising smooth trend, stronger bull pressure than bear pressure, and a bullish absorption signal while price is in bull trend or repair, that is telling you sellers were absorbed and buyers are defending dips in a context where the tape is at least somewhat supportive. On the short side, if weighted imbalance is negative, bear pressure is dominating, the trend line is rolling over, and you get a bearish rejection signal in bear trend or bear cross, that is telling you rallies are being rejected rather than sponsored.
For actual decision-making, I would read it in layers. First ask: what is the regime? Bull trend and repair are the only contexts where bullish absorption should really matter, and bear trend and bear cross are the only contexts where bearish rejection deserves real respect. Second ask: is the imbalance real? That means looking at weighted imbalance, not just raw imbalance. Third ask: is it persistent? If bull pressure has been building for several bars, that matters more than one isolated lower wick. Fourth ask: is it sponsored? Volume confirmation helps here. Then ask the final trader question: where is price? This script uses EMA proximity as location context, which is better than nothing, but you should still layer in your own higher-value references like prior-day levels, VWAP, premarket high/low, or round-number strike areas. In other words, this script is best used to tell you how the market is behaving around a level, not whether the level itself is important. That’s the second-order distinction. The candle-wick engine can tell you buyers are absorbing or sellers are rejecting, but you still need to decide whether that behavior is happening somewhere meaningful.

My practical usage instructions would be simple. Put it in the lower panel on the timeframe you care about, probably 15m if you’re using it tactically and higher if you’re using it for swing context. Start with all filters on so you understand its stricter form first. Watch how the weighted histogram behaves around pivots and trend pullbacks. Use the smooth trend line to judge whether wick pressure is building or fading. Treat the pressure labels as a short-term scoreboard, not a signal by themselves. Only pay serious attention to the bullish or bearish signal dots when they align with your broader structure read. If price is reclaiming an important support area, the script is showing bullish absorption, and the tape is in repair or bull trend, that’s the kind of confluence worth acting on. If price is bouncing into resistance, the script is showing bearish rejection, and the regime is bear cross or bear trend, that’s the kind of fade or avoidance context that matters. The main thing is not to use this as “dot means buy” or “dot means short.” The upgrade from the original is that this script is trying to measure quality of wick behavior, not just existence of wick behavior, and that makes it far more useful as a swing-trader context tool.
 
Here is a read on XOM today -
According to this wick script, the chart quality is not bounce-confirmed yet.
From the screenshot, the script is saying:
  • WICK FLOW:-15.8
  • RAW: about-14
  • Lower wick:6.7%
  • Upper wick:20.7%
  • REGIME: BEAR CROSS
  • PRESSURE: BULL 3 | BEAR 1
  • VOLUME: WEAK
  • SIGNALS: NONE
That combination matters.

The current bar quality is still bearish-to-neutral, not bullish. The negative wick flow and negative raw imbalance mean the current candle is showing more upper-wick rejection than lower-wick absorption. In plain English, sellers are still rejecting price better than buyers are defending it on this bar. If this were the kind of bounce bar you want to trust, I’d want to see the opposite: positive weighted imbalance, stronger lower wick, and ideally an actual bullish absorption signal.

The regime is the bigger issue. The script has this in BEAR CROSS, which is one of the weaker contexts for blindly expecting upside. That means price is below the short-term fast structure enough that the tape is still in a damage/transition state, not a clean bull repair state yet. For your style, that means any bounce here should be treated as possible repair, not assumed reversal.

The one constructive thing in the screenshot is the pressure reading:
BULL 3 | BEAR 1
That tells me there has been more recent bullish wick activity than bearish wick activity over the persistence window. So under the surface, there has been some evidence of dip-buying or absorption recently. But the problem is the current bar is not confirming that pressure well, and volume is weak, so the script is basically saying: “some prior buying evidence exists, but this specific candle is not a high-quality long trigger.”

So should we expect a bounce up? I’d say a bounce is possible, but the script is not giving you permission to trust it yet. This is the exact kind of setup where a trader gets hurt if they confuse “sitting near support” with “confirmed reversal.” The screenshot shows 149.8 area with a visible put-wall / support zone around 150, so location is reasonable for a bounce attempt. But the wick engine itself is not calling this a quality bullish reversal bar right now. It’s saying:
  • support area: yes
  • bullish persistence under the surface: some
  • current candle quality: not good enough
  • regime: still weak / bear-cross
  • volume sponsorship: missing
  • confirmed bullish signal: none
So, my actual read is: do not expect a clean bounce just because it’s near 150. The better framing is watch for a bounce attempt. To upgrade this into a better long-quality setup under the wick script, I’d want to see the next 1 to 3 bars do some combination of:
  • flip wick flow back positive
  • print a lower-wick dominant bar
  • improve from bear cross toward repair
  • show better volume
  • ideally produce an actual bullish absorption signal
If that happens while 150 holds, then the “down before up” thesis starts looking much better. If price loses 150 cleanly or keeps printing negative wick flow with weak volume, then the script is telling you the market is still in rejection mode and the bounce thesis is premature.

My bottom-line read from this exact screenshot is: support is nearby, but bounce quality is currently low-to-medium at best, not high-quality, because regime is bear cross, wick flow is negative, and the script shows no bullish signal yet.
 
Now here is a conflict that points exactly why wick scripts should stay a context layer, not the whole thesis.

On the MU chart, price structure looks undeniably strong:
  • price is in a steep uptrend
  • it just expanded to fresh highs near 916.8
  • your upper study is still labeling bullish acceleration / bull stretched
  • price is well above the main trend bands / VWAP-style base
But the lower wick panel is negative right now:
  • wick flow about -31
  • raw about -21
  • pressure = Bull 1, Bear 2
  • signals = none
That usually does not mean "the chart is bearish." It more often means:
  • recent candles are showing more upper-wick rejection / less clean close-location strength
  • buyers are still winning the larger trend, but the last few bars are distributing or stalling
  • the move may be late-stage and stretched, not necessarily broken
For a swing trader, I’d read this as:
  • Trend: bullish
  • Condition: extended
  • Micro-tape: weakening
  • Implication: chase risk is worse here than trend risk
So the script is probably doing its job, it’s just measuring a different layer than your eye is.
What I think is happening on this chart:
  • The trend regime is strong enough that price can keep rising even while wick sentiment deteriorates.
  • Negative wick flow near highs often shows up when a move is still advancing, but doing it with sloppier auction quality.
  • That can lead to one of two things:
    1. a shallow pause / sideways digestion, then trend continuation
    2. a sharper reset back toward the fast trend line
What would make the mismatch healthy:
  • a brief pullback or 2 to 5 bar consolidation
  • wick flow stops getting worse
  • price holds above the breakout area and then reclaims momentum
What would make it a real warning:
  • negative wick flow persists for several bars
  • candles keep tagging highs and closing off them
  • expansion day gets fully retraced
  • price loses the nearest fast support instead of digesting above it
So my practical takeaway is: This is a bullish chart with a short-term caution flag, not a bearish chart.
 
That's some SOLID reasoning. Thank you for posting such complete rundowns of your work. Sincerely appreciated.

-mashume
 
That's some SOLID reasoning. Thank you for posting such complete rundowns of your work. Sincerely appreciated.

-mashume
My swing-trader hierarchy
When I read a wick, I rank the evidence like this:
  1. Trend structure
  2. Location
  3. Prior move / extension
  4. Close quality
  5. Effort
  6. Follow-through
  7. Higher timeframe alignment
The wick itself is important, but it is not first. The wick becomes powerful when it appears at the right place, after the right move, and gets confirmed.

"A wick is not the signal. A wick is the evidence. The signal is the wick plus level plus context plus follow-through." -Paul Tudor Jones.
 
Last edited by a moderator:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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