Watch how to download trading robots for free
Find us on Telegram!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Experts

Hunter v2, Liquidity Library and Fvg Detection Library - expert for MetaTrader 5

Views:
152
Rating:
(1)
Published:
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance
**Hunter EA v2**

An advanced version of the Hunter EA that integrates Fair Value Gap (FVG) analysis with daily bias trading. This expert advisor offers two distinct trading modes, allowing for either immediate FVG-based entries or more precise encroachment-based entries that wait for price to confirm direction.

**Core Strategy:**

*   **Dual Trading Modes:**
    1.  **Standard FVG Mode:** Enters a trade when any candle touches an active Fair Value Gap AND the FVG's direction (bullish/bearish) aligns with the established daily bias from the Liquidity Library.
    2.  **Encroachment Mode (Recommended):** A more conservative approach that waits for price to touch the FVG's midpoint (encroachment point) AND close with a directional bias that matches the daily bias. This provides higher confirmation before entry.

*   **Bias Confluence:** All trades require alignment between the market's structural bias (from LiquidityLibrary) and the immediate price action signal (from FVGLibrary). A bullish daily bias only triggers buys from bullish FVGs or bullish encroachments, and vice versa for bearish.

*   **Risk Management:** Includes an optional stop loss (in account currency, e.g., $2) alongside the fixed profit target. This creates a defined risk-reward profile for each trade.

**Key Features:**

*   **Flexible FVG Detection:** Configurable timeframe and minimum gap size for FVG detection, allowing adaptation to different instruments and volatility profiles.
*   **Smart Trade Tracking:** Prevents re-entering the same FVG setup and logs the relationship between each trade and its triggering FVG ID.
*   **Enhanced Logging:** Provides detailed real-time console output for FVG formation, encroachment events, bias updates, and trade execution logic.
*   **Visual Object Toggle:** Option to draw FVG zones (boxes) and encroachment points on the chart for visual strategy confirmation and backtesting. (needs to be fixed)
*   **Callback-Driven Architecture:** Efficiently responds to events from the FVG library (formation, encroachment, reset) without constant polling.

Screenshot

Screenshot1

**LiquidityLibrary.mqh**

A comprehensive institutional liquidity detection and tracking library built on ICT Smart Money Concepts. This modular component identifies, categorizes, and monitors key market levels where stop losses accumulate—known as liquidity pools—providing essential targets for price movement (Draw on Liquidity) across multiple timeframes and sessions.

**Core Capabilities:**

*   **Multi-Type Liquidity Detection:** Identifies swing highs/lows, equal highs/lows, session extremes, and historical levels (Previous Day/Week High/Low).
*   **Session Management:** Tracks all major trading sessions (Sydney, Tokyo, London, New York) plus specialized "Silver Bullet" windows for high-probability targeting.
*   **Daily Bias Engine:** Calculates market bias based on the relationship between the current price and key historical levels (PDH/PDL), determining the primary "Draw on Liquidity" target.
*   **Sweep Detection:** Monitors when liquidity levels are breached ("swept"), signaling potential shifts in market structure and invalidating those levels as future targets.
*   **Failure to Displace Logic:** Identifies when price attempts but fails to break through a key level, indicating potential bias reversal.

**Key Features:**

*   **Visual Plotting:** Automatically draws color-coded horizontal lines on the chart for each liquidity type (red for highs, green for lows, orange/aqua for PDH/PDL).
*   **Priority System:** Ranks liquidity targets for each Silver Bullet session, ensuring the EA focuses on the most relevant institutional levels.
*   **Event Callback System:** Notifies the main EA in real-time when liquidity events occur (creation, sweep, failure).
*   **Dynamic Array Management:** Efficiently handles an unlimited number of liquidity levels with automatic memory allocation.
*   **Statistical Reporting:** Provides detailed logs and counts of active vs. swept liquidity levels for strategy analysis.

**FVGLibrary.mqh**

A sophisticated Fair Value Gap (FVG) detection and analysis library built on ICT Smart Money Concepts. This modular component automatically identifies, tracks, and manages institutional price inefficiencies—areas where price moved too quickly, leaving "unfilled" zones that markets tend to revisit.

**Core Capabilities:**

*   **Automatic FVG Detection:** Scans each new candle to identify three-candle patterns that create gaps between the high of the oldest candle and the low of the newest candle (bullish FVG) or the low of the oldest and high of the newest (bearish FVG). Filters by a user-defined minimum gap size.
*   **Encroachment Point Calculation:** For each FVG, calculates a precise midpoint (50% level) known as the Encroachment (ENC) point. This level acts as a trigger zone for potential trade entries.
*   **Directional Bias Determination:** Monitors price action as it touches the ENC point. Determines a directional bias ("BULLISH" or "BEARISH") based on whether the candle closes above or below the ENC point, providing a clear signal for trade direction.
*   **Inverse FVG & Reset Logic:** Identifies when a candle "shoots through" an FVG (opening on one side and closing on the other), which invalidates the FVG and marks it as "RESET," preventing false signals.
*   **High Accuracy Mode:** Optional mode that performs encroachment checks on a lower timeframe (e.g., 1-minute) for more precise entry timing.

**Key Features:**

*   **Event Callback System:** Notifies the main EA in real-time about key FVG events (formation, encroachment, reset) for efficient, event-driven trading logic.
*   **Visual Plotting:** Can automatically plot colored dots on the chart: green for bullish FVGs, red for bearish, orange/blue for encroachment with bias.
*   **Trade Association:** Links executed trade tickets to specific FVG IDs, enabling detailed performance analysis per setup.
*   **Dynamic Array Management:** Efficiently handles an expanding list of FVGs with automatic memory allocation.
*   **Statistical Reporting:** Tracks the total number of FVGs, active vs. filled rates, and provides performance insights.
Hunter V1 Hunter V1

The Hunter EA uses the FVGLibrary and LiquidityLibrary to detect market bias and make trading decisions. The EA operates on a specified hourly timeframe and uses a profit target to manage risk.

The Wick Sculper V7 The Wick Sculper V7

The Wick Sculper V7 Rando EMA trading strategy uses a combination of two exponential moving averages (EMAs) to generate buy and sell signals.

News Spread Risk Dashboard (Spike and Gap Monitor) News Spread Risk Dashboard (Spike and Gap Monitor)

A compact on-chart dashboard that monitors live spread behavior, tracks rolling Min/Max/Avg, and warns on abnormal spread spikes (news, low liquidity, rollover) using adaptive or fixed thresholds with optional alerts.

OB Trader Order Block Strategy tester OB Trader Order Block Strategy tester

This EA Uses Ict's smart money concept - "Order Blocks" - to place trades