phx_fvgfvg generator 4h and current time frame library to import fvg from 4h with midle line and proximity support and resistance Pine Script® libraryby convergo11Updated 0
FVG Detector - With Close Direction & Breakoutdetects fvg. sharp rejection and sweep. developed to help traders achieve success with close direction and breakoutPine Script® indicatorby Danito_1
FVG (1MLuva) - Multi-TimeframeTook something that was cool that Nephew Sam made and added some more awesome-sauce! Make dat dinero!Pine Script® indicatorby the1mLuvaUpdated 7
Fair Value Gaps (40+ Points) with NY Session AlertsFVG with alerts. This works for the NY session only. Pine Script® indicatorby makeit4fam3
FVG BearishThis indicator identified negetive Fair Value Gap based on the following creteria: 1. Gap between the last but 1 candle low and current candle high 2. The width of the gap is at least 0.3% of current close 3. The previous candle is a bearish candle with body at least 0.7% of current close 4. Value of the previous candle is greater tha equal to 30 M 5. The candle is marked with red dot on topPine Script® indicatorby UKHASTAGIR3
FVG BullishThis indicator marks the formation of Positive fair value gap in 1 min chart based on the following conditions: 1. Low of current candle is higher than last but one candle 2. The gap between the two is atleast 0.3% of current closing 3. The middle candle oftren called as the expansion candle is at least 0.7% of current close 4. Valune of the expansion candle is greater than 30M indicating institutional participation 5. Such candle are indicated by Green curcles at the bottomePine Script® indicatorby UKHASTAGIR3
FVG & Order BlocksPlots fair value gaps and order blocks to the chart Pine Script® indicatorby Greaf71
FVG Strength Detector (1–5)shows you fair value gaps with a rating score of 5 strongest to 1 weakest so if u see a 4 thats a good areaPine Script® indicatorby ISPGAPUpdated 77
Confluence IndicatorFVG Liquidity sweeps Order blocks Break of structurePine Script® indicatorby rachellvp123489
FVG + Liquidity Sweepsthis is a test and i don't know if it is gonna actually work but let me know if it does.Pine Script® indicatorby justin_martinez13321197
FVG + IFVG Gap (ULTRA) by Aditya NejeThis Indicator shows Fair Value Gap and Inverse Fair Value gapsPine Script® indicatorby legalFinance94721Updated 189
SMC Liquidity Engine Pro SMC Liquidity Engine Pro - Complete Trading Guide & Documentation 📊 Introduction: Understanding Smart Money Concepts The SMC Liquidity Engine Pro is a comprehensive, institutional-grade trading indicator that brings professional Smart Money Concepts (SMC) methodology directly to your TradingView charts. This isn't just another technical indicator—it's a complete framework for understanding how institutional traders, market makers, banks, and hedge funds manipulate and move the markets. What Makes This Different? While most retail traders rely on lagging indicators like moving averages or RSI, this indicator reveals the real-time footprints of institutional activity. It shows you: Where large players are accumulating or distributing positions How they engineer liquidity to trigger retail stop losses When they're shifting from one directional bias to another Where price inefficiencies exist that institutions will likely revisit The markets don't move randomly—they move based on liquidity. Understanding this fundamental truth is what separates consistently profitable traders from those who struggle. This indicator decodes that liquidity-driven behavior and presents it in clear, actionable visual signals. The Philosophy Behind Smart Money Concepts Smart Money Concepts is built on several core principles: 1. Liquidity is King: Price doesn't move because of patterns or indicators—it moves to collect liquidity (stop losses and pending orders). Institutions need massive liquidity to fill their large positions, so they engineer price movements to create that liquidity before making their real directional move. 2. Market Structure Reveals Intent: The way price forms highs and lows tells a story about who's in control. When structure breaks, it signals a shift in institutional positioning. 3. Inefficiencies Get Filled: When price moves too quickly in one direction, it leaves behind "fair value gaps"—areas of imbalance. Institutions frequently return to these areas to fill orders and restore balance. 4. Manipulation Precedes True Moves: The most explosive directional moves are often preceded by liquidity sweeps in the opposite direction—trapping retail traders before the real move begins. This indicator automates the identification of all these concepts, allowing you to trade alongside the smart money rather than being their exit liquidity. 🎯 Core Features - Deep Dive 1. Market Structure Detection & Visualization What It Is: Market structure forms the foundation of all Smart Money analysis. This indicator automatically identifies and tracks swing highs and swing lows using a sophisticated pivot detection algorithm. These aren't just any price points—they represent areas where the market showed a significant shift in supply and demand dynamics. How It Works: The indicator uses a customizable lookback period to identify valid swing points. A swing high must have lower highs on both sides within the lookback period, and a swing low must have higher lows on both sides. This ensures that only significant structural points are marked, filtering out minor noise and consolidation. Visual Presentation: Bullish Structure (Cyan Lines): Horizontal lines extending from each identified swing high, showing resistance levels that price previously respected Bearish Structure (Red Lines): Horizontal lines extending from each identified swing low, showing support levels where buying pressure emerged Trading Application: These structure levels serve multiple purposes: Target Zones: Previous highs become targets in uptrends; previous lows become targets in downtrends Invalidation Levels: If expecting a bullish move, breaking below the last swing low invalidates the setup Context for Other Signals: All BOS, CHOCH, and liquidity sweep signals gain meaning from their relationship to structure Multi-Timeframe Anchors: Higher timeframe structure provides context for lower timeframe entries Advanced Tip: When multiple timeframe structures align (e.g., a daily swing low coincides with a 4-hour swing low), these levels carry significantly more weight and are more likely to be defended or, when broken, lead to explosive moves. 2. Break of Structure (BOS) - Trend Confirmation What It Is: A Break of Structure occurs when price definitively closes beyond a previous swing high (bullish BOS) or swing low (bearish BOS). This signals that the current trend maintains its momentum and is likely to continue in the same direction. The Institutional Perspective: When institutions want to continue pushing price in a direction, they need to break through previous resistance or support. A clean BOS indicates that: There's sufficient institutional buying/selling to overcome the supply/demand at previous structure The trend has enough momentum to attract more participants Stop losses above/below structure have been triggered, providing liquidity for continuation Signal Characteristics: Bullish BOS Label: Appears below the bar that closes above the previous swing high Bearish BOS Label: Appears above the bar that closes below the previous swing low Confirmation: Requires a full candle close, preventing false signals from wicks Trading Strategies: Trend Continuation Entries: After a BOS, wait for a pullback to a Fair Value Gap or minor structure, then enter in the direction of the break Breakout Trading: Enter immediately on BOS confirmation with a stop below the broken structure Momentum Confirmation: Use BOS to confirm that your existing position is aligned with institutional flow Scaling Strategy: Add to positions on each successive BOS in trending markets What to Watch For: Volume: Strong BOS movements should be accompanied by above-average volume Speed: Rapid price movement through structure suggests institutional urgency Follow-Through: The best BOS signals see price continue strongly without immediately reversing Higher Timeframe Alignment: BOS on higher timeframes (4H, Daily) carry more weight than lower timeframe breaks Common Pitfalls: Not all structure breaks are equal—BOS during ranging markets are less reliable A BOS immediately followed by a reversal back into the range may indicate a failed breakout During major news events, structure can be broken temporarily without institutional intent 3. Liquidity Sweep Detection - Spotting Manipulation What It Is: Liquidity sweeps (also called "stop hunts" or "liquidity grabs") occur when price temporarily breaks beyond a key level to trigger stop losses and pending orders, then immediately reverses back. This is one of the most important concepts in SMC trading because it reveals intentional manipulation. Why Institutions Do This: Large institutional orders can't be filled at a single price point—they need massive liquidity. The biggest pools of liquidity sit just beyond obvious highs and lows where retail traders place their stops. By briefly pushing price into these zones, institutions: Trigger retail stop losses (creating market orders) Activate pending buy/sell orders Fill their large positions at favorable prices Trap late breakout traders before reversing Detection Methodology: The indicator identifies sweeps using multiple criteria: Price must penetrate beyond the structural high/low (creating the sweep) The candle must close back on the opposite side of the structure (confirming rejection) The sweep distance is measured against ATR to distinguish manipulation from normal volatility The sweep multiplier setting allows you to adjust sensitivity based on market conditions Visual Indicators: Orange Down Arrows: Mark liquidity sweeps above structural highs Lime Up Arrows: Mark liquidity sweeps below structural lows Liquidity Zone Boxes: Semi-transparent colored boxes highlight the exact range of the swept area Persistent Display: Zones remain visible for several bars to maintain context Trading Applications: Reversal Trading: Liquidity sweeps often mark excellent reversal points. After a sweep: Wait for the sweep to complete (candle closes back inside structure) Look for a Change of Character signal for confirmation Enter in the direction opposite to the sweep Place stops beyond the sweep high/low Target the opposite side of the range or next structural level Continuation Filtering: Not all sweeps lead to reversals. During strong trends: Sweeps of minor structure in a trending market often precede continuation Use higher timeframe structure to determine if a sweep is counter-trend (likely reversal) or with-trend (likely continuation) Entry Refinement: In ranging markets, trade from swept lows to highs and vice versa, as institutions accumulate at the extremes. Advanced Sweep Analysis: Double Sweeps: When both sides of a range are swept, expect a strong breakout Sweep Rejection Quality: Fast, strong rejections of sweeps are more reliable than slow grinding returns Timeframe Consideration: Daily timeframe sweeps are significantly more important than 15-minute sweeps Volume Profile: Sweeps with low volume followed by high volume reversals confirm manipulation What Makes a High-Quality Sweep Signal: ✅ Penetrates structure by at least 0.5-1x ATR ✅ Strong rejection candle (long wick, decisive close) ✅ Occurs at a higher timeframe structural level ✅ Creates a Change of Character on the following move ✅ Sweeps an obvious level where retail stops cluster 4. Change of Character (CHOCH) - Major Reversal Signals What It Is: A Change of Character represents the most significant shift in market dynamics—when the entire structural bias of the market flips from bullish to bearish or bearish to bullish. CHOCH signals are the crown jewel of SMC trading because they identify the exact moment when institutional positioning fundamentally changes. The Anatomy of a CHOCH: A valid CHOCH requires a specific sequence: Established Trend: A clear directional bias with multiple BOS in one direction Liquidity Engineering: A sweep of structure in the current trend direction (the manipulation phase) Structural Break: Price then breaks structure in the OPPOSITE direction (the revelation phase) This combination shows that institutions have: Completed their accumulation/distribution at favorable prices (via the sweep) Shifted their positioning from bullish to bearish (or vice versa) Begun a new directional campaign Visual Presentation: Bullish CHOCH (Cyan Triangle Up): Appears when bearish structure is broken after a low sweep, signaling the shift to bullish control Bearish CHOCH (Red Triangle Down): Appears when bullish structure is broken after a high sweep, signaling the shift to bearish control Prominent Markers: Larger and more visually distinct than BOS signals, reflecting their importance Why CHOCH Signals Are So Powerful: Trend Reversal Identification: They mark the earliest possible confirmation of a trend change High Win Rate: When combined with proper risk management, CHOCH signals have among the highest success rates in SMC trading Risk-Reward Ratio: Entering at CHOCH gives you the best possible risk-reward since you're entering at the beginning of a new trend Institutional Confirmation: The sequence of sweep + structure break proves institutional repositioning, not just retail sentiment Trading CHOCH Signals: The Perfect CHOCH Setup: Identify the Sweep: Watch for a liquidity sweep of structural lows (for bullish) or highs (for bearish) Wait for the Break: Don't enter on the sweep—wait for structure to break in the opposite direction CHOCH Confirmation: The indicator fires the CHOCH signal—this is your entry trigger Entry Execution: Aggressive: Enter immediately on CHOCH confirmation Conservative: Wait for a pullback to the first Fair Value Gap or broken structure (now turned support/resistance) Stop Placement: Beyond the swept liquidity point Target Selection: Previous swing in the opposite direction, or let it run to the next CHOCH Multiple Timeframe CHOCH Strategy: The most powerful setups occur when CHOCHs align across timeframes: Daily CHOCH: Signals major institutional trend change, target 500+ pips (Forex) or significant point moves 4H CHOCH: Confirms daily direction, provides swing trade opportunities 1H CHOCH: Offers precise entry timing within the higher timeframe trend 15M CHOCH: Used for position scaling and intraday management Example Trade Flow: Daily Chart: Bullish CHOCH appears after weeks of downtrend ↓ 4H Chart: Wait for pullback after the daily CHOCH, then catch the 4H bullish CHOCH ↓ 1H Chart: Enter on the 1H bullish CHOCH that aligns with both higher timeframes ↓ Result: You've entered at the beginning of a major trend with multiple confirmations CHOCH Quality Grading: A-Grade CHOCH (Highest Probability): Occurs at major higher timeframe structure Following a clear liquidity sweep Volume spike on the structural break Multiple timeframe alignment Creates a large Fair Value Gap on the break B-Grade CHOCH (Good Probability): Valid sweep and structure break Single timeframe signal Moderate volume Occurs at minor structure C-Grade CHOCH (Lower Probability): Choppy, ranging market context Weak sweep or unclear structure Counter to higher timeframe trend Low volume confirmation Common Mistakes with CHOCH Trading: ❌ Entering on the sweep instead of waiting for the structure break ❌ Ignoring higher timeframe context ❌ Taking every CHOCH regardless of quality ❌ Not waiting for pullbacks on aggressive trends ❌ Placing stops too tight, getting caught in volatility Advanced CHOCH Concepts: Failed CHOCH: Occasionally, what appears to be a CHOCH will fail (price reverses back into the previous trend). This often indicates: Insufficient institutional conviction for the reversal Fake-out to grab liquidity in the opposite direction Need to wait for a higher timeframe CHOCH for confirmation When a CHOCH fails, it often sets up an even stronger continuation of the original trend. CHOCH vs BOS Decision Matrix: If in doubt about trend direction → wait for CHOCH If confident in trend → trade BOS continuations After a CHOCH → next signals in the new direction are BOS 5. Fair Value Gaps (FVG) - Institutional Retracement Zones What It Is: Fair Value Gaps represent price imbalances where the market moved so quickly that it left behind inefficient pricing. These gaps form when there's no overlap between the current candle's wick and the candle from two bars ago—a void in the price action that creates a "gap" in the order flow. The Institutional Logic: When institutions execute large market orders, they can push price rapidly through levels without allowing normal two-way trading. This creates unfilled orders and imbalanced order books. Institutions often return to these gaps to: Fill additional orders at more favorable prices Allow the market to "breathe" before the next push Create support/resistance at the gap for the next move Restore balance to the order book FVG Formation Criteria: This indicator uses enhanced FVG detection logic: Bullish FVG (Upward Gap): Current candle's low is above the high from 2 candles ago Creates a visible gap where no trading occurred Gap size must exceed 30% of ATR (filtering minor gaps) Typically forms on strong bullish momentum candles Market moved up so fast it left unfilled sell orders Bearish FVG (Downward Gap): Current candle's high is below the low from 2 candles ago Creates a visible gap where no trading occurred Gap size must exceed 30% of ATR Typically forms on strong bearish momentum candles Market moved down so fast it left unfilled buy orders Visual Presentation: Bullish FVG Zones: Semi-transparent cyan boxes extending from gap bottom to top Bearish FVG Zones: Semi-transparent red boxes extending from gap top to bottom Dynamic Management: Gaps automatically removed when filled or expired Clean Display: Only active, unfilled gaps shown to prevent chart clutter FVG Trading Strategies: Strategy 1: FVG Retracement Entries After a CHOCH or strong BOS, wait for price to retrace into the FVG for entry: Identify trend direction via CHOCH or BOS Locate the nearest FVG in the direction of the trend Set limit orders within the FVG zone Stop loss beyond the FVG Target the next structural level or previous swing Strategy 2: FVG Breakout Confirmation When price breaks through an FVG without filling it: Signals extreme institutional urgency Indicates the move is likely to continue strongly The unfilled gap becomes a "no-go zone" for counter-trend entries Strategy 3: Multiple FVG Management When multiple FVGs form in sequence: The first FVG is most likely to be filled If price skips the first FVG, it signals exceptional strength Sequential gaps create a "gap ladder" for scaling into positions FVG Quality Assessment: High-Quality FVGs (Best Trading Zones): Large gap size (1.5x+ ATR) Formed on high volume impulse moves Aligned with higher timeframe structure Created during CHOCH or strong BOS Positioned between current price and key structure Low-Quality FVGs (Use Caution): Small gaps (< 0.5 ATR) Formed during choppy, ranging conditions Multiple overlapping gaps in the same area Counter to higher timeframe trend Very old gaps (50+ bars ago) FVG Lifecycle Management: The indicator intelligently manages FVG zones: Gap Filling: Bullish FVG is "filled" when price touches the bottom of the gap Bearish FVG is "filled" when price touches the top of the gap Filled gaps are automatically removed from the chart Partial fills count as complete fills (institutions got their orders) Gap Expiration: Gaps older than the extension period (default 10 bars) are removed This keeps the chart clean and focuses on relevant levels Adjustable from 5-50 bars based on timeframe and trading style Gap Priority: When multiple gaps exist, closest gap to current price is most relevant Advanced FVG Concepts: Nested FVGs: Sometimes FVGs form within larger FVGs. The smaller, more recent gap typically gets filled first, providing a secondary entry within the larger gap. FVG Clusters: When 3+ FVGs stack in the same zone, this area becomes a major institutional reaccumulation zone—excellent for swing entries. Inverted FVGs: Bullish FVGs in downtrends or bearish FVGs in uptrends can act as resistance/support where rallies/dips fail. FVG + Liquidity Sweep Combination: The ultimate entry setup: Liquidity sweep occurs CHOCH confirms reversal Price retraces into FVG created during the CHOCH move Enter with exceptional risk-reward ratio FVG Statistics & Probabilities: Research on FVG behavior shows: Approximately 70% of FVGs get filled within 20 bars FVGs formed during CHOCH have 80%+ fill rate Larger gaps (2x+ ATR) have lower but higher-quality fill rates Higher timeframe FVGs are more magnetic than lower timeframe Timeframe Considerations: Daily FVGs: Can remain unfilled for weeks Major institutional zones Often mark the absolute best entry prices for swing trades When filled, usually result in strong reactions 4H FVGs: Typically fill within 3-7 days Excellent for swing trading Balance between frequency and reliability 1H FVGs: Usually fill within 1-3 days Good for short-term position trading More frequent signals 15M FVGs: Often fill same day Best used for intraday refinement Should align with higher timeframe gaps 🔧 Customization & Settings Guide Structure Detection Settings Swing Lookback Period (3-50 bars): This is arguably the most important setting as it determines what the indicator considers "structure." Low Values (3-7): Identifies minor swings and frequent structure points More BOS and CHOCH signals Better for scalping and day trading Risk: More false signals in choppy markets Best for: 15M-1H charts, active traders Medium Values (8-15): Balanced approach capturing meaningful swings Default setting works well for most traders Good signal-to-noise ratio Best for: 1H-4H charts, swing traders High Values (16-50): Only major structural points identified Fewer but higher-quality signals Cleaner charts with less noise Better for trending markets Best for: 4H-Daily charts, position traders ATR Period (1-50): Controls how volatility is measured for liquidity sweep detection. Shorter Periods (7-14): More responsive to recent volatility changes Better during high volatility events May overreact to short-term spikes Longer Periods (15-30): Smoother, more stable volatility measurement Better for swing trading Reduces sensitivity to short-term noise Liquidity Sweep Multiplier (0.5-3.0): Determines how far beyond structure price must move to qualify as a sweep. Low Multiplier (0.5-0.9): Catches smaller, more frequent sweeps More signals but lower reliability Good for scalping or high-frequency trading Use in ranging markets Medium Multiplier (1.0-1.5): Balanced sensitivity Default 1.2 works for most situations Good signal quality High Multiplier (1.6-3.0): Only major, obvious sweeps detected Fewer but very high-quality signals Best for trending markets Use when you want only the clearest setups Display Options Toggle Controls: Each component can be individually enabled/disabled: Show Market Structure: Turn off when chart becomes too cluttered Essential for understanding context, generally keep ON Disable only when you know structure from higher timeframe Show Liquidity Zones: Highlights swept areas with boxes Can be disabled if you prefer cleaner charts Keep ON when learning to spot manipulation Show Break of Structure: BOS labels can be disabled if trading only reversals Keep ON for trend following strategies Show Change of Character: Core SMC signal, usually keep ON Only disable if focusing purely on continuation trading Show Fair Value Gaps: OFF by default to prevent overwhelming new users Turn ON once comfortable with basic structure Can generate many zones on lower timeframes FVG Extension Period (5-50 bars): Determines how long unfilled gaps remain displayed. Short Extension (5-10): Keeps charts very clean Only shows very recent gaps Good for day trading May remove gaps before they fill Medium Extension (11-25): Balanced approach Captures most gap fills Good for swing trading Long Extension (26-50): Shows historical gap context Better for position trading Higher timeframe analysis Can make charts busy on lower timeframes Color Scheme Customization Why Colors Matter: Visual clarity is crucial for quick decision-making. The color scheme should: Clearly distinguish bullish vs bearish elements Work well with your chart background (dark/light mode) Be visible but not distracting Match your personal preference for aesthetics Default Colors: Bullish: Cyan ( #00ffff) - visibility and association with "cool" buying Bearish: Red ( #ff0051) - visibility and universal danger/selling association FVG Bullish: 85% transparent cyan - visible but not overpowering FVG Bearish: 85% transparent red - visible but not overpowering Customization Tips: Increase transparency if zones overwhelm price action Use higher contrast colors on light backgrounds Keep bullish/bearish colors visually distinct Test colors across different market conditions Optimization by Market Type Forex (24-hour markets): Structure Lookback: 10-15 ATR Period: 14-21 Sweep Multiplier: 1.0-1.5 Best Timeframes: 15M, 1H, 4H Stocks (Session-based): Structure Lookback: 8-12 ATR Period: 14 Sweep Multiplier: 1.2-1.8 Best Timeframes: 5M, 15M, 1H, Daily Note: Gaps at market open/close aren't FVGs Cryptocurrency (High volatility): Structure Lookback: 12-20 (filter noise) ATR Period: 10-14 (responsive to volatility) Sweep Multiplier: 1.5-2.5 (larger sweeps) Best Timeframes: 15M, 1H, 4H Indices (Moderate volatility): Structure Lookback: 10-15 ATR Period: 14-20 Sweep Multiplier: 1.0-1.5 Best Timeframes: 1H, 4H, Daily 📈 Complete Trading System & Strategies The Complete SMC Trading Process Step 1: Higher Timeframe Analysis (Daily/4H) Begin every trading session by analyzing higher timeframes: Identify the prevailing market structure (bullish or bearish) Mark key swing highs and lows Note any recent CHOCHs that signal trend changes Identify major Fair Value Gaps that could act as targets or entry zones Determine areas of liquidity (obvious highs/lows where stops cluster) Step 2: Trading Timeframe Setup (1H/4H) Move to your primary trading timeframe: Wait for alignment with higher timeframe bias Look for CHOCH signals if expecting reversal Look for BOS signals if expecting continuation Identify liquidity sweeps that create trading opportunities Note nearby FVGs for entry refinement Step 3: Entry Timeframe Execution (15M/1H) Use lower timeframe for precise entry: After higher timeframe signal, wait for lower timeframe confirmation Enter on FVG fills, structure breaks, or CHOCH signals Place stop beyond swept liquidity or broken structure Set targets at next structure level or opposite side of range Step 4: Management Active trade management increases profitability: Move stop to breakeven after price moves 1R (risk unit) Take partial profits at first target (structure level) Let remainder run to major targets Trail stop using FVGs or structure breaks in your direction Exit if a counter-trend CHOCH appears High-Probability Trading Setups Setup 1: The Classic CHOCH Reversal Market Context: Extended trend in one direction Price reaching obvious highs/lows where liquidity pools Setup Requirements: Liquidity sweep of the high/low CHOCH signal fires (Optional) Wait for pullback to FVG Entry: On CHOCH confirmation or FVG fill Stop: Beyond swept liquidity Target: Previous swing in opposite direction Example (Bullish): Market in downtrend for 2 weeks Price sweeps below obvious daily low Bullish CHOCH fires (breaks previous lower high) Enter immediately or wait for pullback to bullish FVG Stop below swept low Target: Previous lower high, then previous high Risk-Reward: Typically 1:3 to 1:5+ Setup 2: BOS Continuation with FVG Entry Market Context: Established trend with recent CHOCH Strong momentum in trend direction Setup Requirements: Recent CHOCH established trend direction BOS signal confirms continuation Wait for pullback into FVG created on the BOS move Entry: Limit order within FVG zone Stop: Beyond FVG (invalid if exceeded) Target: Next structural level Example (Bearish): Bearish CHOCH 2 days ago Price makes BOS breaking new low Large bearish FVG created during the break Price retraces into FVG zone Enter short at FVG fill Stop above FVG Target: Next major low or daily FVG below Risk-Reward: 1:2 to 1:4 Setup 3: Liquidity Sweep Fade Market Context: Ranging market between defined highs/lows Obvious liquidity on both sides of range Setup Requirements: Clear range established (minimum 20-30 bars) Price sweeps one side of range (high or low) Strong rejection back into range Entry: After sweep rejection confirmed Stop: Beyond swept level Target: Opposite side of range Example: Range between 1.0850-1.0920 (EUR/USD) Price sweeps above 1.0920 to 1.0935 Strong bearish rejection candle back below 1.0920 Enter short at 1.0915 Stop at 1.0940 (above sweep high) Target: 1.0850 (range low) Risk-Reward: 1:2.6 Setup 4: Multi-Timeframe CHOCH Alignment Market Context: Major trend change occurring Multiple timeframes showing reversal signals Setup Requirements: Daily timeframe shows CHOCH Wait for 4H CHOCH in same direction Enter on 1H CHOCH that aligns Entry: 1H CHOCH confirmation Stop: Below 4H structure Target: Daily structural level Example (Bullish): Daily bearish trend for months Daily bullish CHOCH appears 4H shows bullish CHOCH next day 1H bullish CHOCH provides entry Enter long on 1H signal Stop: Below 4H swing low Target: Daily previous high Risk-Reward: 1:5 to 1:10+ Position: Larger size due to alignment Setup 5: Failed CHOCH Continuation Market Context: Strong trend temporarily looks like reversing "False" CHOCH creates trap for counter-trend traders Setup Requirements: Apparent CHOCH against main trend Price fails to follow through Original trend resumes with strong BOS Entry: On BOS in original trend direction Stop: Recent swing Target: Extension of original trend Example: Strong daily uptrend Bearish CHOCH appears (potential reversal) Price consolidates but doesn't follow through down Bullish BOS breaks above recent consolidation Enter long on BOS Stop: Below failed CHOCH low Target: New high extension Risk-Reward: 1:3 to 1:6 Note: Failed reversals often lead to explosive continuations Risk Management Framework Position Sizing: Never risk more than 1-2% of account per trade, even on A+ setups. Risk Calculation: Position Size = (Account Size × Risk %) / (Entry - Stop Loss in pips/points) Example: Account: $10,000 Risk: 1% = $100 Entry: 1.0900 Stop: 1.0870 (30 pips) Position Size: $100 / 30 pips = $3.33 per pip Lot Size (Forex): 0.33 lots Stop Loss Placement: For CHOCH Reversals: Place stop 5-10 pips beyond swept liquidity Gives room for volatility while protecting capital If swept liquidity is violated, setup is invalidated For BOS Continuations: Place stop beyond the FVG or structure that provided entry Typically tighter stops (closer to entry) Can trail stop to breakeven quickly For Range Trading: Stop beyond the swept level Generally tight stops work well in ranges Exit quickly if range boundaries break Take Profit Strategy: Scaling Out Method (Recommended): First Target (50% of position): First structural level (1:1 to 1:2) Second Target (30% of position): Major structure (1:3 to 1:5) Trail Stop (20% of position): Let run to full extension Full Exit Method: Hold entire position to predetermined target Requires more discipline Higher reward but also higher risk of giveback Trade Management Rules: Breakeven Rule: Move stop to breakeven after 1R profit Partial Profit Rule: Take partials at structure levels Trailing Rule: Trail stop Pine Script® indicatorby xqweasdzxcvUpdated 2245
FvgObject█ OVERVIEW This library provides a suite of methods designed to manage the visual representation and lifecycle of Fair Value Gap (FVG) objects on a Pine Script™ chart. It extends the `fvgObject` User-Defined Type (UDT) by attaching object-oriented functionalities for drawing, updating, and deleting FVG-related graphical elements. The primary goal is to encapsulate complex drawing logic, making the main indicator script cleaner and more focused on FVG detection and state management. █ CONCEPTS This library is built around the idea of treating each Fair Value Gap as an "object" with its own visual lifecycle on the chart. This is achieved by defining methods that operate directly on instances of the `fvgObject` UDT. Object-Oriented Approach for FVGs Pine Script™ v6 introduced the ability to define methods for User-Defined Types (UDTs). This library leverages this feature by attaching specific drawing and state management functions (methods) directly to the `fvgObject` type. This means that instead of calling global functions with an FVG object as a parameter, you call methods *on* the FVG object itself (e.g., `myFvg.updateDrawings(...)`). This approach promotes better code organization and a more intuitive way to interact with FVG data. FVG Visual Lifecycle Management The core purpose of this library is to manage the complete visual journey of an FVG on the chart. This lifecycle includes: Initial Drawing: Creating the first visual representation of a newly detected FVG, including its main box and optionally its midline and labels. State Updates & Partial Fills: Modifying the FVG's appearance as it gets partially filled by price. This involves drawing a "mitigated" portion of the box and adjusting the `currentTop` or `currentBottom` of the remaining FVG. Full Mitigation & Tested State: Handling how an FVG is displayed once fully mitigated. Depending on user settings, it might be hidden, or its box might change color/style to indicate it has been "tested." Mitigation lines can also be managed (kept or deleted). Midline Interaction: Visually tracking if the price has touched the FVG's 50% equilibrium level (midline). Visibility Control: Dynamically showing or hiding FVG drawings based on various criteria, such as user settings (e.g., hide mitigated FVGs, timeframe-specific visibility) or external filters (e.g., proximity to current price). Deletion: Cleaning up all drawing objects associated with an FVG when it's no longer needed or when settings dictate its removal. Centralized Drawing Logic By encapsulating all drawing-related operations within the methods of this library, the main indicator script is significantly simplified. The main script can focus on detecting FVGs and managing their state (e.g., in arrays), while delegating the complex task of rendering and updating them on the chart to the methods herein. Interaction with `fvgObject` and `drawSettings` UDTs All methods within this library operate on an instance of the `fvgObject` UDT. This `fvgObject` holds not only the FVG's price/time data and state (like `isMitigated`, `currentTop`) but also the IDs of its associated drawing elements (e.g., `boxId`, `midLineId`). The appearance of these drawings (colors, styles, visibility, etc.) is dictated by a `drawSettings` UDT instance, which is passed as a parameter to most drawing-related methods. This `drawSettings` object is typically populated from user inputs in the main script, allowing for extensive customization. Stateful Drawing Object Management The library's methods manage Pine Script™ drawing objects (boxes, lines, labels) by storing their IDs within the `fvgObject` itself (e.g., `fvgObject.boxId`, `fvgObject.mitigatedBoxId`, etc.). Methods like `draw()` create these objects and store their IDs, while methods like `updateDrawings()` modify them, and `deleteDrawings()` removes them using these stored IDs. Drawing Optimization The `updateDrawings()` method, which is the most comprehensive drawing management function, incorporates optimization logic. It uses `prev_*` fields within the `fvgObject` (e.g., `prevIsMitigated`, `prevCurrentTop`) to store the FVG's state from the previous bar. By comparing the current state with the previous state, and also considering changes in visibility or relevant drawing settings, it can avoid redundant and performance-intensive drawing operations if nothing visually significant has changed for that FVG. █ METHOD USAGE AND WORKFLOW The methods in this library are designed to be called in a logical sequence as an FVG progresses through its lifecycle. A crucial prerequisite for all visual methods in this library is a properly populated `drawSettings` UDT instance, which dictates every aspect of an FVG's appearance, from colors and styles to visibility and labels. This `settings` object must be carefully prepared in the main indicator script, typically based on user inputs, before being passed to these methods. Here’s a typical workflow within a main indicator script: 1. FVG Instance Creation (External to this library) An `fvgObject` instance is typically created by functions in another library (e.g., `FvgCalculations`) when a new FVG pattern is identified. This object will have its core properties (top, bottom, startTime, isBullish, tfType) initialized. 2. Initial Drawing (`draw` method) Once a new `fvgObject` is created and its initial visibility is determined: Call the `myFvg.draw(settings)` method on the new FVG object. `settings` is an instance of the `drawSettings` UDT, containing all relevant visual configurations. This method draws the primary FVG box, its midline (if enabled in `settings`), and any initial labels. It also initializes the `currentTop` and `currentBottom` fields of the `fvgObject` if they are `na`, and stores the IDs of the created drawing objects within the `fvgObject`. 3. Per-Bar State Updates & Interaction Checks On each subsequent bar, for every active `fvgObject`: Interaction Check (External Logic): It's common to first use logic (e.g., from `FvgCalculations`' `fvgInteractionCheck` function) to determine if the current bar's price interacts with the FVG. State Field Updates (External Logic): Before calling the `FvgObjectLib` methods below, ensure that your `fvgObject`'s state fields (such as `isMitigated`, `currentTop`, `currentBottom`, `isMidlineTouched`) are updated using the current bar's price data and relevant functions from other libraries (e.g., `FvgCalculations`' `checkMitigation`, `checkPartialMitigation`, etc.). This library's methods render the FVG based on these pre-updated state fields. If interaction occurs and the FVG is not yet fully mitigated: Full Mitigation Update (`updateMitigation` method): Call `myFvg.updateMitigation(high, low)`. This method updates `myFvg.isMitigated` and `myFvg.mitigationTime` if full mitigation occurs, based on the interaction determined by external logic. Partial Fill Update (`updatePartialFill` method): If not fully mitigated, call `myFvg.updatePartialFill(high, low, settings)`. This method updates `myFvg.currentTop` or `myFvg.currentBottom` and adjusts drawings to show the filled portion, again based on prior interaction checks and fill level calculations. Midline Touch Check (`checkMidlineTouch` method): Call `myFvg.checkMidlineTouch(high, low)`. This method updates `myFvg.isMidlineTouched` if the price touches the FVG's 50% level. 4. Comprehensive Visual Update (`updateDrawings` method) After the FVG's state fields have been potentially updated by external logic and the methods in step 3: Call `myFvg.updateDrawings(isVisibleNow, settings)` on each FVG object. `isVisibleNow` is a boolean indicating if the FVG should currently be visible. `settings` is the `drawSettings` UDT instance. This method synchronizes the FVG's visual appearance with its current state and settings, managing all drawing elements (boxes, lines, labels), their styles, and visibility. It efficiently skips redundant drawing operations if the FVG's state or visibility has not changed, thanks to its internal optimization using `prev_*` fields, which are also updated by this method. 5. Deleting Drawings (`deleteDrawings` method) When an FVG object is no longer tracked: Call `myFvg.deleteDrawings(deleteTestedToo)`. This method removes all drawing objects associated with that `fvgObject`. This workflow ensures that FVG visuals are accurately maintained throughout their existence on the chart. █ NOTES Dependencies: This library relies on `FvgTypes` for `fvgObject` and `drawSettings` definitions, and its methods (`updateMitigation`, `updatePartialFill`) internally call functions from `FvgCalculations`. Drawing Object Management: Be mindful of TradingView's limits on drawing objects per script. The main script should manage the number of active FVG objects. Performance and `updateDrawings()`: The `updateDrawings()` method is comprehensive. Its internal optimization (checking `hasStateChanged` based on `prev_*` fields) is crucial for performance. Call it judiciously. Role of `settings.currentTime`: The `currentTime` field in `drawSettings` is key for positioning time-dependent elements like labels and the right edge of non-extended drawings. Mutability of `fvgObject` Instances: Methods in this library directly modify the `fvgObject` instance they are called upon (e.g., its state fields and drawing IDs). Drawing ID Checks: Methods generally check if drawing IDs are `na` before acting on them, preventing runtime errors. █ EXPORTED FUNCTIONS method draw(this, settings) Draws the initial visual representation of the FVG object on the chart. This includes the main FVG box, its midline (if enabled), and a label (if enabled for the specific timeframe). This method is typically invoked immediately after an FVG is first detected and its initial properties are set. It uses drawing settings to customize the appearance based on the FVG's timeframe type. Namespace types: types.fvgObject Parameters: this (fvgObject type from no1x/FvgTypes/1) : The FVG object instance to be drawn. Core properties (top, bottom, startTime, isBullish, tfType) should be pre-initialized. This method will initialize boxId, midLineId, boxLabelId (if applicable), and currentTop/currentBottom (if currently na) on this object. settings (drawSettings type from no1x/FvgTypes/1) : A drawSettings object providing all visual parameters. Reads display settings (colors, styles, visibility for boxes, midlines, labels, box extension) relevant to this.tfType. settings.currentTime is used for positioning labels and the right boundary of non-extended boxes. method updateMitigation(this, highVal, lowVal) Checks if the FVG has been fully mitigated by the current bar's price action. Namespace types: types.fvgObject Parameters: this (fvgObject type from no1x/FvgTypes/1) : The FVG object instance. Reads this.isMitigated, this.isVisible, this.isBullish, this.top, this.bottom. Updates this.isMitigated and this.mitigationTime if full mitigation occurs. highVal (float) : The high price of the current bar, used for mitigation check. lowVal (float) : The low price of the current bar, used for mitigation check. method updatePartialFill(this, highVal, lowVal, settings) Checks for and processes partial fills of the FVG. Namespace types: types.fvgObject Parameters: this (fvgObject type from no1x/FvgTypes/1) : The FVG object instance. Reads this.isMitigated, this.isVisible, this.isBullish, this.currentTop, this.currentBottom, original this.top/this.bottom, this.startTime, this.tfType, this.isLV. Updates this.currentTop or this.currentBottom, creates/updates this.mitigatedBoxId, and may update this.boxId's top/bottom to reflect the filled portion. highVal (float) : The high price of the current bar, used for partial fill check. lowVal (float) : The low price of the current bar, used for partial fill check. settings (drawSettings type from no1x/FvgTypes/1) : The drawing settings. Reads timeframe-specific colors for mitigated boxes (e.g., settings.mitigatedBullBoxColor, settings.mitigatedLvBullColor), box extension settings (settings.shouldExtendBoxes, settings.shouldExtendMtfBoxes, etc.), and settings.currentTime to style and position the mitigatedBoxId and potentially adjust the main boxId. method checkMidlineTouch(this, highVal, lowVal) Checks if the FVG's midline (50% level or Equilibrium) has been touched. Namespace types: types.fvgObject Parameters: this (fvgObject type from no1x/FvgTypes/1) : The FVG object instance. Reads this.midLineId, this.isMidlineTouched, this.top, this.bottom. Updates this.isMidlineTouched if a touch occurs. highVal (float) : The high price of the current bar, used for midline touch check. lowVal (float) : The low price of the current bar, used for midline touch check. method deleteDrawings(this, deleteTestedToo) Deletes all visual drawing objects associated with this FVG object. Namespace types: types.fvgObject Parameters: this (fvgObject type from no1x/FvgTypes/1) : The FVG object instance. Deletes drawings referenced by boxId, mitigatedBoxId, midLineId, mitLineId, boxLabelId, mitLineLabelId, and potentially testedBoxId, keptMitLineId. Sets these ID fields to na. deleteTestedToo (simple bool) : If true, also deletes drawings for "tested" FVGs (i.e., testedBoxId and keptMitLineId). method updateDrawings(this, isVisibleNow, settings) Manages the comprehensive update of all visual elements of an FVG object based on its current state (e.g., active, mitigated, partially filled) and visibility. It handles the drawing, updating, or deletion of FVG boxes (main and mitigated part), midlines, mitigation lines, and their associated labels. Visibility is determined by the isVisibleNow parameter and relevant settings (like settings.shouldHideMitigated or timeframe-specific show flags). This method is central to the FVG's visual lifecycle and includes optimization to avoid redundant drawing operations if the FVG's relevant state or appearance settings have not changed since the last bar. It also updates the FVG object's internal prev_* state fields for future optimization checks. Namespace types: types.fvgObject Parameters: this (fvgObject type from no1x/FvgTypes/1) : The FVG object instance to update. Reads most state fields (e.g., isMitigated, currentTop, tfType, etc.) and updates all drawing ID fields (boxId, midLineId, etc.), this.isVisible, and all this.prev_* state fields. isVisibleNow (bool) : A flag indicating whether the FVG should be currently visible. Typically determined by external logic (e.g., visual range filter). Affects whether active FVG drawings are created/updated or deleted by this method. settings (drawSettings type from no1x/FvgTypes/1) : A fully populated drawSettings object. This method extensively reads its fields (colors, styles, visibility toggles, timeframe strings, etc.) to render FVG components according to this.tfType and current state. settings.currentTime is critical for positioning elements like labels and extending drawings. Pine Script® libraryby no1xUpdated 3
Trading IQ - ICT LibraryLibrary "ICTlibrary" Used to calculate various ICT related price levels and strategies. An ongoing project. Hello Coders! This library is meant for sourcing ICT related concepts. While some functions might generate more output than you require, you can specify "Lite Mode" as "true" in applicable functions to slim down necessary inputs. isLastBar(userTF) Identifies the last bar on the chart before a timeframe change Parameters: userTF (simple int) : the timeframe you wish to calculate the last bar for, must be converted to integer using 'timeframe.in_seconds()' Returns: bool true if bar on chart is last bar of higher TF, dalse if bar on chart is not last bar of higher TF necessaryData(atrTF) returns necessaryData UDT for historical data access Parameters: atrTF (float) : user-selected timeframe ATR value. Returns: logZ. log return Z score, used for calculating order blocks. method gradBoxes(gradientBoxes, idColor, timeStart, bottom, top, rightCoordinate) creates neon like effect for box drawings Namespace types: array Parameters: gradientBoxes (array) : an array.new() to store the gradient boxes idColor (color) timeStart (int) : left point of box bottom (float) : bottom of box price point top (float) : top of box price point rightCoordinate (int) : right point of box Returns: void checkIfTraded(tradeName) checks if recent trade is of specific name Parameters: tradeName (string) Returns: bool true if recent trade id matches target name, false otherwise checkIfClosed(tradeName) checks if recent closed trade is of specific name Parameters: tradeName (string) Returns: bool true if recent closed trade id matches target name, false otherwise IQZZ(atrMult, finalTF) custom ZZ to quickly determine market direction. Parameters: atrMult (float) : an atr multiplier used to determine the required price move for a ZZ direction change finalTF (string) : the timeframe used for the atr calcuation Returns: dir market direction. Up => 1, down => -1 method drawBos(id, startPoint, getKeyPointTime, getKeyPointPrice, col, showBOS, isUp) calculates and draws Break Of Structure Namespace types: array Parameters: id (array) startPoint (chart.point) getKeyPointTime (int) : the actual time of startPoint, simplystartPoint.time getKeyPointPrice (float) : the actual time of startPoint, simplystartPoint.price col (color) : color of the BoS line / label showBOS (bool) : whether to show label/line. This function still calculates internally for other ICT related concepts even if not drawn. isUp (bool) : whether BoS happened during price increase or price decrease. Returns: void method drawMSS(id, startPoint, getKeyPointTime, getKeyPointPrice, col, showMSS, isUp, upRejections, dnRejections, highArr, lowArr, timeArr, closeArr, openArr, atrTFarr, upRejectionsPrices, dnRejectionsPrices) calculates and draws Market Structure Shift. This data is also used to calculate Rejection Blocks. Namespace types: array Parameters: id (array) startPoint (chart.point) getKeyPointTime (int) : the actual time of startPoint, simplystartPoint.time getKeyPointPrice (float) : the actual time of startPoint, simplystartPoint.price col (color) : color of the MSS line / label showMSS (bool) : whether to show label/line. This function still calculates internally for other ICT related concepts even if not drawn. isUp (bool) : whether MSS happened during price increase or price decrease. upRejections (array) dnRejections (array) highArr (array) : array containing historical highs, should be taken from the UDT "necessaryData" defined above lowArr (array) : array containing historical lows, should be taken from the UDT "necessaryData" defined above timeArr (array) : array containing historical times, should be taken from the UDT "necessaryData" defined above closeArr (array) : array containing historical closes, should be taken from the UDT "necessaryData" defined above openArr (array) : array containing historical opens, should be taken from the UDT "necessaryData" defined above atrTFarr (array) : array containing historical atr values (of user-selected TF), should be taken from the UDT "necessaryData" defined above upRejectionsPrices (array) : array containing up rejections prices. Is sorted and used to determine selective looping for invalidations. dnRejectionsPrices (array) : array containing down rejections prices. Is sorted and used to determine selective looping for invalidations. Returns: void method getTime(id, compare, timeArr) gets time of inputted price (compare) in an array of data this is useful when the user-selected timeframe for ICT concepts is greater than the chart's timeframe Namespace types: array Parameters: id (array) : the array of data to search through, to find which index has the same value as "compare" compare (float) : the target data point to find in the array timeArr (array) : array of historical times Returns: the time that the data point in the array was recorded method OB(id, highArr, signArr, lowArr, timeArr, sign) store bullish orderblock data Namespace types: array Parameters: id (array) highArr (array) : array of historical highs signArr (array) : array of historical price direction "math.sign(close - open)" lowArr (array) : array of historical lows timeArr (array) : array of historical times sign (int) : orderblock direction, -1 => bullish, 1 => bearish Returns: void OTEstrat(OTEstart, future, closeArr, highArr, lowArr, timeArr, longOTEPT, longOTESL, longOTElevel, shortOTEPT, shortOTESL, shortOTElevel, structureDirection, oteLongs, atrTF, oteShorts) executes the OTE strategy Parameters: OTEstart (chart.point) future (int) : future time point for drawings closeArr (array) : array of historical closes highArr (array) : array of historical highs lowArr (array) : array of historical lows timeArr (array) : array of historical times longOTEPT (string) : user-selected long OTE profit target, please create an input.string() for this using the example below longOTESL (int) : user-selected long OTE stop loss, please create an input.string() for this using the example below longOTElevel (float) : long entry price of selected retracement ratio for OTE shortOTEPT (string) : user-selected short OTE profit target, please create an input.string() for this using the example below shortOTESL (int) : user-selected short OTE stop loss, please create an input.string() for this using the example below shortOTElevel (float) : short entry price of selected retracement ratio for OTE structureDirection (string) : current market structure direction, this should be "Up" or "Down". This is used to cancel pending orders if market structure changes oteLongs (bool) : input.bool() for whether OTE longs can be executed atrTF (float) : atr of the user-seleceted TF oteShorts (bool) : input.bool() for whether OTE shorts can be executed @exampleInputs oteLongs = input.bool(defval = false, title = "OTE Longs", group = "Optimal Trade Entry") longOTElevel = input.float(defval = 0.79, title = "Long Entry Retracement Level", options = , group = "Optimal Trade Entry") longOTEPT = input.string(defval = "-0.5", title = "Long TP", options = , group = "Optimal Trade Entry") longOTESL = input.int(defval = 0, title = "How Many Ticks Below Swing Low For Stop Loss", group = "Optimal Trade Entry") oteShorts = input.bool(defval = false, title = "OTE Shorts", group = "Optimal Trade Entry") shortOTElevel = input.float(defval = 0.79, title = "Short Entry Retracement Level", options = , group = "Optimal Trade Entry") shortOTEPT = input.string(defval = "-0.5", title = "Short TP", options = , group = "Optimal Trade Entry") shortOTESL = input.int(defval = 0, title = "How Many Ticks Above Swing Low For Stop Loss", group = "Optimal Trade Entry") Returns: void (0) displacement(logZ, atrTFreg, highArr, timeArr, lowArr, upDispShow, dnDispShow, masterCoords, labelLevels, dispUpcol, rightCoordinate, dispDncol, noBorders) calculates and draws dispacements Parameters: logZ (float) : log return of current price, used to determine a "significant price move" for a displacement atrTFreg (float) : atr of user-seleceted timeframe highArr (array) : array of historical highs timeArr (array) : array of historical times lowArr (array) : array of historical lows upDispShow (int) : amount of historical upside displacements to show dnDispShow (int) : amount of historical downside displacements to show masterCoords (map) : a map to push the most recent displacement prices into, useful for having key levels in one data structure labelLevels (string) : used to determine label placement for the displacement, can be inside box, outside box, or none, example below dispUpcol (color) : upside displacement color rightCoordinate (int) : future time for displacement drawing, best is "last_bar_time" dispDncol (color) : downside displacement color noBorders (bool) : input.bool() to remove box borders, example below @exampleInputs labelLevels = input.string(defval = "Inside" , title = "Box Label Placement", options = ) noBorders = input.bool(defval = false, title = "No Borders On Levels") Returns: void method getStrongLow(id, startIndex, timeArr, lowArr, strongLowPoints) unshift strong low data to array id Namespace types: array Parameters: id (array) startIndex (int) : the starting index for the timeArr array of the UDT "necessaryData". this point should start from at least 1 pivot prior to find the low before an upside BoS timeArr (array) : array of historical times lowArr (array) : array of historical lows strongLowPoints (array) : array of strong low prices. Used to retrieve highest strong low price and see if need for removal of invalidated strong lows Returns: void method getStrongHigh(id, startIndex, timeArr, highArr, strongHighPoints) unshift strong high data to array id Namespace types: array Parameters: id (array) startIndex (int) : the starting index for the timeArr array of the UDT "necessaryData". this point should start from at least 1 pivot prior to find the high before a downside BoS timeArr (array) : array of historical times highArr (array) : array of historical highs strongHighPoints (array) Returns: void equalLevels(highArr, lowArr, timeArr, rightCoordinate, equalHighsCol, equalLowsCol, liteMode) used to calculate recent equal highs or equal lows Parameters: highArr (array) : array of historical highs lowArr (array) : array of historical lows timeArr (array) : array of historical times rightCoordinate (int) : a future time (right for boxes, x2 for lines) equalHighsCol (color) : user-selected color for equal highs drawings equalLowsCol (color) : user-selected color for equal lows drawings liteMode (bool) : optional for a lite mode version of an ICT strategy. For more control over drawings leave as "True", "False" will apply neon effects Returns: void quickTime(timeString) used to quickly determine if a user-inputted time range is currently active in NYT time Parameters: timeString (string) : a time range Returns: true if session is active, false if session is inactive macros(showMacros, noBorders) used to calculate and draw session macros Parameters: showMacros (bool) : an input.bool() or simple bool to determine whether to activate the function noBorders (bool) : an input.bool() to determine whether the box anchored to the session should have borders Returns: void po3(tf, left, right, show) use to calculate HTF po3 candle @tip only call this function on "barstate.islast" Parameters: tf (simple string) left (int) : the left point of the candle, calculated as bar_index + left, right (int) : :the right point of the candle, calculated as bar_index + right, show (bool) : input.bool() whether to show the po3 candle or not Returns: void silverBullet(silverBulletStratLong, silverBulletStratShort, future, userTF, H, L, H2, L2, noBorders, silverBulletLongTP, historicalPoints, historicalData, silverBulletLongSL, silverBulletShortTP, silverBulletShortSL) used to execute the Silver Bullet Strategy Parameters: silverBulletStratLong (simple bool) silverBulletStratShort (simple bool) future (int) : a future time, used for drawings, example "last_bar_time" userTF (simple int) H (float) : the high price of the user-selected TF L (float) : the low price of the user-selected TF H2 (float) : the high price of the user-selected TF L2 (float) : the low price of the user-selected TF noBorders (bool) : an input.bool() used to remove the borders from box drawings silverBulletLongTP (series silverBulletLevels) historicalPoints (array) historicalData (necessaryData) silverBulletLongSL (series silverBulletLevels) silverBulletShortTP (series silverBulletLevels) silverBulletShortSL (series silverBulletLevels) Returns: void method invalidFVGcheck(FVGarr, upFVGpricesSorted, dnFVGpricesSorted) check if existing FVGs are still valid Namespace types: array Parameters: FVGarr (array) upFVGpricesSorted (array) : an array of bullish FVG prices, used to selective search through FVG array to remove invalidated levels dnFVGpricesSorted (array) : an array of bearish FVG prices, used to selective search through FVG array to remove invalidated levels Returns: void (0) method drawFVG(counter, FVGshow, FVGname, FVGcol, data, masterCoords, labelLevels, borderTransp, liteMode, rightCoordinate) draws FVGs on last bar Namespace types: map Parameters: counter (map) : a counter, as map, keeping count of the number of FVGs drawn, makes sure that there aren't more FVGs drawn than int FVGshow FVGshow (int) : the number of FVGs to show. There should be a bullish FVG show and bearish FVG show. This function "drawFVG" is used separately for bearish FVG and bullish FVG. FVGname (string) : the name of the FVG, "FVG Up" or "FVG Down" FVGcol (color) : desired FVG color data (FVG) masterCoords (map) : a map containing the names and price points of key levels. Used to define price ranges. labelLevels (string) : an input.string with options "Inside", "Outside", "Remove". Determines whether FVG labels should be inside box, outside, or na. borderTransp (int) liteMode (bool) rightCoordinate (int) : the right coordinate of any drawings. Must be a time point. Returns: void invalidBlockCheck(bullishOBbox, bearishOBbox, userTF) check if existing order blocks are still valid Parameters: bullishOBbox (array) : an array declared using the UDT orderBlock that contains bullish order block related data bearishOBbox (array) : an array declared using the UDT orderBlock that contains bearish order block related data userTF (simple int) Returns: void (0) method lastBarRejections(id, rejectionColor, idShow, rejectionString, labelLevels, borderTransp, liteMode, rightCoordinate, masterCoords) draws rejectionBlocks on last bar Namespace types: array Parameters: id (array) : the array, an array of rejection block data declared using the UDT rejection block rejectionColor (color) : the desired color of the rejection box idShow (int) rejectionString (string) : the desired name of the rejection blocks labelLevels (string) : an input.string() to determine if labels for the block should be inside the box, outside, or none. borderTransp (int) liteMode (bool) : an input.bool(). True = neon effect, false = no neon. rightCoordinate (int) : atime for the right coordinate of the box masterCoords (map) : a map that stores the price of key levels and assigns them a name, used to determine price ranges Returns: void method OBdraw(id, OBshow, BBshow, OBcol, BBcol, bullishString, bearishString, isBullish, labelLevels, borderTransp, liteMode, rightCoordinate, masterCoords) draws orderblocks and breaker blocks for data stored in UDT array() Namespace types: array Parameters: id (array) : the array, an array of order block data declared using the UDT orderblock OBshow (int) : the number of order blocks to show BBshow (int) : the number of breaker blocks to show OBcol (color) : color of order blocks BBcol (color) : color of breaker blocks bullishString (string) : the title of bullish blocks, which is a regular bullish orderblock or a bearish orderblock that's converted to breakerblock bearishString (string) : the title of bearish blocks, which is a regular bearish orderblock or a bullish orderblock that's converted to breakerblock isBullish (bool) : whether the array contains bullish orderblocks or bearish orderblocks. If bullish orderblocks, the array will naturally contain bearish BB, and if bearish OB, the array will naturally contain bullish BB labelLevels (string) : an input.string() to determine if labels for the block should be inside the box, outside, or none. borderTransp (int) liteMode (bool) : an input.bool(). True = neon effect, false = no neon. rightCoordinate (int) : atime for the right coordinate of the box masterCoords (map) : a map that stores the price of key levels and assigns them a name, used to determine price ranges Returns: void FVG UDT for FVG calcualtions Fields: H (series float) : high price of user-selected timeframe L (series float) : low price of user-selected timeframe direction (series string) : FVG direction => "Up" or "Down" T (series int) : => time of bar on user-selected timeframe where FVG was created fvgLabel (series label) : optional label for FVG fvgLineTop (series line) : optional line for top of FVG fvgLineBot (series line) : optional line for bottom of FVG fvgBox (series box) : optional box for FVG labelLine quickly pair a line and label together as UDT Fields: lin (series line) : Line you wish to pair with label lab (series label) : Label you wish to pair with line orderBlock UDT for order block calculations Fields: orderBlockData (array) : array containing order block x and y points orderBlockBox (series box) : optional order block box vioCount (series int) : = 0 violation count of the order block. 0 = Order Block, 1 = Breaker Block traded (series bool) status (series string) : = "OB" status == "OB" => Level is order block. status == "BB" => Level is breaker block. orderBlockLab (series label) : options label for the order block / breaker block. strongPoints UDT for strong highs and strong lows Fields: price (series float) : price of the strong high or strong low timeAtprice (series int) : time of the strong high or strong low strongPointLabel (series label) : optional label for strong point strongPointLine (series line) : optional line for strong point overlayLine (series line) : optional lines for strong point to enhance visibility overlayLine2 (series line) : optional lines for strong point to enhance visibility displacement UDT for dispacements Fields: highPrice (series float) : high price of displacement lowPrice (series float) : low price of displacement timeAtPrice (series int) : time of bar where displacement occurred displacementBox (series box) : optional box to draw displacement displacementLab (series label) : optional label for displacement po3data UDT for po3 calculations Fields: dHigh (series float) : higher timeframe high price dLow (series float) : higher timeframe low price dOpen (series float) : higher timeframe open price dClose (series float) : higher timeframe close price po3box (series box) : box to draw po3 candle body po3line (array) : line array to draw po3 wicks po3Labels (array) : label array to label price points of po3 candle macros UDT for session macros Fields: sessions (array) : Array of sessions, you can populate this array using the "quickTime" function located above "export macros". prices (matrix) : Matrix of session data -> open, high, low, close, time sessionTimes (array) : Array of session names. Pairs with array sessions. sessionLines (matrix) : Optional array for sesion drawings. OTEtimes UDT for data storage and drawings associated with OTE strategy Fields: upTimes (array) : time of highest point before trade is taken dnTimes (array) : time of lowest point before trade is taken tpLineLong (series line) : line to mark tp level long tpLabelLong (series label) : label to mark tp level long slLineLong (series line) : line to mark sl level long slLabelLong (series label) : label to mark sl level long tpLineShort (series line) : line to mark tp level short tpLabelShort (series label) : label to mark tp level short slLineShort (series line) : line to mark sl level short slLabelShort (series label) : label to mark sl level short sweeps UDT for data storage and drawings associated with liquidity sweeps Fields: upSweeps (matrix) : matrix containing liquidity sweep price points and time points for up sweeps dnSweeps (matrix) : matrix containing liquidity sweep price points and time points for down sweeps upSweepDrawings (array) : optional up sweep box array. Pair the size of this array with the rows or columns, dnSweepDrawings (array) : optional up sweep box array. Pair the size of this array with the rows or columns, raidExitDrawings UDT for drawings associated with the Liquidity Raid Strategy Fields: tpLine (series line) : tp line for the liquidity raid entry tpLabel (series label) : tp label for the liquidity raid entry slLine (series line) : sl line for the liquidity raid entry slLabel (series label) : sl label for the liquidity raid entry m2022 UDT for data storage and drawings associated with the Model 2022 Strategy Fields: mTime (series int) : time of the FVG where entry limit order is placed mIndex (series int) : array index of FVG where entry limit order is placed. This requires an array of FVG data, which is defined above. mEntryDistance (series float) : the distance of the FVG to the 50% range. M2022 looks for the fvg closest to 50% mark of range. mEntry (series float) : the entry price for the most eligible fvg fvgHigh (series float) : the high point of the eligible fvg fvgLow (series float) : the low point of the eligible fvg longFVGentryBox (series box) : long FVG box, used to draw the eligible FVG shortFVGentryBox (series box) : short FVG box, used to draw the eligible FVG line50P (series line) : line used to mark 50% of the range line100P (series line) : line used to mark 100% (top) of the range line0P (series line) : line used to mark 0% (bottom) of the range label50P (series label) : label used to mark 50% of the range label100P (series label) : label used to mark 100% (top) of the range label0P (series label) : label used to mark 0% (bottom) of the range sweepData (array) silverBullet UDT for data storage and drawings associated with the Silver Bullet Strategy Fields: session (series bool) sessionStr (series string) : name of the session for silver bullet sessionBias (series string) sessionHigh (series float) : = high high of session // use math.max(silverBullet.sessionHigh, high) sessionLow (series float) : = low low of session // use math.min(silverBullet.sessionLow, low) sessionFVG (series float) : if applicable, the FVG created during the session sessionFVGdraw (series box) : if applicable, draw the FVG created during the session traded (series bool) tp (series float) : tp of trade entered at the session FVG sl (series float) : sl of trade entered at the session FVG sessionDraw (series box) : optional draw session with box sessionDrawLabel (series label) : optional label session with label silverBulletDrawings UDT for trade exit drawings associated with the Silver Bullet Strategy Fields: tpLine (series line) : tp line drawing for strategy tpLabel (series label) : tp label drawing for strategy slLine (series line) : sl line drawing for strategy slLabel (series label) : sl label drawing for strategy unicornModel UDT for data storage and drawings associated with the Unicorn Model Strategy Fields: hPoint (chart.point) hPoint2 (chart.point) hPoint3 (chart.point) breakerBlock (series box) : used to draw the breaker block required for the Unicorn Model FVG (series box) : used to draw the FVG required for the Unicorn model topBlock (series float) : price of top of breaker block, can be used to detail trade entry botBlock (series float) : price of bottom of breaker block, can be used to detail trade entry startBlock (series int) : start time of the breaker block, used to set the "left = " param for the box includes (array) : used to store the time of the breaker block, or FVG, or the chart point sequence that setup the Unicorn Model. entry (series float) : // eligible entry price, for longs"math.max(topBlock, FVG.get_top())", tpLine (series line) : optional line to mark PT tpLabel (series label) : optional label to mark PT slLine (series line) : optional line to mark SL slLabel (series label) : optional label to mark SL rejectionBlocks UDT for data storage and drawings associated with rejection blocks Fields: rejectionPoint (chart.point) bodyPrice (series float) : candle body price closest to the rejection point, for "Up" rejections => math.max(open, close), rejectionBox (series box) : optional box drawing of the rejection block rejectionLabel (series label) : optional label for the rejection block equalLevelsDraw UDT for data storage and drawings associated with equal highs / equal lows Fields: connector (series line) : single line placed at the first high or low, y = avgerage of distinguished equal highs/lows connectorLab (series label) : optional label to be placed at the highs or lows levels (array) : array containing the equal highs or lows prices times (array) : array containing the equal highs or lows individual times startTime (series int) : the time of the first high or low that forms a sequence of equal highs or lows radiate (array) : options label to "radiate" the label in connector lab. Can be used for anything necessaryData UDT for data storage of historical price points. Fields: highArr (array) : array containing historical high points lowArr (array) : array containing historical low points timeArr (array) : array containing historical time points logArr (array) : array containing historical log returns signArr (array) : array containing historical price directions closeArr (array) : array containing historical close points binaryTimeArr (array) : array containing historical time points, uses "push" instead of "unshift" to allow for binary search binaryCloseArr (array) : array containing historical close points, uses "push" instead of "unshift" to allow the correct binaryOpenArr (array) : array containing historical optn points, uses "push" instead of "unshift" to allow the correct atrTFarr (array) : array containing historical user-selected TF atr points openArr (array) : array containing historical open pointsPine Script® libraryby Trading-IQ11134
Smart Money Concepts by WeloTradesThe "Smart Money Concepts by WeloTrades" indicator is designed to offer traders a comprehensive tool that integrates multiple advanced features to aid in market analysis. By combining order blocks, liquidity levels, fair value gaps, trendlines, and market structure analysis, the indicator provides a holistic approach to understanding market dynamics and making informed trading decisions. Components and Their Integration: Order Blocks and Breaker Blocks Detection Functionality: Order blocks represent areas where significant buying or selling occurred, creating potential support or resistance zones. Breaker blocks signal potential reversals. Integration: By detecting and visualizing these blocks, the indicator helps traders identify key levels where price might react, aiding in entry and exit decisions. The customizable settings allow traders to adjust the visibility and parameters to suit their specific trading strategy. Liquidity Levels Analysis Functionality: Liquidity levels indicate zones where significant price movements can occur due to the presence of large orders. These are areas where smart money might be executing trades. Integration: By tracking these high-probability liquidity areas, traders can anticipate potential price movements. Customizable display limits and mitigation strategies ensure that the information is tailored to the trader’s needs, providing precise and actionable insights. Fair Value Gaps (FVG) Functionality: Fair value gaps highlight areas where there is an imbalance between buyers and sellers. These gaps often represent potential trading opportunities. Integration: The ability to identify and analyze FVGs helps traders spot potential entries based on market inefficiencies. The touch and break detection functionalities provide further refinement, enhancing the precision of trading signals. Trendlines Functionality: Trendlines help in identifying the direction of the market and potential reversal points. The additional trendline adds a layer of confirmation for breaks or retests. Integration: Automatically drawn trendlines assist traders in visualizing market trends and making decisions about potential entries and exits. The additional trendline for stronger confirmation reduces the risk of false signals, providing more reliable trading opportunities. Market Structure Analysis Functionality: Understanding market structure is crucial for identifying key support and resistance levels and overall market dynamics. This component displays internal, external, and composite market structures. Integration: By automatically highlighting shifts in market structure, the indicator helps traders recognize important levels and potential changes in market direction. This analysis is critical for strategic planning and execution in trading. Customizable Alerts Functionality: Alerts ensure that traders do not miss significant market events, such as the formation or breach of order blocks, liquidity levels, and trendline interactions. Integration: Customizable alerts enhance the user experience by providing timely notifications of key events. This feature ensures that traders can act quickly and efficiently, leveraging the insights provided by the indicator. Interactive Visualization Functionality: Customizable visual aspects of the indicator allow traders to tailor the display to their preferences and trading style. Integration: This feature enhances user engagement and usability, making it easier for traders to interpret the data and make informed decisions. Personalization options like colors, styles, and display formats improve the overall effectiveness of the indicator. How Components Work Together Comprehensive Market Analysis Each component of the indicator addresses a different aspect of market analysis. Order blocks and liquidity levels highlight potential support and resistance zones, while fair value gaps and trendlines provide additional context for potential entries and exits. Market structure analysis ties everything together by offering a broad view of market dynamics. Synergistic Insights The integration of multiple features allows for cross-validation of trading signals. For instance, an order block coinciding with a high-probability liquidity level and a fair value gap can provide a stronger signal than any of these features alone. This synergy enhances the reliability of the insights and trading signals generated by the indicator. Enhanced Decision Making By combining these advanced features into a single tool, traders are equipped with a powerful resource for making informed decisions. The customizable alerts and interactive visualization further support this by ensuring that traders can act quickly on the insights provided. Order Blocks ( OB) & Breaker Blocks (BB) Visuals: 📝 OB Input Settings 📊 Timeframe #1 TF #1🕑: Enable or disable Timeframe 1. What it is: A boolean input to toggle the use of the first timeframe. What it does: Enables or disables Timeframe 1 for the OB settings. How to use it: Check or uncheck the box to enable or disable. 📊 Timeframe 1 Selection Timeframe #1🕑: Select the timeframe for Timeframe 1. What it is: A dropdown to select the desired timeframe. What it does: Sets the timeframe for Timeframe 1. How to use it: Choose a timeframe from the dropdown list. 📊 Timeframe #2 TF #2🕑: Enable or disable Timeframe 2. What it is: A boolean input to toggle the use of the second timeframe. What it does: Enables or disables Timeframe 2 for the OB settings. How to use it: Check or uncheck the box to enable or disable. 📊 Timeframe 2 Selection Timeframe #2🕑: Select the timeframe for Timeframe 2. What it is: A dropdown to select the desired timeframe. What it does: Sets the timeframe for Timeframe 2. How to use it: Choose a timeframe from the dropdown list. Additional Info: Higher TF Chart & Lower TF Setting / Lower TF Chart & Higher TF Setting. 📏 Show OBs OB (Length)📏: Toggle the display of Order Blocks. What it is: A boolean input to enable or disable the display of Order Blocks. What it does: Shows or hides Order Blocks based on the selected swing length. How to use it: Check or uncheck the box to enable or disable. 📏 Swing Length Option Swing Length Option: Select the swing length option. What it is: A dropdown to choose between SHORT, MID, LONG, or CUSTOM. What it does: Sets the length of swings for Order Blocks. How to use it: Choose an option from the dropdown. Additional Info: Default lengths are SHORT=10, MID=28, LONG=50. 🔧 Custom Swing Length 🔧custom: Specify a custom swing length. What it is: An integer input for setting a custom swing length. What it does: Overrides the default swing lengths if set to CUSTOM. How to use it: Enter a custom integer value (only shown when CUSTOM is selected). 📛 Show BBs BB (Method)📛: Toggle the display of Breaker Blocks. What it is: A boolean input to enable or disable the display of Breaker Blocks. What it does: Shows or hides Breaker Blocks. How to use it: Check or uncheck the box to enable or disable. 📛 OB End Method OB End Method: Select the method for determining the end of a Breaker Block. What it is: A dropdown to choose between Wick and Close. What it does: Sets the criteria for when a Breaker Block is considered mitigated. How to use it: Choose an option from the dropdown. Additional Info: Wicks: OB is mitigated when the price wicks through the OB Level. Close: OB is mitigated when the closing price is within the OB Level. 🔍 Max Bullish Zones 🔍Max Bullish: Set the maximum number of Bullish Order Blocks to display. What it is: A dropdown to select the maximum number of Bullish Order Blocks. What it does: Limits the number of Bullish Order Blocks shown on the chart. How to use it: Choose a value from the dropdown (1-10). 🔍 Max Bearish Zones 🔍Max Bearish: Set the maximum number of Bearish Order Blocks to display. What it is: A dropdown to select the maximum number of Bearish Order Blocks. What it does: Limits the number of Bearish Order Blocks shown on the chart. How to use it: Choose a value from the dropdown (1-10). 🟩 Bullish OB Color Bullish OB Color: Set the color for Bullish Order Blocks. What it is: A color picker to set the color of Bullish Order Blocks. What it does: Changes the color of Bullish Order Blocks on the chart. How to use it: Select a color from the color picker. 🟥 Bearish OB Color Bearish OB Color: Set the color for Bearish Order Blocks. What it is: A color picker to set the color of Bearish Order Blocks. What it does: Changes the color of Bearish Order Blocks on the chart. How to use it: Select a color from the color picker. 🔧 OB & BB Range ↔ OB & BB Range: Select the range option for OB and BB. What it is: A dropdown to choose between RANGE and CUSTOM. What it does: Sets how far the OB or BB should extend. How to use it: Choose an option from the dropdown. Additional Info: RANGE = Current price, CUSTOM = Adjustable Range. 🔧 Custom OB & BB Range 🔧Custom: Specify a custom range for OB and BB. What it is: An integer input for setting a custom range. What it does: Defines how far the OB or BB should go, based on a custom value. How to use it: Enter a custom integer value (range: 1000-500000). 💬 Text Options 💬Text Options: Set text size and color for OB and BB. What it is: A dropdown to select text size and a color picker to choose text color. What it does: Changes the size and color of the text displayed for OB and BB. How to use it: Select a size from the dropdown and a color from the color picker. 💬 Show Timeframe OB Text: Toggle to display the timeframe of OB. What it is: A boolean input to show or hide the timeframe text for OB. What it does: Displays the timeframe information for Order Blocks on the chart. How to use it: Check or uncheck the box to enable or disable. 💬 Show Volume Volume: Toggle to display the volume of OB. What it is: A boolean input to show or hide the volume information for Order Blocks. What it does: Displays the volume information for Order Blocks on the chart. How to use it: Check or uncheck the box to enable or disable. Additional Info: What it represents: The volume displayed represents the total trading volume that occurred during the formation of the Order Block. This can indicate the level of participation or interest in that price level. How it's calculated: The volume is the sum of all traded volumes within the candles that form the Order Block. What it means: Higher volume at an Order Block level may suggest stronger support or resistance. It shows the amount of trading activity and can be an indicator of the potential strength or validity of the Order Block. Why it's shown: To give traders an idea of the market participation and to help assess the strength of the Order Block. 💬 Show Percentage %: Toggle to display the percentage of OB. What it is: A boolean input to show or hide the percentage information for Order Blocks. What it does: Displays the percentage information for Order Blocks on the chart. How to use it: Check or uncheck the box to enable or disable. Additional Info: What it represents: The percentage displayed usually represents the proportion of price movement relative to the Order Block. How it's calculated: This can be the percentage move from the start to the end of the Order Block or the retracement level that price has reached relative to the Order Block's range. What it means: It helps traders understand the extent of price movement within the Order Block and can indicate the significance of the price level. Why it's shown: To provide a clearer understanding of the price dynamics and the importance of the Order Block within the overall price movement. Additional Information Volume Example: If an Order Block forms over three candles with volumes of 100, 150, and 200, the total volume displayed for that Order Block would be 450. Percentage Example: If the price moves from 100 to 110 within an Order Block, and the total range of the Order Block is from 100 to 120, the percentage shown might be 50% (since the price has moved halfway through the Order Block's range). Liquidity Levels visuals: 📊 Liquidity Levels Input Settings 📊 Current Timeframe TF #1🕑: Enable or disable the current timeframe. What it is: A boolean input to toggle the use of the current timeframe. What it does: Enables or disables the display of liquidity levels for the current timeframe. How to use it: Check or uncheck the box to enable or disable. 📊 Higher Timeframe Higher Timeframe: Select the higher timeframe for liquidity levels. What it is: A dropdown to select the desired higher timeframe. What it does: Sets the higher timeframe for liquidity levels. How to use it: Choose a timeframe from the dropdown list. 📏 Liquidity Length Option 📏Liquidity Length: Select the length for liquidity levels. What it is: A dropdown to choose between SHORT, MID, LONG, or CUSTOM. What it does: Sets the length of swings for liquidity levels. How to use it: Choose an option from the dropdown. Additional Info: Default lengths are SHORT=10, MID=28, LONG=50. 🔧 Custom Liquidity Length 🔧custom: Specify a custom length for liquidity levels. What it is: An integer input for setting a custom swing length. What it does: Overrides the default liquidity lengths if set to CUSTOM. How to use it: Enter a custom integer value (only shown when CUSTOM is selected). 📛 Mitigation Method 📛Mitigation (Method): Select the method for determining the mitigation of liquidity levels. What it is: A dropdown to choose between Close and Wick. What it does: Sets the criteria for when a liquidity level is considered mitigated. How to use it: Choose an option from the dropdown. Additional Info: Wick: Level is mitigated when the price wicks through the level. Close: Level is mitigated when the closing price is within the level. 📛 Display Mitigated Levels -: Select to display or hide mitigated levels. What it is: A dropdown to choose between Remove and Show. What it does: Displays or hides mitigated liquidity levels. How to use it: Choose an option from the dropdown. Additional Info: Remove: Hide mitigated levels. Show: Display mitigated levels. 🔍 Max Buy Side Liquidity 🔍Max Buy Side Liquidity: Set the maximum number of Buy Side Liquidity Levels to display. What it is: An integer input to set the maximum number of Buy Side Liquidity Levels. What it does: Limits the number of Buy Side Liquidity Levels shown on the chart. How to use it: Enter a value between 0 and 50. 🟦 Buy Side Liquidity Color Buy Side Liquidity Color: Set the color for Buy Side Liquidity Levels. What it is: A color picker to set the color of Buy Side Liquidity Levels. What it does: Changes the color of Buy Side Liquidity Levels on the chart. How to use it: Select a color from the color picker. Additional Info: Tooltip: Set the maximum number of Buy Side Liquidity Levels to display. Default: 5, Min: 1, Max: 50. If liquidity levels are not displayed as expected, try increasing the max count. 🔍 Max Sell Side Liquidity 🔍Max Sell Side Liquidity: Set the maximum number of Sell Side Liquidity Levels to display. What it is: An integer input to set the maximum number of Sell Side Liquidity Levels. What it does: Limits the number of Sell Side Liquidity Levels shown on the chart. How to use it: Enter a value between 0 and 50. 🟥 Sell Side Liquidity Color Sell Side Liquidity Color: Set the color for Sell Side Liquidity Levels. What it is: A color picker to set the color of Sell Side Liquidity Levels. What it does: Changes the color of Sell Side Liquidity Levels on the chart. How to use it: Select a color from the color picker. Additional Info: Tooltip: Set the maximum number of Sell Side Liquidity Levels to display. Default: 5, Min: 1, Max: 50. If liquidity levels are not displayed as expected, try increasing the max count. ✂ Box Style (Height) ✂ Box Style (↕): Set the box height style for liquidity levels. What it is: A float input to set the height of the boxes. What it does: Adjusts the height of the boxes displaying liquidity levels. How to use it: Enter a value between -50 and 50. Additional Info: Default value is -5. 📏 Box Length b: Set the box length of liquidity levels. What it is: An integer input to set the length of the boxes. What it does: Adjusts the length of the boxes displaying liquidity levels. How to use it: Enter a value between 0 and 500. Additional Info: Default value is 20. ⏭ Extend Liquidity Levels Extend ⏭: Toggle to extend liquidity levels beyond the current range. What it is: A boolean input to enable or disable the extension of liquidity levels. What it does: Extends liquidity levels beyond their default range. How to use it: Check or uncheck the box to enable or disable. Additional Info: Extend liquidity levels beyond the current range. 💬 Text Options 💬 Text Options: Set text size and color for liquidity levels. What it is: A dropdown to select text size and a color picker to choose text color. What it does: Changes the size and color of the text displayed for liquidity levels. How to use it: Select a size from the dropdown and a color from the color picker. 💬 Show Text Text: Toggle to display text for liquidity levels. What it is: A boolean input to show or hide the text for liquidity levels. What it does: Displays the text information for liquidity levels on the chart. How to use it: Check or uncheck the box to enable or disable. 💬 Show Volume Volume: Toggle to display the volume of liquidity levels. What it is: A boolean input to show or hide the volume information for liquidity levels. What it does: Displays the volume information for liquidity levels on the chart. How to use it: Check or uncheck the box to enable or disable. Additional Info: What it represents: The volume displayed represents the total trading volume that occurred during the formation of the liquidity level. This can indicate the level of participation or interest in that price level. How it's calculated: The volume is the sum of all traded volumes within the candles that form the liquidity level. What it means: Higher volume at a liquidity level may suggest stronger support or resistance. It shows the amount of trading activity and can be an indicator of the potential strength or validity of the liquidity level. Why it's shown: To give traders an idea of the market participation and to help assess the strength of the liquidity level. 💬 Show Percentage %: Toggle to display the percentage of liquidity levels. What it is: A boolean input to show or hide the percentage information for liquidity levels. What it does: Displays the percentage information for liquidity levels on the chart. How to use it: Check or uncheck the box to enable or disable. Additional Info: What it represents: The percentage displayed usually represents the proportion of price movement relative to the liquidity level. How it's calculated: This can be the percentage move from the start to the end of the liquidity level or the retracement level that price has reached relative to the liquidity level's range. What it means: It helps traders understand the extent of price movement within the liquidity level and can indicate the significance of the price level. Why it's shown: To provide a clearer understanding of the price dynamics and the importance of the liquidity level within the overall price movement. Fair Value Gaps visuals: 📊 Fair Value Gaps Input Settings 📊 Show FVG TF #1🕑: Enable or disable Fair Value Gaps for Timeframe 1. What it is: A boolean input to toggle the display of Fair Value Gaps. What it does: Shows or hides Fair Value Gaps on the chart. How to use it: Check or uncheck the box to enable or disable. 📊 Select Timeframe Timeframe: Select the timeframe for Fair Value Gaps. What it is: A dropdown to select the desired timeframe. What it does: Sets the timeframe for Fair Value Gaps. How to use it: Choose a timeframe from the dropdown list. Additional Info: Higher TF Chart & Lower TF Setting or Lower TF Chart & Higher TF Setting. 📛 FVG Break Method 📛FVG Break (Method): Select the method for determining when an FVG is mitigated. What it is: A dropdown to choose between Touch, Wicks, Close, or Average. What it does: Sets the criteria for when a Fair Value Gap is considered mitigated. How to use it: Choose an option from the dropdown. Additional Info: Touch: FVG is mitigated when the price touches the gap. Wicks: FVG is mitigated when the price wicks through the gap. Close: FVG is mitigated when the closing price is within the gap. Average: FVG is mitigated when the average price (average of high and low) is within the gap. 📛 Show Mitigated FVG show: Toggle to display mitigated FVGs. What it is: A boolean input to show or hide mitigated Fair Value Gaps. What it does: Displays or hides mitigated Fair Value Gaps. How to use it: Check or uncheck the box to enable or disable. 📛 Fill FVG Fill: Toggle to fill Fair Value Gaps. What it is: A boolean input to fill the Fair Value Gaps with color. What it does: Adds a color fill to the Fair Value Gaps. How to use it: Check or uncheck the box to enable or disable. 📛 Shade FVG Shade: Toggle to shade Fair Value Gaps. What it is: A boolean input to shade the Fair Value Gaps. What it does: Adds a shade effect to the Fair Value Gaps. How to use it: Check or uncheck the box to enable or disable. Additional Info: Select the method to break FVGs and toggle the visibility of FVG Breaks (fill FVG and/or shade FVG). 🔍 Max Bullish FVG 🔍Max Bullish FVG: Set the maximum number of Bullish Fair Value Gaps to display. What it is: An integer input to set the maximum number of Bullish Fair Value Gaps. What it does: Limits the number of Bullish Fair Value Gaps shown on the chart. How to use it: Enter a value between 0 and 50. 🔍 Max Bearish FVG 🔍Max Bearish FVG: Set the maximum number of Bearish Fair Value Gaps to display. What it is: An integer input to set the maximum number of Bearish Fair Value Gaps. What it does: Limits the number of Bearish Fair Value Gaps shown on the chart. How to use it: Enter a value between 0 and 50. 🟥 Bearish FVG Color Bearish FVG Color: Set the color for Bearish Fair Value Gaps. What it is: A color picker to set the color of Bearish Fair Value Gaps. What it does: Changes the color of Bearish Fair Value Gaps on the chart. How to use it: Select a color from the color picker. Additional Info: Tooltip: Set the maximum number of Bearish Fair Value Gaps to display. Default: 5, Min: 1, Max: 50. If Fair Value Gaps are not displayed as expected, try increasing the max count. 🟦 Bullish FVG Color Bullish FVG Color: Set the color for Bullish Fair Value Gaps. What it is: A color picker to set the color of Bullish Fair Value Gaps. What it does: Changes the color of Bullish Fair Value Gaps on the chart. How to use it: Select a color from the color picker. Additional Info: Tooltip: Set the maximum number of Bullish Fair Value Gaps to display. Default: 5, Min: 1, Max: 50. If Fair Value Gaps are not displayed as expected, try increasing the max count. 📏 FVG Range ↔ FVG Range: Set the range for Fair Value Gaps. What it is: An integer input to set the range of the Fair Value Gaps. What it does: Adjusts the range of the Fair Value Gaps displayed. How to use it: Enter a value between 0 and 100. Additional Info: Adjustable length only works when both RANGE & EXTEND display OFF. Range=current price, Extend=Full Range. ⏭ Extend FVG Extend⏭: Toggle to extend Fair Value Gaps beyond the current range. What it is: A boolean input to enable or disable the extension of Fair Value Gaps. What it does: Extends Fair Value Gaps beyond their default range. How to use it: Check or uncheck the box to enable or disable. ⏯ FVG Range Range⏯: Toggle the range of Fair Value Gaps. What it is: A boolean input to enable or disable the range display for Fair Value Gaps. What it does: Sets the range of Fair Value Gaps displayed. How to use it: Check or uncheck the box to enable or disable. ↕ Max Width ↕ Max Width: Set the maximum width of Fair Value Gaps. What it is: A float input to set the maximum width of Fair Value Gaps. What it does: Limits the width of Fair Value Gaps as a percentage of the price range. How to use it: Enter a value between 0 and 5.0. Additional Info: FVGs wider than this value will be ignored. ♻ Filter FVG Filter FVG ♻: Toggle to filter out small Fair Value Gaps. What it is: A boolean input to filter out small Fair Value Gaps. What it does: Ignores Fair Value Gaps smaller than the specified max width. How to use it: Check or uncheck the box to enable or disable. ➖ Mid Line Style ➖Mid Line Style: Select the style of the mid line for Fair Value Gaps. What it is: A dropdown to choose between Solid, Dashed, or Dotted. What it does: Sets the style of the mid line within Fair Value Gaps. How to use it: Choose an option from the dropdown. 🎨 Mid Line Color Mid Line Color: Set the color for the mid line within Fair Value Gaps. What it is: A color picker to set the color of the mid line. What it does: Changes the color of the mid line within Fair Value Gaps. How to use it: Select a color from the color picker. Additional Information Mitigation Methods: Each method (Touch, Wicks, Close, Average) provides different criteria for when a Fair Value Gap is considered mitigated, helping traders to understand the dynamics of price movements within gaps. Volume and Percentage: Displaying volume and percentage information for Fair Value Gaps helps traders gauge the strength and significance of these gaps in relation to trading activity and price movements. Trendlines visuals: 📊 Trendlines Input Settings 📊 Show Trendlines Trendlines & Trendlines Difference(%) ↕: Enable or disable trendlines and set the percentage difference from the first trendline. What it is: A boolean input to toggle the display of trendlines. What it does: Shows or hides trendlines on the chart and allows setting a percentage difference from the first trendline. How to use it: Check or uncheck the box to enable or disable. Additional Info: The percentage difference determines the distance of the second trendline from the first one. 📏 Trendline Length Option 📏Trendline Length: Select the length for trendlines. What it is: A dropdown to choose between SHORT, MID, LONG, or CUSTOM. What it does: Sets the length of trendlines. How to use it: Choose an option from the dropdown. Additional Info: Default lengths are SHORT=50, MID=100, LONG=200. 🔧 Custom Trendline Length 🔧custom: Specify a custom length for trendlines. What it is: An integer input for setting a custom trendline length. What it does: Overrides the default trendline lengths if set to CUSTOM. How to use it: Enter a custom integer value (only shown when CUSTOM is selected). 🔍 Max Bearish Trendlines 🔍Max Trendlines Bearish: Set the maximum number of bearish trendlines to display. What it is: A dropdown to select the maximum number of bearish trendlines. What it does: Limits the number of bearish trendlines shown on the chart. How to use it: Choose a value from the dropdown (2-20). 🟩 Bearish Trendline Color Bearish Trendline Color: Set the color for bearish trendlines. What it is: A color picker to set the color of bearish trendlines. What it does: Changes the color of bearish trendlines on the chart. How to use it: Select a color from the color picker. Additional Info: Adjust to control how many bearish trendlines are displayed. 🔍 Max Bullish Trendlines 🔍Max Trendlines Bullish: Set the maximum number of bullish trendlines to display. What it is: A dropdown to select the maximum number of bullish trendlines. What it does: Limits the number of bullish trendlines shown on the chart. How to use it: Choose a value from the dropdown (2-20). 🟥 Bullish Trendline Color Bullish Trendline Color: Set the color for bullish trendlines. What it is: A color picker to set the color of bullish trendlines. What it does: Changes the color of bullish trendlines on the chart. How to use it: Select a color from the color picker. Additional Info: Adjust to control how many bullish trendlines are displayed. 📐 Degrees Text 📐Degrees ° (💬 Size): Enable or disable degrees text and set its size and color. What it is: A boolean input to show or hide the degrees text for trendlines. What it does: Displays the degrees text for trendlines. How to use it: Check or uncheck the box to enable or disable. 📏 Text Size for Degrees Text Size: Set the text size for degrees on trendlines. What it is: A dropdown to select the size of the degrees text. What it does: Changes the size of the degrees text displayed for trendlines. How to use it: Choose a size from the dropdown (XS, S, M, L, XL). 🎨 Degrees Text Color Degrees Text Color: Set the color for the degrees text on trendlines. What it is: A color picker to set the color of the degrees text. What it does: Changes the color of the degrees text on the chart. How to use it: Select a color from the color picker. ♻ Filter Degrees ♻ Filter Degrees °: Enable or disable angle filtering and set the angle range. What it is: A boolean input to filter trendlines by their angle. What it does: Shows only trendlines within a specified angle range. How to use it: Check or uncheck the box to enable or disable. Additional Info: Angles outside this range will be filtered out. 🔢 Angle Range Angle Range: Set the angle range for filtering trendlines. What it is: Two float inputs to set the minimum and maximum angle for trendlines. What it does: Defines the range of angles for which trendlines will be shown. How to use it: Enter values for the minimum and maximum angles. ➖ Line Style ➖Style #1 & #2: Select the style of the primary and secondary trendlines. What it is: Two dropdowns to choose between Solid, Dashed, or Dotted for the trendlines. What it does: Sets the style of the primary and secondary trendlines. How to use it: Choose a style from each dropdown. 📏 Line Thickness : Set the thickness for the trendlines. What it is: An integer input to set the thickness of the trendlines. What it does: Adjusts the thickness of the trendlines displayed on the chart. How to use it: Enter a value between 1 and 5. Additional Information Trendline Percentage Difference: Setting a percentage difference helps in analyzing the relative position and angle of trendlines. Filtering by Angle: This feature allows focusing on trendlines within a specific angle range, enhancing the clarity of trend analysis. BOS & CHOCH Market Structure visuals: 📊 BOS & CHOCH Market Structure Input Settings 📏 Market Structure Length Option 📏Market Structure: Select the market structure length option. What it is: A dropdown to choose between INTERNAL, EXTERNAL, ALL, CUSTOM, or NONE. What it does: Sets the type of market structure to be displayed. How to use it: Choose an option from the dropdown. Additional Info: INTERNAL: Only internal structure. EXTERNAL: Only external structure. ALL: Both internal and external structures. CUSTOM: Custom lengths. NONE: No structure. 🔧 Custom Internal Length 🔧Custom Internal: Specify a custom length for internal market structure. What it is: An integer input for setting a custom internal length. What it does: Defines the length of internal market structures if CUSTOM is selected. How to use it: Enter a custom integer value (only shown when CUSTOM is selected). 💬 Internal Label Size 💬Internal Label Size: Set the label size for internal market structures. What it is: A dropdown to select the size of the labels. What it does: Changes the size of the labels for internal market structures. How to use it: Choose a size from the dropdown (XS, S, M, L, XL). 🟩 Internal Bullish Color Internal Bullish Color: Set the color for bullish internal market structures. What it is: A color picker to set the color of bullish internal market structures. What it does: Changes the color of bullish internal market structures on the chart. How to use it: Select a color from the color picker. 🟥 Internal Bearish Color Internal Bearish Color: Set the color for bearish internal market structures. What it is: A color picker to set the color of bearish internal market structures. What it does: Changes the color of bearish internal market structures on the chart. How to use it: Select a color from the color picker. 🔧 Custom External Length 🔧Custom External: Specify a custom length for external market structure. What it is: An integer input for setting a custom external length. What it does: Defines the length of external market structures if CUSTOM is selected. How to use it: Enter a custom integer value (only shown when CUSTOM is selected). 💬 External Label Size 💬External Label Size: Set the label size for external market structures. What it is: A dropdown to select the size of the labels. What it does: Changes the size of the labels for external market structures. How to use it: Choose a size from the dropdown (XS, S, M, L, XL). 🟩 External Bullish Color External Bullish Color: Set the color for bullish external market structures. What it is: A color picker to set the color of bullish external market structures. What it does: Changes the color of bullish external market structures on the chart. How to use it: Select a color from the color picker. 🟥 External Bearish Color External Bearish Color: Set the color for bearish external market structures. What it is: A color picker to set the color of bearish external market structures. What it does: Changes the color of bearish external market structures on the chart. How to use it: Select a color from the color picker. 📐 Show Equal Highs and Lows EQL & EQH📐: Toggle visibility for equal highs and lows. What it is: A boolean input to show or hide equal highs and lows. What it does: Displays or hides equal highs and lows on the chart. How to use it: Check or uncheck the box to enable or disable. 📏 Equal Highs and Lows Threshold Equal Highs and Lows Threshold: Set the threshold for equal highs and lows. What it is: A float input to set the threshold for equal highs and lows. What it does: Defines the range within which highs and lows are considered equal. How to use it: Enter a value between 0 and 10. 💬 Label Size for Equal Highs and Lows 💬Label Size for Equal Highs and Lows: Set the label size for equal highs and lows. What it is: A dropdown to select the size of the labels. What it does: Changes the size of the labels for equal highs and lows. How to use it: Choose a size from the dropdown (XS, S, M, L, XL). 🟩 Bullish Color for Equal Highs and Lows Bullish Color for Equal Highs and Lows: Set the color for bullish equal highs and lows. What it is: A color picker to set the color of bullish equal highs and lows. What it does: Changes the color of bullish equal highs and lows on the chart. How to use it: Select a color from the color picker. 🟥 Bearish Color for Equal Highs and Lows Bearish Color for Equal Highs and Lows: Set the color for bearish equal highs and lows. What it is: A color picker to set the color of bearish equal highs and lows. What it does: Changes the color of bearish equal highs and lows on the chart. How to use it: Select a color from the color picker. 📏 Show Swing Points Swing Points📏: Toggle visibility for swing points. What it is: A boolean input to show or hide swing points. What it does: Displays or hides swing points on the chart. How to use it: Check or uncheck the box to enable or disable. 📏 Swing Points Length Option Swing Points Length Option: Select the length for swing points. What it is: A dropdown to choose between SHORT, MID, LONG, or CUSTOM. What it does: Sets the length of swing points. How to use it: Choose an option from the dropdown. Additional Info: Default lengths are SHORT=10, MID=28, LONG=50. 💬 Swing Points Label Size 💬Swing Points Label Size: Set the label size for swing points. What it is: A dropdown to select the size of the labels. What it does: Changes the size of the labels for swing points. How to use it: Choose a size from the dropdown (XS, S, M, L, XL). 🎨 Swing Points Color Swing Points Color: Set the color for swing points. What it is: A color picker to set the color of swing points. What it does: Changes the color of swing points on the chart. How to use it: Select a color from the color picker. 🔧 Custom Swing Points Length 🔧Custom Swings: Specify a custom length for swing points. What it is: An integer input for setting a custom length for swing points. What it does: Defines the length of swing points if CUSTOM is selected. How to use it: Enter a custom integer value (only shown when CUSTOM is selected). Additional Information Market Structure Types: Understanding internal and external structures helps in analyzing different market behaviors. Equal Highs and Lows: This feature identifies areas where price action is balanced, which can be significant for trading strategies. Swing Points: Highlighting swing points aids in recognizing significant market reversals or continuations. Benefits Enhance your trading strategy by visualizing smart money's influence on price movements. Make informed decisions with real-time data on significant market structures. Reduce manual analysis with automated detection of key trading signals. Ideal For Traders looking for an edge in forex, equities, and cryptocurrency markets by understanding the underlying forces driving market dynamics. Acknowledgements Special thanks to these amazing creators for inspiration and their creations: I want to thank these amazing creators for creating there amazing indicators , that inspired me and also gave me a head start by making this indicator! Without their amazing indicators it wouldn't be possible! Flux Charts: Volumized Order Blocks LuxAlgo: Trend Lines UAlgo: Fair Value Gaps (FVG) By Leviathan: Market Structure Sonarlab: Liquidity Levels Note Remember to always backtest the indicator first before integrating it into your strategy! For any questions about the indicator, please feel free to ask for assistance.Pine Script® indicatorby WeloTradesUpdated 147147 6.8 K
Mars Signals - Ultimate Institutional Suite v3.0(Joker)Comprehensive Trading Manual Mars Signals – Ultimate Institutional Suite v3.0 (Joker) ## Chapter 1 – Philosophy & System Architecture This script is not a simple “buy/sell” indicator. Mars Signals – UIS v3.0 (Joker) is designed as an institutional-style analytical assistant that layers several methodologies into a single, coherent framework. The system is built on four core pillars: 1. Smart Money Concepts (SMC) - Detection of Order Blocks (professional demand/supply zones). - Detection of Fair Value Gaps (FVGs) (price imbalances). 2. Smart DCA Strategy - Combination of RSI and Bollinger Bands - Identifies statistically discounted zones for scaling into spot positions or exiting shorts. 3. Volume Profile (Visible Range Simulation) - Distribution of volume by price, not by time. - Identification of POC (Point of Control) and high-/low-volume areas. 4. Wyckoff Helper – Spring - Detection of bear traps, liquidity grabs, and sharp bullish reversals. All four pillars feed into a Confluence Engine (Scoring System). The final output is presented in the Dashboard, with a clear, human-readable signal: - STRONG LONG 🚀 - WEAK LONG ↗ - NEUTRAL / WAIT - WEAK SHORT ↘ - STRONG SHORT 🩸 This allows the trader to see *how many* and *which* layers of the system support a bullish or bearish bias at any given time. ## Chapter 2 – Settings Overview ### 2.1 General & Dashboard Group - Show Dashboard Panel (`show_dash`) Turns the dashboard table in the corner of the chart ON/OFF. - Show Signal Recommendation (`show_rec`) - If enabled, the textual signal (STRONG LONG, WEAK SHORT, etc.) is displayed. - If disabled, you only see feature status (ON/OFF) and the current price. - Dashboard Position (`dash_pos`) Determines where the dashboard appears on the chart: - `Top Right` - `Bottom Right` - `Top Left` ### 2.2 Smart Money (SMC) Group - Enable SMC Strategy (`show_smc`) Globally enables or disables the Order Block and FVG logic. - Order Block Pivot Lookback (`ob_period`) Main parameter for detecting key pivot highs/lows (swing points). - Default value: 5 - Concept: A bar is considered a pivot low if its low is lower than the lows of the previous 5 and the next 5 bars. Similarly, a pivot high has a high higher than the previous 5 and the next 5 bars. These pivots are used as anchors for Order Blocks. - Increasing `ob_period`: - Fewer levels. - But levels tend to be more significant and reliable. - In highly volatile markets (major news, war events, FOMC, etc.), using values 7–10 is recommended to filter out weak levels. - Show Fair Value Gaps (`show_fvg`) Enables/disables the drawing of FVG zones (imbalances). - Bullish OB Color (`c_ob_bull`) - Color of Bullish Order Blocks (Demand Zones). - Default: semi-transparent green (transparency ≈ 80). - Bearish OB Color (`c_ob_bear`) - Color of Bearish Order Blocks (Supply Zones). - Default: semi-transparent red. - Bullish FVG Color (`c_fvg_bull`) - Color of Bullish FVG (upward imbalance), typically yellow. - Bearish FVG Color (`c_fvg_bear`) - Color of Bearish FVG (downward imbalance), typically purple. ### 2.3 Smart DCA Strategy Group - Enable DCA Zones (`show_dca`) Enables the Smart DCA logic and visual labels. - RSI Length (`rsi_len`) Lookback period for RSI (default: 14). - Shorter → more sensitive, more noise. - Longer → fewer signals, higher reliability. - Bollinger Bands Length (`bb_len`) Moving average period for Bollinger Bands (default: 20). - BB Multiplier (`bb_mult`) Standard deviation multiplier for Bollinger Bands (default: 2.0). - For extremely volatile markets, values like 2.5–3.0 can be used so that only extreme deviations trigger a DCA signal. ### 2.4 Volume Profile (Visible Range Sim) Group - Show Volume Profile (`show_vp`) Enables the simulated Volume Profile bars on the right side of the chart. - Volume Lookback Bars (`vp_lookback`) Number of bars used to compute the Volume Profile (default: 150). - Higher values → broader historical context, heavier computation. - Row Count (`vp_rows`) Number of vertical price segments (rows) to divide the total price range into (default: 30). - Width (%) (`vp_width`) Relative width of each volume bar as a percentage. In the code, bar widths are scaled relative to the row with the maximum volume. > Technical note: Volume Profile calculations are executed only on the last bar (`barstate.islast`) to keep the script performant even on higher timeframes. ### 2.5 Wyckoff Helper Group - Show Wyckoff Events (`show_wyc`) Enables detection and plotting of Wyckoff Spring events. - Volume MA Length (`vol_ma_len`) Length of the moving average on volume. A bar is considered to have Ultra Volume if its volume is more than 2× the volume MA. ## Chapter 3 – Smart Money Strategy (Order Blocks & FVG) ### 3.1 What Is an Order Block? An Order Block (OB) represents the footprint of large institutional orders: - Bullish Order Block (Demand Zone) The last selling region (bearish candle/cluster) before a strong upward move. - Bearish Order Block (Supply Zone) The last buying region (bullish candle/cluster) before a strong downward move. Institutions and large players place heavy orders in these regions. Typical price behavior: - Price moves away from the zone. - Later returns to the same zone to fill unfilled orders. - Then continues the larger trend. In the script: - If `pl` (pivot low) forms → a Bullish OB is created. - If `ph` (pivot high) forms → a Bearish OB is created. The box is drawn: - From `bar_index ` to `bar_index`. - Between `low ` and `high `. - `extend=extend.right` extends the OB into the future, so it acts as a dynamic support/resistance zone. - Only the last 4 OB boxes are kept to avoid clutter. ### 3.2 Order Block Color Guide - Semi-transparent Green (`c_ob_bull`) - Represents a Bullish Order Block (Demand Zone). - Interpretation: a price region with a high probability of bullish reaction. - Semi-transparent Red (`c_ob_bear`) - Represents a Bearish Order Block (Supply Zone). - Interpretation: a price region with a high probability of bearish reaction. Overlap (Multiple OBs in the Same Area) When two or more Order Blocks overlap: - The shared area appears visually denser/stronger. - This suggests higher order density. - Such zones can be treated as high-priority levels for entries, exits, and stop-loss placement. ### 3.3 Demand/Supply Logic in the Scoring Engine is_in_demand = low <= ta.lowest(low, 20) is_in_supply = high >= ta.highest(high, 20) - If current price is near the lowest lows of the last 20 bars, it is considered in a Demand Zone → positive impact on score. - If current price is near the highest highs of the last 20 bars, it is considered in a Supply Zone → negative impact on score. This logic complements Order Blocks and helps the Dashboard distinguish whether: - Market is currently in a statistically cheap (long-friendly) area, or - In a statistically expensive (short-friendly) area. ### 3.4 Fair Value Gaps (FVG) #### Concept When the market moves aggressively: - Some price levels are skipped and never traded. - A gap between wicks/shadows of consecutive candles appears. - These regions are called Fair Value Gaps (FVGs) or Imbalances. The market generally “dislikes” imbalance and often: - Returns to these zones in the future. - Fills the gap (rebalance). - Then resumes its dominant direction. #### Implementation in the Code Bullish FVG (Yellow) fvg_bull_cond = show_smc and show_fvg and low > high and close > high if fvg_bull_cond box.new(bar_index , high , bar_index, low, ...) Core condition: `low > high ` → the current low is above the high of two bars ago; the space between them is an untraded gap. Bearish FVG (Purple) fvg_bear_cond = show_smc and show_fvg and high < low and close < low if fvg_bear_cond box.new(bar_index , low , bar_index, high, ...) Core condition: `high < low ` → the current high is below the low of two bars ago; again a price gap exists. #### FVG Color Guide - Transparent Yellow (`c_fvg_bull`) – Bullish FVG Often acts like a magnet for price: - Price tends to retrace into this zone, - Fill the imbalance, - And then continue higher. - Transparent Purple (`c_fvg_bear`) – Bearish FVG Price tends to: - Retrace upward into the purple area, - Fill the imbalance, - And then resume downward movement. #### Trading with FVGs - FVGs are *not* standalone entry signals. They are best used as: - Targets (take-profit zones), or - Reaction areas where you expect a pause or reversal. Examples: - If you are long, a bearish FVG above is often an excellent take-profit zone. - If you are short, a bullish FVG below is often a good cover/exit zone. ### 3.5 Core SMC Trading Templates #### Reversal Long 1. Price trades down into a green Order Block (Demand Zone). 2. A bullish confirmation candle (Close > Open) forms inside or just above the OB. 3. If this zone is close to or aligned with a bullish FVG (yellow), the signal is reinforced. 4. Entry: - At the close of the confirmation candle, or - Using a limit order near the upper boundary of the OB. 5. Stop-loss: - Slightly below the OB. - If the OB is broken decisively and price consolidates below it, the zone loses validity. 6. Targets: - The next FVG, - Or the next red Order Block (Supply Zone) above. #### Reversal Short The mirror scenario: - Price rallies into a red Order Block (Supply). - A bearish confirmation candle forms (Close < Open). - FVG/premium structure above can act as a confluence. - Stop-loss goes above the OB. - Targets: lower FVGs or subsequent green OBs below. ## Chapter 4 – Smart DCA Strategy (RSI + Bollinger Bands) ### 4.1 Smart DCA Concept - Classic DCA = buying at fixed time intervals regardless of price. - Smart DCA = scaling in only when: - Price is statistically cheaper than usual, and - The market is in a clear oversold condition. Code logic: rsi_val = ta.rsi(close, rsi_len) = ta.bb(close, bb_len, bb_mult) dca_buy = show_dca and rsi_val < 30 and close < bb_lower dca_sell = show_dca and rsi_val > 70 and close > bb_upper Conditions: - DCA Buy – Smart Scale-In Zone - RSI < 30 → oversold. - Close < lower Bollinger Band → price has broken below its typical volatility envelope. - DCA Sell – Overbought/Distribution Zone - RSI > 70 → overbought. - Close > upper Bollinger Band → price is extended far above the mean. ### 4.2 Visual Representation on the Chart - Green “DCA” Label Below Candle - Shape: `labelup`. - Color: lime background, white text. - Meaning: statistically attractive level for laddered spot entries or short exits. - Red “SELL” Label Above Candle - Warning that the market is in an extended, overbought condition. - Suitable for profit-taking on longs or considering short entries (with proper confluence and risk management). - Light Green Background (`bgcolor`) - When `dca_buy` is true, the candle background turns very light green (high transparency). - This helps visually identify DCA Zones across the chart at a glance. ### 4.3 Practical Use in Trading #### Spot Trading Used to build a better average entry price: - Every time a DCA label appears, allocate a fixed portion of capital (e.g., 2–5%). - Combining DCA signals with: - Green OBs (Demand Zones), and/or - The Volume Profile POC makes the zone structurally more important. #### Futures Trading - Longs - Use DCA Buy signals as low-risk zones for opening or adding to longs when: - Price is inside a green OB, or - The Dashboard already leans LONG. - Shorts - Use DCA Sell signals as: - Exit zones for longs, or - Areas to initiate shorts with stops above structural highs. ## Chapter 5 – Volume Profile (Visible Range Simulation) ### 5.1 Concept Traditional volume (histogram under the chart) shows volume over time. Volume Profile shows volume by price level: - At which prices has the highest trading activity occurred? - Where did buyers and sellers agree the most (High Volume Nodes – HVNs)? - Where did price move quickly due to low participation (Low Volume Nodes – LVNs)? ### 5.2 Implementation in the Script Executed only when `show_vp` is enabled and on the last bar: 1. The last `vp_lookback` bars (default 150) are processed. 2. The minimum low and maximum high over this window define the price range. 3. This price range is divided into `vp_rows` segments (e.g., 30 rows). 4. For each row: - All bars are scanned. - If the mid-price `(high + low ) / 2` falls inside a row, that bar’s volume is added to the row total. 5. The row with the greatest volume is stored as `max_vol_idx` (the POC row). 6. For each row, a volume box is drawn on the right side of the chart. ### 5.3 Color Scheme - Semi-transparent Orange - The row with the maximum volume – the Point of Control (POC). - Represents the strongest support/resistance level from a volume perspective. - Semi-transparent Blue - Other volume rows. - The taller the bar → the higher the volume → the stronger the interest at that price band. ### 5.4 Trading Applications - If price is above POC and retraces back into it: → POC often acts as support, suitable for long setups. - If price is below POC and rallies into it: → POC often acts as resistance, suitable for short setups or profit-taking. HVNs (Tall Blue Bars) - Represent areas of equilibrium where the market has spent time and traded heavily. - Price tends to consolidate here before choosing a direction. LVNs (Short or Nearly Empty Bars) - Represent low participation zones. - Price often moves quickly through these areas – useful for targeting fast moves. ## Chapter 6 – Wyckoff Helper – Spring ### 6.1 Spring Concept In the Wyckoff framework: - A Spring is a false break of support. - The market briefly trades below a well-defined support level, triggers stop losses, then sharply reverses upward as institutional buyers absorb liquidity. This movement: - Clears out weak hands (retail sellers). - Provides large players with liquidity to enter long positions. - Often initiates a new uptrend. ### 6.2 Code Logic Conditions for a Spring: 1. The current low is lower than the lowest low of the previous 50 bars → apparent break of a long-standing support. 2. The bar closes bullish (Close > Open) → the breakdown was rejected. 3. Volume is significantly elevated: → `volume > 2 × volume_MA` (Ultra Volume). When all conditions are met and `show_wyc` is enabled: - A pink diamond is plotted below the bar, - With the label “Spring” – one of the strongest long signals in this system. ### 6.3 Trading Use - After a valid Spring, markets frequently enter a meaningful bullish phase. - The highest quality setups occur when: - The Spring forms inside a green Order Block, and - Near or on the Volume Profile POC. Entries: - At the close of the Spring bar, or - On the first pullback into the mid-range of the Spring candle. Stop-loss: - Slightly below the Spring’s lowest point (wick low plus a small buffer). ## Chapter 7 – Confluence Engine & Dashboard ### 7.1 Scoring Logic For each bar, the script: 1. Resets `score` to 0. 2. Adjusts the score based on different signals. SMC Contribution if show_smc if is_in_demand score += 1 if is_in_supply score -= 1 - Being in Demand → `+1` - Being in Supply → `-1` DCA Contribution if show_dca if dca_buy score += 2 if dca_sell score -= 2 - DCA Buy → `+2` (strong, statistically driven long signal) - DCA Sell → `-2` Wyckoff Spring Contribution if show_wyc if wyc_spring score += 2 - Spring → `+2` (entry of strong money) ### 7.2 Mapping Score to Dashboard Signal - score ≥ 2 → STRONG LONG 🚀 Multiple bullish conditions aligned. - score = 1 → WEAK LONG ↗ Some bullish bias, but only one layer clearly positive. - score = 0 → NEUTRAL / WAIT Rough balance between buying and selling forces; staying flat is usually preferable. - score = -1 → WEAK SHORT ↘ Mild bearish bias, suited for cautious or short-term plays. - score ≤ -2 → STRONG SHORT 🩸 Convergence of several bearish signals. ### 7.3 Dashboard Structure The dashboard is a two-column table: - Row 0 - Column 0: `"Mars Signals"` – black background, white text. - Column 1: `"UIS v3.0"` – black background, yellow text. - Row 1 - Column 0: `"Price:"` (light grey background). - Column 1: current closing price (`close`) with a semi-transparent blue background. - Row 2 - Column 0: `"SMC:"` - Column 1: - `"ON"` (green) if `show_smc = true` - `"OFF"` (grey) otherwise. - Row 3 - Column 0: `"DCA:"` - Column 1: - `"ON"` (green) if `show_dca = true` - `"OFF"` (grey) otherwise. - Row 4 - Column 0: `"Signal:"` - Column 1: signal text (`status_txt`) with background color `status_col` (green, red, teal, maroon, etc.) - If `show_rec = false`, these cells are cleared. ## Chapter 8 – Visual Legend (Colors, Shapes & Actions) For quick reading inside TradingView, the visual elements are described line by line instead of a table. Chart Element: Green Box Color / Shape: Transparent green rectangle Core Meaning: Bullish Order Block (Demand Zone) Suggested Trader Response: Look for longs, Smart DCA adds, closing or reducing shorts. Chart Element: Red Box Color / Shape: Transparent red rectangle Core Meaning: Bearish Order Block (Supply Zone) Suggested Trader Response: Look for shorts, or take profit on existing longs. Chart Element: Yellow Area Color / Shape: Transparent yellow zone Core Meaning: Bullish FVG / upside imbalance Suggested Trader Response: Short take-profit zone or expected rebalance area. Chart Element: Purple Area Color / Shape: Transparent purple zone Core Meaning: Bearish FVG / downside imbalance Suggested Trader Response: Long take-profit zone or temporary supply region. Chart Element: Green "DCA" Label Color / Shape: Green label with white text, plotted below the candle Core Meaning: Smart ladder-in buy zone, DCA buy opportunity Suggested Trader Response: Spot DCA entry, partial short exit. Chart Element: Red "SELL" Label Color / Shape: Red label with white text, plotted above the candle Core Meaning: Overbought / distribution zone Suggested Trader Response: Take profit on longs, consider initiating shorts. Chart Element: Light Green Background (bgcolor) Color / Shape: Very transparent light-green background behind bars Core Meaning: Active DCA Buy zone Suggested Trader Response: Treat as a discount zone on the chart. Chart Element: Orange Bar on Right Color / Shape: Transparent orange horizontal bar in the volume profile Core Meaning: POC – price with highest traded volume Suggested Trader Response: Strong support or resistance; key reference level. Chart Element: Blue Bars on Right Color / Shape: Transparent blue horizontal bars in the volume profile Core Meaning: Other volume levels, showing high-volume and low-volume nodes Suggested Trader Response: Use to identify balance zones (HVN) and fast-move corridors (LVN). Chart Element: Pink "Spring" Diamond Color / Shape: Pink diamond with white text below the candle Core Meaning: Wyckoff Spring – liquidity grab and potential major bullish reversal Suggested Trader Response: One of the strongest long signals in the suite; look for high-quality long setups with tight risk. Chart Element: STRONG LONG in Dashboard Color / Shape: Green background, white text in the Signal row Core Meaning: Multiple bullish layers in confluence Suggested Trader Response: Consider initiating or increasing longs with strict risk management. Chart Element: STRONG SHORT in Dashboard Color / Shape: Red background, white text in the Signal row Core Meaning: Multiple bearish layers in confluence Suggested Trader Response: Consider initiating or increasing shorts with a logical, well-placed stop. ## Chapter 9 – Timeframe-Based Trading Playbook ### 9.1 Timeframe Selection - Scalping - Timeframes: 1M, 5M, 15M - Objective: fast intraday moves (minutes to a few hours). - Recommendation: focus on SMC + Wyckoff. Smart DCA on very low timeframes may introduce excessive noise. - Day Trading - Timeframes: 15M, 1H, 4H - Provides a good balance between signal quality and frequency. - Recommendation: use the full stack – SMC + DCA + Volume Profile + Wyckoff + Dashboard. - Swing Trading & Position Investing - Timeframes: Daily, Weekly - Emphasis on Smart DCA + Volume Profile. - SMC and Wyckoff are used mainly to fine-tune swing entries within larger trends. ### 9.2 Scenario A – Scalping Long Example: 5-Minute Chart 1. Price is declining into a green OB (Bullish Demand). 2. A candle with a long lower wick and bullish close (Pin Bar / Rejection) forms inside the OB. 3. A Spring diamond appears below the same candle → very strong confluence. 4. The Dashboard shows at least WEAK LONG ↗, ideally STRONG LONG 🚀. 5. Entry: - On the close of the confirmation candle, or - On the first pullback into the mid-range of that candle. 6. Stop-loss: - Slightly below the OB. 7. Targets: - Nearby bearish FVG above, and/or - The next red OB. ### 9.3 Scenario B – Day-Trading Short Recommended Timeframes: 1H or 4H 1. The market completes a strong impulsive move upward. 2. Price enters a red Order Block (Supply). 3. In the same zone, a purple FVG appears or remains unfilled. 4. On a lower timeframe (e.g., 15M), RSI enters overbought territory and a DCA Sell signal appears. 5. The main timeframe Dashboard (1H) shows WEAK SHORT ↘ or STRONG SHORT 🩸. Trade Plan - Open a short near the upper boundary of the red OB. - Place the stop above the OB or above the last swing high. - Targets: - A yellow FVG lower on the chart, and/or - The next green OB (Demand) below. ### 9.4 Scenario C – Swing / Investment with Smart DCA Timeframes: Daily / Weekly 1. On the daily or weekly chart, each time a green “DCA” label appears: - Allocate a fixed fraction of your capital (e.g., 3–5%) to that asset. 2. Check whether this DCA zone aligns with the orange POC of the Volume Profile: - If yes → the quality of the entry zone is significantly higher. 3. If the DCA signal sits inside a daily green OB, the probability of a medium-term bottom increases. 4. Always build the position laddered, never all-in at a single price. Exits for investors: - Near weekly red OBs or large purple FVG zones. - Ideally via partial profit-taking rather than closing 100% at once. ### 9.5 Case Study 1 – BTCUSDT (15-Minute) - Context: Price has sold off down towards 65,000 USD. - A green OB had previously formed at that level. - Near the lower boundary of this OB, a partially filled yellow FVG is present. - As price returns to this region, a Spring appears. - The Dashboard shifts from NEUTRAL / WAIT to WEAK LONG ↗. Plan - Enter a long near the OB low. - Place stop below the Spring low. - First target: a purple FVG around 66,200. - Second (optional) target: the first red OB above that level. ### 9.6 Case Study 2 – Meme Coin (PEPE – 4H) - After a strong pump, price enters a corrective phase. - On the 4H chart, RSI drops below 30; price breaks below the lower Bollinger Band → a DCA label prints. - The Volume Profile shows the POC at approximately the same level. - The Dashboard displays STRONG LONG 🚀. Plan - Execute laddered buys in the combined DCA + POC zone. - Place a protective stop below the last significant swing low. - Target: an expected 20–30% upside move towards the next red OB or purple FVG. ## Chapter 10 – Risk Management, Psychology & Advanced Tuning ### 10.1 Risk Management No signal, regardless of its strength, replaces risk control. Recommendations: - In futures, do not expose more than 1–3% of account equity to risk per trade. - Adjust leverage to the volatility of the instrument (lower leverage for highly volatile altcoins). - Place stop-losses in zones where the idea is clearly invalidated: - Below/above the relevant Order Block or Spring, not randomly in the middle of the structure. ### 10.2 Market-Specific Parameter Tuning - Calmer Markets (e.g., major FX pairs) - `ob_period`: 3–5. - `bb_mult`: 2.0 is usually sufficient. - Highly Volatile Markets (Crypto, news-driven assets) - `ob_period`: 7–10 to highlight only the most robust OBs. - `bb_mult`: 2.5–3.0 so that only extreme deviations trigger DCA. - `vol_ma_len`: increase (e.g., to ~30) so that Spring triggers only on truly exceptional volume spikes. ### 10.3 Trading Psychology - STRONG LONG 🚀 does not mean “risk-free”. It means the probability of a successful long, given the model’s logic, is higher than average. - Treat Mars Signals as a confirmation and context system, not a full replacement for your own decision-making. - Example of disciplined thinking: - The Dashboard prints STRONG LONG, - But price is simultaneously testing a multi-month macro resistance or a major negative news event is imminent, - In such cases, trade smaller, widen stops appropriately, or skip the trade. ## Chapter 11 – Technical Notes & FAQ ### 11.1 Does the Script Repaint? - Order Blocks and Springs are based on completed pivot structures and confirmed candles. - Until a pivot is confirmed, an OB does not exist; after confirmation, behavior is stable under classic SMC assumptions. - The script is designed to be structurally consistent rather than repainting signals arbitrarily. ### 11.2 Computational Load of Volume Profile - On the last bar, the script processes up to `vp_lookback` bars × `vp_rows` rows. - On very low timeframes with heavy zooming, this can become demanding. - If you experience performance issues: - Reduce `vp_lookback` or `vp_rows`, or - Temporarily disable Volume Profile (`show_vp = false`). ### 11.3 Multi-Timeframe Behavior - This version of the script is not internally multi-timeframe. All logic (OB, DCA, Spring, Volume Profile) is computed on the active timeframe only. - Practical workflow: - Analyze overall structure and key zones on higher timeframes (4H / Daily). - Use lower timeframes (15M / 1H) with the same tool for timing entries and exits. ## Conclusion Mars Signals – Ultimate Institutional Suite v3.0 (Joker) is a multi-layer trading framework that unifies: - Price structure (Order Blocks & FVG), - Statistical behavior (Smart DCA via RSI + Bollinger), - Volume distribution by price (Volume Profile with POC, HVN, LVN), - Liquidity events (Wyckoff Spring), into a single, coherent system driven by a transparent Confluence Scoring Engine. The final output is presented in clear, actionable language: > STRONG LONG / WEAK LONG / NEUTRAL / WEAK SHORT / STRONG SHORT The system is designed to support professional decision-making, not to replace it. Used together with strict risk management and disciplined execution, Mars Signals – UIS v3.0 (Joker) can serve as a central reference manual and operational guide for your trading workflow, from scalping to swing and investment positioning. Pine Script® indicatorby MarsSignals119
iFVG Strategie by Futures.RobbyiFVG Strategy Checklist by Futures.Robby Updated: October 27, 2025 Description This script is a manual checklist designed to help traders evaluate their setups based on the iFVG (Fair Value Gap) strategy. It serves solely as a visual aid and does not perform automatic analysis, signal generation, or trade execution. How It Works The script creates an interactive checklist directly on the chart. Traders manually select which criteria are met, and the script calculates a percentage score, displaying it with color coding: Green (≥ 60%): Good fulfillment of criteria Orange (40–59%): Partial fulfillment Red (< 40%): Poor fulfillment Checklist Criteria The checklist is divided into two main sections: 1. Trade Criteria (8 Points) Eight manually selectable criteria to assess setup quality: Trade im Bias → Trade in Bias: Trade follows the higher timeframe trend (H1/H4/Daily). BE Level → BE Level: Swing point between entry and target. Sweep → Sweep: Price hits a key swing before reversing. Displacement → Displacement: iFVG broken by strong candles. Leg FVG geschlossen → Leg FVG Closed: No open m1 to m5 FVGs to target. FVG Reaktion → FVG Reaction: Reaction at FVG during sweep (HTF). FVG Größe → FVG Size: 6 to 10 points. Anzahl Kerzen → Number of Candles: Maximum of 6 candles. 2. Goals (1 Point) Six optional goal conditions, counted together as 1 point: Equal H / L → Equal High/Low Session H / L → Session High/Low News H / L → News High/Low HTF Swing Point → HTF Swing Point HTF OB → HTF Order Block HTF FVG → HTF FVG Settings and Customization The script’s settings are translated as follows: Group: Trade Criteria Trade im Bias → Trade in Bias Tooltip: Trendrichtung folgt HTF (H1/H4/Täglich) – Trend follows HTF direction BE Level → BE Level Tooltip: Swingpunkt zwischen Einstieg und Ziel – Swing point between entry and target Sweep → Sweep Tooltip: Kurs erreicht markanten Swing – Price hits key swing before inverse Displacement → Displacement Tooltip: iFVG durch starke Kerzen gebrochen – iFVG broken by strong candles Leg FVG geschlossen → Leg FVG Closed Tooltip: Keine offenen m1 bis m5 FVGs bis Ziel – No open m1 to m5 FVGs to target FVG Reaktion → FVG Reaction Tooltip: Reaktion an FVG beim Sweep (HTF) – Reaction at FVG during sweep (HTF) FVG Größe → FVG Size Tooltip: 6 bis 10 Punkte – 6 to 10 points Anzahl Kerzen → Number of Candles Tooltip: Maximal 6 Kerzen – Maximum of 6 candles Group: Goals Equal H / L → Equal High/Low Session H / L → Session High/Low News H / L → News High/Low HTF Swing Point → HTF Swing Point HTF OB → HTF Order Block HTF FVG → HTF FVG ℹ️ Ziele zählen gemeinsam als 1 Punkt → ℹ️ Goals count together as 1 point Window Position & Size Fensterposition → Window Position oben rechts → top right oben links → top left unten rechts → bottom right unten links → bottom left Tabellengröße → Table Size normal → normal small → small tiny → tiny Translation of Chart Table Contents The table headers and entries on the chart are translated as follows: Table Headers: Trade Checkliste → Trade Checklist Ziele → Goals Status Symbols: ✅ → ✅ (Fulfilled) ❌ → ❌ (Not fulfilled) Individual Criteria (Trade Criteria): Trade im Bias → Trade in Bias BE Level → BE Level Sweep → Sweep Displacement → Displacement Leg FVG geschlossen → Leg FVG Closed FVG Reaktion → FVG Reaction FVG Größe → FVG Size Anzahl Kerzen → Number of Candles Individual Criteria (Goals): Equal H / L → Equal High/Low Session H / L → Session High/Low News H / L → News High/Low HTF Swing Point → HTF Swing Point HTF OB → HTF Order Block HTF FVG → HTF FVG Note Line: Ziele zählen gemeinsam als 1 Punkt → Goals count together as 1 point Important Note This tool is not an automated indicator, but a visual decision aid for traders who want to apply their strategy in a structured and conscious way.Pine Script® indicatorby kp_eu_de117
USDJPY Fair Value Gap + Session Strategy🎯 Overview This strategy combines Fair Value Gaps (FVGs) with session-based order flow analysis, specifically optimized for USDJPY. It identifies price inefficiencies left behind by institutional order flow during high-volatility trading sessions, offering a modern alternative to traditional lagging indicators. 🔬 What Are Fair Value Gaps? Fair Value Gaps represent areas where aggressive institutional buying or selling created "gaps" in the market structure: Bullish FVG: Price moves up so aggressively that it leaves unfilled buy orders behind Bearish FVG: Price moves down so quickly that it leaves unfilled sell orders behind Research shows approximately 80% of FVGs get "filled" (price returns to the gap) within 20-60 bars, making them highly predictable trading zones. (see the generated image above) (see the generated image above) FVG Detection Logic: text // Bullish FVG: Gap between high and current low bullishFVG = low > high and high > high // Bearish FVG: Gap between low and current high bearishFVG = high < low and low < low 🌏 Session-Based Trading Why Sessions Matter for USDJPY (see the generated image above) Tokyo Session (00:00-09:00 UTC) Highest volatility during first hour (00:00-01:00 UTC) Average movement: 51-60 pips Best for breakout strategies London/NY Overlap (13:00-16:00 UTC) Maximum liquidity and institutional participation Tightest spreads and most reliable FVG formations Optimal for continuation trades Monday Premium Effect USDJPY moves 120+ pips on Mondays due to weekend positioning Enhanced FVG formation during session opens 📊 Strategy Components (see the generated image above) 1. Fair Value Gap Detection Identifies bullish and bearish FVGs automatically Age limit: FVGs expire after 20 bars to avoid stale setups Size filter: Minimum gap size to filter out noise 2. Session Filtering Tokyo Open focus: Trades during first hour of Asian session London/NY Overlap: Captures high-liquidity institutional flows Weekend gap strategy: Enhanced signals on Monday opens 3. Volume Confirmation Requires 1.5x average volume spike Confirms institutional participation Reduces false signals 4. Trend Alignment 50 EMA filter ensures trades align with higher timeframe trend Long trades above EMA, short trades below Prevents costly counter-trend trades 5. Risk Management 2:1 Risk/Reward minimum ensures profitability with 40%+ win rate Percentage-based stops adapt to USDJPY volatility (0.3% default) Configurable position sizing 🎯 Entry Conditions (see the generated image above) Long Entry (BUY) ✅ Bullish FVG detected in previous bars ✅ Price returns to FVG zone during active trading session ✅ Volume spike above 1.5x average ✅ Price above 50 EMA (trend confirmation) ✅ Bullish candle closes within FVG zone ✅ Trading during Tokyo open OR London/NY overlap Short Entry (SELL) ✅ Bearish FVG detected in previous bars ✅ Price returns to FVG zone during active trading session ✅ Volume spike above 1.5x average ✅ Price below 50 EMA (trend confirmation) ✅ Bearish candle closes within FVG zone ✅ Trading during Tokyo open OR London/NY overlap 📈 Expected Performance Backtesting Results (Based on Similar Strategies): Win Rate: 44-59% (profitable due to high R:R ratio) Average Winner: 60-90 pips during London/NY sessions Average Loser: 30-40 pips (tight stops at FVG boundaries) Risk/Reward: 2:1 minimum, often 3:1 during strong trends Best Performance: Monday Tokyo opens and Wednesday London/NY overlaps Why This Works for USDJPY: 90% correlation with US-Japan bond yield spreads High volatility provides sufficient pip movement Heavy institutional/central bank participation creates clear FVGs Consistent volatility patterns across trading sessions ⚙️ Configurable Parameters Session Settings: Trade Tokyo Session (Enable/Disable) Trade London/NY Overlap (Enable/Disable) FVG Settings: FVG Minimum Size (Filter small gaps) Maximum FVG Age (20 bars default) Show FVG Markers (Visual display) Volume Settings: Use Volume Filter (Enable/Disable) Volume Multiplier (1.5x default) Volume Average Period (20 bars) Trend Settings: Use Trend Filter (Enable/Disable) Trend EMA Period (50 default) Risk Management: Risk/Reward Ratio (2.0 default) Stop Loss Percentage (0.3% default) 🎨 Visual Indicators 🟡 Yellow Line: 50 EMA trend filter 🟢 Green Triangles: Long entry signals 🔴 Red Triangles: Short entry signals 🟢 Green Dots: Bullish FVG zones 🔴 Red Dots: Bearish FVG zones 🟦 Blue Background: Tokyo open session 🟧 Orange Background: London/NY overlap 📊 Recommended Settings Optimal Timeframes: Primary: 5-minute charts (scalping) Secondary: 15-minute charts (swing trading) Parameter Optimization: Conservative: Stop Loss 0.2%, R:R 2:1, Volume 2.0x Balanced: Stop Loss 0.3%, R:R 2:1, Volume 1.5x (default) Aggressive: Stop Loss 0.4%, R:R 1.5:1, Volume 1.2x Risk Management: Maximum 1-2% of account per trade Daily loss limit: Stop after 3-5 consecutive losses Use fixed percentage position sizing ⚠️ Important Considerations Avoid Trading During: Major news events (BOJ interventions, NFP, FOMC) Holiday periods with reduced liquidity Low volatility Asian afternoon sessions When US-Japan yield differential narrows sharply Best Practices: Limit to 2-3 trades per session maximum Always respect the 50 EMA trend filter Never risk more than planned per trade Paper trade for 2-4 weeks before live implementation Track performance by session and day of week 🚀 How to Use Add the script to your USDJPY chart Set timeframe to 5-minute or 15-minute Adjust parameters based on your risk tolerance Enable strategy alerts for automated notifications Wait for visual signals (triangles) to appear Enter trades according to your risk management rules 📚 Strategy Foundation This strategy is based on: Smart Money Concepts (SMC): Institutional order flow tracking Market Microstructure: Understanding how FVGs form in electronic trading Quantified Risk Management: Statistical edge through proper R:R ratios Session Liquidity Patterns: Exploiting predictable volatility cyclesPine Script® strategyby Stockhock18
D3m4h GIFVGDescription D3m4h GIFVG is an indicator designed to automatically detect market imbalances—often referred to as FVGs (Fair Value Gaps)—and potential pivot-based shifts in market structure. It offers a dynamic approach to visualizing supply/demand inefficiencies and pivot-based trend changes. Key features include: 1. Pivot-Based Bullish/Bearish Detection The indicator identifies higher-high/lower-low pivot logic as well as “outside bar” pivots. It tracks when the market transitions from bullish to bearish ranges, or vice versa, by using multiple checks: Pivot low/high detection Break-of-structure (when price crosses the last pivot) Opposing FVG detection to confirm an intraday pivot shift 2. FVG (Fair Value Gap) Detection The script automatically scans for bullish or bearish FVG conditions: Bullish FVG: Candle at position (bar_index - 2) has a high below the current candle’s low. Bearish FVG: Candle at position (bar_index - 2) has a low above the current candle’s high. When it detects an FVG, it draws a box on the chart to highlight the price gap (yellow boxes by default). 3. Pivot Range FVG If an FVG forms while the market is in a bullish pivot range, the script can paint a special “blue” FVG to underscore its significance. The same logic applies if a newly formed FVG appears in a bearish pivot range. 4. Filled Gap Cleanup You can optionally hide standard FVG boxes once they’re filled. For example, if the candle’s body (or candle range) covers that gap, the box is removed to keep your chart clean. 5. Pivot-Range FVG “Raided” Cleanup If the pivot-based FVG is later filled from the opposing direction, it turns green and can optionally remove itself after a set number of bars. 6. Informative Table A small table on the chart optionally displays whether or not the pivot-based FVG has been “raided”. You can toggle this table on/off in the settings. How It Works 1. Pivot Shifts The script tracks the last pivot high/low using a combination of candle-based pivot detection and break-of-structure checks (when price crosses the last pivot in the opposite direction). When a shift is detected, the pivot range ID increments—this helps the script know when to remove old pivot-based FVGs or draw new ones. 2. FVG Formation Each new bar checks if a bullish or bearish FVG formed (comparing the high of bar two bars ago to the current low, or the low of bar two bars ago to the current high). If one is found, a box is drawn to highlight the imbalance. Its color and extension depend on script settings. 3. Imbalance or Pivot FVG Standard imbalance boxes appear in yellow. If the new imbalance coincides with a bullish or bearish pivot range, a special “pivot imbalance” box in blue is drawn. 3. Hide Filled If a newly formed candle’s body fully covers the FVG, the box is considered filled. If Hide Filled Gaps is enabled, the box is deleted once it’s covered. 4. Raid Status For the pivot-based (blue) FVG, once price invalidates it from the opposite side, it changes color to green and gets removed after a user-defined number of bars. How to Use 1. Look for FVGs Observe yellow boxes to identify potential intraday imbalances. Watch for price returning to fill these zones. If you see a “blue” box, it signifies a pivot-based FVG in line with a recognized shift in structure—arguably a higher-probability zone. 2. “Hide Filled Gaps” Turn this on if you only want to see currently active or partially filled imbalances. The script cleans up old, fully covered boxes to keep your chart neat. 3. Pivot Shifts Note the script’s internal pivot logic. Each new pivot re-defines bullish or bearish states. Use these states to gauge the short-term trend shifts. 4. Toggle the Table You can show or hide the chart table by enabling/disabling “Show Table” from the inputs. This table indicates if the pivot-based “GIFVG” has been “raided” or not. 5. Extend Count Adjust the extendCount in the code if you want FVG boxes to extend further or shorter in time. Underlying Concepts Fair Value Gaps Market inefficiencies that occur when price jumps, leaving a “gap” from the candle 2 bars ago to the current candle. They can act like mini supply/demand zones where price may revisit for balance. Pivot Ranges The script tries to maintain an internal sense of whether the market is in a bullish or bearish pivot range. When it sees a contrary FVG or break-of-structure, it flips the pivot state. Outside Bars A candle that has both a higher high and a lower low than the previous bar. The script uses these to mark significant pivot shifts. By combining pivot-based logic with FVG detection, the D3m4h GIFVG indicator helps highlight potential areas of liquidity or unfilled value. Traders can use these zones to plan entries/exits or to confirm short-term trend shifts.Pine Script® indicatorby d3m4h25
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)Pine Script® libraryby robbattUpdated 1515185
Fair Value Gap [UkutaLabs]█ OVERVIEW Fair Value Gaps are price jumps caused by the imbalance buying and selling pressures in trading and are most commonly used amongst price action traders. Fair Value Gaps are formed via a three-candle sequence in which a large candle’s neighbouring candles’ upper and lower wicks do not fully overlap the large candle. The Fair Value Gaps Indicator also supports Multi Time Frame Plotting, allowing you to plot the Fair Value Gaps from higher time frames onto lower time frame charts. The Fair Value Gaps Indicator is a powerful trading toolkit that provides users with more information than they would typically have available to them by allowing them to configure several charts worth of information onto one single chart. █ USAGE The script automatically identifies imbalances between buying and selling pressure in the market in real time, offering traders valuable insight into current market sentiment. These gaps are considered to be levels where the supply and demand of a commodity are imbalanced, and the price tends to return to fill these gaps (But are not guaranteed to). The Fair Value Gaps Indicator also allows gaps from higher time frames to be drawn on lower time frame charts, providing traders with more information than they would typically have access to to further simplify the decision making process. █ SETTINGS Configuration • Show Labels: Determines whether labels that identify which time frame a FVG is calculated from. • Max FVG Display: Determines the limit to the number of FVGs that can be drawn from all time frames. Set this value to 0 to remove this limit. Current Time Frame • Display: Determines whether or not FVGs from the current time frame will be drawn on the chart. • Bullish Color: Determines the color of Bullish FVGs calculated from the current time frame. • Bearish Color: Determines the color of Bearish FVGs calculated from the current time frame. 5 Minute (Higher Time Frame) • Display: Determines whether or not FVGs from the 5 minute time frame will be drawn on the chart. • Bullish Color: Determines the color of Bullish FVGs calculated from the 5 minute time frame. • Bearish Color: Determines the color of Bearish FVGs calculated from the 5 minute time frame. 15 Minute (Higher Time Frame) • Display: Determines whether or not FVGs from the 15 minute time frame will be drawn on the chart. • Bullish Color: Determines the color of Bullish FVGs calculated from the 15 minute time frame. • Bearish Color: Determines the color of Bearish FVGs calculated from the 15 minute time frame. 30 Minute (Higher Time Frame) • Display: Determines whether or not FVGs from the 30 minute time frame will be drawn on the chart. • Bullish Color: Determines the color of Bullish FVGs calculated from the 30 minute time frame. • Bearish Color: Determines the color of Bearish FVGs calculated from the 30 minute time frame. 60 Minute (Higher Time Frame) • Display: Determines whether or not FVGs from the 60 minute time frame will be drawn on the chart. • Bullish Color: Determines the color of Bullish FVGs calculated from the 60 minute time frame. • Bearish Color: Determines the color of Bearish FVGs calculated from the 60 minute time frame. 240 Minute (Higher Time Frame) • Display: Determines whether or not FVGs from the 240 minute time frame will be drawn on the chart. • Bullish Color: Determines the color of Bullish FVGs calculated from the 240 minute time frame. • Bearish Color: Determines the color of Bearish FVGs calculated from the 240 minute time frame. Daily (Higher Time Frame) • Display: Determines whether or not FVGs from the daily time frame will be drawn on the chart. • Bullish Color: Determines the color of Bullish FVGs calculated from the daily time frame. • Bearish Color: Determines the color of Bearish FVGs calculated from the daily time frame. Pine Script® indicatorby UkutaLabs100
ICT Silver Bullet with signals The "ICT Silver Bullet with signals" indicator (inspired from the lectures of "The Inner Circle Trader" (ICT)), goes a step further than the ICT Silver Bullet publication, which I made for LuxAlgo : • uses HTF candles • instant drawing of Support & Resistance (S/R) lines when price retraces into FVG • NWOG - NDOG S/R lines • signals The Silver Bullet (SB) window which is a specific 1-hour interval where a Fair Value Gap (FVG) pattern can be formed. When price goes back to the FVG, without breaking it, Support & Resistance lines will be drawn immediately. There are 3 different Silver Bullet windows (New York local time): The London Open Silver Bullet (03 AM — 04 AM ~ 03:00 — 04:00) The AM Session Silver Bullet (10 AM — 11 AM ~ 10:00 — 11:00) The PM Session Silver Bullet (02 PM — 03 PM ~ 14:00 — 15:00) 🔶 USAGE This technique can visualise potential support/resistance lines, which can be used as targets. The script contains 2 main components: • forming of a Fair Value Gap (FVG) • drawing support/resistance (S/R) lines 🔹 Forming of FVG When HTF candles forms an FVG, the FVG will be drawn at the end (close) of the last HTF candle. To make it easier to visualise the 2 HTF candles that form the FVG, you can enable • SHOW -> HTF candles During the SB session, when a FVG is broken, the FVG will be removed, together with its S/R lines. The same goes if price did not retrace into FVG at the last bar of the SB session Only exception is when "Remove broken FVG's" is disabled. In this case a FVG can be broken, as long as price bounces back before the end of the SB session, it will remain to be visible: 🔹 Drawing support/resistance lines S/R target lines are drawn immediately when price retraces into the FVG. They will remain updated until they are broken (target hit) Potential S/R lines are formed by: • previous swings (swing settings (left-right) • New Week Opening Gap (NWOG): close on Friday - weekly open • New Day Opening Gap (NWOG): close previous day - current daily open Only non-broken lines are included. Broken = • minimum of open and close below potential S/R line • maximum of open and close above potential S/R line NDOG lines are coloured fuchsia (as in the ICT lectures), NWOG are coloured white (darkmode) or black (lightmode ~ ICT lectures) Swing line colour can be set as desired. Here S/R includes NDOG lines: The same situation, with "Extend Target-lines to their source" enabled: Here with NWOG lines: This publication contains a "Minimum Trade Framework (mTFW)", which represents the best-case expected price delivery, this is not your actual trade entry - exit range. • 40 ticks for index futures or indices • 15 pips for Forex pairs The minimum distance (if applicable) can be shown by enabling "Show" - "Minimum Trade Framework" -> blue arrow from close to mTFW Potential S/R lines needs to be higher (bullish) or lower (bearish) than mTFW. 🔶 SETTINGS (check USAGE for deeper insights and explanation) 🔹 Only last x bars: when enabled, the script will do most of the calculations at these last x candles, potentially this can speeds calculations. 🔹 Swing settings (left-right): Sets the length, which will set the lookback period/sensitivity of the ZigZag patterns (which directs the trend and points for S/R lines) 🔹 FVG HTF (minutes): 1-15 minutes. • When the chart TF is equal of higher, calculations are based on current TF. • Chart TF > 15 minutes will give the warning: "Please use a timeframe <= 15 minutes". Remove broken FVG's: when enabled the script will remove FVG (+ associated S/R lines) immediately when FVG is broken at opposite direction. FVG's still will be automatically removed at the end of the SB session, when there is no retrace, together with associated S/R lines,... ~ trend: Only include FVG in the same direction as the current trend Note -> when set 'right' (swing setting) rather high ( > 3), he trend change will be delayed as well (default 'right' max 5) Extend: extend FVG to max right side of SB session 🔹 Targets – support/resistance Extend Target-lines to their source: extend lines to their origin Colours (Swing S/R lines) 🔹 Show SB session: show lines and labels of SB session (+ colour) • Labels can be disabled separately in the 'Style' section, colour is set at the 'Inputs' section Trend : Show trend (ZigZag, coloured ~ trend) HTF candles: Show the 2 HTF candles that form the FVG Minimum Trade Framework: blue arrow (if applicable) 🔶 ALERTS There are 4 signals provided (bullish/bearish): FVG Formed FVG Retrace Target reached FVG cancelled You can choose between dynamic alerts - only 1 alert needs to be set for all signals, or you can set specific alerts as desired. 💜 PURPLE BARS 😈 • Since TradingView has chosen to give away our precious Purple coloured Wizard Badge, bars are coloured purple 😊😉Pine Script® indicatorby fikira1818816
SMC Analysis - Fair Value Gaps (Enhanced)SMC Analysis - Fair Value Gaps (Enhanced) Script Summary Overview The "SMC Analysis - Fair Value Gaps (Enhanced)" script, written in Pine Script (version 6), is a technical analysis indicator designed for TradingView to identify and visualize Fair Value Gaps (FVGs) on a price chart. It supports both the main timeframe and multiple higher timeframes (MTF) for comprehensive market analysis. FVGs are price gaps formed by a three-candle pattern, indicating potential areas of market inefficiency where price may return to fill the gap. Key Features FVG Detection: Identifies bullish FVGs: Occur when the high of a candle two bars prior is lower than the low of the current candle, with the middle candle being bullish (close > open). Identifies bearish FVGs: Occur when the low of a candle two bars prior is higher than the high of the current candle, with the middle candle being bearish (close < open). Visualizes FVGs as colored boxes on the chart (green for bullish, red for bearish). Mitigation Tracking: Tracks when FVGs are touched (price overlaps the gap range) or mitigated (price fully closes the gap). Strict Mode: Marks an FVG as mitigated when price touches the gap range. Normal Mode: Requires a full breakthrough (price crossing the gap’s bottom for bullish FVGs or top for bearish FVGs) for mitigation. Optionally converts FVG box borders to dashed lines and increases transparency when partially touched. Multi-Timeframe (MTF) Support: Analyzes FVGs on three user-defined higher timeframes (default: 15m, 60m, 240m). Displays MTF FVGs with distinct labels and slightly more transparent colors. Ensures no duplicate processing of MTF bars to maintain performance. Customization Options: FVG Length: Adjustable duration for how long FVGs are displayed (default: 20 bars). Show/Hide FVGs: Toggle visibility for main timeframe and each MTF. Color Customization: User-defined colors for bullish and bearish FVGs (default: green and red). Display Options: Toggle for showing dashed lines after partial touches and strict mitigation mode. Performance Optimization: Limits the number of displayed boxes (50 for main timeframe, 20 per MTF) to prevent performance issues. Automatically removes older boxes to maintain a clean chart. Functionality Visualization: Draws boxes around detected FVGs, with customizable colors and text labels ("FVG" for main timeframe, "FVG " for MTF). Dynamic Updates: Extends or terminates FVG boxes based on mitigation status and user settings. Efficient Storage: Uses arrays to manage FVG data (boxes, tops, bottoms, indices, mitigation status, and touch status) separately for main and MTF analyses. Use Case This indicator is designed for traders using Smart Money Concepts (SMC) to identify areas of market inefficiency (FVGs) for potential price reversals or continuations. The MTF support allows analysis across different timeframes, aiding in confirming trends or spotting higher-timeframe support/resistance zones.Pine Script® indicatorby osterhansi_Updated 231