Updated
L1 Buy after Dump Detector

Level: 1
Background
The so-called "Buy after Dump" refers to the phenomenon in which the stock price sometimes rebounds temporarily due to the rapid decline in the falling market. The rebound was smaller than the decline, and the downtrend resumed after the rebound.
Function
L1 Buy after Dump Detector is one of my research to see win rate of a "Buy after Dump" chance. The principle is that I use ema() and OHLC to model a whale dump behavior. After the dump wave, I use KDJ to indicate several long entry points.
Key Signal
dump --> whale dump signal
fundready --> it indicate the end of a dump and make fund ready to long entry
longentry --> long entry signal generated from KDJ resonating with dump and fundready signal
Pros and Cons
Pros:
1. it can detect obvious dump and depict the decay of dump wave
2. use resonance to generate long entry
Cons:
1. it may be risky to "buy after dump" which may require take profit method here because the opportunity may be very short
2. KDJ is too sensitive in large time frame and have many long entry signals (the closer to dump wave, the better based on experience)
Remarks
Very interesing stuff, but rare of people trade with such crazy method. I suggest this is ONLY for backtest study of market behavior.
Readme
In real life, I am a prolific inventor. I have successfully applied for more than 60 international and regional patents in the past 12 years. But in the past two years or so, I have tried to transfer my creativity to the development of trading strategies. Tradingview is the ideal platform for me. I am selecting and contributing some of the hundreds of scripts to publish in Tradingview community. Welcome everyone to interact with me to discuss these interesting pine scripts.
The scripts posted are categorized into 5 levels according to my efforts or manhours put into these works.
Level 1 : interesting script snippets or distinctive improvement from classic indicators or strategy. Level 1 scripts can usually appear in more complex indicators as a function module or element.
Level 2 : composite indicator/strategy. By selecting or combining several independent or dependent functions or sub indicators in proper way, the composite script exhibits a resonance phenomenon which can filter out noise or fake trading signal to enhance trading confidence level.
Level 3 : comprehensive indicator/strategy. They are simple trading systems based on my strategies. They are commonly containing several or all of entry signal, close signal, stop loss, take profit, re-entry, risk management, and position sizing techniques. Even some interesting fundamental and mass psychological aspects are incorporated.
Level 4 : script snippets or functions that do not disclose source code. Interesting element that can reveal market laws and work as raw material for indicators and strategies. If you find Level 1~2 scripts are helpful, Level 4 is a private version that took me far more efforts to develop.
Level 5 : indicator/strategy that do not disclose source code. private version of Level 3 script with my accumulated script processing skills or a large number of custom functions. I had a private function library built in past two years. Level 5 scripts use many of them to achieve private trading strategy.
Background
The so-called "Buy after Dump" refers to the phenomenon in which the stock price sometimes rebounds temporarily due to the rapid decline in the falling market. The rebound was smaller than the decline, and the downtrend resumed after the rebound.
Function
L1 Buy after Dump Detector is one of my research to see win rate of a "Buy after Dump" chance. The principle is that I use ema() and OHLC to model a whale dump behavior. After the dump wave, I use KDJ to indicate several long entry points.
Key Signal
dump --> whale dump signal
fundready --> it indicate the end of a dump and make fund ready to long entry
longentry --> long entry signal generated from KDJ resonating with dump and fundready signal
Pros and Cons
Pros:
1. it can detect obvious dump and depict the decay of dump wave
2. use resonance to generate long entry
Cons:
1. it may be risky to "buy after dump" which may require take profit method here because the opportunity may be very short
2. KDJ is too sensitive in large time frame and have many long entry signals (the closer to dump wave, the better based on experience)
Remarks
Very interesing stuff, but rare of people trade with such crazy method. I suggest this is ONLY for backtest study of market behavior.
Readme
In real life, I am a prolific inventor. I have successfully applied for more than 60 international and regional patents in the past 12 years. But in the past two years or so, I have tried to transfer my creativity to the development of trading strategies. Tradingview is the ideal platform for me. I am selecting and contributing some of the hundreds of scripts to publish in Tradingview community. Welcome everyone to interact with me to discuss these interesting pine scripts.
The scripts posted are categorized into 5 levels according to my efforts or manhours put into these works.
Level 1 : interesting script snippets or distinctive improvement from classic indicators or strategy. Level 1 scripts can usually appear in more complex indicators as a function module or element.
Level 2 : composite indicator/strategy. By selecting or combining several independent or dependent functions or sub indicators in proper way, the composite script exhibits a resonance phenomenon which can filter out noise or fake trading signal to enhance trading confidence level.
Level 3 : comprehensive indicator/strategy. They are simple trading systems based on my strategies. They are commonly containing several or all of entry signal, close signal, stop loss, take profit, re-entry, risk management, and position sizing techniques. Even some interesting fundamental and mass psychological aspects are incorporated.
Level 4 : script snippets or functions that do not disclose source code. Interesting element that can reveal market laws and work as raw material for indicators and strategies. If you find Level 1~2 scripts are helpful, Level 4 is a private version that took me far more efforts to develop.
Level 5 : indicator/strategy that do not disclose source code. private version of Level 3 script with my accumulated script processing skills or a large number of custom functions. I had a private function library built in past two years. Level 5 scripts use many of them to achieve private trading strategy.
Release Notes
In order to obey the House Rule, remove the irrelevant MA Cross display.Release Notes
OVERVIEW This Pine Script identifies potential L1-level buying opportunities emerging after market dumps using dynamic volatility analysis and oscillator-based validation. It combines custom moving averages, multi-timeframe support/resistance calculations, and a refined KDJ oscillator to detect temporary bottoms.
FEATURES
Advanced Volatility Analysis:
• Weighted Moving Average (WMA) calculates normalized low-price volatility ratio
• Adjusted EMA blending short-term lows with smoothed volatility metrics
Support Level Detection
• Dual SMA-based support tiers (support_level_1/i] @0.96x SMALOW, support_level_2/i] @0.85x long-SMALOW)
• Dynamic dumping condition identification via tier comparisons
Oscillator-Based Signals
• Refined KDJ oscillator with optimized WMA smoothing
• J-value threshold crossing verification system
Visual Indicators
• Color-coded dump strength meter (yellow candles)
• Negative-scaled volatility readiness plot (lime green)
• Background highlighting confirmed buy zones
HOW TO USE
Enable "Don't Paint Beyond Last Bar" option
Observe: • Yellow dump strength bars rising above prior values → increased reversal confidence • Green background activation requires simultaneous:
✓ Positive fund readiness (+ve lime plot)
✓ Validated KDJ/J crosses
✓ Confirmed dump indicator presence
LIMITATIONS
• Results sensitive to windowing parameters (e.g., 34-bar lows vs 55-bar lows discrepancy)
• Requires trending markets; ineffective during sideways consolidation phases
• Backtesting recommended before live use due to overlapping calculation dependencies
NOTES
Abbreviated naming conventions follow TradingView community standards:
sm = Simple Moving Average
ema/wma denote Exponential/Weighted varieties
All timeframes assume default bar lengths unless modified
Release Notes
█ OVERVIEWThis oscillator detects exhaustion extremes in both directions: it highlights
buy opportunities after a dump and — new in V2 — fully symmetric sell
opportunities after a pump. Signals are edge-triggered, state-managed, and
shipped with ATR-based take-profit / stop-loss references and alerts.
█ CONCEPTS
The indicator is built as a dual-sided reversal detector operating in a
separate pane:
• Dump / Pump strength engine: a volatility-ratio moving-average core
measures how violent one-sided price extension is; strength spikes when
price presses its lowest low (dump) or highest high (pump) of the
lookback window.
• Structure confirmation: two smoothed support levels (buy side) and
two mirrored resistance levels (sell side) must agree that the market has
genuinely extended, not just wobbled.
• KDJ trigger: a classic KDJ-style oscillator provides the final
entry edge — J-value turning up from a recent low (buy) or turning down
from a recent high (sell).
• State machine: a position-state engine with cooldown and same-bar
exclusivity governs every entry and exit, preventing signal chatter.
█ HOW TO USE
1 — Add the script to any chart; it loads in a separate pane below price.
2 — Watch the yellow (dump) and fuchsia (pump) strength candles and lines:
rising bars mean the corresponding extreme is building.
3 — Green "B" labels mark buy-after-dump entries; red "S" labels mark
sell-after-pump entries; orange "XL"/"XS" crosses mark exits.
4 — The dashboard (top right) summarizes position state, current dump/pump
strength, entry price, ATR and TP/SL levels.
5 — Create alerts from "Long Entry Alert", "Short Entry Alert",
"Long Exit Alert" or "Short Exit Alert", or use "Any function call" alerts
for dynamic messages that include price and TP/SL.
Input Parameters
• Core Engine: volatility ratio length (13), extreme lookback (34),
temporary bottom/top lookback (55), strength scale (618), smoothing (3).
• Buy Side: support-1/2 SMA lengths and multipliers (2/0.96, 26/0.85),
enable switch.
• Sell Side: resistance-1/2 SMA lengths and multipliers (2/1.04, 26/1.15),
enable switch.
• Entry Trigger (KDJ): RSV length (9), K/D smoothing (3/3), J low/high
window (2) and confirm window (8).
• Signal Governance: same-bar entry/exit exclusivity (on), cooldown bars (3).
• Risk: ATR length (14), stop-loss multiplier (2.0 xATR), take-profit
multiplier (3.0 xATR), show TP/SL switch.
• Visual: labels, state background, dashboard toggles.
█ FEATURES
• Fully symmetric dual-side logic — every buy condition has an exact
mirrored sell condition (duality principle), with distinct color coding.
• Position state machine with cooldown and same-bar exclusivity.
• ATR-based TP/SL reference levels (data window, dashboard and alerts).
• Five alertcondition channels plus dynamic close-confirmed alert() calls.
• Information dashboard, state background shading, signal labels.
█ SIGNALS
Visual Elements
• Yellow candles / thick line: dump strength building (buy context).
• Green candles / lime line: buy-side fund readiness recovering.
• Fuchsia candles / thick line: pump strength building (sell context).
• Maroon line (negative region): sell-side readiness mirrored downward.
• "B" green label up: buy-after-dump entry (edge-triggered).
• "S" red label down: sell-after-pump entry (edge-triggered).
• "XL"/"XS" orange crosses: long/short exit via opposite-side signal.
• Green/red pane background: long/short state; light shading when flat-off.
█ IMPLEMENTATION NOTES
Open-source, Pine v6. Built with ta.ema, ta.sma, ta.atr, ta.highest,
ta.lowest, ta.crossover and ta.crossunder plus two custom moving-average
helpers inherited from V1. No request.security calls — no multi-timeframe
repainting. Entry signals are edge-triggered (crossover/crossunder), state
transitions happen at most once per bar, and dynamic alerts fire only on
confirmed bars (alert.freq_once_per_bar_close). This is an indicator, not
a strategy: it does not place orders.
█ LIMITATIONS
• Reversal logic performs best at genuine exhaustion extremes; extended
one-sided trends can keep strength elevated for long stretches.
• Not recommended below the 5-minute timeframe (oscillator warm-up noise).
• TP/SL levels are reference projections, not orders.
• Short signals assume the instrument/market supports selling; disable
the Sell Side group for long-only markets.
█ NOTES
• V2 upgrade of the "L1 Buy after Dump Detector": adds the mirrored
sell-after-pump side, exits, state machine, ATR risk references,
dashboard and alerts.
• Feel free to use and modify — attribution appreciated.
════════════════════════════════════════════════════════════════════════
For questions or feedback, please use the comments section below.
Don't miss out! The first and most important thing to do is to join my Discord chat now! Click here to start your adventure: discord.com/invite/ZTGpQJq My new github for more pine development soon: github.com/wxt-coder
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Don't miss out! The first and most important thing to do is to join my Discord chat now! Click here to start your adventure: discord.com/invite/ZTGpQJq My new github for more pine development soon: github.com/wxt-coder
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.