OPEN-SOURCE SCRIPT
IU Gap Fill Strategy

The IU Gap Fill Strategy is designed to capitalize on price gaps that occur between trading sessions. It identifies gaps based on a user-defined percentage threshold and executes trades when the price fills the gap within a day. This strategy is ideal for traders looking to take advantage of market inefficiencies that arise due to overnight or session-based price movements. An ATR-based trailing stop-loss is incorporated to dynamically manage risk and lock in profits.
USER INPUTS
Percentage Difference for Valid Gap - Defines the minimum gap size in percentage terms for a valid trade setup. ( Default is 0.2 )
ATR Length - Sets the lookback period for the Average True Range (ATR) calculation. (default is 14 )
ATR Factor - Determines the multiplier for the trailing stop-loss, helping in risk management. ( Default is 2.00 )

LONG CONDITION

SHORT CONDITION

LONG EXIT
An ATR-based trailing stop-loss is set below the entry price and dynamically adjusts upwards as the price moves in favor of the trade.
The position is closed when the trailing stop-loss is hit.

SHORT EXIT
An ATR-based trailing stop-loss is set above the entry price and dynamically adjusts downwards as the price moves in favor of the trade.
The position is closed when the trailing stop-loss is hit.

WHY IT IS UNIQUE
HOW USERS CAN BENEFIT FROM IT
USER INPUTS
Percentage Difference for Valid Gap - Defines the minimum gap size in percentage terms for a valid trade setup. ( Default is 0.2 )
ATR Length - Sets the lookback period for the Average True Range (ATR) calculation. (default is 14 )
ATR Factor - Determines the multiplier for the trailing stop-loss, helping in risk management. ( Default is 2.00 )
LONG CONDITION
- A gap-up occurs, meaning the current session opens above the previous session’s close.
- The price initially dips below the previous session's close but then recovers and closes above it.
- The gap meets the valid percentage threshold set by the user.
- The bar is not the first or last bar of the session to avoid false signals.
SHORT CONDITION
- A gap-down occurs, meaning the current session opens below the previous session’s close.
- The price initially moves above the previous session’s close but then closes below it.
- The gap meets the valid percentage threshold set by the user.
- The bar is not the first or last bar of the session to avoid false signals.
LONG EXIT
An ATR-based trailing stop-loss is set below the entry price and dynamically adjusts upwards as the price moves in favor of the trade.
The position is closed when the trailing stop-loss is hit.
SHORT EXIT
An ATR-based trailing stop-loss is set above the entry price and dynamically adjusts downwards as the price moves in favor of the trade.
The position is closed when the trailing stop-loss is hit.
WHY IT IS UNIQUE
- Precision in Identifying Gaps - The strategy focuses on real price gaps rather than minor fluctuations.
- Dynamic Risk Management - Uses ATR-based trailing stop-loss to secure profits while allowing the trade to run.
- Versatility - Works on stocks, indices, forex, and any market that experiences session-based gaps.
- Optimized Entry Conditions - Ensures entries are taken only when the price attempts to fill the gap, reducing false signals.
HOW USERS CAN BENEFIT FROM IT
- Enhance Trade Timing - Captures high-probability trade setups based on market inefficiencies caused by gaps.
- Minimize Risk - The ATR trailing stop-loss helps protect gains and limit losses.
- Works in Different Market Conditions - Whether markets are trending or consolidating, the strategy adapts to potential gap fill opportunities.
- Fully Customizable - Users can fine-tune gap percentage, ATR settings, and stop-loss parameters to match their trading style.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Shivam mandai
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Shivam mandai
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.