OPEN-SOURCE SCRIPT
AetherEdge - Order Block + FVG Detector

🖊️ Overview
AetherEdge Order Block + FVG Detector is a high-precision engine that integrates the two core elements of Smart Money Concepts (SMC)—Order Blocks (OB) and Fair Value Gaps (FVG)—to visualize institutional footprints on your chart. It features BOS (Break of Structure)-driven OB identification, automatic price gap mapping, mitigation tracking, and a beginner-friendly "Entry Zone" mode. The zone-based strategies practiced by professional traders are reproduced visually and systematically, all within a single indicator.
🔶 Key Features
BOS-Driven Order Block Detection: Auto-identifies the last opposite candle before structure break
Bullish/Bearish OB Support: Functions in both long and short scenarios
Auto Fair Value Gap Detection: Captures 3-bar price imbalances
Mitigation Tracking: Wick/Close toggle, Touch/50%/Full thresholds
Entry Zone Mode: 4 modes—OB only / FVG only / Either / Both overlap
Auto BOS Line Drawing: Visualizes structure break points
Active Zone Management: obMaxShow/fvgMaxShow retain only latest zones
Right-Side Auto Extension: Untouched zones extended forward
Integrated Dashboard: Active OB/FVG count, latest BOS direction
Premium AetherEdge UI: Dark-mode professional design
🧠 Technical Architecture
This indicator crystallizes SMC theory into implementable logic—a sophisticated zone detection engine.
Structure Detection (BOS Engine): ta.pivothigh/pivotlow detects swing points based on obSwingLen. lastSwingH/L updates dynamically; close > lastSwingH (with prior bar below) fires bosUp, and the inverse fires bosDown.
Order Block Identification Logic: On BOS trigger, scans up to 20 bars back for the "last opposite candle." On bullish BOS, the last bearish candle becomes Bull OB; on bearish BOS, the last bullish candle becomes Bear OB. This is the classical SMC logic capturing institutional "final accumulation/distribution points."
OB Data Structure: Custom type OB integrates box/top/bot/createdBar/bullish/mitigated/label. Array-based lifecycle management.
FVG Detection Logic: 3-bar pattern detects high[2] < low[0] (bullish FVG) or low[2] > high[0] (bearish FVG). fvgMinSize filters minimum gap size.
Mitigation Logic:
Wick mode: Consumed when wick reaches zone
Close mode: Consumed when close penetrates zone (stricter)
FVG uses Touch/50%/Full for graded judgment
Entry Zone Composition: 4 signal logics from OB+FVG overlap/standalone/selection modes. Both overlap = strongest confluence.
Dynamic Zone Management: Zones exceeding max array size auto-deleted, keeping chart clean.
⚙️ Recommended Settings & Tuning Guide
Crypto Defaults:
BTC (4H–Daily): obSwingLen=10, fvgMinSize=0.1, obMitigate=Wick (standard)
ETH (1H–4H): obSwingLen=8, fvgMinSize=0.05 for slightly higher sensitivity
SOL (High-Vol): obSwingLen=15, fvgMinSize=0.2 for large zones only
XRP (Range): obMitigate=Close, fvgFill=50% for strict judgment
Tuning Guide:
Day Trading: obSwingLen=8-10, obExtend=30-50, primary 1H
Swing: obSwingLen=20-30, obExtend=100 for macro zones
Scalping: obSwingLen=5, fvgMinSize=0.0 for short-term zones
Conservative Traders: ezRequire="Both overlap" for OB+FVG overlap only
Aggressive Traders: ezRequire="Either" to maximize signals
Excess Zones: obMaxShow=3, fvgMaxShow=5 to prioritize precision
Strong Trends: obSwingLen=15 for major structure only, avoiding fake BOS
💡 How to Use in Practice
Bull OB Retest: Price returning to Bull OB after BOS = golden long entry timing
FVG Fill Strategy: 50% gap fill confirms reversal, enter in trend direction
OB+FVG Overlap Zones: Both overlap mode pinpoints highest-conviction entries
BOS Line Break Confirmation: Retest after structure break confirms trend continuation
Multi-Timeframe Synergy: Higher-TF OB for direction + lower-TF FVG for precise entry
AetherEdge Synergy:
Self-Evolving S/R Grid strong line + OB overlap = triple confirmation
RSI Divergence Hunter signal + OB retest = max reversal conviction
Squeeze Breaker breakout direction + FVG fill = entry timing decision
Target Setting: Use opposite OB/FVG as profit-taking targets
⚠️ Important Notes
BOS Confirmation Lag: obSwingLen bars of confirmation delay; some real-time uncertainty
OB Search Range: No OB generated if no opposite candle exists within past 20 bars
Post-Mitigation Effect: Consumed OB/FVG tend to weaken; prioritize fresh zones
Consecutive BOS in Strong Trends: Mass OB generation possible in short periods; recommend limiting via obMaxShow
FVG Min Size: fvgMinSize=0 detects micro-gaps; tune based on market conditions
🚨 Disclaimer
This indicator is a technical analysis tool provided for educational and research purposes only and does not constitute financial advice. Order Block and FVG detection is a structural evaluation based on historical price data and does not guarantee future market behavior. All trading decisions are made at your own risk and should be accompanied by proper risk management.
AetherEdge Order Block + FVG Detector is a high-precision engine that integrates the two core elements of Smart Money Concepts (SMC)—Order Blocks (OB) and Fair Value Gaps (FVG)—to visualize institutional footprints on your chart. It features BOS (Break of Structure)-driven OB identification, automatic price gap mapping, mitigation tracking, and a beginner-friendly "Entry Zone" mode. The zone-based strategies practiced by professional traders are reproduced visually and systematically, all within a single indicator.
🔶 Key Features
BOS-Driven Order Block Detection: Auto-identifies the last opposite candle before structure break
Bullish/Bearish OB Support: Functions in both long and short scenarios
Auto Fair Value Gap Detection: Captures 3-bar price imbalances
Mitigation Tracking: Wick/Close toggle, Touch/50%/Full thresholds
Entry Zone Mode: 4 modes—OB only / FVG only / Either / Both overlap
Auto BOS Line Drawing: Visualizes structure break points
Active Zone Management: obMaxShow/fvgMaxShow retain only latest zones
Right-Side Auto Extension: Untouched zones extended forward
Integrated Dashboard: Active OB/FVG count, latest BOS direction
Premium AetherEdge UI: Dark-mode professional design
🧠 Technical Architecture
This indicator crystallizes SMC theory into implementable logic—a sophisticated zone detection engine.
Structure Detection (BOS Engine): ta.pivothigh/pivotlow detects swing points based on obSwingLen. lastSwingH/L updates dynamically; close > lastSwingH (with prior bar below) fires bosUp, and the inverse fires bosDown.
Order Block Identification Logic: On BOS trigger, scans up to 20 bars back for the "last opposite candle." On bullish BOS, the last bearish candle becomes Bull OB; on bearish BOS, the last bullish candle becomes Bear OB. This is the classical SMC logic capturing institutional "final accumulation/distribution points."
OB Data Structure: Custom type OB integrates box/top/bot/createdBar/bullish/mitigated/label. Array-based lifecycle management.
FVG Detection Logic: 3-bar pattern detects high[2] < low[0] (bullish FVG) or low[2] > high[0] (bearish FVG). fvgMinSize filters minimum gap size.
Mitigation Logic:
Wick mode: Consumed when wick reaches zone
Close mode: Consumed when close penetrates zone (stricter)
FVG uses Touch/50%/Full for graded judgment
Entry Zone Composition: 4 signal logics from OB+FVG overlap/standalone/selection modes. Both overlap = strongest confluence.
Dynamic Zone Management: Zones exceeding max array size auto-deleted, keeping chart clean.
⚙️ Recommended Settings & Tuning Guide
Crypto Defaults:
BTC (4H–Daily): obSwingLen=10, fvgMinSize=0.1, obMitigate=Wick (standard)
ETH (1H–4H): obSwingLen=8, fvgMinSize=0.05 for slightly higher sensitivity
SOL (High-Vol): obSwingLen=15, fvgMinSize=0.2 for large zones only
XRP (Range): obMitigate=Close, fvgFill=50% for strict judgment
Tuning Guide:
Day Trading: obSwingLen=8-10, obExtend=30-50, primary 1H
Swing: obSwingLen=20-30, obExtend=100 for macro zones
Scalping: obSwingLen=5, fvgMinSize=0.0 for short-term zones
Conservative Traders: ezRequire="Both overlap" for OB+FVG overlap only
Aggressive Traders: ezRequire="Either" to maximize signals
Excess Zones: obMaxShow=3, fvgMaxShow=5 to prioritize precision
Strong Trends: obSwingLen=15 for major structure only, avoiding fake BOS
💡 How to Use in Practice
Bull OB Retest: Price returning to Bull OB after BOS = golden long entry timing
FVG Fill Strategy: 50% gap fill confirms reversal, enter in trend direction
OB+FVG Overlap Zones: Both overlap mode pinpoints highest-conviction entries
BOS Line Break Confirmation: Retest after structure break confirms trend continuation
Multi-Timeframe Synergy: Higher-TF OB for direction + lower-TF FVG for precise entry
AetherEdge Synergy:
Self-Evolving S/R Grid strong line + OB overlap = triple confirmation
RSI Divergence Hunter signal + OB retest = max reversal conviction
Squeeze Breaker breakout direction + FVG fill = entry timing decision
Target Setting: Use opposite OB/FVG as profit-taking targets
⚠️ Important Notes
BOS Confirmation Lag: obSwingLen bars of confirmation delay; some real-time uncertainty
OB Search Range: No OB generated if no opposite candle exists within past 20 bars
Post-Mitigation Effect: Consumed OB/FVG tend to weaken; prioritize fresh zones
Consecutive BOS in Strong Trends: Mass OB generation possible in short periods; recommend limiting via obMaxShow
FVG Min Size: fvgMinSize=0 detects micro-gaps; tune based on market conditions
🚨 Disclaimer
This indicator is a technical analysis tool provided for educational and research purposes only and does not constitute financial advice. Order Block and FVG detection is a structural evaluation based on historical price data and does not guarantee future market behavior. All trading decisions are made at your own risk and should be accompanied by proper risk management.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.