PROTECTED SOURCE SCRIPT

ACE FVG & IFVG Trading System

87
1. What the Script Does
The "ACE FVG & IFVG Trading System " is a TradingView Pine Script (version 5) that identifies and trades Fair Value Gaps (FVGs) and Inverse Fair Value Gaps (IFVGs). It offers:

Detection of bullish/bearish FVGs and IFVGs with customizable parameters.

Multiple entry types: regular FVG retracement, Break of Structure (BOS), breakaway gaps, and Immediate/Retrace IFVG entries.

A pending setup system showing potential trades before they trigger.

Risk management with configurable stop loss (SL) and take profit (TP) based on FVG levels, swing points, or risk-reward ratios.

Market structure analysis using swing highs/lows, BOS, and Market Structure Shifts (MSS).

Time filters to restrict trading to specific sessions.

Visualizations including FVG boxes, trade boxes, pivot lines, and labels.

Entry and performance tables displaying trade details and metrics like win rates and P&L by entry type.

2. How It Works
The script is organized into modular sections for efficient execution:

Inputs: Extensive customization options (e.g., FVG size, entry types, SL/TP modes, time filters) grouped for clarity.

Data Structures: Custom types (FVGData, SwingPoint, EntryData) store FVG, pivot, and trade data in arrays.

Utility Functions: Handle calculations like risk-reward ratios, time validation, and trade size filtering.

Swing Point Detection: Uses ta.pivothigh/ta.pivotlow to identify pivots, supporting BOS/MSS and SL/TP calculations.

FVG Detection: Identifies regular FVGs (low > high[2] or high < low[2]) and IFVGs (mitigated FVGs with immediate or retrace signals).

Entry Logic: Triggers trades based on user-enabled conditions (e.g., retracement, BOS, breakaway gaps) with dynamic SL/TP.

Trade Management: Tracks active/pending trades, updates visualizations (boxes, lines, labels), and handles cancellations/invalidations.

Main Logic: Executes on each bar to detect FVGs, process entries, update trades, and manage visualizations.

Tables: Displays recent trades and performance stats (e.g., win rates by entry type) on the last bar.

Pivot Visualization: Plots swing points with dynamic extensions and mitigation status (solid/dotted lines).

3. How to Use It
Add to TradingView:

Open Pine Editor, paste the script, save it, and add to chart.

Configure Inputs:
Access settings via chart (right-click indicator > Settings).
Adjust:
fvgMinSize for market volatility (e.g., 5 for forex).
Entry types (e.g., enable IFVG, disable breakaway gaps).
SL/TP modes and minimum R:R (e.g., 2.0 for 1:2).
Time filters for active sessions (e.g., 09:30-16:00).
Visual settings (box transparency, table positions).

Interpret Output:

FVG Boxes: Green (bullish), red (bearish), purple (IFVG/mitigated).
Trade Boxes: Gray-green/red-gray (pending), green/red (active), updated for win/loss.
Pivot Lines: Solid (unmitigated), dotted (mitigated).
Tables: Entry table shows trade details; performance table shows win rates/P&L.
Trading:

Monitor pending setups for entry signals.
Enter manually at active trade levels, following SL/TP.
Use performance stats to refine settings.
Test on demo charts and adjust for market/timeframe.

Best Practices:
Use higher timeframes (e.g., 1H, 4H) for less noise.

Combine with other analysis (e.g., support/resistance).

Backtest using TradingView’s replay feature.

Originality
The script is original due to its unique combination of features:
Enhanced IFVG Strategy: Dual Immediate/Retrace IFVG modes with a novel “Immediate Then Retrace” preference.

Pending Setup System: Proactive visualization of potential trades with auto-cancellation.

Granular Performance Tracking: Detailed breakdown of win rates/P&L by entry type (regular FVG, IFVG, breakaway).

Dynamic Pivot Visualization: Real-time mitigation updates (solid to dotted lines).

Modular Design: Custom types and organized logic for extensibility. It builds on general FVG concepts (e.g., from ICT) but implements unique logic and features not found in standard
TradingView FVG scripts, distinguishing it from both open-source and premium indicators.

Credit of Concepts to ICT
Collaborations with JMAC and Timeless

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.