Smart Money Concept [TradingFinder] Major OB + FVG + Liquidity🔵 Introduction 
"Smart Money" refers to funds under the control of institutional investors, central banks, funds, market makers, and other financial entities. Ordinary people recognize investments made by those who have a deep understanding of market performance and possess information typically inaccessible to regular investors as "Smart Money". 
Consequently, when market movements often diverge from expectations, traders identify the footprints of smart money. For example, when a classic pattern forms in the market, traders take short positions. However, the market might move upward instead. They attribute this contradiction to smart money and seek to capitalize on such inconsistencies in their trades.
The "Smart Money Concept" (SMC) is one of the primary styles of technical analysis that falls under the subset of "Price Action". Price action encompasses various subcategories, with one of the most significant being "Supply and Demand", in which SMC is categorized. 
The SMC method aims to identify trading opportunities by emphasizing the impact of large traders (Smart Money) on the market, offering specific patterns, techniques, and trading strategies.
🟣 Key Terms of Smart Money Concept (SMC) 
• Market Structure (Trend)
• Change of Character (ChoCh)
• Break of Structure (BoS)
• Order Blocks (Supply and Demand)
• Imbalance (IMB)
• Inefficiency (IFC)
• Fair Value Gap (FVG)
• Liquidity
• Premium and Discount
🔵 How Does the "Smart Money Concept Indicator" Work? 
🟣 Market Structure 
    a. Accumulation
    b. Market-Up
    c. Distribution
    d. Market-Down
a)  Accumulation Phase : During the accumulation period, typically following a downtrend, smart money enters the market without significantly affecting the pricing trend.
b)  Market-Up Phase : In this phase, the price of an asset moves upward from the accumulation range and begins to rise. Usually, the buying by retail investors is the main driver of this trend, and due to positive market sentiment, it continues.
c)  Distribution Phase : The distribution phase, unlike the accumulation stage, occurs after an uptrend. In this phase, smart money attempts to exit the market without causing significant price fluctuations.
d)  Market-Down Phase : In this stage, the price of an asset moves downward from the distribution phase, initiating a prolonged downtrend. Smart money liquidates all its positions by creating selling pressure, trapping latecomer investors.
The result of these four phases in the market becomes the market trend.
  
 Types of Trends in Financial Markets :
    a. Up-Trend
    b. Down Trend
    c. Range (No Trend)
a)  Up-Trend : The market breaks consecutive highs.
b)  Down Trend : The market breaks consecutive lows.
c)  No Trend or Range : The market oscillates within a range without breaking either highs or lows.
  
  
🟣 Change of Character (ChoCh) 
The "ChoCh" or "Change of Character" pattern indicates an initial change in order flow in financial markets. This structural change occurs when a major pivot in the opposite direction of the market trend fails. It signals a potential change in the market trend and can serve as a signal for short-term or long-term trend changes in a trading symbol.
🟣 Break of Structure (BoS) 
The "BoS" or "Break of Structure" pattern indicates the continuation of the trend in financial markets. This structure forms when, in an uptrend, the price breaks its ceiling or, in a downtrend, the price breaks its floor.
  
  
🟣 Order Blocks (Supply and Demand) 
Order blocks consist of supply and demand areas where the likelihood of price reversal is higher. There are six order blocks in this indicator, categorized based on their origin and formation reasons.
a. Demand Main Zone, "ChoCh" Origin.
b. Demand Sub Zone, "ChoCh" Origin.
c. Demand All Zone, "BoS" Origin.
d. Supply Main Zone, "ChoCh" Origin.
e. Supply Sub Zone, "ChoCh" Origin.
f. Supply All Zone, "BoS" Origin.
  
  
🟣 FVG | Inefficiency | Imbalance 
These three terms are almost synonymous. They describe the presence of gaps between consecutive candle shadows. This inefficiency occurs when the market moves rapidly. Primarily, imbalances and these rapid movements stem from the entry of smart money and the imbalance between buyer and seller power. Therefore, identifying these movements is crucial for traders.
These areas are significant because prices often return to fill these gaps or even before they occur to fill price gaps.
  
🟣 Liquidity 
Liquidity zones are areas where there is a likelihood of congestion of stop-loss orders. Liquidity is considered the driving force of the entire market, and market makers may manipulate the market using these zones. However, in many cases, this does not happen because there is insufficient liquidity in some areas. 
 Types of Liquidity in Financial Markets :
    a. Trend Lines
    b. Double Tops | Double Bottoms
    c. Triple Tops | Triple Bottoms
    d. Support Lines | Resistance Lines
All four types of liquidity in this indicator are automatically identified.
  
  
🟣 Premium and Discount 
Premium and discount zones can assist traders in making better decisions. For instance, they may sell positions in expensive ranges and buy in cheaper ranges. The closer the price is to the major resistance, the more expensive it is, and the closer it is to the major support, the cheaper it is.
🔵 How to Use 
🟣 Change of Character (ChoCh) and Break of Structure (BoS) 
This indicator detects "ChoCh" and "BoS" in both Minor and Major states. You can turn on the display of these lines by referring to the last part of the settings.
  
🟣 Order Blocks (Supply and Demand) 
Order blocks are Zones where the probability of price reversal is higher. In demand Zones you can buy opportunities and in supply Zones you can check sell opportunities.
The "Refinement" feature allows you to adjust the width of the order block according to your strategy. There are two modes, "Aggressive" and "Defensive," in the "Order Block Refine". The difference between "Aggressive" and "Defensive" lies in the width of the order block. 
For risk-averse traders, the "Defensive" mode is suitable as it provides a lower loss limit and a greater reward-to-risk ratio. For risk-taking traders, the "Aggressive" mode is more appropriate. These traders prefer to enter trades at higher prices, and this mode, which has a wider order block width, is more suitable for this group of individuals.
  
  
🟣 Fair Value Gap (FVG) | Imbalance (IMB) | Inefficiency (IFC) 
In order to identify the "fair value gap" on the chart, it must be analyzed candle by candle. In this process, it is important to pay attention to candles with a large size, and a candle and a candle should be examined before that. 
Candles before and after this central candle should have long shadows and their bodies should not overlap with the central candle body. The distance between the shadows of the first and third candles is known as the FVG range.
 These areas work in two ways :
•  Supply and demand area : In this case, the price reacts to these areas and the trend is reversed.
•  Liquidity zone : In this scenario, the price "fills" the zone and then reaches the order block.
 Important note : In most cases, the FVG zone of very small width acts as a supply and demand zone, while the zone of significant width acts as a liquidity zone and absorbs price.
When the FVG filter is activated, the FVG regions are filtered based on the specified algorithm.
 FVG filter types include the following :
1. Very Aggressive Mode : In addition to the initial condition, an additional condition is considered. For bullish FVG, the maximum price of the last candle must be greater than the maximum price of the middle candle. 
Similarly, for a bearish FVG, the minimum price of the last candle must be lower than the minimum price of the middle candle. This mode removes the minimum number of FVGs.
2. Aggressive : In addition to the very aggressive condition, the size of the middle candle is also considered. The size of the center candle should not be small and therefore more FVGs are removed in this case.
3. Defensive : In addition to the conditions of the very aggressive mode, this mode also considers the size of the middle pile, which should be relatively large and make up the majority of the body. 
Also, to identify bullish FVGs, the second and third candles must be positive, while for bearish FVGs, the second and third candles must be negative. This mode filters out a significant number of FVGs and keeps only those of good quality.
4. Very Defensive : In addition to the conditions of the defensive mode, in this mode the first and third candles should not be very small-bodied doji candles. This mode filters out most FVGs and only the best quality ones remain.
  
🟣 Liquidity 
These levels are where traders intend to exit their trades. "Market makers" or smart money usually accumulate or distribute their trading positions near these levels, where many retail traders have placed their "stop loss" orders. When liquidity is collected from these losses, the price often reverses.
A "Stop hunt" is a move designed to offset liquidity generated by established stop losses. Banks often use major news events to trigger stop hunts and capture liquidity released into the market. For example, if they intend to execute heavy buy orders, they encourage others to sell through stop-hots.
Consequently, if there is liquidity in the market before reaching the order block area, the validity of that order block is higher. Conversely, if the liquidity is close to the order block, that is, the price reaches the order block before reaching the liquidity limit, the validity of that order block is lower.
  
  
  
🟣 Alert 
With the new alert functionality in this indicator, you won't miss any important trading signals. Alerts are activated when the price hits the last order block.
1. It is possible to set alerts for each "symbol" and "time frame". The system will automatically detect both and include them in the warning message.
2. Each alert provides the exact date and time it was triggered. This helps you measure the timeliness of the signal and evaluate its relevance.
3. Alerts include target order block price ranges. The "Proximal" level represents the initial price level strike, while the "Distal" level represents the maximum price gap in the block. These details are included in the warning message.
4. You can customize the alert name through the "Alert Name" entry.
5. Create custom messages for "long" and "short" alerts to be sent with notifications.
  
🔵 Setting 
a.  Pivot Period of Order Blocks Detector : 
Using this parameter, you can set the zigzag period that is formed based on the pivots.
b.  Order Blocks Validity Period (Bar) : 
You can set the validity period of each Order Block based on the number of candles that have passed since the origin of the Order Block.
c.  Demand Main Zone, "ChoCh" Origin : 
You can control the display or not display as well as the color of Demand Main Zone, "ChoCh" Origin.
d.  Demand Sub Zone, "ChoCh" Origin : 
You can control the display or not display as well as the color of Demand Sub Zone, "ChoCh" Origin.
e.  Demand All Zone, "BoS" Origin : 
You can control the display or not display as well as the color of Demand All Zone, "BoS" Origin.
f.  Supply Main Zone, "ChoCh" Origin : 
You can control the display or not display as well as the color of Supply Main Zone, "ChoCh" Origin.
g.  Supply Sub Zone, "ChoCh" Origin : 
You can control the display or not display as well as the color of Supply Sub Zone, "ChoCh" Origin.
h.  Supply All Zone, "BoS" Origin : 
You can control the display or not display as well as the color of Supply All Zone, "BoS" Origin.
i.  Refine Demand Main : You can choose to be refined or not and also the type of refining.
j.  Refine Demand Sub : You can choose to be refined or not and also the type of refining. 
k.  Refine Demand BoS : You can choose to be refined or not and also the type of refining.
l.  Refine Supply Main : You can choose to be refined or not and also the type of refining.
m.  Refine Supply Sub : You can choose to be refined or not and also the type of refining.
n.  Refine Supply BoS : You can choose to be refined or not and also the type of refining.
o.  Show Demand FVG : You can choose to show or not show Demand FVG.
p.  Show Supply FVG : You can choose to show or not show Supply FVG
q.  FVG Filter : You can choose whether FVG is filtered or not. Also specify the type of filter you want to use.
r.  Show Statics High Liquidity Line : Show or not show Statics High Liquidity Line.
s.  Show Statics Low Liquidity Line : Show or not show Statics Low Liquidity Line.
t.  Show Dynamics High Liquidity Line : Show or not show Dynamics High Liquidity Line. 
u.  Show Dynamics Low Liquidity Line : Show or not show Dynamics Low Liquidity Line.
v.  Statics Period Pivot : 
Using this parameter, you can set the Swing period that is formed based on Static  Liquidity Lines.
w.  Dynamics Period Pivot :  
Using this parameter, you can set the Swing period that is formed based Dynamics Liquidity Lines.
x.  Statics Liquidity Line Sensitivity : 
is a number between 0 and 0.4. Increasing this number decreases the sensitivity of the "Statics Liquidity Line Detection" function and increases the number of lines identified. The default value is 0.3.
y.  Dynamics Liquidity Line Sensitivity :
is a number between 0.4 and 1.95. Increasing this number increases the sensitivity of the "Dynamics Liquidity Line Detection" function and decreases the number of lines identified. The default value is 1.
z.  Alerts Name : You can customize the alert name using this input and set it to your desired name.
aa.  Alert Demand Main Mitigation : 
If you want to receive the alert about Demand Main 's mitigation after setting the alerts, leave this tick on. Otherwise, turn it off.
bb.  Alert Demand Sub Mitigation : 
If you want to receive the alert about Demand Sub's mitigation after setting the alerts, leave this tick on. Otherwise, turn it off.
cc.  Alert Demand BoS Mitigation : 
If you want to receive the alert about Demand BoS's mitigation after setting the alerts, leave this tick on. Otherwise, turn it off.
dd.  Alert Supply Main Mitigation :
If you want to receive the alert about Supply Main's mitigation after setting the alerts, leave this tick on. Otherwise, turn it off.
ee.  Alert Supply Sub Mitigation : 
If you want to receive the alert about Supply Sub's mitigation after setting the alerts, leave this tick on. Otherwise, turn it off.
ff.  Alert Supply BoS Mitigation : 
If you want to receive the alert about Supply BoS's mitigation after setting the alerts, leave this tick on. Otherwise, turn it off.
gg.  Message Frequency : 
This parameter, represented as a string, determines the frequency of announcements. Options include: 'All' (triggers the alert every time the function is called), 'Once Per Bar' (triggers the alert only on the first call within the bar), and 'Once Per Bar Close' (activates the alert only during the final script execution of the real-time bar upon closure). The default setting is 'Once per Bar'.
hh.  Show Alert time by Time Zone : 
The date, hour, and minute displayed in alert messages can be configured to reflect any chosen time zone. For instance, if you prefer London time, you should input 'UTC+1'. By default, this input is configured to the 'UTC' time zone.
ii. Display More Info : The 'Display More Info' option provides details regarding the price range of the order blocks (Zone Price), along with the date, hour, and minute. If you prefer not to include this information in the alert message, you should set it to 'Off'.
 You also have access to display or not to display, choose the Style and Color of all the lines below :
a. Major Bullish "BoS" Lines
b. Major Bearish "BoS" Lines
c. Minor Bullish "BoS" Lines
d. Minor Bearish "BoS" Lines
e. Major Bullish "ChoCh" Lines
f. Major Bearish "ChoCh" Lines
g. Minor Bullish "ChoCh" Lines
h. Minor Bearish "ChoCh" Lines
i. Last Major Support Line
j. Last Major Resistance Line
k. Last Minor Support Line
l. Last Minor Resistance Line
Cari dalam skrip untuk "BOS"
FVG Radar [Mr_Rakun]The FVG Radar indicator is designed to automatically detect Fair Value Gaps (FVG) on your TradingView chart. It visually highlights bullish and bearish gaps with colored boxes and provides alerts when specific conditions are met.
How It Works
Fair Value Gap (FVG) Detection:
The script identifies gaps based on previous price action. A bullish FVG is recognized when there is a gap below a higher low candle, and a bearish FVG when there is a gap above a lower high candle.
Radar Area:
A yellow “Radar Area” box is drawn on the chart using upper and lower bands defined as a percentage above and below the current price. This area helps you visualize where the price is relative to these bands.
Alerts:
Alerts are triggered based on user-defined conditions:
When price crosses half of the gap (if the "Clear FVG When Price Reaches Half" option is enabled).
When price fully fills the gap (if the option is disabled).
The alert will only be activated after waiting a specified number of bars post-gap formation (as set by the "Wait X Bars After FVG Formation" parameter).
Input Parameters
Radar Upper Band (%):
Sets the upper threshold percentage relative to the current price for the radar area.
Radar Lower Band (%):
Sets the lower threshold percentage relative to the current price for the radar area.
Minimum FVG Size (%):
Determines the minimum size (as a percentage) for a gap to be recognized as a valid FVG.
Clear FVG When Price Reaches Half:
If enabled, the FVG will be cleared when the price reaches the midpoint of the gap. If disabled, the entire gap must be filled before it is cleared.
Wait X Bars After FVG Formation:
Specifies the number of bars to wait after an FVG is detected before triggering an alert. This delay helps to avoid premature alerts.
Bullish and Bearish FVG Colors and Opacity:
Customize the appearance of the FVG boxes for bullish (green) and bearish (red) gaps, including the opacity of these visual elements.
How to Use
Add the Indicator:
Load the FVG Radar indicator on your TradingView chart.
Customize Settings:
Adjust the input parameters based on your trading style and the market’s volatility. The radar area settings help you set your own visual reference for price deviations.
Monitor the Chart:
Watch for the colored boxes that represent FVGs. The boxes will display the size of the gap as a percentage.
Respond to Alerts:
When an alert is triggered after the specified number of bars, it indicates that the price has interacted with the gap. Use this information to guide your trading decisions.
Türkçe --------------------------------------------
FVG Radar göstergesi, TradingView grafiğinizde Fair Value Gap (FVG) – yani adil değer boşluklarını – otomatik olarak tespit etmek için tasarlanmıştır. Bu boşluklar, yükseliş ve düşüş boşluklarını farklı renkli kutularla vurgular ve belirli koşullar sağlandığında uyarılar verir.
Nasıl Çalışır
Fair Value Gap (FVG) Tespiti:
Gösterge, önceki fiyat hareketlerine dayalı olarak boşlukları belirler. Yükseliş boşluğu, düşük seviyenin yukarıdaki mumun altındaki boşlukla oluştuğu durumlarda; düşüş boşluğu ise, yüksek seviyenin aşağıdaki mumun üstünde boşluk oluştuğunda tespit edilir.
Radar Alanı:
Grafikte, mevcut fiyata göre belirlenen üst ve alt yüzde bantlarına dayalı olarak sarı renkte “Radar Alanı” kutusu çizilir. Bu alan, fiyatın bu bantlara göre nerede olduğunu görsel olarak anlamanıza yardımcı olur.
Uyarılar:
Kullanıcının belirlediği koşullara göre uyarılar verilir:
Fiyat, boşluğun yarısına ulaştığında (eğer "FVG'nin yarısına ulaştığında temizle" seçeneği etkinse).
Fiyat boşluğu tamamen doldurduğunda (seçenek devre dışı bırakıldığında).
Uyarı, boşluk oluşumundan sonra belirlenen bar sayısı kadar bekledikten sonra tetiklenir ("FVG Oluşumundan Sonra X Bar Bekle" parametresi).
Giriş Parametreleri
Radar Upper Band (%):
Mevcut fiyata göre radar alanı için üst eşik yüzdesini ayarlar.
Radar Lower Band (%):
Mevcut fiyata göre radar alanı için alt eşik yüzdesini ayarlar.
Minimum FVG Size (%):
Bir boşluğun geçerli bir FVG olarak tanınabilmesi için gereken minimum boyutu (yüzde olarak) belirler.
FVG'nin yarısına ulaştığında temizle:
Etkinse, fiyat boşluğun orta noktasına ulaştığında boşluk temizlenir. Devre dışı bırakılırsa, boşluğun tamamen doldurulması gerekir.
FVG Oluşumundan Sonra X Bar Bekle:
Bir FVG tespit edildikten sonra uyarı tetiklenmeden önce beklenmesi gereken bar sayısını belirler. Bu gecikme, erken uyarıların önüne geçmeyi amaçlar.
Yükseliş ve Düşüş FVG Renkleri ve Opaklık:
Yükseliş boşlukları (yeşil) ve düşüş boşlukları (kırmızı) için kutuların görünümünü ve opaklığını özelleştirmenize olanak tanır.
Nasıl Kullanılır
Göstergeyi Ekleyin:
FVG Radar göstergesini TradingView grafiğinize ekleyin.
Ayarları Özelleştirin:
Ticaret tarzınıza ve piyasanın oynaklığına göre giriş parametrelerini ayarlayın. Radar alanı ayarları, fiyat sapmalarını kendi görsel referansınızla tanımlamanıza yardımcı olur.
Grafiği İzleyin:
FVG’leri temsil eden renkli kutuları takip edin. Kutular, boşluğun yüzdelik büyüklüğünü gösterecektir.
Uyarılara Tepki Verin:
Belirlenen bar sayısı sonrasında tetiklenen uyarı, fiyatın boşluk ile etkileşime girdiğini gösterir. Bu bilgiyi, ticaret kararlarınızı yönlendirmek için kullanın.
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.
Sweep2Trade Pro [CHE]Sweep2Trade Pro \  — Liquidity Sweep → Trend → Confirmation 
Sweep2Trade Pro \  helps you catch high-probability reversals or continuations that start with a liquidity sweep, align with the T3 trend, and finalize with a structure confirmation (BOS). It’s designed to reduce noise, time your entries, and keep you out of weak, chop-driven signals.
  What’s a “sweep”? 
A liquidity sweep happens when price briefly breaks a prior swing high/low (where many stops sit), triggers those stops, and then snaps back. This “stop-hunt” creates liquidity for bigger players and often precedes a sharp move in the opposite direction if the break fails, or fuels continuation if structure actually shifts.
  What’s a BOS (Break of Structure)? 
A BOS is a price action event where the market takes out a recent swing level in the trend’s direction, signaling continuation and confirming that structure has shifted (bullish BOS through a recent swing high, bearish BOS through a recent swing low).
 How the indicator works (at a glance)
 1. Regime Filter (T3 + R²) 
    T3 Moving Average: A smoother, faster-responding moving average that aims to reduce lag while filtering noise, so trend direction changes are clearer.
    R² (Coefficient of Determination): Measures how “linear” the recent price path is (0→1). Higher values = stronger, cleaner trend; lower values = more chop. Used here to allow trades only when trend quality exceeds a user-set threshold.
 2. Sweep Detection 
    Bullish sweep: price pokes below a prior swing low and closes back above it.
    Bearish sweep: price pokes above a prior swing high and closes back below it.
    Lookback length is configurable.
 3. Sequence Lock (built-in FSM) 
   The script manages state in phases so you don’t jump the gun:
    Phase 1: Sweep detected → wait for T3 to turn in the corresponding direction.
    Phase 2: T3 direction confirmed → show “SWEEP OK” and wait for final confirmation.
    Trade Signal: Only fires if confirmation arrives before a timeout.
 4. Confirmation Layer 
    BOS via wick or close (you choose),
    Strong close toward the signal (top/bottom quartile of the candle),
    Optional “close above/below T3” condition.
     These checks help avoid weak sweeps that immediately fade.
 5. Alerts & Visuals 
    “SWEEP OK” markers show when the sweep + T3 direction align.
    Final BUY/SELL arrows appear only when the confirmation layer passes.
    Ready-made alert conditions for automation.
  What you can do with it 
 Time reversals after sweeps: Enter when a stop-hunt fades and structure confirms.
 Ride continuations: Use BOS with the T3 trend to pyramid or re-enter with structure on your side.
 Filter chop: Let R² gate entries to periods with cleaner directional drift.
 Automate: Use the included alerts with your platform or webhook setup.
  Inputs (key settings) 
 Regime Filter
   T3 Length / Volume Factor: Controls smoothness and responsiveness. Smaller length → faster, more sensitive; higher volume factor → smoother curve.
   R² Lookback & Threshold: Length of the linear fit window and the minimum “trend quality” required. Higher thresholds mean fewer, cleaner signals.
  Sweep / Sequence 
   Swing Lookback: How far back to define the “reference” high/low for sweeps.
   Timeout: Maximum bars allowed between phases to keep signals fresh.
   Restart timeout on Phase 2: Optional safety so entries don’t go stale.
 Confirmation
   BOS Lookback: Micro-pivot window for structure breaks.
   Wick vs Close BOS: Conservative traders may prefer close.
   Require close above/below T3: Tightens confirmation with trend alignment.
  Practical guide (quick start) 
1. Timeframe & markets: Works across majors, indices, and crypto. Start with 5m–1h intraday or 1h–4h swing; adjust R² threshold upward on noisier pairs.
2. Entry recipe (Long):
    Bullish sweep of a prior low → T3 turns up → BOS/strong close.
    Optional: enable “close above T3” for extra confirmation.
3. Entry recipe (Short): Mirror the above.
4. Stops: Common choices are just beyond the sweep wick (tighter) or past the BOS invalidation (safer).
5. Targets: Previous structural levels, measured move, or a T3 trail (exit when price closes back through T3).
6. Avoid low-quality contexts: If R² is very low, market is likely ranging erratically—skip or widen filters.
  Tips & best practices 
 Context first: The same sweep means different things in a strong trend vs. flat regime; that’s why the T3+R² filter exists.
 BOS choice: Wick-based BOS is earlier but noisier; close-based BOS is slower but cleaner. Tune per market.
 Backtest -> Forward test: Validate settings per symbol/timeframe; then paper trade before going live.
 Risk: Fixed fractional risk with asymmetric R\:R (e.g., 1:1.5–1:3) generally performs better than “all-in” discretionary sizing.
  Behind the scenes (for the curious) 
 T3 is a multi-stage EMA construction that produces a smooth curve with reduced lag versus simple/standard EMAs.
 R² is the square of correlation (0–1). Here it’s used as a moving gauge of how well price aligns to a linear path—our “trend quality” dial.
 Stop-hunts / sweeps are a recognized microstructure phenomenon where clustered stops provide the liquidity that fuels the next move.
  Disclaimer 
No indicator guarantees profits. Sweep2Trade Pro \  is a decision aid; always combine with solid risk management and your own judgment. Backtest, forward test, and size responsibly.
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Enhance your trading precision and confidence 🚀
Happy trading
Chervolino
Contrarian 100 MAPairs nicely with Enhanced-Stock-Ticker-with-50MA-vs-200MA located here:
Description
The Contrarian 100 MA is a sophisticated Pine Script v6 indicator designed for traders seeking to identify key market structure shifts and trend reversals using a combination of a 100-period Simple Moving Average (SMA) envelope and Inner Circle Trader (ICT) Break of Structure (BoS) and Market Structure Shift (MSS) logic. By overlaying a semi-transparent SMA-based shadow on the price chart and plotting bullish and bearish structure signals, this indicator helps traders visualize critical price levels and potential trend changes. It leverages higher timeframe (HTF) pivot points and dynamic logic to adapt to various chart timeframes, making it ideal for swing and contrarian trading strategies. Customizable colors, timeframes, and alert conditions enhance its versatility for manual and automated trading setups.
Key Features
SMA Envelope: Plots a 100-period SMA for high and low prices, creating a semi-transparent (50% opacity) purple shadow to highlight the price range and provide context for price movements.
ICT BoS/MSS Logic: Identifies Break of Structure (BoS) and Market Structure Shift (MSS) signals for both bullish and bearish conditions, based on HTF pivot points.
Dynamic Timeframe Support: Adjusts pivot detection based on user-selected HTF (default: 1D) and chart timeframe (1M, 5M, 15M, 30M, 1H, 4H, 1D), ensuring adaptability across markets.
Visual Signals: Draws dotted lines for BoS (bullish/bearish) and MSS (bullish/bearish) signals at pivot levels, with customizable colors for easy identification.
Contrarian Approach: Signals potential reversals by combining SMA context with ICT structure breaks, ideal for traders looking to capitalize on trend shifts.
Alert Conditions: Supports alerts for bullish/bearish BoS and MSS signals, enabling integration with TradingView’s alert system for automated trading.
Performance Optimization: Uses efficient pivot detection and line management to minimize resource usage while maintaining accuracy.
Technical Details
SMA Calculation:
Computes 100-period SMAs for high (smaHigh) and low (smaLow) prices.
Plots invisible SMAs (fully transparent) and fills the area between them with 50% transparent purple for visual context.
Pivot Detection:
Uses ta.pivothigh and ta.pivotlow to identify HTF swing points, with dynamic lookback periods (rlBars: 5 for daily, 2 for intraday).
Tracks pivot highs (pH, nPh) and lows (pL, nPl) using a custom piv type for price and time.
BoS/MSS Logic:
Bullish BoS: Triggered when price breaks above a pivot high in a bullish trend, drawing a line at the pivot level.
Bearish BoS: Triggered when price breaks below a pivot low in a bearish trend.
Bullish MSS: Occurs when price breaks a pivot high in a bearish trend, signaling a potential trend reversal.
Bearish MSS: Occurs when price breaks a pivot low in a bullish trend.
Lines are drawn using line.new with xloc.bar_time for precise alignment, styled as dotted with customizable colors.
HTF Integration: Fetches HTF close prices and pivot data using request.security with lookahead_on for accurate signal timing.
Line Management: Maintains an array of lines (lin), removing outdated lines when new MSS signals occur to keep the chart clean.
Pivot Reset: Clears broken pivots (e.g., when price exceeds a pivot high or falls below a pivot low) to ensure fresh signal generation.
How to Use
Add to Chart:
Copy the script into TradingView’s Pine Editor and apply it to your chart.
Configure Settings:
SMA Length: Adjust the SMA period (default: 100 bars) to suit your trading style.
Structure Timeframe: Set the HTF for pivot detection (default: 1D).
Chart Timeframe: Select the chart timeframe (1M, 5M, 15M, 30M, 1H, 4H, 1D) to adjust pivot sensitivity.
Colors: Customize bullish/bearish BoS and MSS line colors via input settings.
Interpret Signals:
Bullish BoS: White dotted line (default) at a broken pivot high in a bullish trend, indicating trend continuation.
Bearish BoS: White dotted line at a broken pivot low in a bearish trend.
Bullish MSS: White dotted line at a broken pivot high in a bearish trend, suggesting a reversal to bullish.
Bearish MSS: White dotted line at a broken pivot low in a bullish trend, suggesting a reversal to bearish.
Use the SMA shadow to gauge price position within the recent range.
Set Alerts:
Create alerts for bullish/bearish BoS and MSS signals using TradingView’s alert system.
Customize Visuals:
Adjust line colors or SMA fill transparency via TradingView’s settings for better visibility.
Example Use Cases
Swing Trading: Use MSS signals to enter trades at potential trend reversals, with the SMA envelope confirming price extremes.
Contrarian Trading: Capitalize on BoS and MSS signals to trade against prevailing trends, using the SMA shadow for context.
Automated Trading: Integrate BoS/MSS alerts with trading bots for systematic entries and exits.
Multi-Timeframe Analysis: Combine HTF signals (e.g., 1D) with lower timeframe charts (e.g., 1H) for precise entries.
Notes
Testing: Backtest the indicator on your chosen market and timeframe to validate performance.
Compatibility: Built for Pine Script v6 and tested on TradingView as of June 19, 2025.
Limitations: Signals rely on HTF pivot accuracy, which may lag in fast-moving markets. Adjust rlBars or timeframe for sensitivity.
Optional Enhancements: Consider uncommenting or adding a histogram for SMA divergence (e.g., smaHigh - smaLow) for additional insights.
Acknowledgments
This indicator combines ICT’s market structure concepts with a dynamic SMA envelope to provide a unique contrarian trading tool. Share your feedback or suggestions in the TradingView comments, and happy trading!
lib_smcLibrary   "lib_smc" 
This is an adaptation of LuxAlgo's Smart Money Concepts indicator with numerous changes. Main changes include integration of object based plotting, plenty of performance improvements, live tracking of Order Blocks, integration of volume profiles to refine Order Blocks, and many more.
This is a library for developers, if you want this converted into a working strategy, let me know. 
 buffer(item, len, force_rotate) 
  Parameters:
     item (float) 
     len (int) 
     force_rotate (bool) 
 buffer(item, len, force_rotate) 
  Parameters:
     item (int) 
     len (int) 
     force_rotate (bool) 
 buffer(item, len, force_rotate) 
  Parameters:
     item (Profile type from robbatt/lib_profile/32) 
     len (int) 
     force_rotate (bool) 
 swings(len) 
  INTERNAL: detect swing points (HH and LL) in given range
  Parameters:
     len (simple int) : range to check for new swing points
  Returns:   values are the price level where and if a new HH or LL was detected, else na
 method init(this) 
  Namespace types: OrderBlockConfig
  Parameters:
     this (OrderBlockConfig) 
 method delete(this) 
  Namespace types: OrderBlock
  Parameters:
     this (OrderBlock) 
 method clear_broken(this, broken_buffer) 
  INTERNAL: delete internal order blocks box coordinates if top/bottom is broken
  Namespace types: map
  Parameters:
     this (map) 
     broken_buffer (map) 
  Returns: any_bull_ob_broken, any_bear_ob_broken, broken signals are true if an according order block was broken/mitigated, broken contains the broken block(s)
 create_ob(id, mode, start_t, start_i, top, end_t, end_i, bottom, break_price, early_confirmation_price, config, init_plot, force_overlay) 
  INTERNAL: set internal order block coordinates
  Parameters:
     id (int) 
     mode (int) : 1: bullish, -1 bearish block
     start_t (int) 
     start_i (int) 
     top (float) 
     end_t (int) 
     end_i (int) 
     bottom (float) 
     break_price (float) 
     early_confirmation_price (float) 
     config (OrderBlockConfig) 
     init_plot (bool) 
     force_overlay (bool) 
  Returns:   signals are true if an according order block was broken/mitigated
 method align_to_profile(block, align_edge, align_break_price) 
  Namespace types: OrderBlock
  Parameters:
     block (OrderBlock) 
     align_edge (bool) 
     align_break_price (bool) 
 method create_profile(block, opens, tops, bottoms, closes, values, resolution, vah_pc, val_pc, args, init_calculated, init_plot, force_overlay) 
  Namespace types: OrderBlock
  Parameters:
     block (OrderBlock) 
     opens (array) 
     tops (array) 
     bottoms (array) 
     closes (array) 
     values (array) 
     resolution (int) 
     vah_pc (float) 
     val_pc (float) 
     args (ProfileArgs type from robbatt/lib_profile/32) 
     init_calculated (bool) 
     init_plot (bool) 
     force_overlay (bool) 
 method create_profile(block, resolution, vah_pc, val_pc, args, init_calculated, init_plot, force_overlay) 
  Namespace types: OrderBlock
  Parameters:
     block (OrderBlock) 
     resolution (int) 
     vah_pc (float) 
     val_pc (float) 
     args (ProfileArgs type from robbatt/lib_profile/32) 
     init_calculated (bool) 
     init_plot (bool) 
     force_overlay (bool) 
 track_obs(swing_len, hh, ll, top, btm, bull_bos_alert, bull_choch_alert, bear_bos_alert, bear_choch_alert, min_block_size, max_block_size, config_bull, config_bear, init_plot, force_overlay, enabled, extend_blocks, clear_broken_buffer_before, align_edge_to_value_area, align_break_price_to_poc, profile_args_bull, profile_args_bear, use_soft_confirm, soft_confirm_offset, use_retracements_with_FVG_out) 
  Parameters:
     swing_len (int) 
     hh (float) 
     ll (float) 
     top (float) 
     btm (float) 
     bull_bos_alert (bool) 
     bull_choch_alert (bool) 
     bear_bos_alert (bool) 
     bear_choch_alert (bool) 
     min_block_size (float) 
     max_block_size (float) 
     config_bull (OrderBlockConfig) 
     config_bear (OrderBlockConfig) 
     init_plot (bool) 
     force_overlay (bool) 
     enabled (bool) 
     extend_blocks (simple bool) 
     clear_broken_buffer_before (simple bool) 
     align_edge_to_value_area (simple bool) 
     align_break_price_to_poc (simple bool) 
     profile_args_bull (ProfileArgs type from robbatt/lib_profile/32) 
     profile_args_bear (ProfileArgs type from robbatt/lib_profile/32) 
     use_soft_confirm (simple bool) 
     soft_confirm_offset (float) 
     use_retracements_with_FVG_out (simple bool) 
 method draw(this, config, extend_only) 
  Namespace types: OrderBlock
  Parameters:
     this (OrderBlock) 
     config (OrderBlockConfig) 
     extend_only (bool) 
 method draw(blocks, config) 
  INTERNAL: plot order blocks
  Namespace types: array
  Parameters:
     blocks (array) 
     config (OrderBlockConfig) 
 method draw(blocks, config) 
  INTERNAL: plot order blocks
  Namespace types: map
  Parameters:
     blocks (map) 
     config (OrderBlockConfig) 
 method cleanup(this, ob_bull, ob_bear) 
  removes all Profiles that are older than the latest OrderBlock from this profile buffer
  Namespace types: array
  Parameters:
     this (array type from robbatt/lib_profile/32) 
     ob_bull (OrderBlock) 
     ob_bear (OrderBlock) 
 _plot_swing_points(mode, x, y, show_swing_points, linecolor_swings, keep_history, show_latest_swings_levels, trail_x, trail_y, trend) 
  INTERNAL: plot swing points
  Parameters:
     mode (int) : 1: bullish, -1 bearish block
     x (int) : x-coordingate of swing point to plot (bar_index)
     y (float) : y-coordingate of swing point to plot (price)
     show_swing_points (bool) : switch to enable/disable plotting of swing point labels
     linecolor_swings (color) : color for swing point labels and lates level lines
     keep_history (bool) : weater to remove older swing point labels and only keep the most recent
     show_latest_swings_levels (bool) 
     trail_x (int) : x-coordinate for latest swing point (bar_index)
     trail_y (float) : y-coordinate for latest swing point (price)
     trend (int) : the current trend 1: bullish, -1: bearish, to determine Strong/Weak Low/Highs
 _pivot_lvl(mode, trend, hhll_x, hhll, super_hhll, filter_insignificant_internal_breaks) 
  INTERNAL: detect whether a structural level has been broken and if it was in trend direction (BoS) or against trend direction (ChoCh), also track the latest high and low swing points
  Parameters:
     mode (simple int) : detect 1: bullish, -1 bearish pivot points
     trend (int) : current trend direction
     hhll_x (int) : x-coordinate of newly detected hh/ll (bar_index)
     hhll (float) : y-coordinate of newly detected hh/ll (price)
     super_hhll (float) : level/y-coordinate of superior hhll (if this is an internal structure pivot level)
     filter_insignificant_internal_breaks (bool) : if true pivot points / internal structure will be ignored where the wick in trend direction is longer than the opposite (likely to push further in direction of main trend)
  Returns:   coordinates of internal structure that has been broken (x,y): start of structure, (trail_x, trail_y): tracking hh/ll after structure break, (bos_alert,  choch_alert): signal whether a structural level has been broken
 _plot_structure(x, y, is_bos, is_choch, line_color, line_style, label_style, label_size, keep_history) 
  INTERNAL: plot structural breaks (BoS/ChoCh)
  Parameters:
     x (int) : x-coordinate of newly broken structure (bar_index)
     y (float) : y-coordinate of newly broken structure (price)
     is_bos (bool) : whether this structural break was in trend direction
     is_choch (bool) : whether this structural break was against trend direction
     line_color (color) : color for the line connecting the structural level and the breaking candle
     line_style (string) : style (line.style_dashed/solid) for the line connecting the structural level and the breaking candle
     label_style (string) : style (label.style_label_down/up) for the label above/below the line connecting the structural level and the breaking candle
     label_size (string) : size (size.small/tiny) for the label above/below the line connecting the structural level and the breaking candle
     keep_history (bool) : weater to remove older swing point labels and only keep the most recent
 structure_values(length, super_hh, super_ll, filter_insignificant_internal_breaks) 
  detect (and plot) structural breaks and the resulting new trend
  Parameters:
     length (simple int) : lookback period for swing point detection
     super_hh (float) : level/y-coordinate of superior hh (for internal structure detection)
     super_ll (float) : level/y-coordinate of superior ll (for internal structure detection)
     filter_insignificant_internal_breaks (bool) : if true pivot points / internal structure will be ignored where the wick in trend direction is longer than the opposite (likely to push further in direction of main trend)
  Returns:   trend: direction 1:bullish -1:bearish, (bull_bos_alert, bull_choch_alert, top_x, top_y, trail_up_x, trail_up): whether and which level broke in a bullish direction, trailing high, (bbear_bos_alert, bear_choch_alert, tm_x, btm_y, trail_dn_x, trail_dn): same in bearish direction
 structure_plot(trend, bull_bos_alert, bull_choch_alert, top_x, top_y, trail_up_x, trail_up, hh, bear_bos_alert, bear_choch_alert, btm_x, btm_y, trail_dn_x, trail_dn, ll, color_bull, color_bear, show_swing_points, show_latest_swings_levels, show_bos, show_choch, line_style, label_size, keep_history) 
  detect (and plot) structural breaks and the resulting new trend
  Parameters:
     trend (int) : crrent trend 1: bullish, -1: bearish
     bull_bos_alert (bool) : if there was a bullish bos alert -> plot it
     bull_choch_alert (bool) : if there was a bullish choch alert -> plot it
     top_x (int) : latest shwing high x
     top_y (float) : latest swing high y
     trail_up_x (int) : trailing high x
     trail_up (float) : trailing high y
     hh (float) : if there was a higher high
     bear_bos_alert (bool) : if there was a bearish bos alert -> plot it
     bear_choch_alert (bool) : if there was a bearish chock alert -> plot it
     btm_x (int) : latest swing low x
     btm_y (float) : latest swing low y
     trail_dn_x (int) : trailing low x
     trail_dn (float) : trailing low y
     ll (float) : if there was a lower low
     color_bull (color) : color for bullish BoS/ChoCh levels
     color_bear (color) : color for bearish BoS/ChoCh levels
     show_swing_points (bool) : whether to plot swing point labels
     show_latest_swings_levels (bool) : whether to track and plot latest swing point levels with lines
     show_bos (bool) : whether to plot BoS levels
     show_choch (bool) : whether to plot ChoCh levels
     line_style (string) : whether to plot BoS levels
     label_size (string) : label size of plotted BoS/ChoCh levels
     keep_history (bool) : weater to remove older swing point labels and only keep the most recent
 structure(length, color_bull, color_bear, super_hh, super_ll, filter_insignificant_internal_breaks, show_swing_points, show_latest_swings_levels, show_bos, show_choch, line_style, label_size, keep_history, enabled) 
  detect (and plot) structural breaks and the resulting new trend
  Parameters:
     length (simple int) : lookback period for swing point detection
     color_bull (color) : color for bullish BoS/ChoCh levels
     color_bear (color) : color for bearish BoS/ChoCh levels
     super_hh (float) : level/y-coordinate of superior hh (for internal structure detection)
     super_ll (float) : level/y-coordinate of superior ll (for internal structure detection)
     filter_insignificant_internal_breaks (bool) : if true pivot points / internal structure will be ignored where the wick in trend direction is longer than the opposite (likely to push further in direction of main trend)
     show_swing_points (bool) : whether to plot swing point labels
     show_latest_swings_levels (bool) : whether to track and plot latest swing point levels with lines
     show_bos (bool) : whether to plot BoS levels
     show_choch (bool) : whether to plot ChoCh levels
     line_style (string) : whether to plot BoS levels
     label_size (string) : label size of plotted BoS/ChoCh levels
     keep_history (bool) : weater to remove older swing point labels and only keep the most recent
     enabled (bool) 
 _check_equal_level(mode, len, eq_threshold, enabled) 
  INTERNAL: detect equal levels (double top/bottom)
  Parameters:
     mode (int) : detect 1: bullish/high, -1 bearish/low pivot points
     len (int) : lookback period for equal level (swing point) detection
     eq_threshold (float) : maximum price offset for a level to be considered equal
     enabled (bool) 
  Returns:   eq_alert whether an equal level was detected and coordinates of the first and the second level/swing point
 _plot_equal_level(show_eq, x1, y1, x2, y2, label_txt, label_style, label_size, line_color, line_style, keep_history) 
  INTERNAL: plot equal levels (double top/bottom)
  Parameters:
     show_eq (bool) : whether to plot the level or not
     x1 (int) : x-coordinate of the first level / swing point
     y1 (float) : y-coordinate of the first level / swing point
     x2 (int) : x-coordinate of the second level / swing point
     y2 (float) : y-coordinate of the second level / swing point
     label_txt (string) : text for the label above/below the line connecting the equal levels
     label_style (string) : style (label.style_label_down/up) for the label above/below the line connecting the equal levels
     label_size (string) : size (size.tiny) for the label above/below the line connecting the equal levels
     line_color (color) : color for the line connecting the equal levels (and it's label)
     line_style (string) : style (line.style_dotted) for the line connecting the equal levels
     keep_history (bool) : weater to remove older swing point labels and only keep the most recent
 equal_levels_values(len, threshold, enabled) 
  detect (and plot) equal levels (double top/bottom), returns coordinates
  Parameters:
     len (int) : lookback period for equal level (swing point) detection
     threshold (float) : maximum price offset for a level to be considered equal
     enabled (bool) : whether detection is enabled
  Returns:   (eqh_alert, eqh_x1, eqh_y1, eqh_x2, eqh_y2) whether an equal high was detected and coordinates of the first and the second level/swing point, (eql_alert, eql_x1, eql_y1, eql_x2, eql_y2) same for equal lows
 equal_levels_plot(eqh_x1, eqh_y1, eqh_x2, eqh_y2, eql_x1, eql_y1, eql_x2, eql_y2, color_eqh, color_eql, show, keep_history) 
  detect (and plot) equal levels (double top/bottom), returns coordinates
  Parameters:
     eqh_x1 (int) : coordinates of first point of equal high
     eqh_y1 (float) : coordinates of first point of equal high
     eqh_x2 (int) : coordinates of second point of equal high
     eqh_y2 (float) : coordinates of second point of equal high
     eql_x1 (int) : coordinates of first point of equal low
     eql_y1 (float) : coordinates of first point of equal low
     eql_x2 (int) : coordinates of second point of equal low
     eql_y2 (float) : coordinates of second point of equal low
     color_eqh (color) : color for the line connecting the equal highs (and it's label)
     color_eql (color) : color for the line connecting the equal lows (and it's label)
     show (bool) : whether plotting is enabled
     keep_history (bool) : weater to remove older swing point labels and only keep the most recent
  Returns:   (eqh_alert, eqh_x1, eqh_y1, eqh_x2, eqh_y2) whether an equal high was detected and coordinates of the first and the second level/swing point, (eql_alert, eql_x1, eql_y1, eql_x2, eql_y2) same for equal lows
 equal_levels(len, threshold, color_eqh, color_eql, enabled, show, keep_history) 
  detect (and plot) equal levels (double top/bottom)
  Parameters:
     len (int) : lookback period for equal level (swing point) detection
     threshold (float) : maximum price offset for a level to be considered equal
     color_eqh (color) : color for the line connecting the equal highs (and it's label)
     color_eql (color) : color for the line connecting the equal lows (and it's label)
     enabled (bool) : whether detection is enabled
     show (bool) : whether plotting is enabled
     keep_history (bool) : weater to remove older swing point labels and only keep the most recent
  Returns:   (eqh_alert) whether an equal high was detected, (eql_alert) same for equal lows
 _detect_fvg(mode, enabled, o, h, l, c, filter_insignificant_fvgs, change_tf) 
  INTERNAL: detect FVG (fair value gap)
  Parameters:
     mode (int) : detect 1: bullish, -1 bearish gaps
     enabled (bool) : whether detection is enabled
     o (float) : reference source open
     h (float) : reference source high
     l (float) : reference source low
     c (float) : reference source close
     filter_insignificant_fvgs (bool) : whether to calculate and filter small/insignificant gaps
     change_tf (bool) : signal when the previous reference timeframe closed, triggers new calculation
  Returns:   whether a new FVG was detected and its top/mid/bottom levels
 _clear_broken_fvg(mode, upper_boxes, lower_boxes) 
  INTERNAL: clear mitigated FVGs (fair value gaps)
  Parameters:
     mode (int) : detect 1: bullish, -1 bearish gaps
     upper_boxes (array) : array that stores the upper parts of the FVG boxes
     lower_boxes (array) : array that stores the lower parts of the FVG boxes
 _plot_fvg(mode, show, top, mid, btm, border_color, extend_box) 
  INTERNAL: plot (and clear broken) FVG (fair value gap)
  Parameters:
     mode (int) : plot 1: bullish, -1 bearish gap
     show (bool) : whether plotting is enabled
     top (float) : top level of fvg
     mid (float) : center level of fvg
     btm (float) : bottom level of fvg
     border_color (color) : color for the FVG box
     extend_box (int) : how many bars into the future the FVG box should be extended after detection
 fvgs_values(o, h, l, c, filter_insignificant_fvgs, change_tf, enabled) 
  detect (and plot / clear broken) FVGs (fair value gaps), and return alerts and level values
  Parameters:
     o (float) : reference source open
     h (float) : reference source high
     l (float) : reference source low
     c (float) : reference source close
     filter_insignificant_fvgs (bool) : whether to calculate and filter small/insignificant gaps
     change_tf (bool) : signal when the previous reference timeframe closed, triggers new calculation
     enabled (bool) : whether detection is enabled
  Returns:   (bullish_fvg_alert, bull_top, bull_mid, bull_btm): whether a new bullish FVG was detected and its top/mid/bottom levels, (bearish_fvg_alert, bear_top, bear_mid, bear_btm): same for bearish FVGs
 fvgs_plot(bullish_fvg_alert, bull_top, bull_mid, bull_btm, bearish_fvg_alert, bear_top, bear_mid, bear_btm, color_bull, color_bear, extend_box, show) 
  Parameters:
     bullish_fvg_alert (bool) 
     bull_top (float) 
     bull_mid (float) 
     bull_btm (float) 
     bearish_fvg_alert (bool) 
     bear_top (float) 
     bear_mid (float) 
     bear_btm (float) 
     color_bull (color) : color for bullish FVG boxes
     color_bear (color) : color for bearish FVG boxes
     extend_box (int) : how many bars into the future the FVG box should be extended after detection
     show (bool) : whether plotting is enabled
  Returns:   (bullish_fvg_alert, bull_top, bull_mid, bull_btm): whether a new bullish FVG was detected and its top/mid/bottom levels, (bearish_fvg_alert, bear_top, bear_mid, bear_btm): same for bearish FVGs
 fvgs(o, h, l, c, filter_insignificant_fvgs, change_tf, color_bull, color_bear, extend_box, enabled, show) 
  detect (and plot / clear broken) FVGs (fair value gaps)
  Parameters:
     o (float) : reference source open
     h (float) : reference source high
     l (float) : reference source low
     c (float) : reference source close
     filter_insignificant_fvgs (bool) : whether to calculate and filter small/insignificant gaps
     change_tf (bool) : signal when the previous reference timeframe closed, triggers new calculation
     color_bull (color) : color for bullish FVG boxes
     color_bear (color) : color for bearish FVG boxes
     extend_box (int) : how many bars into the future the FVG box should be extended after detection
     enabled (bool) : whether detection is enabled
     show (bool) : whether plotting is enabled
  Returns:   (bullish_fvg_alert): whether a new bullish FVG was detected, (bearish_fvg_alert): same for bearish FVGs
 OrderBlock 
  Fields:
     id (series int) 
     dir (series int) 
     left_top (chart.point) 
     right_bottom (chart.point) 
     break_price (series float) 
     early_confirmation_price (series float) 
     ltf_high (array) 
     ltf_low (array) 
     ltf_volume (array) 
     plot (Box type from robbatt/lib_plot_objects/49) 
     profile (Profile type from robbatt/lib_profile/32) 
     trailing (series bool) 
     extending (series bool) 
     awaiting_confirmation (series bool) 
     touched_break_price_before_confirmation (series bool) 
     soft_confirmed (series bool) 
     has_fvg_out (series bool) 
     hidden (series bool) 
     broken (series bool) 
 OrderBlockConfig 
  Fields:
     show (series bool) 
     show_last (series int) 
     show_id (series bool) 
     show_profile (series bool) 
     args (BoxArgs type from robbatt/lib_plot_objects/49) 
     txt (series string) 
     txt_args (BoxTextArgs type from robbatt/lib_plot_objects/49) 
     delete_when_broken (series bool) 
     broken_args (BoxArgs type from robbatt/lib_plot_objects/49) 
     broken_txt (series string) 
     broken_txt_args (BoxTextArgs type from robbatt/lib_plot_objects/49) 
     broken_profile_args (ProfileArgs type from robbatt/lib_profile/32) 
     use_profile (series bool) 
     profile_args (ProfileArgs type from robbatt/lib_profile/32)
TrendCraft ICT SwiftEdge// The TrendCraft ICT SwiftEdge is a trend-following indicator that combines Simple Moving Averages (SMAs) with Inner Circle Trader (ICT) concepts, specifically Break of Structure (BOS) and Market Structure Shift (MSS), to generate precise buy and sell signals. This unique mashup leverages the strengths of trend confirmation through SMAs and market structure analysis via ICT to help traders identify high-probability trend entries. The indicator is designed to be intuitive, customizable, and suitable for traders of all levels seeking to align with market trends on various timeframes.
// 
// ### What It Does
// The indicator plots two SMAs based on the high and low prices of candles to define the trend direction. It colors the SMAs and fills the area between them to visually indicate whether the price is in a bullish (above both SMAs), bearish (below both SMAs), or neutral (between SMAs) state. Simultaneously, it identifies BOS and MSS levels on a user-defined higher timeframe to confirm trend continuation or reversal points. Buy and sell signals are generated when the price closes above/below the latest BOS or MSS level (based on user preference) while also being correctly positioned relative to the SMAs, ensuring alignment with the trend.
// 
// ### Why Combine SMAs and ICT?
// SMAs provide a reliable way to gauge trend direction by smoothing price data, but they can lag or generate false signals in choppy markets. ICT's BOS and MSS concepts address this by focusing on key market structure breaks, offering context for significant price movements. By requiring price to close beyond a BOS or MSS level and align with the SMA-defined trend, the TrendCraft ICT SwiftEdge filters out noise and enhances signal reliability. This combination creates a robust system that balances trend-following simplicity with structural market insights, making it ideal for trend traders.
// 
// ### How to Use
// 1. **SMA Length**: Adjust the `SMA Length` (default: 20) to control the sensitivity of the SMAs. Shorter lengths react faster to price changes, while longer lengths provide smoother trends.
// 2. **Structure Timeframe**: Set the `Structure Timeframe` to a higher timeframe (e.g., "1H" on a 15M chart) to calculate BOS and MSS levels. This ensures structural signals are based on significant market moves.
// 3. **Chart Timeframe**: Select the `Chart Timeframe` to optimize pivot point calculations for your current chart (e.g., "30M" for a 30-minute chart).
// 4. **Signal Type**: Choose between "BOS" (default) for signals based on trend continuation breaks or "MSS" for signals based on potential reversal points (breakers).
// 5. **Display Options**: Enable/disable `Show Continuation (BOS)` and `Show Breaker (MSS)` to toggle the visibility of BOS and MSS lines. Customize their colors for better chart clarity.
// 
// ### Signals
// - **Buy Signal**: Appears when the close price crosses above the latest BOS or MSS level (based on Signal Type) and is above both SMAs, indicating a bullish trend entry. Marked with a green "Buy" label.
// - **Sell Signal**: Appears when the close price crosses below the latest BOS or MSS level (based on Signal Type) and is below both SMAs, indicating a bearish trend entry. Marked with a red "Sell" label.
// 
// ### Originality
// The TrendCraft ICT SwiftEdge stands out by integrating the trend-following reliability of SMAs with the structural precision of ICT's BOS and MSS. Unlike standalone SMA or ICT indicators, this script requires both trend alignment and structural confirmation, reducing false signals. The user-selectable Signal Type (BOS or MSS) adds versatility, allowing traders to adapt the indicator to trend-following or counter-trend strategies. Its dynamic timeframe adjustments and visual clarity make it a unique tool for traders seeking to capture trend entries with confidence.
// 
// ### Notes
// - Ensure the `Structure Timeframe` is higher than your chart timeframe to avoid calculation issues.
// - Signals are generated only when the trend state changes to avoid redundant signals in the same trend direction.
// - Past performance is not indicative of future results. Always combine this indicator with other analysis and risk management techniques.
Smart Money Oscillator [ChartPrime]The  "Smart Money Oscillator  "  is a premium and discount zone oscillator with BOS and CHoCH built in for further analysis of price action. This indicator works by first determining the the premium and discount zones by using pivot points and high/lows. The top of this oscillator represents the current premium zone while the bottom half of this oscillator represents the discount zone. This oscillator functionally works like a stochastic oscillator with more sophisticated upper and lower bounds generated using smart money concept theories. We have included a moving average to allow the user to visualize the currant momentum in the oscillator. Another key feature we have included lagging divergences to help traders visualize potential reversal conditions. 
Understanding the concepts of Premium and Discount zones, as well as Break of Structure (BoS) and Change of Character (CHoCH), is crucial for traders using the Smart Money Oscillator. These concepts are rooted in market structure analysis, which involves studying price levels and movements.
  
Premium Zone is where the price is considered to be relatively high or 'overbought'. In this zone, prices have risen significantly and may indicate that the asset is becoming overvalued, potentially leading to a reversal or slowdown in the upward trend.
The Discount Zone represents a 'discount' or 'oversold' area. Here, prices have fallen substantially, suggesting that the asset might be undervalued. This could be an indicator of a potential upward reversal or a pause in the downward trend.
Break of Structure (BoS) is about the continuation of a trend. In a bullish trend, a BoS is identified by the break of a recent higher high. In a bearish trend, it's the break of a recent Lower Low. BoS indicates that the trend is strong and likely to continue in its current direction. It's a sign of strength in the prevailing trend, whether up or down.
Change of Character (CHoCH) is an indication of a potential end to a trend. It occurs when there's a significant change in the market's behavior, contradicting the current trend. For example, in an uptrend characterized by higher highs and higher lows, a CHoCH may occur if a new high is formed but then is followed by an impulsive move downwards. This suggests that the bullish trend may be weakening and a bearish reversal could be imminent. CHoCH is essentially a sign of trend exhaustion and potential reversal.
With each consecutive BoS, the signal line of the oscillator will deepen in color. This allows you to visually see the strength of the current trend. The maximum strength of the trend is found by keeping track of the maximum number of consecutive BoS's within a window of 10. This calculation excludes periods without any BoS's to allow for a more stable max. 
Quick Update is a feature that implements a more aggressive algorithm to update the highs and lows. Instead of updating the pivot points exclusively to update the range levels, it will attempt to use the current historical highs/lows to update the bounds. This results in a more responsive range at the cost of stability. There are pros and cons for both settings. With Quick Update disabled, the indicator will allow for strong reversals to register without the indicator maxing out. With Quick Update enabled, the indicator will show shorter term extremes with the risk of the signal being pinned to the extremities during strong trends or large movements. With Quick Update disabled, the oscillator prioritizes stability, using a more historical perspective to set its bounds. When Quick Update is enabled, the oscillator becomes more responsive, adjusting its bounds rapidly to reflect the latest market movements.
The Scale Offset feature allows the indicator to break the boundaries of the oscillator. This can be useful when the market is breaking highs or lows allowing the user to identify extremities in price. With Scale Offset disabled the oscillator will always remain inside of the boundaries because the extremities will be updated instantly. When this feature is enabled it will update the boundaries one step behind instead of updating it instantly. This allows the user to more easily see overbought and oversold conditions at the cost of incurring a single bar lag to the boundaries. Generally this is a good idea as this behavior makes the oscillator more sensitive to recent price spikes or drops, reflecting sudden market movements more accurately. It accentuates the extremities of the market conditions, potentially offering a more aggressive analysis. The main trade-off with the Scale Offset feature is between sensitivity and potential overreaction. It offers a more immediate and exaggerated reflection of market conditions but might also lead to misinterpretations in certain scenarios, especially in highly volatile markets.
Divergence is used to predict potential trend reversals. It occurs when the price of an asset and the reading of an oscillator move in opposite directions. This discrepancy can signal a weakening of the current trend and possibly indicate a potential reversal. 
Divergence doesn't always lead to a trend reversal, but it's a warning sign that the current trend might be weakening. Divergence can sometimes give false signals, particularly in strongly trending markets where the oscillator may remain in overbought or oversold conditions for extended periods. The lagging nature of using pivot points to calculate divergences means that all divergences are limited by the pivot look forward input. The upside of using a longer look forward is that the divergences will be more accurate. The obvious con here is that it will be more delayed and might be useless by the time it appears. Its recommended to use the built in divergences as a way to learn how these are formed so you can make your own in real time. 
By default, the oscillator uses a smoothing of 3 to allow for a more price like behavior while still being rather smooth compared to raw price data. Conversely, you can increase this value to make this indicator behave smoother. Something to keep in mind is that the amount of delay from real time is equal to half of the smoothing period.
We have included a verity of alerts in this indicator. Here is a list of all of the available alerts: Bullish BOS, Bearish BOS, Bullish CHoCH, Bearish CHoCH, Bullish Divergence, Hidden Bullish Divergence, Bearish Divergence, Hidden Bearish Divergence, Cross Over Average, Cross Under Average.
Below are all of the inputs and their tooltips to get you started:
 Settings: 
 
 Smoothing:  Specifies the degree of smoothing applied to the oscillator. Higher values result in smoother but potentially less responsive signals.
 Average Length:  Sets the length of the moving average applied to the oscillator, affecting its sensitivity and smoothness.
 Pivot Length:  Specifies the forward-looking length for pivot points, affecting how the oscillator anticipates future price movements. This directly impacts the delay in finding a pivot.
 Max Length:  Sets the maximum length to consider for calculating the highest values in the oscillator.
 Min Length:  Defines the minimum length for calculating the lowest values in the oscillator.
 Quick Update:  Activates a faster update mode for the oscillator's extremities, which may result in less stable range boundaries.
 Scale Offset:  When enabled, delays updating minimum and maximum values to enhance signal directionality, allowing the signal to occasionally exceed normal bounds.
 Candle Color:  Enables coloring of candles based on the current directional signal of the oscillator.
 
 Labels: 
 
 Enable BOS/CHoCH Labels:  Activates the display of BOS (Break of Structure) and CHoCH (Change of Character) labels on the chart.
 Visual Padding:  Turns on additional visual padding at the top and bottom of the chart to accommodate labels. Determines the amount of visual padding added to the chart for label display.
 
 Divergence: 
 
 Divergence Pivot:  Defines the number of bars to the right of the pivot in divergence calculations, influencing the oscillator's responsiveness.
 Divergence Pivot Forward:  Directly impacts latency. Longer periods results in more accurate results at the sacrifice of delay.
 Upper Range:  Sets the upper range limit for divergence calculations, influencing the oscillator's sensitivity to larger trends.
 Lower Range:  Determines the lower range limit for divergence calculations, affecting the oscillator's sensitivity to shorter trends.
 Symbol:  Allows selection of the label style for divergence indicators, with options for text or symbolic representation.
 Regular Bullish:  Activates the detection and marking of regular bullish divergences in the oscillator.
 Hidden Bullish:  Enables the identification and display of hidden bullish divergences.
 Regular Bearish:  Turns on the feature to detect and highlight regular bearish divergences.
 Hidden Bearish:  Activates the functionality for detecting and displaying hidden bearish divergences.
 
 Color: 
 
 Bullish: Determines the minimum/maximum color gradient for bullish signals, impacting the chart's visual appearance.
 Bearish: Defines the minimum/maximum color gradient for bearish signals, affecting their visual representation.
 Average: Specifies the color for the average line of the oscillator, enhancing chart readability.
 CHoCH: Sets the color for bullish/bearish CHoCH (Change of Character) signals.
 Premium/Discount: Determines the color for the premium/discount zone in the oscillator's visual representation.
 Text Color: Sets the color for the text in BoS/CHoCH labels.
 Regular Bullish: Defines the color used to represent regular bullish divergences.
 Hidden Bullish: Specifies the color for hidden bullish divergences.
 Regular Bearish: Determines the color for hidden bearish divergences.
 Divergence Text Color: Specifies the color for the text in divergence labels.
 
PowerHouse SwiftEdge AI v2.10 StrategyOverview
The PowerHouse SwiftEdge AI v2.10 Strategy is a sophisticated trading system designed to identify high-probability trade setups in forex, stocks, and cryptocurrencies. By combining multi-timeframe trend analysis, momentum signals, volume confirmation, and smart money concepts (Change of Character   and Break of Structure  ), this strategy offers traders a robust tool to capitalize on market trends while minimizing false signals. The strategy’s unique “AI” component analyzes trends across multiple timeframes to provide a clear, actionable dashboard, making it accessible for both novice and experienced traders. The strategy is fully customizable, allowing users to tailor its filters to their trading style.
What It Does
This strategy generates Buy and Sell signals based on a confluence of technical indicators and smart money concepts. It uses:
Multi-Timeframe Trend Analysis: Confirms the market’s direction by analyzing trends on the 1-hour (60M), 4-hour (240M), and daily (D) timeframes.
Momentum Filter: Ensures trades align with strong price movements to avoid choppy markets.
Volume Filter: Validates signals with above-average volume to confirm market participation.
Breakout Filter: Requires price to break key levels for added confirmation.
Smart Money Signals (CHoCH/BOS): Identifies reversals (CHoCH) and trend continuations (BOS) based on pivot points.
AI Trend Dashboard: Summarizes trend strength, confidence, and predictions across timeframes, helping traders make informed decisions without needing to analyze complex data manually.
The strategy also plots dynamic support and resistance trendlines, take-profit (TP) levels, and “Get Ready” signals to alert users of potential setups before they fully develop. Trades are executed with predefined take-profit and stop-loss levels for disciplined risk management.
How It Works
The strategy integrates multiple components to create a cohesive trading system:
Multi-Timeframe Trend Analysis:
The strategy evaluates trends on three timeframes (1H, 4H, Daily) using Exponential Moving Averages (EMA) and Volume-Weighted Average Price (VWAP). A trend is considered bullish if the price is above both the EMA and VWAP, bearish if below, or neutral otherwise.
Signals are only generated when the trend on the user-selected higher timeframe aligns with the trade direction (e.g., Buy signals require a bullish higher timeframe trend). This reduces noise and ensures trades follow the broader market context.
Momentum Filter:
Measures the percentage price change between consecutive bars and compares it to a volatility-adjusted threshold (based on the Average True Range  ). This ensures trades are taken only during significant price movements, filtering out low-momentum conditions.
Volume Filter (Optional):
Checks if the current volume exceeds a long-term average and shows positive short-term volume change. This confirms strong market participation, reducing the risk of false breakouts.
Breakout Filter (Optional):
Requires the price to break above (for Buy) or below (for Sell) recent highs/lows, ensuring the signal aligns with a structural shift in the market.
Smart Money Concepts (CHoCH/BOS):
Change of Character (CHoCH): Detects potential reversals when the price crosses under a recent pivot high (for Sell) or over a recent pivot low (for Buy) with a bearish or bullish candle, respectively.
Break of Structure (BOS): Confirms trend continuations when the price breaks below a recent pivot low (for Sell) or above a recent pivot high (for Buy) with strong momentum.
These signals are plotted as horizontal lines with labels, making it easy to visualize key levels.
AI Trend Dashboard:
Combines trend direction, momentum, and volatility (ATR) across timeframes to calculate a trend score. Scores above 0.5 indicate an “Up” trend, below -0.5 indicate a “Down” trend, and otherwise “Neutral.”
Displays a table summarizing trend strength (as a percentage), AI confidence (based on trend alignment), and Cumulative Volume Delta (CVD) for market context.
A second table (optional) shows trend predictions for 1H, 4H, and Daily timeframes, helping traders anticipate future market direction.
Dynamic Trendlines:
Plots support and resistance lines based on recent swing lows and highs within user-defined periods (shortTrendPeriod, longTrendPeriod). These lines adapt to market conditions and are colored based on trend strength.
Why This Combination?
The PowerHouse SwiftEdge AI v2.10 Strategy is original because it seamlessly integrates traditional technical analysis (EMA, VWAP, ATR, volume) with smart money concepts (CHoCH, BOS) and a proprietary AI-driven trend analysis. Unlike standalone indicators, this strategy:
Reduces False Signals: By requiring confluence across trend, momentum, volume, and breakout filters, it minimizes trades in choppy or low-conviction markets.
Adapts to Market Context: The ATR-based momentum threshold adjusts dynamically to volatility, ensuring signals remain relevant in both trending and ranging markets.
Simplifies Decision-Making: The AI dashboard distills complex multi-timeframe data into a user-friendly table, eliminating the need for manual analysis.
Leverages Smart Money: CHoCH and BOS signals capture institutional price action patterns, giving traders an edge in identifying reversals and continuations.
The combination of these components creates a balanced system that aligns short-term trade entries with longer-term market trends, offering a unique blend of precision, adaptability, and clarity.
How to Use
Add to Chart:
Apply the strategy to your TradingView chart on a liquid symbol (e.g., EURUSD, BTCUSD, AAPL) with a timeframe of 60 minutes or lower (e.g., 15M, 60M).
Configure Inputs:
Pivot Length: Adjust the number of bars (default: 5) to detect pivot highs/lows for CHoCH/BOS signals. Higher values reduce noise but may delay signals.
Momentum Threshold: Set the base percentage (default: 0.01%) for momentum confirmation. Increase for stricter signals.
Take Profit/Stop Loss: Define TP and SL in points (default: 10 each) for risk management.
Higher/Lower Timeframe: Choose timeframes (60M, 240M, D) for trend filtering. Ensure the chart timeframe is lower than or equal to the higher timeframe.
Filters: Enable/disable momentum, volume, or breakout filters to suit your trading style.
Trend Periods: Set shortTrendPeriod (default: 30) and longTrendPeriod (default: 100) for trendline plotting. Keep below 2000 to avoid buffer errors.
AI Dashboard: Toggle Enable AI Market Analysis to show/hide the prediction table and adjust its position.
Interpret Signals:
Buy/Sell Labels: Green "Buy" or red "Sell" labels indicate trade entries with predefined TP/SL levels plotted.
Get Ready Signals: Yellow "Get Ready BUY" or orange "Get Ready SELL" labels warn of potential setups.
CHoCH/BOS Lines: Aqua (CHoCH Sell), lime (CHoCH Buy), fuchsia (BOS Sell), or teal (BOS Buy) lines mark key levels.
Trendlines: Green/lime (support) or fuchsia/purple (resistance) dashed lines show dynamic support/resistance.
AI Dashboard: Check the top-right table for trend strength, confidence, and CVD. The optional bottom table shows trend predictions (Up, Down, Neutral).
Backtest and Trade:
Use TradingView’s Strategy Tester to evaluate performance. Adjust TP/SL and filters based on results.
Trade manually based on signals or automate with TradingView alerts (set alerts for Buy/Sell labels).
Originality and Value
The PowerHouse SwiftEdge AI v2.10 Strategy stands out by combining multi-timeframe analysis, smart money concepts, and an AI-driven dashboard into a single, user-friendly system. Its adaptive momentum threshold, robust filtering, and clear visualizations empower traders to make confident decisions without needing advanced technical knowledge. Whether you’re a day trader or swing trader, this strategy provides a versatile, data-driven approach to navigating dynamic markets.
Important Notes:
Risk Management: Always use appropriate position sizing and risk management, as the strategy’s TP/SL levels are customizable.
Symbol Compatibility: Test on liquid symbols with sufficient historical data (at least 2000 bars) to avoid buffer errors.
Performance: Backtest thoroughly to optimize settings for your market and timeframe.
Multi Timeframe Market Structure ContinuationOverview 
This indicator identifies Break of Structure (BOS) and Change of Character (ChoCh) patterns using multi-timeframe (MTF) analysis to filter high-probability trade setups. By aligning lower timeframe signals with higher timeframe bias, it helps traders enter positions in the direction of the dominant trend while avoiding counter-trend traps.
 Multi-Timeframe Analysis  
The indicator analyzes market structure on two timeframes simultaneously:
 Current Timeframe (CTF):  Detects immediate BOS and ChoCh signals for entry timing
 Higher Timeframe (HTF):  Establishes the overall trend direction (default: 1H, customizable)
Signals only appear when the current timeframe structure aligns with the higher timeframe bias, ensuring you're trading with the momentum, not against it.
 Break of Structure (BOS) 
BOS signals indicate trend continuation - when price breaks a previous high in an uptrend or a previous low in a downtrend. These are reliable entries that confirm the trend is still active and strong.
 Change of Character (ChoCh) 
ChoCh signals mark early trend reversals - when market structure shifts from bearish to bullish (or vice versa). When captured in alignment with the higher timeframe trend, ChoCh entries can achieve exceptional risk-to-reward ratios as they allow entry near the beginning of a new impulse move.
 Exit Signals 
Exit signals are plotted when a ChoCh occurs in the opposite direction of the HTF trend. For example, if the HTF is bullish and a bearish ChoCh forms on the current timeframe, an orange "EXIT" signal appears - warning long traders that the lower timeframe structure is shifting against them. This provides an early warning system to protect profits or minimize losses before the HTF trend itself reverses.
 Trading Strategy Recommendations
Trending Markets (Recommended) 
In strong trending conditions, both BOS and ChoCh signals can be taken when aligned with the HTF bias. ChoCh entries are particularly powerful as they catch early reversals within the larger trend, offering entries with tight stop losses and extended profit targets.
 Ranging Markets 
During consolidation or choppy conditions, it's best to be selective and take only BOS entries. BOS signals confirm that the trend is continuing beyond the range, reducing false breakouts and whipsaw trades that are common with counter-trend ChoCh signals in sideways markets.
 Customization 
Pivot Length: Adjust the sensitivity of structure detection (default: 5). Lower values detect structure more frequently with earlier but potentially noisier signals. Higher values provide cleaner, more significant structural breaks but with some delay.
Higher Timeframe: Customize the HTF to suit your trading style. Day traders might use 1H HTF on 5m charts, while swing traders could use 4H or Daily HTF.
 Alert System
 
Six alert conditions available:
 
 Long BOS Entry / Long ChoCh Entry
 Short BOS Entry / Short ChoCh Entry
 Long Exit / Short Exit
 
All alerts fire only on confirmed candle closes to eliminate repainting and false signals.
 Visual Features 
 
 Color-coded background showing HTF bias
 Clear BOS/ChoCh labels with horizontal lines at structure levels
 Orange "EXIT" signals when structure breaks against your position
 Gray lines tracking current swing highs/lows
 HTF trend indicator in the top-right corner
Market structure + TF Bucket Market Structure + TF Bucket
This Pine Script™ indicator, published under the Mozilla Public License 2.0, extends the "Market Structure" script by mickes (), with full credit to mickes. It integrates the enhanced MarketStructure library by Fenomentn (), also based on mickes’ library under MPL 2.0, to provide advanced market structure analysis with multi-timeframe pivot length customization.
Functionality
Market Structure Analysis: Detects internal (orderflow) and swing market structures, visualizing Break of Structure (BOS), Change of Character (CHoCH), Equal High/Low (EQH/EQL), and liquidity zones using the MarketStructure library.
Timeframe Bucket (TF Bucket): Dynamically adjusts pivot lengths for six user-defined timeframes (e.g., 3m, 5m, 10m, 15m, 4h, 12h), optimizing structure detection across different chart timeframes.
Trend Strength Visualization: Displays a trend strength metric (from the library) for internal and swing structures, indicating trend reliability based on pivot frequency and volatility.
Statistics Table: Shows yearly counts of BOS and CHoCH events for internal and swing structures, configurable by a user-defined period.
Screener Support: Outputs BOS and CHoCH signals for TradingView’s screener, with a configurable signal persistence period.
Customizable Alerts: Enables alerts for BOS and CHoCH events, separately configurable for internal and swing structures.
Methodology
Pivot Detection: Uses the library’s Pivot function, which applies a volatility filter (ATR-based) to confirm significant pivots, reducing false signals in low-volatility markets.
TF Bucket: Maps user-selected timeframes to Pine Script’s timeframe.period using f_getTimeframePeriod, applying custom pivot lengths when the chart’s timeframe matches a selected one (or base lengths in Static mode).
Trend Strength: Calculates a score as pivotCount / LeftLength * (currentATR / ATR), displayed via labels to help traders assess trend reliability.
BOS/CHoCH Detection: Identifies BOS when price breaks a pivot in the trend direction and CHoCH when price reverses against the trend, labeling events as “MSF” or “MSF+” based on pivot patterns.
EQH/EQL and Liquidity: Draws boxes for equal high/low zones within ATR-based thresholds and visualizes liquidity levels with confirmation bars.
Statistics and Screener: Tracks BOS/CHoCH events in a yearly table and outputs signals for screener use, with persistence controlled by a user-defined period.
Usage
Integration: Apply the indicator to any chart and import the library via import Fenomentn/MarketStructure/1.
Configuration: Set up to six timeframes with custom pivot lengths, enable/disable internal and swing structures, configure alerts, and adjust statistics years in the settings panel.
Alerts: Enable BOS and CHoCH alerts for real-time notifications, triggered on bar close to avoid repainting.
Screener: Use the plotted signals to monitor BOS/CHoCH events across multiple tickers in TradingView’s screener.
Best Practices: Optimal for forex and crypto charts on 1m to 12h timeframes. Adjust pivot lengths and the library’s volatility threshold for specific market conditions.
Originality
This indicator enhances mickes’ original script with:
Timeframe Bucket: Dynamic pivot length selection for multi-timeframe analysis, not present in the original.
Trend Strength Display: Visualizes the library’s TrendStrength metric for enhanced trend analysis.
Enhanced Library Integration: Leverages Fenomentn/MarketStructure/1, which adds a volatility-based pivot filter, dynamic label sizing, and customizable BOS/CHoCH visualization styles.No additional open-source code was reused beyond mickes’ script and library, fully credited under MPL 2.0.
PowerHouse SwiftEdge AI v2.10 with Custom Filters & AI AnalysisPowerHouse SwiftEdge AI v2.10 with Custom Filters & AI Analysis
Overview
PowerHouse SwiftEdge AI v2.10 is an advanced TradingView Pine Script indicator designed to identify high-probability trading setups by combining pivot-based structure analysis, multi-timeframe trend detection, and adaptive AI-driven signal filtering. The script integrates Change of Character (CHoCH) and Break of Structure (BOS) signals with customizable momentum, volume, breakout, and trend filters to enhance trade precision. Additionally, it offers an optional AI Market Analysis module that predicts future price trends across multiple timeframes, providing traders with a comprehensive market outlook.
The script is highly customizable, allowing users to tailor inputs to their trading style, whether for scalping, swing trading, or long-term strategies. It is suitable for all asset classes, including stocks, forex, crypto, and commodities, and performs optimally on timeframes ranging from 1-minute to daily charts.
Key Features
Pivot-Based Signal Generation:
Identifies pivot highs and lows to detect CHoCH (reversal patterns) and BOS (continuation patterns).
Signals are plotted as "Buy" or "Sell" labels with optional "Get Ready" pre-signals to prepare traders for potential setups.
Take-profit (TP) levels are automatically calculated based on user-defined points, with optional TP box visualization.
Multi-Timeframe Trend Analysis:
Analyzes trends across seven timeframes (1M, 5M, 15M, 30M, 1H, 4H, D) using EMA and VWAP to determine bullish, bearish, or neutral conditions.
Displays a futuristic AI-Trend Matrix dashboard showing trend direction, strength, and confidence levels for quick decision-making.
Customizable Signal Filters:
Momentum Filter: Ensures signals align with significant price changes, adjusted dynamically using ATR-based volatility.
Higher Timeframe Trend Filter: Requires signals to align with the trend of a user-selected higher timeframe (e.g., 1H).
Lower Timeframe Trend Filter: Prevents signals that conflict with the trend of a user-selected lower timeframe (e.g., 5M).
Volume Filter: Optionally requires above-average volume to confirm signals.
Breakout Filter: Optionally requires price to break previous highs/lows for signal validation.
Repeated Signal Restriction: Prevents consecutive signals in the same trend direction until the trend changes on a user-defined timeframe.
AI-Driven Adaptivity:
Incorporates Cumulative Volume Delta (CVD) to assess buying/selling pressure and classify market volatility (Low, Medium, High).
Uses ATR to dynamically adjust momentum thresholds, ensuring signals adapt to current market conditions.
Optional AI Market Analysis module predicts trends across multiple timeframes by combining trend, momentum, and volatility scores.
Visual Elements:
Plots CHoCH and BOS levels as horizontal lines with distinct colors (aqua for CHoCH sell, lime for CHoCH buy, fuchsia for BOS sell, teal for BOS buy).
Draws dynamic support and resistance trendlines based on short and long-term price action, colored by trend strength.
Displays TP levels and pivot highs/lows for easy reference.
How It Works
The script combines several technical analysis concepts to create a robust trading system:
Market Structure Analysis:
Pivot highs and lows are identified using a user-defined lookback period (Pivot Length).
CHoCH occurs when price crosses below a pivot high (bearish reversal) or above a pivot low (bullish reversal).
BOS occurs when price breaks a previous pivot low (bearish continuation) or pivot high (bullish continuation).
Trend and Momentum Integration:
Trends are determined by comparing price to EMA and VWAP on multiple timeframes.
Momentum is calculated as the percentage price change, with thresholds adjusted by ATR to account for volatility.
"Get Ready" signals appear when momentum approaches the threshold, preparing traders for potential CHoCH or BOS signals.
Signal Filtering:
Filters ensure signals align with user-defined criteria (e.g., trend direction, volume, breakouts).
The Restrict Repeated Signals option prevents over-signaling by requiring a trend change on a specified timeframe before generating a new signal in the same direction.
AI Market Analysis:
The optional AI module calculates a score for each timeframe based on trend direction, momentum, and volatility (ATR compared to its SMA).
Scores are translated into predictions (▲ for bullish, ▼ for bearish, — for neutral), displayed in a dedicated table.
CVD and Volatility Context:
CVD tracks buying vs. selling pressure by accumulating volume based on price direction.
Volatility is classified using CVD magnitude, influencing the script’s visual cues and signal sensitivity.
Why This Combination?
The integration of pivot-based structure analysis, multi-timeframe trend filtering, and AI-driven adaptivity addresses common trading challenges:
Precision: CHoCH and BOS signals focus on key market turning points, reducing noise from minor price fluctuations.
Context: Multi-timeframe analysis ensures trades align with broader market trends, improving win rates.
Adaptivity: ATR and CVD adjustments make the script responsive to changing market conditions, avoiding static thresholds that fail in volatile or quiet markets.
Customization: Extensive input options allow traders to adapt the script to their preferred markets, timeframes, and risk profiles.
Predictive Insight: The AI Market Analysis module provides forward-looking trend predictions, helping traders anticipate market moves.
This combination creates a self-contained system that balances responsiveness with reliability, making it suitable for both novice and experienced traders.
How to Use
Add to Chart:
Apply the indicator to your TradingView chart for any asset and timeframe.
Recommended timeframes: 5M to 1H for scalping/day trading, 4H to D for swing trading.
Configure Inputs:
Pivot Length: Adjust (default 5) to control sensitivity to pivot highs/lows. Lower values for faster signals, higher for stronger confirmations.
Momentum Threshold: Set the minimum price change (default 0.01%) for signals. Increase for stricter conditions.
Take Profit Points: Define TP distance (default 10 points). Adjust based on asset volatility.
Signal Filters: Enable/disable filters (momentum, trend, volume, breakout) to match your strategy.
Higher/Lower Timeframe: Select timeframes for trend alignment (e.g., 1H for higher, 5M for lower).
AI Market Analysis: Enable for predictive trend insights across timeframes.
Get Ready Signals: Enable to see pre-signals for potential setups.
Interpret Signals:
Buy/Sell Labels: Act on green "Buy" or red "Sell" labels, confirming with TP levels and trend direction.
Get Ready Labels: Yellow "Get Ready BUY" or orange "Get Ready SELL" indicate potential setups; prepare but wait for confirmation.
CHoCH/BOS Lines: Use aqua/lime (CHoCH) and fuchsia/teal (BOS) lines as key support/resistance levels.
AI-Trend Matrix: Check the top-right dashboard for trend strength (%), confidence (%), and timeframe-specific trends.
AI Market Analysis Table: If enabled, view predictions (▲/▼/—) for each timeframe to anticipate market direction.
Trading Tips:
Combine signals with other indicators (e.g., RSI, MACD) for additional confirmation.
Use higher timeframe trend alignment for higher-probability trades.
Adjust TP and signal distance based on asset volatility and trading style.
Monitor the AI-Trend Matrix for trend strength; values above 50% or below -50% indicate strong directional bias.
Originality
PowerHouse SwiftEdge AI v2.10 stands out due to its unique blend of:
Adaptive Signal Generation: ATR-based momentum thresholds and CVD-driven volatility context ensure signals remain relevant across market conditions.
Multi-Timeframe Synergy: The script’s ability to filter signals based on both higher and lower timeframe trends provides a rare balance of precision and context.
AI-Powered Insights: The AI Market Analysis module offers predictive capabilities not commonly found in traditional indicators, simulating institutional-grade analysis.
Visual Clarity: The futuristic dashboard and color-coded trendlines make complex data accessible, enhancing usability for all trader levels.
Unlike standalone pivot or trend indicators, this script integrates multiple layers of analysis into a cohesive system, reducing false signals and providing actionable insights without requiring external tools or research.
Limitations
False Signals: No indicator is foolproof; signals may fail in choppy or low-volume markets. Use filters to mitigate.
Timeframe Sensitivity: Performance varies by timeframe and asset. Test settings thoroughly.
AI Predictions: The AI Market Analysis is based on historical data and simplified scoring; it’s not a guaranteed forecast.
Resource Usage: Enabling all filters and AI analysis may slow performance on lower-end devices.
DTFX Algo Zones [SamuraiJack Mod]CME_MINI:NQ1!  
 Credits 
This indicator is a modified version of an open-source tool originally developed by Lux Algo. I literally modded their indicator to create the  DTFX Algo Zones   version, incorporating additional features and refinements. Special thanks to Lux Algo for their original work and for providing the open-source code that made this development possible.
 Introduction 
 DTFX Algo Zones   is a technical analysis indicator designed to automatically identify key supply and demand zones on your chart using market structure and Fibonacci retracements. It helps traders spot high-probability reversal areas and important support/resistance levels at a glance. By detecting shifts in market structure (such as Break of Structure and Change of Character) and highlighting bullish or bearish zones dynamically, this tool provides an intuitive framework for planning trades. The goal is to save traders time and improve decision-making by focusing attention on the most critical price zones where market bias may confirm or reverse.
 Logic & Features 
	•	Market Structure Shift Detection (BOS & CHoCH): The indicator continuously monitors price swings and marks significant structure shifts. A Break of Structure (BOS) occurs when price breaks above a previous swing high or below a swing low, indicating a continuation of the current trend. A Change of Character (ChoCH) is detected when price breaks in the opposite direction of the prior trend, often signaling an early trend reversal. These moments are visually marked on the chart, serving as anchor points for new zones. By identifying BOS and ChoCH in real-time, the DTFX Algo Zones indicator ensures you’re aware of key trend changes as they happen.
	•	Auto-Drawn Fibonacci Supply/Demand Zones: Upon a valid structure shift, the indicator plots a Fibonacci-based zone between the breakout point and the preceding swing high/low (the source of the move). This creates a shaded area or band of Fibonacci retracement levels (for example 38.2%, 50%, 61.8%, etc.) representing a potential support zone in an uptrend or resistance zone in a downtrend. These supply/demand zones are derived from the natural retracement of the breakout move, highlighting where price is likely to pull back. Each zone is essentially an auto-generated Fibonacci retracement region tied to a market structure event, which traders can use to anticipate where the next pullback or bounce might occur.
	•	Dynamic Bullish and Bearish Zones: The DTFX Algo Zones indicator distinguishes bullish vs. bearish zones and updates them dynamically as new price action unfolds. Bullish zones (formed after bullish BOS/ChoCH) are typically highlighted in one color (e.g. green or blue) to indicate areas of demand/support where price may bounce upward. Bearish zones (formed after bearish BOS/ChoCH) are shown in another color (e.g. red/orange) to mark supply/resistance where price may stall or reverse downward. This color-coding and real-time updating allow traders to instantly recognize the market bias: for instance, a series of bullish zones implies an uptrend with multiple support levels on pullbacks, while consecutive bearish zones indicate a downtrend with resistance overhead. As old zones get invalidated or new ones appear, the chart remains current with the latest key levels, eliminating clutter from outdated levels.
	•	Flexible Customization: The indicator comes with several options to tailor the zones to your trading style. You can filter which zones to display – for example, show only the most recent N zones or limit to only bullish or only bearish zones – helping declutter the chart and focus on recent, relevant levels. There are settings to control zone extension (how far into the future the zones are drawn) and to automatically invalidate zones once they’re no longer relevant (for instance, if price fully breaks through a zone or a new structure shift occurs that supersedes it). Additionally, the Fibonacci retracement levels within each zone are customizable: you can choose which retracement percentages to plot, adjust their colors or line styles, and decide whether to fill the zone area for visibility. This flexibility ensures the DTFX Algo Zones can be tuned for different markets and strategies, whether you want a clean minimalist look or detailed zones with multiple internal levels.
 Best Use Cases 
 DTFX Algo Zones   is a versatile indicator that can enhance various trading strategies. Some of its best use cases include:
	•	Identifying High-Probability Reversal Zones: Each zone marks an area where price has a higher likelihood of stalling or reversing because it reflects a significant prior swing and Fibonacci retracement. Traders can watch these zones for entry opportunities when the market approaches them, as they often coincide with order block or strong supply/demand areas. This is especially useful for catching trend reversals or pullbacks at points where risk is lower and potential reward is higher.
	•	Spotting Key Support and Resistance: The automatically drawn zones act as dynamic support (below price) and resistance (above price) levels. Instead of manually drawing Fibonacci retracements or support/resistance lines, you get an instant map of the key levels derived from recent price action. This helps in quickly identifying where the next bounce (support) or rejection (resistance) might occur. Swing traders and intraday traders alike can use these zones to set alerts or anticipate reaction areas as the market moves.
	•	Trend-Following Entries: In a trending market, the indicator’s zones provide ideal areas to join the trend on pullbacks. For example, in an uptrend, when a new bullish zone is drawn after a BOS, it indicates a fresh demand zone – buying near the lower end of that zone on a pullback can offer a low-risk entry to ride the next leg up. Similarly, in a downtrend, selling rallies into the highlighted supply zones can position you in the direction of the prevailing trend. The zones effectively serve as a roadmap of the trend’s structure, allowing trend traders to buy dips and sell rallies with greater confidence.
	•	Mean-Reversion and Range Trading: Even in choppy or range-bound markets, DTFX Algo Zones can help find mean-reversion trades. If price is oscillating sideways, the zones at extremes of the range might mark where momentum is shifting (ChoCH) and price could swing back toward the mean. A trader might fade an extended move when it reaches a strong zone, anticipating a reversion. Additionally, if multiple zones cluster in an area across time (creating a zone overlap), it often signifies a particularly robust support/resistance level ideal for range trading strategies.
In all these use cases, the indicator’s ability to filter out noise and highlight structurally important levels means traders can focus on higher-probability setups and make more informed trading decisions.
 Strategy – Pullback Trading with DTFX Algo Zones 
One of the most effective ways to use the DTFX Algo Zones indicator is trading pullbacks in the direction of the trend. Below is a step-by-step strategy to capitalize on pullbacks using the zones, combining the indicator’s signals with sound price action analysis and risk management:
	1.	Identify a Market Structure Shift and Trend Bias: First, observe the chart for a recent BOS or ChoCH signal from the indicator. This will tell you the current trend bias. For instance, a bullish BOS/ChoCH means the market momentum has shifted upward (bullish bias), and a new demand zone will be drawn. A bearish structure break indicates downward momentum and creates a supply zone. Make sure the broader context supports the bias (e.g., if multiple higher timeframe zones are bullish, focus on long trades).
	2.	Wait for the Pullback into the Zone: Once a new zone appears, don’t chase the price immediately. Instead, wait for price to retrace back into that highlighted zone. Patience is key – let the market come to you. For a bullish setup, allow price to dip into the Fibonacci retracement zone (demand area); for a bearish setup, watch for a rally into the supply zone. Often, the middle of the zone (around the 50% retracement level) can be an optimal area where price might slow down and pivot, but it’s wise to observe price behavior across the entire zone.
	3.	Confirm the Entry with Price Action & Confluence: As price tests the zone, look for confirmation signals before entering the trade. This can include bullish reversal candlestick patterns (for longs) or bearish patterns (for shorts) such as engulfing candles, hammers/shooting stars, or doji indicating indecision turning to reversal. Additionally, incorporate confluence factors to strengthen the setup: for example, check if the zone overlaps with a key moving average, a round number price level, or an old support/resistance line from a higher timeframe. You might also use an oscillator (like RSI or Stochastic) to see if the pullback has reached oversold conditions in a bullish zone (or overbought in a bearish zone), suggesting a bounce is likely. The more factors aligning at the zone, the more confidence you can have in the trade. Only proceed with an entry once you see clear evidence of buyers defending a demand zone or sellers defending a supply zone.
	4.	Enter the Trade and Manage Risk: When you’re satisfied with the confirmation (e.g., price starts to react positively off a demand zone or shows rejection wicks in a supply zone), execute your entry in the direction of the original trend. Immediately set a stop-loss order to control risk: for a long trade, a common placement is just below the demand zone (a few ticks/pips under the swing low that formed the zone); for a short trade, place the stop just above the supply zone’s high. This way, if the zone fails and price continues beyond it, your loss is limited. Position size the trade so that this stop-loss distance corresponds to a risk you are comfortable with (for example, 1-2% of your trading capital).
	5.	Take Profit Strategically: Plan your take-profit targets in advance. A conservative approach is to target the origin of the move – for instance, in a long trade, you might take profit as price moves back up to the swing high (the 0% Fibonacci level of the zone) or the next significant zone or resistance level above. This often yields at least a 1:1 reward-to-risk ratio if you entered around mid-zone. More aggressive trend-following traders may leave a portion of the position running beyond the initial target, aiming for a larger move in line with the trend (for example, new higher highs in an uptrend). You can also trail your stop-loss upward behind new higher lows (for longs) or lower highs (for shorts) as the trend progresses, locking in profit while allowing for further gains.
	6.	Monitor Zone Invalidation: Even after entering, keep an eye on the behavior around the zone and any new zones that may form. If price fails to bounce and instead breaks decisively through the entire zone, respect that as an invalidation – the market may be signaling a deeper reversal or that the signal was false. In such a case, it’s better to exit early or stick to your stop-loss than to hold onto a losing position. The indicator will often mark or no longer highlight zones that have been invalidated by price, guiding you to shift focus to the next opportunity.
 Risk Management Tips: 
	•	Always use a stop-loss and don’t move it farther out in hope. Placing the stop just beyond the zone’s far end (the swing point) helps protect you if the pullback turns into a larger reversal.
	•	Aim for a favorable risk-to-reward ratio. With pullback entries near the middle or far end of a zone, you can often achieve a reward that equals or exceeds your risk. For example, risking 20 pips to make 20+ pips (1:1 or better) is a prudent starting point. Adjust targets based on market structure – if the next resistance is 50 pips away, consider that upside against your risk.
	•	Use confluence and context: Don’t take every zone signal in isolation. The highest probability trades come when the DTFX Algo Zone aligns with other analysis (trend direction, chart patterns, higher timeframe support/resistance, etc.). This filtered approach will reduce trades taken in weak zones or counter-trend traps.
	•	Embrace patience and selectivity: Not all zones are equal. It can be wise to skip very narrow or insignificant zones and wait for those that form after a strong BOS/ChoCH (indicating a powerful move). Larger zones or zones formed during high-volume times tend to produce more reliable pullback opportunities.
	•	Review and adapt: After each trade, note how price behaved around the zone. If you notice certain Fib levels (like 50% or 61.8%) within the zone consistently provide the best entries, you can refine your approach to focus on those. Similarly, adjust the indicator’s settings if needed – for example, if too many minor zones are cluttering your screen, limit to the last few or increase the structure length parameter to capture only more significant swings.
⸻ 
By combining the  DTFX Algo Zones   indicator with disciplined confirmation and risk management, traders can improve their timing on pullback entries and avoid chasing moves. This indicator shines in helping you trade what you see, not what you feel – the clearly marked zones and structure shifts keep you grounded in price action reality. Whether you’re a trend trader looking to buy the dip/sell the rally, or a reversal trader hunting for exhaustion points, DTFX Algo Zones provides a robust visual aid to elevate your trading decisions. Use it as a complementary tool in your analysis to stay on the right side of the market’s structure and enhance your trading performance.
Dabel MS + FVGThis script is designed to assist traders by identifying market structures, imbalances, and potential trade opportunities using Break of Structure (BOS) and Market Structure Shifts (MSS). It visually highlights imbalances in price action, key pivots, and market structure changes, providing actionable information for making trading decisions.
 Key features: 
Imbalances Detection: Highlights bullish and bearish price gaps (Fair Value Gaps) using colored boxes. Users can choose the line style (solid, dashed, or dotted) for imbalance midlines.
 Market Structure Analysis:  Tracks pivot highs and lows to identify BOS and MSS in two separate market structures with adjustable pivot strengths.
 Customizable Visualization:  Allows users to choose line styles, colors, and display options for both imbalances and market structures.
 Alerts:  Alerts traders when BOS or MSS occur, helping to monitor the market effectively.
 Trading Strategy 
Imbalance Trading:
Imbalances (gaps) represent areas where supply or demand was left unfilled. These gaps often act as magnet zones where the price revisits to fill.
 Bullish Imbalance:  Look for buying opportunities when price enters a green imbalance zone.
 Bearish Imbalance:  Look for selling opportunities when price enters a red imbalance zone.
Use the midline of the imbalance box as a key reference point for potential reversals.
 Break of Structure (BOS) and Market Structure Shift (MSS): 
 BOS:  Indicates a continuation of the existing trend. For example:
Bullish BOS: Look for continuation in the uptrend after a high is broken.
Bearish BOS: Look for continuation in the downtrend after a low is broken.
 MSS:  Suggests a potential reversal in market structure. For example:
Bullish MSS: Indicates a possible shift from a bearish to bullish market.
Bearish MSS: Indicates a potential shift from a bullish to bearish market.
Multiple Market Structures:
This script provide two sets of market structures, allowing traders to compare short-term and long-term trends.
Adjust the pivot strength to suit your trading style (lower for intraday trading, higher for swing or positional trading).
 Entry and Exit: 
Entry: Look for entries near imbalances or after confirmed BOS/MSS in line with the overall trend.
Exit: Place stop-loss below/above recent pivots and take profit at nearby support/resistance or imbalance zones.
 For New Traders 
Focus on Basics: Understand what BOS and MSS mean and how they signal trend direction or reversals.
Use Alerts: Rely on the script's alert system to catch important moments without staring at charts all day.
Start Small: Test this strategy on a demo account before using it live. You can understand it more with practice.
Market Structure Trailing Stop [BigBeluga]The  Market Structure Trailing Stop  indicator is an advanced tool for identifying market structure shifts, liquidity sweeps, and potential trend reversals using comprehensive volume analysis. This indicator combines the analysis of market structure pivots (CHoCH - Change of Character) with a sophisticated volume-based trailing stop logic. By evaluating delta volume at key structural points, it allows traders to identify high-probability trend continuations or reversals and manage their trades more effectively.
  
🔵  KEY FEATURES 
 ● Market Structure Analysis 
 
 Pivot-Based Market Structure : The indicator identifies high and lows using user-defined periods, allowing traders to spot key market structure shifts.
 Change of Character (CHoCH) : The first significant break of a market structure is marked as a CHoCH, indicating a potential trend reversal.
  
 Break of Structure (BoS) : The indicator highlights subsequent breaks of structure after CHoCH, providing traders with crucial insights into trend strength.
  
 
 ● Advanced Volume Analysis 
 
 Delta Volume Evaluation : The indicator calculates delta volume (difference between up and down volume) at each ChoCh or BoS market structure point to assess the strength of the move. Identify Delta Volume from break point back to Pivot
  
 
 ● Trailing Stop Logic 
  
 
 Volume-Validated Trailing Stop : The indicator automatically plots a trailing stop if the delta volume at the UP CHoCH is positive and above the defined threshold and vice versa for Down CHoCH , allowing traders to protect their profits while riding the trend.
 Trend Weakness Detection : If a subsequent BoS occurs with negative delta volume or lower volume than the input threshold, the trailing stop disappears, indicating potential trend exhaustion or reversal.
 Dynamic Stop Placement : The trailing stop is dynamically adjusted based on market structure and volume, providing traders with a more adaptive stop-loss strategy.
 Up Trend Trailing Stop: 
  
 Down Trend Trailing Stop: 
  
 
 ● Liquidity Sweep Detection 
 
 Liquidity Sweep (X) Labels : The indicator identifies liquidity sweeps—points where the price temporarily reverses to sweep liquidity above or below a key level—marked with an “X” label.
 Potential Reversal Zones : These liquidity sweeps are potential reversal zones, especially when accompanied by significant delta volume changes, providing traders with early warnings of potential trend reversals.
 
🔵  HOW TO USE 
 ● Identifying Market Structure Shifts 
 
 Change of Character (CHoCH) : When a CHoCH occurs, the indicator calculates the total volume from the high point to the break point. If the delta volume is positive and exceeds the input threshold, a trailing stop is plotted, signaling potential trend continuation.
 Break of Structure (BoS) : If BoS is enabled, subsequent breaks of structure are highlighted. If these BoS points show weaker volume or negative delta volume, the trailing stop will disappear, indicating that the trend may be losing strength.
 
 ● Using the Trailing Stop Feature 
 
 Protecting Profits : Once a CHoCH occurs and the delta volume validates the trend, the trailing stop will be plotted below (or above) the price to protect profits while allowing the trend to run.
  
 Trend Reversal Signals : If the trailing stop disappears due to weak volume at subsequent BoS points, it may signal that the trend is losing momentum, and traders may consider closing their positions or tightening their stops manually.
  
 
 ● Liquidity Sweep Interpretation 
 
 Spotting Reversal Zones : Liquidity sweeps, marked with an “X” label, indicate zones where the price has swept liquidity. These areas can serve as potential reversal zones, especially when significant delta volume is observed at these points.
 Early Reversal Warnings : Traders can use these liquidity sweep labels as early warnings for potential trend reversals, particularly in conjunction with other technical analysis methods.
 
  
  
🔵  CUSTOMIZATION 
 
 Highs and Lows Calculation : Customize the number of bars to the left and right for identifying pivots and market structure shifts.
 Volume Threshold : Define the volume threshold to filter out weaker moves and focus on significant market structure shifts.
 BoS and Liquidity Sweep Labels : Toggle on or off the BoS and Liquidity Sweep labels to tailor the indicator to your trading style.
 Trend Color : Enable or disable trend coloring for candles to visually highlight uptrends and downtrends on the chart.
  
 
🔵  CONCLUSION 
The  Market Structure Trailing Stop  indicator combines advanced volume analysis with market structure detection to provide traders with a powerful tool for identifying and managing trends. By leveraging delta volume at key structure points, it helps traders validate trend strength and manage their positions with a dynamic trailing stop strategy. The addition of liquidity sweep detection further enhances its utility, offering early warnings of potential trend reversals. This indicator is ideal for traders who want to gain a deeper understanding of market structure while incorporating volume-based insights into their trading strategies.
Dynamic Market Structure (MTF) - Dow TheoryDynamic Market Structure (MTF) 
 OVERVIEW 
This advanced indicator provides a comprehensive and fully customizable solution for analyzing market structure based on classic Dow Theory principles. It automates the identification of key structural points, including Higher Highs (HH), Higher Lows (HL), Lower Lows (LL), and Lower Highs (LH).
Going beyond simple pivot detection, this tool visualizes the flow of the trend by plotting dynamic Breaks of Structure (BOS) and potential reversals with Changes of Character (CHoCH). It is designed to be a flexible and powerful tool for traders who use price action and trend analysis as a core part of their strategy.
CORE CONCEPTS
The indicator is built on the foundational principles of Dow Theory:
 
 Uptrend: A series of Higher Highs and Higher Lows.
 Downtrend: A series of Lower Lows and Lower Highs.
 Break of Structure (BOS): Occurs when price action continues the current trend by creating a new HH in an uptrend or a new LL in a downtrend.
 Change of Character (CHoCH): Occurs when the established trend sequence is broken, signaling a potential reversal. For example, when a Lower Low forms after a series of Higher Highs.
 
CALCULATION METHODOLOGY
This section explains the indicator's underlying logic:
Pivot Detection: The indicator's core logic is based on TradingView's built-in  ta.pivothigh()  and  ta.pivotlow()  functions. The sensitivity of this detection is fully controlled by the user via the Pivot Lookback Left and Pivot Lookback Right settings.
Structure Calculation (BOS/CHoCH): The script identifies market structure by analyzing the sequence of these confirmed pivots.
 
 A bullish BOS is plotted when a new  ta.pivothigh  is confirmed at a price higher than the previous confirmed ta.pivothigh.
 A bearish CHoCH is plotted when a new  ta.pivotlow  is confirmed at a price lower than the previous confirmed  ta.pivotlow , breaking the established sequence of higher lows.
 The logic is mirrored for bearish BOS and bullish CHoCH.
 
Invalidation Levels: This feature identifies the last confirmed pivot before a structure break (e.g., the last  ta.pivotlow  before a bullish BOS) and plots a dotted line from it to the breakout bar. This level is considered the structural invalidation point for that move.
MTF Confirmation: This unique feature provides confluence by analyzing a second, lower timeframe. When a pivot (e.g., a Higher Low) is confirmed on the main chart, the script requests pivot data from the user-selected lower timeframe. If a corresponding trend reversal is detected on that lower timeframe (e.g., a break of its own minor downtrend), the pivot is labeled "Firm" (FHL); otherwise, it is labeled "Soft" (SHL).
KEY FEATURES
This indicator is packed with advanced features designed to provide a deeper level of market insight:
 
 Dynamic Structure Lines: BOS and CHoCH levels are plotted with clean, dashed lines that dynamically start at the old pivot and terminate precisely at the breakout bar, keeping the chart clean and precise.
 Invalidation Levels: For every structure break, the indicator can plot a dotted "Invalidation" line (INV). This marks the critical support or resistance pivot that, if broken, would negate the previous move, providing a clear reference for risk management.
 Multi-Timeframe (MTF) Confirmation: Add a layer of confluence to your analysis by confirming pivots on a lower timeframe. The indicator can label Higher Lows and Lower Highs as either "Firm" (FHL/FLH) if confirmed by a reversal on a lower timeframe, or "Soft" (SHL/SLH) if not.
 Flexible Pivot Detection: Fully adjustable  Pivot Lookback  settings for the left and right sides allow you to tune the indicator's sensitivity to match any timeframe or trading style, from long-term investing to short-term scalping.
 Full Customization: Take complete control of the indicator's appearance. A dedicated style menu allows you to customize the colors for all bullish, bearish, and reversal elements, including the transparency of the trend-based candle coloring.
 
HOW TO USE
 
 Trend Identification: Use the sequence of HH/HL and LL/LH, along with the trend-colored candles, to quickly assess the current market direction on any timeframe.
 Entry Signals: A confirmed BOS can signal a potential entry in the direction of the trend. A CHoCH can signal a potential reversal, offering an opportunity to enter a new trend early.
 Risk Management: Use the automatically plotted "Invalidation" (INV) lines as a logical reference point for placing stop losses. A break of this level indicates that the structure you were trading has failed.
 Confluence: Use the "Firm" pivot signals from the MTF analysis to identify high-probability swing points that are supported by price action on multiple timeframes.
 
SETTINGS BREAKDOWN
 
 Pivot Lookback Left/Right: Controls the sensitivity of pivot detection. Higher numbers find more significant (but fewer) pivots.
 MTF Confirmation: Enable/disable the "Firm" vs. "Soft" pivot analysis and select your preferred lower timeframe for confirmation.
 Style Settings: Customize all colors and the transparency of the candle coloring to match your chart's theme.
 Show Invalidation Levels: Toggle the visibility of the dotted invalidation lines.
 
This indicator is a powerful tool for visualizing and trading with the trend. Experiment with the settings to find a configuration that best fits your personal trading strategy.
Iani SMC Sniper XAU v2.2 (Long+Short + News Countdown, v6)Iani SMC Sniper v2.6 — Anytime • Auto Pip • FVG 50% • OB • News Panel
Smart-Money Concepts made simple for intraday XAU/USD (works on any symbol).
Finds BOS, 50% FVG “sniper” entries, optional Order Blocks, London H/L, news countdown, and a mini info panel.
What it does
BOS (Break of Structure): detects bullish/bearish BOS after London sweep logic.
FVG 50% entries: plots precise long/short entry dots at the midpoint of the gap.
Auto TP/SL: TP = RR × risk, SL below/above recent swing with a small buffer.
Order Blocks (optional): marks the last opposite candle after BOS and alerts on OB revisit.
London High/Low: tracks session range; session filter is optional.
News countdown: shows next event time and minutes left (user-selectable timezone).
Mini Panel: top-left table with Trend (last BOS), Next news, R:R, Pip size.
Inputs (key)
Auto pip size: uses syminfo.mintick. Manual override available.
Risk:Reward (RR): default 2.0.
Pivot length: swing sensitivity.
Sessions: enable if you want signals only 12:00–20:00 (symbol timezone). Off = anytime.
News timezone: pick your own (e.g., Europe/Brussels, America/New_York).
Absolute & daily times: add your events (strings like 2025-09-17 20:00 or 14:30,16:00…).
Show labels/levels/OBs: toggle on/off.
Alerts included
BOS Bullish / BOS Bearish
BUY Entry / SELL Entry (return to 50% FVG)
Bullish OB revisit / Bearish OB revisit
TP Long/Short reached, SL Long/Short hit
NEWS WARNING (warning window only; does not block signals)
To use: Add Alert → Condition: this indicator → choose any of the alertconditions.
Best use
Bias: H1 for structure.
Execution: M15 (standard) or M5 (aggressive).
Works great on XAUUSD, but is symbol-agnostic (auto pip adapts).
Notes
News times display in the timezone you pick in settings.
OBs are a simple implementation meant for quick visual guidance.
Labels: BUY/SELL near entries, TP/SL on set and when hit, BOS up/down.
Risk disclaimer
This tool is for education only. Not financial advice. Backtest and manage risk.
MarketStructureLibMarketStructure Library
This library extends the "MarketStructure" library by mickes () under the Mozilla Public License 2.0, credited to mickes. It provides functions for detecting and visualizing market structure, including Break of Structure (BOS), Change of Character (CHoCH), Equal High/Low (EQH/EQL), and liquidity zones, with enhancements for improved accuracy and customization.
Functionality
Market Structure Detection: Identifies internal (orderflow) and swing market structures using pivot points, with support for BOS, CHoCH, and EQH/EQL.
Volatility Filter: Only confirms pivots when the ATR exceeds a user-defined threshold, reducing false signals in low-volatility markets.
Trend Strength Metric: Calculates a trend strength score based on pivot frequency and volatility, stored in the Structure type for use in scripts.
Customizable Visualizations: Allows users to configure line styles and colors for BOS and CHoCH, and label sizes for pivots, BOS, CHoCH, and liquidity.
Liquidity Zones: Visualizes liquidity levels with confirmation bars and lookback periods.
Methodology
Pivot Detection: Uses ta.pivothigh and ta.pivotlow with a volatility filter (ATR multiplier) to confirm significant pivots.
Trend Strength: Computes a score as pivotCount / LeftLength * (currentATR / ATR), reflecting trend reliability based on pivot frequency and market volatility.
BOS/CHoCH Logic: Detects BOS when price breaks a pivot in the trend direction, and CHoCH when price reverses against the trend, with labels for "MSF" or "MSF+" based on pivot patterns.
EQH/EQL Zones: Creates boxes around equal highs/lows within an ATR-based threshold, with optional extension.
Visualization: Draws lines and labels for BOS, CHoCH, and liquidity, with user-defined styles, colors, and sizes.
Usage
Integration: Import into Pine Script indicators (e.g., import Fenomentn/MarketStructure/1) to analyze market structure.
Configuration: Set pivot lengths, volatility threshold, label sizes, and visualization styles via script inputs.
Alerts: Enable alerts for BOS, CHoCH, and EQH/EQL events, triggered on bar close to avoid repainting.
Best Practices: Use on forex or crypto charts (1m to 12h timeframes) for optimal results. Adjust the volatility threshold for different market conditions.
Originality
This library builds on mickes’ framework by adding:
A volatility-based pivot filter to enhance signal accuracy.
A trend strength metric for assessing trend reliability.
Dynamic label sizing and customizable visualization styles for better usability. No additional open-source code was reused beyond mickes’ library, credited under MPL 2.0.
Developed by Fenomentn. Published under Mozilla Public License 2.0.
Market Structure Break Targets [UAlgo]The "Market Structure Break Targets  " indicator is designed to identify and visualize key market structure points such as Market Structure Breaks (MSBs) and Break of Structures (BoS). These points are crucial for understanding market trends and potential reversal zones. By plotting these structures on the chart, traders can easily spot significant support and resistance levels, as well as potential entry and exit points.
This indicator uses a combination of swing highs and lows to determine market structures and calculates targets based on user-defined percentages or Average True Range (ATR) multipliers. It provides visual cues in the form of lines, labels, and boxes to help traders quickly interpret market conditions.
  
 🔶 Key Features 
 Customizable Swing Length:  Users can set the swing length to identify the pivot highs and lows, which are crucial for determining market structure.
 Target Duration Bars:  Defines the maximum duration (in bars) for which the targets will be considered valid.
 Target Calculation Methods:  The target levels are crucial for setting potential price objectives. The calculation can be based on a percentage move from the identified pivot or using the ATR to factor in market volatility. These targets help in setting realistic profit-taking levels or identifying stop-loss placements.
  
  
 Bullish and Bearish Market Structure Break (MSB):  Detects and highlights bullish and bearish market structure breaks with customizable colors and target percentages.
 Bullish MSB  
When the price closes above a significant pivot high, a bullish MSB is identified. The indicator will draw a line at this level and calculate a target based on the chosen method (percentage or ATR). The target is visualized with a dotted line, and a label "MSB" is displayed. Additionally, an order block is created at the level of the bullish MSB. This order block is highlighted with a semi-transparent box, representing a potential area where price might find support in the future.
 Bearish MSB  
Conversely, when the price closes below a significant pivot low, a bearish MSB is marked. Similar to bullish MSBs, targets are calculated and displayed on the chart. An order block is also generated at the level of the bearish MSB, visualized with a semi-transparent box. This box highlights a potential resistance area where price might face selling pressure.
 Bullish and Bearish Break of Structure (BoS):  Identifies break of structures for both bullish and bearish scenarios, providing additional target levels.
  
 Bullish BoS  
If the price continues to rise and breaks another significant level, a bullish BoS is detected. This break is also marked with lines and labels, providing additional target levels for traders. An order block is created at the BoS level, serving as a potential support zone.
 Bearish BoS  
If the price falls further after a bearish MSB, a bearish BoS is identified and visualized similarly. The indicator creates an order block at the BoS level, which acts as a potential resistance zone.
  
  
🔶 Disclaimer:
Use with Caution: This indicator is provided for educational and informational purposes only and should not be considered as financial advice. Users should exercise caution and perform their own analysis before making trading decisions based on the indicator's signals.
Not Financial Advice: The information provided by this indicator does not constitute financial advice, and the creator (UAlgo) shall not be held responsible for any trading losses incurred as a result of using this indicator.
Backtesting Recommended: Traders are encouraged to backtest the indicator thoroughly on historical data before using it in live trading to assess its performance and suitability for their trading strategies.
Risk Management: Trading involves inherent risks, and users should implement proper risk management strategies, including but not limited to stop-loss orders and position sizing, to mitigate potential losses.
No Guarantees: The accuracy and reliability of the indicator's signals cannot be guaranteed, as they are based on historical price data and past performance may not be indicative of future results.
Zendog V2 backtest DCA bot 3commasHi everyone,
After a few iterations and additional implemented features this version of the Backtester is now open source.
The Strategy is a Backtester for 3commas DCA bots. The main usage scenario is to plugin your external indicator, and backtest it using different DCA settings.
Before using this script please make sure you read these explanations and make sure you understand how it works.
Features:
- Because of Tradingview limitations on how orders are grouped into Trades, this Strategy statistics are calculated by the script, so please ignore the Strategy Tester statistics completely
Statistics Table explained:
    - Status: either all deals are closed or there is a deal still running, in which case additional info
    is provided below, as when the deal started, current PnL, current SO
    - Finished deals: Total number of closed deals both Winning and Losing.
    A deal is comprised as the Base Order (BO) + all Safety Orders (SO) related to that deal, so this number
    will be different than the Strategy Tester List of Trades
    - Winning Deals: Deal ended in profit
    - Losing deals: Deals ended with loss due to Stop Loss. In the future I might add a Deal Stop condition to
    the script, so that will count towards this number as well.
    - Total days ( Max / Avg days in Deal ):
    Total Days in the Backtest given by either Tradingview limitation on the number of candles or by the
    config of the script regarding "Limit Date Range".
    Max Days spent in a deal + which period this happened.
    Avg days spent in a deal.
    - Required capital: This is the total capital required to run the Backtester and it is automatically calculated by
    the script taking into consideration BO size, SO size, SO volume scale. This should be the same as 3commas.
    This number overwrites strategy.initial_capital and is used to calculate Profit and other stats, so you don't need
    to update strategy.initial_capital every time you change BO/SO settings
    - Profit after commission
    - Buy and Hold return: The PnL that could have been obtained by buying at the close of the first candle of the
    backtester and selling at the last.
    - Covered deviation: The % of price move from initial BO order covered by SO settings
    - Max Deviation: Biggest market % price move vs BO price, in the other direction (for long
    is down, for short it is up)
    - Max Drawdown: Biggest market % price move vs Avg price of the whole Trade (BO + any SO), in the other
    direction (for long price goes down, for short it goes up)
    This is calculated for the whole Trade so it is different than List of Trades
    - Max / Avg bars in deal
    - Total volume / Commission calculated by the strategy. For correct commission please set Commission in the
    Inputs Tab and you may ignore Properties Tab
    - Close stats for deals: This is a list of how many Trades were closed at each step, including Stop Loss (if
    configured), together with covered deviation for that step, the number of deals, and the percentage of this
    number from all the deals
    TODO: Might add deal avg value for each step
- Settings Table that can be enabled / disabled just to have an overview of your configs on the chart, this is a
drawn on bottom left
- Steps Table similar to 3commas, this is also drawn on bottom left, so please disable Settings table if you want
to see this one
TODO: Might add extra stats here
- Deal start condition: built in RSI-7 or plugin any external indicator and compare with any value the indicator plots
(main purpose of this strategy is to connect your own studies, so using external indicator is recommended)
- Base order and safety orders configs similar to 3commas (order size, percent deviation, safety orders,
percent scale and volume scale)
- Long and Short
- Stop Loss
- Support for Take profit from base order or from Total volume of the deal
- Configs help (besides self explanatory):
    - Chart theme: Adjust according to the theme you run on. There is no way to detect theme at the moment.
    This adjust different colors
    - Deal Start Type: Either a builtin RSI7 or "External indicator"
    - Indicator Source an value: If using External Indicator then select source, comparison and value.
    For example you could start a deal when Volume is greater than xxxx, or code a custom indicator that plots
    different values based on your conditions and test those values
    - Visuals / Decimals for display: Adjust according to your symbol
    - BO Entry Price for steps table: This is the BO start deal price used to calculate the steps in the table
Smart Money Trades Pro [BOSWaves]Smart Money Trades Pro   – Advanced Market Structure & Liquidity Visualizer
 
 Overview 
Smart Money Trades Pro is a comprehensive trading tool designed for traders seeking an in-depth understanding of market structure, liquidity dynamics, and institutional flow. The indicator systematically identifies key market turning points, including break of structure (BOS) and change of character (CHoCH) events, and overlays these with adaptive visualizations to highlight high-probability trade setups. By integrating ATR-based risk zones, progressive take-profit levels, and real-time trade analytics, Smart Money Trades Pro transforms complex price action into an interpretable framework suitable for multiple trading styles, including scalping, intraday, and swing trading.
  
Unlike traditional static indicators, Smart Money Trades Pro adapts continuously to market conditions. It evaluates swing highs and lows over a configurable lookback period, then determines structural breaks using customizable confirmation methods (candle body or wick). The resulting signals are augmented with dynamic entry, stop-loss, and target levels, allowing traders to analyze potential trade opportunities with both precision and context. The indicator’s design ensures that each visual element—trend-colored candles, signal markers, and risk/reward boxes—reflects real-time market conditions, offering an actionable interpretation of institutional activity.
 How It Works 
The indicator’s foundation is built upon market structure analysis. By calculating pivot highs and lows over a specified period, Smart Money Trades Pro identifies potential points of liquidity accumulation and exhaustion. When price breaks a pivot high or low, the indicator evaluates whether this constitutes a BOS or a CHoCH, signaling trend continuation or reversal. These events are marked on the chart with distinct visual cues, allowing traders to quickly discern shifts in market sentiment without manually analyzing historical price action.
Once a structural break is confirmed, the indicator automatically determines entry levels, stop-loss placements, and progressive take-profit zones (TP1, TP2, TP3). These calculations are based on ATR-derived volatility, ensuring that targets scale with current market conditions. Risk and reward zones are plotted as shaded boxes, providing a clear visual representation of potential profit relative to risk for each trade setup. This system allows traders to maintain discipline and consistency, with dynamic trade management baked directly into the visualization.
Trend direction is further reinforced by color-coded candles, which reflect the prevailing market bias. Bullish trends are represented by one color, bearish trends by another, and neutral conditions are displayed in muted tones. This continuous visual feedback simplifies the process of trend assessment and helps confirm the validity of trade setups alongside BOS and CHoCH markers.
 Signals and Breakouts 
Smart Money Trades Pro includes structured visual signals to indicate actionable price movements:
 
 Bullish Break Signals  – Triangular markers below the candle appear when a swing high is broken, suggesting potential long opportunities.
 Bearish Break Signals  – Triangular markers above the candle appear when a swing low is broken, indicating potential short setups.
 Change of Character (CHoCH)  – Special markers highlight trend reversals, showing where momentum shifts from bullish to bearish or vice versa.
 
These markers are strategically spaced to prevent overlap and remain clear during high-volatility periods. Traders can use them in combination with trend-colored candles, risk/reward zones, and ATR-based targets to assess the strength and reliability of each setup. The integrated table provides live trade information, including entry price, stop-loss level, take-profit levels, risk/reward ratio, and trade direction, ensuring that trade decisions are informed and data-driven.
 Interpretation 
 Trend Analysis : The indicator’s trend coloring, combined with BOS and CHoCH detection, provides an immediate view of market direction. Rising structures indicate bullish momentum, while falling structures signal bearish momentum. CHoCH markers highlight potential trend reversals or significant liquidity sweeps.
 Volatility and Risk Assessment : ATR-based calculations determine stop-loss distances and target levels, giving a quantitative measure of risk relative to market volatility. Wide ATR readings indicate periods of high price fluctuation, whereas narrow readings suggest consolidation and reduced risk exposure.
 Market Structure Insights : By monitoring swing highs and lows alongside break confirmations, traders can identify where institutional players are likely active. Areas with multiple structural breaks or overlapping targets can indicate liquidity hotspots, potential reversal zones, or areas of market congestion.
 Trade Management : The built-in trade zones allow traders to visualize entry, risk, and reward simultaneously. Progressive targets (TP1, TP2, TP3) reflect incremental profit-taking strategies, while dynamic stop-loss levels help preserve capital during adverse moves.
 Strategy Integration 
Smart Money Trades Pro supports a range of trading approaches:
 
 Trend Following : Enter trades in the direction of confirmed BOS while using CHoCH markers and trend-colored candles to validate momentum.
 Pullback Entries : Use failed breakout retests or minor reversals toward broken structure levels for lower-risk entries.
 Mean Reversion : In consolidated zones with narrow ATR and repeated BOS/CHoCH activity, anticipate reversals or short-term corrective moves.
 Multi-Timeframe Confirmation : Overlay signals on higher or lower timeframes to filter noise and improve trade accuracy.
 
Stop-loss levels should be placed just beyond the opposing structural point, while take-profit targets can be scaled using the ATR-based zones. Progressive targets allow for partial exits or scaling out of trades while maintaining exposure to larger moves.
 Advanced Techniques 
Traders seeking greater precision can combine Smart Money Trades Pro with volume, momentum, or volatility indicators to validate signals. Observing sequences of BOS and CHoCH markers across multiple timeframes provides insight into liquidity accumulation and depletion trends. Tracking the expansion or contraction of ATR-based zones helps anticipate shifts in volatility, enabling better timing for entries and exits.
Customizing the structure period and confirmation type allows the indicator to adapt to different asset classes and timeframes. Shorter periods increase sensitivity to smaller swings, while longer periods filter noise and emphasize higher-probability structural breaks. By integrating these features, the indicator offers a robust statistical framework for disciplined, data-driven trading decisions.
 Inputs and Customization 
 
 Structure Detection Period : Defines the lookback window for pivot high and low calculation.
 Break Confirmation : Choose whether to confirm breaks using candle body or wick.
 Display CHoCH : Toggle visibility of change-of-character markers.
 Color Trend Bars : Enable color-coding of candles based on market structure direction.
 Show Info Table : Display trade dashboard showing entry, stop-loss, take-profits, risk/reward, and bias.
 Table Position : Choose from top-left, top-right, bottom-left, or bottom-right placement.
 Color Customization : Configure bullish, bearish, neutral, risk, reward, and text colors for enhanced visual clarity.
 
 Why Use Smart Money Trades Pro 
Smart Money Trades Pro transforms complex market behavior into an actionable visual framework. By combining market structure analysis, liquidity tracking, ATR-based risk/reward mapping, and a dynamic trade dashboard, it provides a multidimensional view of the market. Traders can focus on execution, interpret trends, and evaluate overextensions or reversals without relying on guesswork. The indicator is suitable for scalping, intraday, and swing strategies, offering a comprehensive system for understanding and trading alongside institutional participants.
XAUUSD Strength Dashboard with VolumeXAUUSD Strength Dashboard with Volume Analysis
📌 Description
This advanced Pine Script indicator provides a multi-timeframe dashboard for XAUUSD (Gold vs. USD), combining price action analysis with volume confirmation to generate high-probability trading signals. It detects:
✅ Break of Structure (BOS)
✅ Fair Value Gaps (FVG)
✅ Change of Character (CHOCH)
✅ Trendline Breaks (9/21 SMA Crossover)
✅ Volume Spikes (Confirmation of Strength)
The dashboard displays strength scores (0-100%) and action recommendations (Strong Buy/Buy/Neutral/Sell/Strong Sell) across multiple timeframes, helping traders identify confluences for better trade decisions.
🎯 How It Works
1. Multi-Timeframe Analysis
Fetches data from 1m, 5m, 15m, 30m, 1h, 4h, Daily, and Weekly timeframes.
Compares trend direction, BOS, FVG, CHOCH, and volume spikes across all timeframes.
2. Volume-Confirmed Strength Score
The Strength Score (0-100%) is calculated using:
Trend Direction (25 points) → 9 SMA vs. 21 SMA
Break of Structure (20 points) → New highs/lows with momentum
Fair Value Gaps (10 points) → Imbalance zones
Change of Character (10 points) → Shift in market structure
Trendline Break (20 points) → SMA crossover confirmation
Volume Spike (15 points) → High volume confirms moves
Score Interpretation:
≥75% → Strong Buy (High confidence bullish move)
60-74% → Buy (Bullish but weaker confirmation)
40-59% → Neutral (No strong bias)
25-39% → Sell (Bearish but weaker confirmation)
≤25% → Strong Sell (High confidence bearish move)
3. Dashboard & Chart Markers
Dashboard Table: Shows Trend, BOS, Volume, CHOCH, TL Break, Strength %, Key Level, and Action for each timeframe.
Chart Markers:
🟢 Green Triangles → Bullish BOS
🔴 Red Triangles → Bearish BOS
🟢 Green Circles → Bullish CHOCH
🔴 Red Circles → Bearish CHOCH
📈 Green Arrows → Bullish Trendline Break
📉 Red Arrows → Bearish Trendline Break
"Vol↑" (Lime) → Bullish Volume Spike
"Vol↓" (Maroon) → Bearish Volume Spike
🚀 How to Use
1. Dashboard Interpretation
Higher Timeframes (D/W) → Show the dominant trend.
Lower Timeframes (1m-4h) → Help with entry timing.
Strength Score ≥75% or ≤25% → Look for high-confidence trades.
Volume Spikes → Confirm breakouts/reversals.
2. Trading Strategy
📈 Long (Buy) Setup:
Higher TFs (D/W/4h) show bullish trend (↑).
Current TF has BOS & Volume Spike.
Strength Score ≥60%.
Key Level (Low) holds as support.
📉 Short (Sell) Setup:
Higher TFs (D/W/4h) show bearish trend (↓).
Current TF has BOS & Volume Spike.
Strength Score ≤40%.
Key Level (High) holds as resistance.
3. Customization
Adjust Volume Spike Multiplier (Default: 1.5x) → Controls sensitivity to volume spikes.
Toggle Timeframes → Enable/disable higher/lower timeframes.
🔑 Key Benefits
✔ Multi-Timeframe Confluence → Avoids false signals.
✔ Volume Confirmation → Filters low-quality breakouts.
✔ Clear Strength Scoring → Removes emotional bias.
✔ Visual Chart Markers → Easy to spot key signals.
This indicator is ideal for gold traders who follow institutional order flow, market structure, and volume analysis to improve their trading decisions.
🎯 Best Used With:
Support/Resistance Levels
Fibonacci Retracements
Price Action Confirmation
🚀 Happy Trading! 🚀
Order-Flow Market StructureOrder-Flow Market Structure by The_Forex_Steward 
 A precision tool for visualizing internal shifts, swing structure, BOS events, Fibonacci levels, and multi-timeframe alerts. 
 What It Does 
The Order-Flow Market Structure indicator intelligently tracks and visualizes price structure using higher timeframe candles. It automatically detects:
• Internal bullish and bearish structure shifts
• Swing highs and lows (HH, HL, LH, LL)
• Break of Structure (BoS) confirmations
• Fibonacci retracement levels from recent swing moves
• Real-time alerts across LTF, MTF, and HTF modes
It’s a complete tool for traders who follow Smart Money Concepts, ICT, or institutional price action strategies.
 How It Works 
• You select a Higher Timeframe (HTF) to set the structural context
• Internal shifts are identified using HTF candle closes
• The indicator scans for swing highs/lows after each internal shift
• Breaks of previous swing points confirm BoS and plot horizontal lines
• Zigzag lines visually connect structural points (swings and BoS)
• Fibonacci levels are drawn between the latest swings
• Alerts can be configured for structure shifts, BoS events, and fib level breaks
 How to Use It 
Set your preferred HTF (e.g., 1H while trading on 5-minute)
Enable Fibonacci levels to visualize retracement zones
Watch for:
• Bullish internal shifts → HL to HH
• Bearish internal shifts → LH to LL
• BOS → Breakout confirmation
Enable alerts to catch structural events in real-time
Adjust the "Safe History Offset" if working with long lookbacks or volatile assets
 Who It's For 
• Traders using Smart Money, ICT, or market structure-based systems
• Scalpers, day traders, and swing traders
• Anyone needing precise structural insight across multiple timeframes
 Features 
• BoS detection with custom line styles and width
• HH, HL, LH, LL label plotting
• Optional Fibonacci retracement zones
• Custom alerts for swing shifts and fib level breaks
• LTF, MTF, and HTF alert modes
 Stay aligned with structure, trade with precision, and get alerted to key shifts in real time.






















