72s: Adaptive Hull Moving Average+One challenging issue for beginner traders is to differentiate market conditions, whether or not the current market is giving best possibility to stack profits, as earliest, in shortest time possible, or not.
On intraday, we've seen some big actions by big banks are somewhat can be defined --or circling around-- by HMA 200 . I've been thinking on to make the visuals more conform to price dynamics (separating major movement and minor noise) to get clearer signs of when it starts to happen. So it will be easier to see in a glance when the strength starts really taken place, with less cluttered chart.
This Adaptive HMA is using the new Pine Script's feature which now support Dynamic Length arguments for several Pine functions. ( read: www.tradingview.com). It hasn't support the built-in HMA() directly, but thankfully we can use its wma() formula to construct. (Note: I tweaked a bit HMA formula already popular here by using plain int() instead of round() on its wma's length, since I find it precisely match tradingview's built-in HMA).
You can choose which aspect the Adaptive HMA period will adapt to.
In this study I present it with two options: Volume and Volatility . It will "moves" faster or slower depends on which situation the aspect is currently into. ie: When volume is generally low or volatile readings is not there, price won't move very much, so the adapting MA will slow down by dynamically lengthen the lookback period, and vice versa, and so on.
Colour-markings in the Adaptive resembles which situation explained above. In addition, I also combine it with slope calculation of the MA to help measuring trend-strength or sideway/choppy conditions.
This way when we use it as dynamic support/resistance it will be more visually-reliable.
Secondly, and more important, it might help us traders with better probability info of whether or not a trade should even worth to be made . ie: If in the mean time market won't give much movement, any profit would also only as much. In most cases, we might better save our dime for later or place it somewhere else.
HOW TO USE:
Aside from better dynamic support/resistance and clearer breakout confirmation, MA is coloured as follow:
YELLOW:
Market is in consolidation or flat. Be it sideways, choppy, or in relatively small movements. If it shows up in a trending market, it may be an earlier sign that current trend might about to change its direction, or confirming a price broke-out to another side.
LIGHT GREEN or LIGHT RED:
Tells if a trend is forming but still relatively weak (or getting weaker), as it doesn't have volume or volatility to support.
DARKER GREEN ot DARKER RED:
This is where we can expect some good and strong price movement to ride. If it's strong enough, many times it marks a start of new long-lasting major trend.
SETTINGS:
Charger:
Choose which aspect your HMA should plug itself into, thus it will adapt to it.
Minimum Period, Maximum Period:
172 - 233 is just my own setting to outmatch the static HMA 200 for intraday. I find it --in my style of trading-- best in 15m tf in almost any pair, and 15m to 1H for some stocks. It also works nicely with conventional EMA 200, sometimes as if they somewhat work hand-in-hand in defining where the price should go. But you can, ofcourse, experiment with other ranges, broader or narrower. Especially if you already have an established strategy to follow to. As you might do with:
Consolidation area threshold:
This has to do with slope calculation. The bigger the number means your MA needs bigger degree to define the market is out of flat (yellow) area. This can be useful if needed to lighten up the filter or vice-versa.
Background colouring:
Just another colouring to help highlighting the difference in market conditions.
ALERTS:
There are two alerts:
Volume Break: when volume is breaking up above average, and
Volatility Meter: when the market more likely is about to have its moment of the big wiggling brush.
USAGE:
Very very nice BUY entry to catch big up-movement if:
1. Price is above MA. (It is best when price is also not to far distance from the MA, or you can also use distance oscillator to help out too)
2. HMA's color is in darker green. Means it's on the charging plug with your chosen aspect.
3. RSI is above 50. This is to help as additional confirmation.
Clear SELL entry signal is same as above, just the opposite.
-------------------------------------------------------
Note:
Lower timeframe of course means more noise to be filtered. Depends on the instrument, you might need to tweak the settings a bit till it conform nicely and shows lots of good trades in history. Here's another example on GBPUSD 5m timeframe:
For exit/take-profit point, you can use a second faster period static HMA. Or you can also use RSI. Here's an example:
Don't get me wrong, on few occasions I found it's still best using static MA to spot fakeouts, breakouts, etc, especially ones that's been already use widely. If that's the case or price actions seems suspicious, simply put the same value for minimum and maximum period settings, and there you have the original HMA with extra features.
For developer, check in the code if you need to customise your own charger.
-------------------------------------------------------
That's it. Hopefully this Adaptive HMA+ could at least be a good sidekick to your own strategy, as it does mine. ;)
在腳本中搜尋"breakout"
Consolidation Zones - LiveHello Traders!
This is the script that finds Consolidation Zones in Realtime.
How it works?
- The script finds highest/lowest bars by using "Loopback Period"
- Then it calculates direction
- By using the direction and highest/lowest bar info it calculates consolidation zones in realtime
- If the length of consolidation area is equal/greater than user-defined min length then this area is shown as consolidation zone
- Then Consolidation Zone extends automatically if there is no breakout
if you increase the Loopback Length then you get bigger consolidation zones:
You have option to "Paint Consolidation Area" or not:
Enjoy!
Pine Script®指標
Renko AccelerationRenko is a very useful charting method for analyzing stock movement. It does a great job of filtering out all the excess noise so that all we're left with is pure price action. But, what about time? Time is a fundamental part of chart analysis and we are only seeing part of the picture. After all, shouldn't we take a very different approach to trading signals from a block that renders in 2 seconds as opposed to a block that renders in 30 minutes?
This indicator provides the best of both worlds, enabling us to correlate the passing of time with price movement and clearly see when squeezes and breakouts occur.
As the indicator turns up to green we can see that volatility is on the move and the market is accelerating (breakout), and as it turns down to red the market is stagnating (squeeze). There is also an alternate 'Precise' view which renders the exact time per block for more granular analysis.
Pine Script®指標
Range Breakouts - AshraffThis computes the Range Breakout strategy based on the last five days of stock data.
Pine Script®指標
ChannelsBreakoutThis script allows you to intercept price channel breakouts (Donchian channel) in a bullish perspective. Applicable both on Equities/ETFs and on Futures (Index Futures).
We open a position when closes crosses the upper channel. The trade ends with a trailing associated with a fast lower Donchian or a monetary stop loss.
It is an educational code and does not constitute a solicitation for public savings.
Pine Script®策略
Pine Script®指標
FALSE BREAKOUT NO PROBLEM !! CHK TWIN MOV AVG SEGREGATED RIBBON PROBLEM DEFINITION 1 : To Avoid False Breakouts
PROBLEM DEFINITION 2 : To Ascertain if the trend has changed when a Stock opens with a Gap up or Gap Down
## PROBABLE SOLUTION : Use a Moving Average with lot of latency
## PROBLEM WITH ABOVE SOLUTION : Misses on lot of trades, Late exits leads to drain on winning trades
S O L U T I O N
An Indicator which plots two different types of Moving Averages at the same time
For the MA length 5-100 a fast plot of choice
For the MA Length 110-200 a plot with a lag to ascertain the trend
And then ONE LAST MAN STANDING with even bigger MA length for a lagging indicator to save the day
This indicator gives one 9X9 = 81 Permutation Combinations to look at the markets
One can devise strategies basis if one particular MA Type has crossed another MA Type
Feel free to post the strategies you have come out with!
//// CREDITS AND ACKNOWLEDGEMENTS //////////////////////////////////////////////////////////////////
Following contributors helped the author ::
Credits to Neobutane for his Multiple Type Mov. Avg. Guppy at ......
hxxps://www.tradingview.c0m/script/UQAv1U0c-MA-Study-Different-Types-and-More-NeoButane/
Credits to Jose5770 for sharing Jurik MA code at .....
hxxps://www.tradingview.c0m/script/uqYvkHna-Trend-Direction-Force-Index/
Appreciate and Thank You for sharing your work.
//////////////////////////////////////////////////////////////////////////////////////////////////////
P.S You might notice in the code that the few plots are skipped. It is done to fasten the indicator without compromising
on the functionality
Pine Script®指標
ATR-ranged Donch on 15min// This is a simple Mean Reversion & Breakout Indicator.
// A Donchian Channel is plotted. A threshold equal to 0.25 of Daily ATR.
// If price reverses from this threshold, then it can be taken as possible Mean Reversion.
// If price crosses the previous Donchian levels, it can be taken as a possible breakout.
// Typical of such strategy is the whipsaw effect when price movement is just flat.
// I have marked the region where the lower and higher thresholds are closer to be an indicative of whipsaw.
// But it is not really effective to avoid whipsaw.
Pine Script®指標
Support-Resistance breakoutStrategy based on longing resistance breakout and shorting support breakout.
It defines highs and lows using fractal with 2 bars for confirming high/lows. So it has 2 bars lag.
It calculates the difference between sma with defined length (21 by default) of highs and of lows and uses it as alt SR level. This idea I took from synapticEx's indicator Nebula-Advanced-Dynamic-Support-Resistance.
Position enter is the breakout of SR, defined by fractals.
Position exit is: bar change in opposite to position direction > difference is sma of highs and of lows.
Pine Script®策略
Volume w/ Threshold and Editable MA PeriodJust a simple script that tweaks the original Volume one.
The purpose is creating a threshold which we'll use to put an alert on. This way, we can be notified whether Volume pumps.
Useful for spotting breakouts, breakdowns and pumps.
Threshold is simply a coeff * ma(volume,period). Coeff is editable as well.
Hope this helps!
Pine Script®指標
Dotenslayer : An open range breakouts method indicator for botThis script shows the long and short points of certain Japanese bots like 'DotenKun' which use open range breakouts method.
Searching recent 18 bars as default and shows the range calculated with a factor (default k = 1.6). You can edit this condition by yourself.
When filled the long or short conditions, also shows the indicator on the price chart to help your trading on BTC.
Also, this script can make alarm events related to those conditions.
This script only works for BTCUSD, XBTUSD, BTCJPY, FXBTCJPY with 1H time span.
Disclaimer :
I don't own the source code of the certain bots and I didn't directly reference the source code of it.
So which means, I don't guarantee this script works as same as the bots works.
Also, I didn't mean to disturb their trading bot businesses.
Your donations are welcome! :
BTC : 327MqYGfHJFC7LRijGwQZXdTAyFwvYCzyv
ETH : 0x5E270c3667E65ba6158D292a98c5b54F81AfCAf1
Pine Script®指標
Auto AVWAP (Anchored-VWAP) with Breakout Screener_v2Updated indicator for AWAP breakout. The indicator identified the candle that breaks out of AVWAP
Pine Script®指標
Engulfing & Pin Bar Breakout StrategyOverview
This strategy automates a classic, powerful trading methodology based on identifying key candlestick reversal patterns and trading the subsequent price breakout. It is designed to be a complete, "set-and-go" system with built-in risk and position size management.
The core logic operates on the 1-Hour timeframe, scanning for four distinct high-probability reversal signals: two bullish and two bearish. An entry is only triggered when the market confirms the signal by breaking a key price level, aiming to capture momentum following a potential shift in market sentiment.
The Strategy Logic
The system is composed of two distinct modules: Bullish (Long) and Bearish (Short).
🐂 Bullish (Long) Setup
The script initiates a long trade based on the following strict criteria:
Signal: Identifies either a Hammer or a Bullish Engulfing pattern. These patterns often indicate that sellers are losing control and buyers are stepping in.
Confirmation: Waits for the very next candle after the signal.
Entry Trigger: A long position is automatically opened as soon as the price breaks above the high of the signal candle.
Stop Loss: Immediately set just below the low of the signal candle.
Take Profit: A fixed target is placed at a 1:5 Risk/Reward Ratio.
🐻 Bearish (Short) Setup
The script initiates a short trade based on the following strict criteria:
Signal: Identifies either a Shooting Star or a Bearish Engulfing pattern. These patterns suggest buying pressure is fading and sellers are taking over.
Confirmation: Waits for the very next candle after the signal.
Entry Trigger: A short position is automatically opened as soon as the price breaks below the low of the signal candle.
Stop Loss: Immediately set just above the high of the signal candle.
Take Profit: A fixed target is placed at a 1:4 Risk/Reward Ratio.
Key Feature: Automated Risk Management
This strategy is designed for disciplined trading. You do not need to calculate position sizes manually.
Fixed Risk: The script automatically calculates the correct position size to risk exactly 2% of your total account equity on every single trade.
Dynamic Sizing: The position size will adjust based on the distance between your entry price and your stop loss for each specific setup, ensuring a consistent risk profile.
How To Use
Apply the script to your chosen chart (e.g., BTC/USD).
Crucially, set your chart's timeframe to 1-Hour (H1). The strategy is specifically calibrated for this interval.
Navigate to the "Strategy Tester" tab below your chart to view backtest results, including net profit, win rate, and individual trades.
Disclaimer: This script is provided for educational and informational purposes only. It is not financial advice. All trading involves substantial risk, and past performance is not indicative of future results. Please use this tool responsibly and at your own risk.
Pine Script®策略
1R Breakout Highlighter1R Breakout. This indicator measures every bar and highlights any bar that is greater than the previous bar by more than 1R.
Pine Script®指標
Chews Opening Range Breakout - FibonacciVisual tool for taking a Fibonacci retracement-backed opening range breakout.
How it works:
Short a first red candle. Long a first green candle.
You decide which Fibonacci % you prefer your stop loss to be, the plot and label will represent your decision.
Fibonacci logic is close --> open.
Recommendations:
Use a lower time frame interval like 3m.
Extra Notes:
On higher priced stocks, you may see some discrepancy (~$0.1!) when plotting a Fibonacci Retracement compared to the suggested stop loss.
Since this discrepancy happens on inherently more volatile stocks, I have chosen to neglect the discrepancy instead of going for point perfect stop loss exits.
Realistically, it won't matter unless you get very unlucky.
Fibonacci drawing is not a feature of what this indicator plots. It's there for reference, but I can add if requested.
I drafted this simple code to help me visualize automating this strategy.
"That's spoicy!"
ToDo: Add an optional two-sided ORB. Higher chance of success since it is meant for reversals.
Pine Script®指標
Pivot-Based Channels & Bands [Misu]█ This Indicator is based on Pivot detection to show bands and channels.
The pivot price is similar to a resistance or support level. If the pivot level is breached, the price should continue in that direction. Or the price could reverse at or near this level.
█ Usages:
Use channels as a support & resistance zone.
Use bands as a support & resistance zone. It is also very powerfull to use it as a breakout.
Use mid bands & mid channels as a trend direction or trade filter as a more usual moving average.
█ Parameters:
Show Pivot Bands: show bands.
Show Pivot Mid Band: show mid bands.
Show Pivot Channels: show channels.
Show Pivot Mid Channel: show mid channels.
Deviation: deviation used to calculate pivot points.
Depth: depth used to calculate pivot points.
Pine Script®指標
Bulu BreakoutI designed this indicator to trade 52 weeks high breakout. It tests three conditions 1)close above 52weeks high 2)close above upper Bollinger band 3) adx <30. any candle that satisfies all these condition will change its color to black. i also added 44sma to this script to find high probable trade. if the black candle is near 44 sma it is more reliable.
Pine Script®指標
[KL] Double Bollinger Bands Strategy (for Crypto/FOREX)This strategy uses a setup consisting of two Bollinger Bands based on the 20 period 20-SMA +/-
(a) upper/lower bands of two standard deviations apart, and
(b) upper/lower bands of one standard deviation apart.
We consider price at +/- one standard deviation apart from 20-SMA as the "Neutral Zone".
If price closes above Neutral Zone after a period of consolidation, then it's an opportunity for entry. Strategy will long, anticipating for breakout.
The illustration below shows price closing above the Neutral Zone after a period of consolidation.
a.c-dn.net
Position is exited when prices closes at Neutral Zone (being lower than prior bars)
Pine Script®策略
Inside Candle Positional StrategyIntroduction
This strategy implements a structured Inside Candle breakout model designed to capture expansion moves following short-term price compression.
An inside candle represents a temporary contraction in volatility, where the entire range of the current bar is contained within the previous bar. The preceding bar becomes the Mother Candle, and its range defines the potential breakout boundaries.
The model focuses purely on price structure and predefined risk parameters rather than trend-following overlays or momentum filters.
Core Logic and Structure
Inside Candle Detection
An inside candle is defined as:
Current High < Previous High
Current Low > Previous Low
When this condition occurs, the previous bar is marked as the Mother Candle. Only one breakout attempt is allowed per identified structure to prevent repeated entries within the same consolidation phase.
Trade Entry Rules
Entries are executed at market on confirmed bar close.
Long Position
Close > Mother Candle High
No active position
Short Position
Close < Mother Candle Low
No active position
This ensures breakout confirmation rather than anticipatory positioning.
Risk Management Framework
Risk control is fully rule-based and determined at the moment of entry.
For each trade:
Initial Stop Loss = Opposite boundary of the Mother Candle
Risk = Distance between entry price and initial stop
Target = Entry ± (Risk × Risk-Reward Ratio)
The Risk-Reward Ratio is user configurable.
Only one position is active at any time (pyramiding disabled).
Optional ATR-Based Trailing Stop
An optional trailing mechanism may be enabled:
Trailing Stop updates on every confirmed bar.
Calculated using ATR × Multiplier.
Moves only in the direction of profit.
Never worsens beyond the initial stop level.
If disabled, exits rely solely on the fixed stop and target.
Execution Model
All signals are calculated on confirmed bar closes.
Entries are market orders.
Stop and target levels are evaluated using bar OHLC values.
No repainting logic is used.
No intrabar order sequencing assumptions are applied.
Backtest performance may differ from live execution due to slippage, spread, liquidity, and market conditions.
Visual Components
Inside candles are highlighted (default: yellow).
Entry, Initial Stop, Trailing Stop (if enabled), and Target levels are displayed using line-break formatting for clarity.
Designed to maintain structural visibility without excessive chart clutter.
Strategy Defaults
Initial Capital: $1000
Commission: 0.05%
Position Size: 1 (fixed quantity)
Pyramiding: Disabled
These defaults can be adjusted in the Strategy Properties panel.
Intended Application
This strategy is suited for studying breakout behavior after short-term consolidation phases.
Performance characteristics will vary depending on instrument volatility, timeframe, and market regime.
It is presented as a structural breakout framework and should be tested and adapted according to individual risk tolerance and trading objectives.
Disclaimer
Trading involves significant risk. This script is provided for educational and research purposes only and does not constitute financial advice. Users are responsible for evaluating its suitability for their own trading decisions.
Pine Script®策略
Gold Breakout Trader⚙️ Gold short-term entries off M1 timeframe every 2 hours every day with SL/TP targets.
📦 2-Hour Breakout Structure: The indicator plots a new set of dynamic zones every two hours, providing a fresh breakout structure based on the most recent price action. This is the default setting and is designed for intraday trading.
🎯 Precision Entry & Exit Levels: A central gray box is plotted, with Buy Stop and Sell Stop lines automatically placed 2 USD away from its borders. This buffer creates a neutral zone and helps filter out noise.
💰 Pre-Defined Profit Targets: Three Take Profit TP zones are plotted for both long and short trades TP1, TP2, TP3. These zones are spaced apart, providing clear targets for managing trades.
⚙️ Fully Customizable Spacing: Every element is adjustable. You can change the buffer between the gray box and stop lines, the gap between the stop lines and the first TP zone, and the gaps between each subsequent TP zone.
🔔 M1 Breakout Alerts: The indicator includes a powerful alerts module that triggers when an M1 candle closes above the Buy Stop level or below the Sell Stop level. This provides real-time notifications for potential trade entries.
🎨 Clean Visuals & Clear Labels: The zones are color-coded teal for buy-side, red/purple for sell-side for instant recognition. The Buy Stop and Sell Stop labels are also colored to match their respective directions, ensuring zero confusion.
⚙️ Trading Strategy & Logic
This strategy is designed for precision and requires patience. The core idea is to wait for the market to confirm a breakout of the established 2-hour range before entering a trade.
📌 Entry Logic
1. 🕒 Wait for a New Zone: Allow the indicator to plot a new 2-hour structure. Do not trade old or expired zones.
2. 🔔 Set Your Alerts: In TradingView, create a new alert and select the indicator. For the condition, choose "Any alert() function call" and set it to trigger "Once Per Bar Close". This will notify you the moment a candle closes across a stop level.
3. 👀 Wait for the M1 Close: For a Long Buy Trade, wait for an M1 candle to close above the Buy Stop line. For a Short Sell Trade, wait for an M1 candle to close below the Sell Stop line.
4. ✅ Enter on Confirmation: Once you receive the alert and visually confirm the M1 candle has closed past the level, you can enter the trade.
🛑 Stop Loss SL Placement
The stop loss is designed to be tight and objective, providing a clear invalidation of the trade idea.
⬇️ For a Long Trade, the Stop Loss should be placed at the Sell Stop line the level on the opposite side of the gray box.
⬆️ For a Short Trade, the Stop Loss should be placed at the Buy Stop line.
🎯 Take Profit TP Strategy
The indicator provides three clear targets. How you use them depends on your trade management style.
🥇 TP1: The first level of resistance/support. This is an ideal target for taking partial profits and moving your stop loss to breakeven.
🥈 TP2 & TP3: Subsequent targets for scaling out of the position or for your final profit target.
⚠️ IMPORTANT NOTICE
This indicator and the accompanying strategy are provided for educational purposes only. Trading financial markets involves substantial risk, and past performance is not indicative of future results. The logic described is based on a specific set of rules and does not guarantee profit. Always conduct your own analysis and risk management before entering any trade. The creators are not responsible for any financial losses incurred.
Pine Script®指標
Bullish Flag Breakout Alert//@version=5
indicator("Bullish Flag Breakout Alert", overlay=true)
// Inputs
flagLookback = input.int(15, "Flag High Lookback")
volMultiplier = input.float(1.5, "Volume Multiplier")
// Calculations
flagHigh = ta.highest(high, flagLookback)
avgVol = ta.sma(volume, 20)
// Breakout condition
breakout = close > flagHigh and volume > avgVol * volMultiplier
// Plot
plot(flagHigh, "Flag High", color=color.orange)
plotshape(breakout, style=shape.triangleup, location=location.belowbar,
color=color.green, size=size.small, text="BO")
// Alert
alertcondition(breakout, title="Bullish Flag Breakout")
Pine Script®指標
Volume Surge Breakout + TP/SL█ OVERVIEW
“Volume Surge Breakout + TP/SL” is a breakout indicator designed to capture strong momentum moves driven by sudden increases in trading volume and decisive price action. Instead of focusing on classical consolidation structures, the indicator reacts to volume-based impulses combined with candle strength, identifying moments when the market shifts out of short-term balance.
After a confirmed breakout, the indicator automatically plots the entry level, Stop Loss, and up to three Take Profit targets, making it a complete momentum-trading tool.
█ CONCEPTS
Strong market moves often begin with a sudden surge in volume, signaling increased participation and commitment from market participants. This indicator detects such moments by combining three core conditions:
- volume significantly above its average,
- a candle body clearly larger than the previous one,
- directional price close confirming bullish or bearish intent.
When these conditions are met, a momentum zone (box) is drawn around the signal candle. The box extends forward until a breakout occurs, which then triggers the entry signal and full TP/SL projection. A breakout in the opposite direction invalidates the zone, filtering out false impulses.
█ FEATURES
Volume filter
- volume > volume SMA × Volume Threshold (default 2.0×)
- adjustable volume average length (Volume SMA Length)
Candle strength filter
- current candle body > previous candle body × Body Multiplier
- removes weak and random price moves
Dynamic impulse zones (boxes)
- green for LONG, red for SHORT
- semi-transparent fill with colored borders
- boxes extend to the right until a breakout occurs
- opposite breakout deletes the zone
Breakout signals
- small green triangles below the bar (LONG)
- small red triangles above the bar (SHORT)
- signals appear only after a valid breakout from the zone
Volume strength display
- optional label showing the volume multiplier (e.g. 2.35×)
- color-coded to match trade direction
Automatic Take Profit & Stop Loss
- two SL calculation modes:
• ATR-based (default 1.5× ATR)
• Percentage-based from entry price
- up to 3 Take Profit levels based on Risk-to-Reward ratios
- independent visibility toggles for SL, TP1, TP2, TP3
- visual fills:
• red – risk zone
• green – reward zone
Single active trade logic
- TP/SL levels are locked once SL or the furthest TP is hit
- lines terminate exactly at the exit bar
Alerts
- LONG – bullish volume impulse
- SHORT – bearish volume impulse
█ HOW TO USE
Add the indicator to your TradingView chart → Indicators → search for
“Volume Surge Breakout + TP/SL”.
After each valid breakout, you will see:
- a volume impulse box,
- a breakout triangle,
- the entry line,
- SL and TP1–TP3 levels,
- a visual risk-to-reward projection.
Key settings to optimize:
Volume
- Volume SMA Length – averaging period for volume
- Volume Threshold – minimum volume multiplier
- Body Multiplier – required candle body expansion
TP / SL
- choose SL mode: ATR or Percentage
- ATR period and multiplier
- RR values for TP1, TP2, TP3
Signal interpretation:
- Green box + green triangle + TP above price = LONG
- Red box + red triangle + TP below price = SHORT
- No breakout = no trade (box remains observational)
█ APPLICATIONS
- Momentum and breakout trading across all timeframes
- Best used as an entry trigger, not as a standalone strategy
Recommended confluence-based approach:
The highest-quality signals occur when the breakout aligns with broader market context:
- higher-timeframe trend agreement
- breakout signal generated by the indicator
- increasing momentum (e.g. RSI, MACD, custom momentum oscillators)
- no major resistance/support levels directly in front of price
- volume impulse confirming market participation
Example:
If the market is in an uptrend, a LONG breakout signal appears, momentum is accelerating, and no nearby resistance is present, the trade is worth considering, using the automatically projected RR levels.
- Aggressive two-sided trading is possible but requires stricter signal selection
- Higher RR setups (e.g. TP3 = 3–5× SL) with lower win rates often outperform over time
█ NOTES
This indicator works only on markets with real volume data (e.g. stocks, futures, many crypto markets).
On instruments without real volume (such as some CFD indices), signals may be unreliable or the indicator may not function correctly.
Always test and optimize parameters for the specific instrument and timeframe. The indicator intentionally does not interpret market structure — its sole purpose is to identify clean volume-driven impulses.
Pine Script®指標
Occurrence Scanner | MA Resilience & Breakout LogicThis indicator is designed to quantify the reliability of a Moving Average (MA) as a dynamic Support or Resistance level. Unlike standard crossover indicators that generate signals on every touch, this script employs a rigorous "Zone Tolerance" and "Temporal Confirmation" logic to filter out noise and classify price action into three distinct behaviors: Valid Bounce, Confirmed Breakout, or False Breakout (Trap).
It also integrates an optional Volatility Filter (based on TTM Squeeze mechanics) to prevent false signals during low-volatility "chop" regimes.
HOW IT WORKS:
1. The "Safe Zone" (Buffer Logic): Standard MAs are thin lines. This script creates a programmable "Road" around the MA (defined by the Zone Tolerance % input).
A touch is only considered a potential breakout if the price closes outside this zone.
Wicks that pierce the MA but close inside the zone are treated as Bounces (respecting the level).
2. Event Classification (The Decision Engine): Once the price interacts with the MA Zone, a "Sovereignty Window" (Lookahead Timer) is activated to monitor the subsequent candles:
✅ Bounce: Price tests the MA but never closes outside the Safe Zone during the window. The MA held as support/resistance.
❌ Breakout (Breakdown/Breakup): Price closes outside the Safe Zone. A strict "2-Consecutive Close" logic is applied to confirm the trend change immediately, avoiding premature signals.
⚠️ False Break: Price momentarily closes outside the zone but aggressively reverses to the opposite side within the time window. This identifies "Bull/Bear Traps".
3. The Volatility Filter (Anti-Chop): Market consolidation often leads to MA whipsaws.
The script calculates Bollinger Bands (2.0 std) vs. Keltner Channels (1.5 ATR).
If the Squeeze Filter is enabled in settings, the script forces the scanner to IGNORE any MA touches while volatility is compressed (Squeeze ON). This ensures signals are only generated during active trends.
SETTINGS:
MA Type & Length: Choose between SMA or EMA and the period (e.g., 20, 50, 200).
Zone Tolerance (+/- %): The buffer width. Default is 0.2%. Higher values filter more noise.
Lookahead Candles: The confirmation window size.
Squeeze Filter: Toggle On/Off to ignore signals during low volatility regimes.
INTENDED USE: This tool is intended for Swing Traders and Scalpers looking to statistically validate which Moving Average is being respected by a specific asset. It automates the "visual backtest" process, providing a Dashboard with success rates for Bounces vs. Breaks.
Pine Script®指標






















