Smart Structure Breaks & Order BlocksOverview (What it does)
The indicator “Smart Structure Breaks & Order Blocks” detects market structure using swing highs and lows, identifies Break of Structure (BOS) events, and automatically draws order blocks (OBs) from the origin candle. These zones extend to the right and change color/outline when mitigated or invalidated. By formalizing and automating part of discretionary analysis, it provides consistent zone recognition.
Main Components
Swing Detection: ta.pivothigh/ta.pivotlow identify confirmed swing points.
BOS Detection: Determines if the recent swing high/low is broken by close (strict mode) or crossover.
OB Creation: After a BOS, the opposite candle (bearish for bullish BOS, bullish for bearish BOS) is used to generate an order block zone.
Zone Management: Limits the number of zones, extends them to the right, and tracks tagged (mitigated) or invalidated states.
Input Parameters
Left/Right Pivot (default 6/6): Number of bars required on each side to confirm a swing. Higher values = smoother swings.
Max Zones (default 4): Maximum zones stored per direction (bull/bear). Oldest zones are overwritten.
Zone Confirmation Lookback (default 3): Ensures OB origin candle validity by checking recent highs/lows.
Show Swing Points (default ON): Displays triangles on swing highs/lows.
Require close for BOS? (default ON): Strict BOS (close required) vs loose BOS (line crossover).
Use candle body for zones (default OFF): Zones drawn from candle body (ON) or wick (OFF).
Signal Definition & Logic
Swing Updates: Latest confirmed pivots update lastHighLevel / lastLowLevel.
BOS (Break of Structure):
Bullish – close breaks last swing high.
Bearish – close breaks last swing low.
Only one valid BOS per swing (avoids duplicates).
OB Detection:
Bullish BOS → previous bearish candle with lowest low forms the OB.
Bearish BOS → previous bullish candle with highest high forms the OB.
Zones: Bull = green, Bear = red, semi-transparent, extended to the right.
Zone States:
Mitigated: Price touches the zone → border highlighted.
Invalidated:
Bull zone → close below → turns red.
Bear zone → close above → turns green.
Chart Appearance
Swing High: red triangle above bar
Swing Low: green triangle below bar
Bull OB: green zone (border highlighted on touch)
Bear OB: red zone (border highlighted on touch)
Invalid Zones: Bull zones turn reddish, Bear zones turn greenish
Practical Use (Trading Assistance)
Trend Following Entries: Buy pullbacks into green OBs in uptrends, sell rallies into red OBs in downtrends.
Focus on First Touch: First mitigation after BOS often has higher reaction probability.
Confluence: Combine with higher timeframe trend, volume, session levels, key price levels (previous highs/lows, VWAP, etc.).
Stops/Targets:
Bull – stop below zone, partial take profit at swing high or resistance.
Bear – stop above zone, partial take profit at swing low or support.
Parameter Tuning (per market/timeframe)
Pivot (6/6 → 4/4/8/8): Lower for scalping (3–5), medium for day trading (5–8), higher for swing trading (8–14). Increase to reduce noise.
Strict Break: ON to reduce false breaks in ranging markets; OFF for earlier signals.
Body Zones: ON for assets with long wicks, OFF for cleaner OBs in liquid instruments.
Zone Confirmation (default 3): Increase for stricter OB origin, fewer zones.
Max Zones (default 4 → 6–10): Increase for higher volatility, decrease to avoid clutter.
Strengths
Standardizes BOS and OB detection that is usually subjective.
Tracks mitigation and invalidation automatically.
Adaptable: allows body/wick zone switching for different instruments.
Limitations
Pivot-based: Signals appear only after pivots confirm (slight lag).
Zones reflect past balance: Can fail after new events (news, earnings, macro data).
Range-heavy markets: More false BOS; consider stricter settings.
Backtesting: This script is for drawing/visual aid; trading rules must be defined separately.
Workflow Example
Identify higher timeframe trend (4H/Daily).
On lower TF (15–60m), wait for BOS and new OB.
Enter on first mitigation with confirmation candle.
Stop beyond zone; targets based on R multiples and swing points.
FAQ
Q: Why are zones invalidated quickly?
A: Flow reversal after BOS. Adjust pivots higher, enable Strict mode, or switch to Body zones to reduce noise.
Q: What does “tagged” mean?
A: Price touched the zone once = mitigated. Implies some orders in that zone may have been filled.
Q: Body or Wick zones?
A: Wick zones are fine in clean markets. For volatile pairs with long wicks, body zones provide more realistic areas.
Customization Tips (Code perspective)
Zone storage: Currently ring buffer ((idx+1) % zoneLimit). Could prioritize keeping unmitigated zones.
Automated testing: Add strategy.entry/exit for rule-based backtests.
Multi-timeframe: Use request.security() for higher timeframe swings/BOS.
Visualization: Add labels for BOS bars, tag zones with IDs, count touches.
Summary
This indicator formalizes the cycle Swing → BOS → OB creation → Mitigation/Invalidation, providing consistent structure analysis and zone tracking. By tuning sensitivity and strictness, and combining with higher timeframe context, it enhances pullback/continuation trading setups. Always combine with proper risk management.
Smart-money-concepts
TrendSync Pro (SMC)📊 TrendSync Pro (SMC) – Advanced Trend-Following Strategy with HTF Alignment
Created by Shubham Singh
🔍 Strategy Overview
TrendSync Pro (SMC) is a precision-based smart trend-following strategy inspired by Smart Money Concepts (SMC). It combines: Real-time pivot-based trendline detection
Higher Time Frame (HTF) filtering to align trades with dominant trend
Risk management via adjustable Stop Loss (SL) and Take Profit (TP)
Directional control — trade only bullish, bearish, or both setups
Realistic backtesting using commissions and slippage
Pre-optimized profiles for scalpers, intraday, swing, and long-term traders
🧠 How It Works:
🔧 Strategy Settings Image:
beeimg.com
The strategy dynamically identifies trend direction by using swing high/low pivots. When a new pivot forms: It draws a trendline from the last significant pivot
Detects whether the trend is up (based on pivot lows) or down (based on pivot highs)
Waits for price to break above/below the trendline
Confirms with HTF price direction (HTF close > previous HTF close = bullish)
Only then it triggers a long or short trade
It exits either at TP, SL, or a manual trendline break
🛠️ Adjustable Parameters:
Trend Period: Length for pivot detection (affects sensitivity of trendlines)
HTF Timeframe: Aligns lower timeframe entries with higher timeframe direction
SL% and TP%: Customize your risk-reward profile
Commission & Slippage: Make backtests more realistic
Trade Direction: Choose to trade: Long only, Short only, or Both
🎛️ Trade Direction Control:
In settings, you can choose: Bullish Only: Executes only long entries
Bearish Only: Executes only short entries
Both: Executes both long and short entries when conditions are met
This allows you to align trades with your own market bias or external analysis.
📈 Entry Logic: Long Entry:
• Price crosses above trendline
• HTF is bullish (HTF close > previous close)
• Latest pivot is a low (trend is considered up)
Short Entry:
• Price crosses below trendline
• HTF is bearish (HTF close < previous close)
• Latest pivot is a high (trend is considered down)
📉 Exit Logic: Hit Take Profit or Stop Loss
Manual trendline invalidation: If price crosses opposite of the trend direction
⏰ Best Timeframes & Recommended Settings:
Scalping (1m to 5m):
HTF = 15m | Trend Period = 7
SL = 0.5% | TP = 1% to 2%
Intraday (15m to 30m):
HTF = 1H | Trend Period = 10–14
SL = 0.75% | TP = 2% to 3%
6 Hour Trading (30m to 1H):
HTF = 4H | Trend Period = 20
SL = 1% | TP = 4% to 6%
Swing Trading (4H to 1D):
HTF = 1D | Trend Period = 35
SL = 2% | TP = 8% to 12%
Long-Term Investing (1D+):
HTF = 1W | Trend Period = 50
SL = 3% | TP = 15%+
Note: These are recommended base settings. Adjust based on volatility, asset class, or personal trading style.
📸 Testing Note:
beeimg.com
TradingView limits test length to 20k bars (~40 trades on smaller timeframes). To show long-term results: Test on higher timeframes (e.g., 1H, 4H, 1D)
Share images of backtest result in description
Host longer test result screenshots on Imgur or any public drive
📍 Asset Behavior Insight:
This strategy works on multiple assets, including BTC, ETH, etc.
Performance varies by trend strength:
Sometimes BTC performs better than ETH
Other times ETH gives better results
That’s normal as both assets follow different volatility and trend behavior
It’s a trend-following setup. Longer and clearer the trend → better the results.
✅ Best Practices: Avoid ranging markets
Use proper SL/TP for each timeframe
Use directional filter if you already have a directional bias
Always forward test before going live
⚠️ Trading Disclaimer:
This script is for educational and backtesting purposes only. Trading involves risk. Always use risk management and never invest more than you can afford to lose.
Imbalance(FVG) DetectorImbalance (FVG) Detector
Overview
The Imbalance (FVG) Detector is a technical analysis tool designed to highlight price inefficiencies by identifying Fair Value Gaps (FVGs). These gaps occur when rapid price movement leaves an area with little to no traded volume, which may later act as a zone of interest. The indicator automatically detects and marks these imbalances on the chart, allowing users to observe historical price behavior more effectively.
Key Features
- Automatic Imbalance Detection: Identifies bullish and bearish imbalances based on a structured three-bar price action model.
- Customizable Sensitivity: Users can adjust the minimum imbalance percentage threshold to tailor detection settings to different assets and market conditions.
- Real-time Visualization: Marked imbalances are displayed as colored boxes directly on the chart.
- Dynamic Box Updates: Imbalance zones extend forward in time until price interacts with them.
- Alert System: Users can set alerts for when new imbalances appear or when price tests an existing imbalance.
How It Works
The indicator identifies market imbalances using a three-bar price structure:
- Bullish Imbalance: Occurs when the high of three bars ago is lower than the low of the previous bar, forming a price gap.
- Bearish Imbalance: Occurs when the low of three bars ago is higher than the high of the previous bar, creating a downward gap.
When an imbalance is detected:
- Green Boxes indicate bullish imbalances.
- Red Boxes indicate bearish imbalances.
- Once price interacts with an imbalance, the box fades to gray, marking it as tested.
! Designed for Crypto Markets
This indicator is particularly useful in crypto markets, where frequent volatility can create price inefficiencies. It provides a structured way to visualize gaps in price movement, helping users analyze historical liquidity areas.
Customization Options
- Min Imbalance Percentage Size: Adjusts the sensitivity of the imbalance detection.
- Alerts: Users can enable alerts to stay notified of new or tested imbalances.
Important Notes
- This indicator is a technical analysis tool and does not provide trading signals or financial advice.
- It does not predict future price movement but highlights historical price inefficiencies.
- Always use this tool alongside other market analysis methods and risk management strategies.
ADR/AWR/AMR Average Daily+Weekly+Monthly Range[Traders Reality]Advanced ADR/AWR/AMR indicator created for Traders Reality community, as well as the greater trading community.
Thanks to the TR community discord guys: infernix, peshocore and xtech5192
Everything is modular and can be turned on/off, including a customisable table showing daily/weekly/monthly average pips/dollars.
If you just want the average daily range lines for example, you can just disable everything else. You can choose how many days to look back; as well as for weeks or months.
Check out Traders Reality on YouTube if you want to see this implemented as part of Tino's strategy that utilizes market manipulation, imbalances, times of day etc.
Price regularly reverses from ADR, making it one of the few highly valuable indicators in price action/smart money trading.