OPEN-SOURCE SCRIPT
[SHORT ONLY] Internal Bar Strength (IBS) Mean Reversion Strategy

█ STRATEGY DESCRIPTION
The "Internal Bar Strength (IBS) Strategy" is a mean-reversion strategy designed to identify trading opportunities based on the closing price's position within the daily price range. It enters a short position when the IBS indicates overbought conditions and exits when the IBS reaches oversold levels. This strategy is Short-Only and was designed to be used on the Daily timeframe for Stocks and ETFs.
█ WHAT IS INTERNAL BAR STRENGTH (IBS)?
Internal Bar Strength (IBS) measures where the closing price falls within the high-low range of a bar. It is calculated as:
- Low IBS (≤ 0.2): Indicates the close is near the bar's low, suggesting oversold conditions.
- High IBS (≥ 0.8): Indicates the close is near the bar's high, suggesting overbought conditions.
█ SIGNAL GENERATION
1. SHORT ENTRY
A Short Signal is triggered when:
2. EXIT CONDITION
█ ADDITIONAL SETTINGS
█ PERFORMANCE OVERVIEW
The "Internal Bar Strength (IBS) Strategy" is a mean-reversion strategy designed to identify trading opportunities based on the closing price's position within the daily price range. It enters a short position when the IBS indicates overbought conditions and exits when the IBS reaches oversold levels. This strategy is Short-Only and was designed to be used on the Daily timeframe for Stocks and ETFs.
█ WHAT IS INTERNAL BAR STRENGTH (IBS)?
Internal Bar Strength (IBS) measures where the closing price falls within the high-low range of a bar. It is calculated as:
Pine Script®
IBS = (Close - Low) / (High - Low)
- Low IBS (≤ 0.2): Indicates the close is near the bar's low, suggesting oversold conditions.
- High IBS (≥ 0.8): Indicates the close is near the bar's high, suggesting overbought conditions.
█ SIGNAL GENERATION
1. SHORT ENTRY
A Short Signal is triggered when:
- The IBS value rises to or above the Upper Threshold (default: 0.9).
- The Closing price is greater than the previous bars High (close>high[1]).
- The signal occurs within the specified time window (between `Start Time` and `End Time`).
2. EXIT CONDITION
- An exit Signal is generated when the IBS value drops to or below the Lower Threshold (default: 0.3). This prompts the strategy to exit the position.
█ ADDITIONAL SETTINGS
- Upper Threshold: The IBS level at which the strategy enters trades. Default is 0.9.
- Lower Threshold: The IBS level at which the strategy exits short positions. Default is 0.3.
- Start Time and End Time: The time window during which the strategy is allowed to execute trades.
█ PERFORMANCE OVERVIEW
- This strategy is designed for Stocks and ETFs markets and performs best when prices frequently revert to the mean.
- The strategy can be optimized further using additional conditions such as using volume or volatility filters.
- It is sensitive to extreme IBS values, which help identify potential reversals.
- Backtesting results should be analyzed to optimize the Upper/Lower Thresholds for specific instruments and market conditions.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.