AI Sniper XAUUSD v1.0AI Sniper XAUUSD v1.0 is a precision scalping indicator for trading gold (XAUUSD), built on intelligent entry logic. It analyzes the trend (EMA20/50), detects engulfing candles, and automatically draws Entry, Stop Loss, and Take Profit levels (RR 1:2 and 1:4).
Includes an interactive confirmation table for quick decision-making.
Designed for fast and safe entries on 1-minute and 5-minute charts.
Indicatori e strategie
Weekly ManipulationUnderstanding the "Weekly Manipulation" Indicator
The "Weekly Manipulation" indicator is a powerful tool designed to identify false breakouts in the market—moments. Let me explain how it works in simple terms.
What This Indicator Detects
This indicator spots two specific market behaviors that often indicate manipulation:
1. Single-Day Manipulation (Red/Green Labels)
This occurs when price briefly breaks through a significant daily level but fails to maintain the momentum:
Bearish Manipulation (Red) : Price pushes above the previous day's high , but then reverses and closes below that high .
Bullish Manipulation (Green) : Price drops below the previous day's low ), but then reverses and closes above that low .
2. Two-Day Manipulation (Black Labels)
This is a more complex version of the same pattern, but occurring over a 2-day period. These signals can indicate even stronger manipulation attempts and potentially more powerful reversals.
Why This Matters for Your Trading
By identifying these patterns, you can:
- Avoid getting caught in false breakouts
- Find potential entry points after the manipulation is complete
- Understand when market action might not be genuine price discovery
How to Use This Indicator
1. Look for Red Markers: These appear when price has attempted to break higher but failed. This often suggests bearish potential going forward.
2. Look for Green Markers : These appear when price has attempted to break lower but failed. This often suggests bullish potential going forward.
3. Pay Attention to Black Markers : These 2-day patterns can signal stronger reversals and might be worth giving extra weight in your analysis.
The indicator labels these patterns clearly as "Manipulation" right on your chart, giving you an immediate visual cue when these potential setups occur.
The Reality Behind This Indicator
It's important to understand the background of this indicator. This indicator is designed based on a [ b]strategy developed by ConquerFX , who charges between $1500-$2000 for lifetime membership to his trading education program.
He markets what he calls "the blueprint strategy to beat prop firms," which combines this manipulation detection with VWAP and several other techniques. no one in his mentorship program has consistently passed prop firm challenges using this approach. The creator himself claimed he would reach $1 million in prop firm funding by year's end, but apparently abandoned this pursuit to focus on athletic endeavors like marathons, essentially disappearing from his mentorship community.
The most telling detail might be that the only members who reportedly achieved funding through prop firms were those who diverged from this strategy entirely and developed their own approaches.
This situation highlights an important lesson in trading education:
strategies that sound compelling in theory and look promising when back-tested don't always translate to consistent real-world trading success. The significant gap between the promises made and actual results achieved serves as a reminder that in trading, healthy skepticism and thorough personal verification are essential before committing substantial resources to any methodology.
While the indicator itself identifies a legitimate market pattern (false breakouts do occur and can be traded), it's important to develop your own comprehensive trading approach rather than expecting any single indicator or strategy to be a "blueprint" for guaranteed success.
Goldman Sachs Risk Appetite ProxyRisk appetite indicators serve as barometers of market psychology, measuring investors' collective willingness to engage in risk-taking behavior. According to Mosley & Singer (2008), "cross-asset risk sentiment indicators provide valuable leading signals for market direction by capturing the underlying psychological state of market participants before it fully manifests in price action."
The GSRAI methodology aligns with modern portfolio theory, which emphasizes the importance of cross-asset correlations during different market regimes. As noted by Ang & Bekaert (2002), "asset correlations tend to increase during market stress, exhibiting asymmetric patterns that can be captured through multi-asset sentiment indicators."
Implementation Methodology
Component Selection
Our implementation follows the core framework outlined by Goldman Sachs research, focusing on four key components:
Credit Spreads (High Yield Credit Spread)
As noted by Duca et al. (2016), "credit spreads provide a market-based assessment of default risk and function as an effective barometer of economic uncertainty." Higher spreads generally indicate deteriorating risk appetite.
Volatility Measures (VIX)
Baker & Wurgler (2006) established that "implied volatility serves as a direct measure of market fear and uncertainty." The VIX, often called the "fear gauge," maintains an inverse relationship with risk appetite.
Equity/Bond Performance Ratio (SPY/IEF)
According to Connolly et al. (2005), "the relative performance of stocks versus bonds offers significant insight into market participants' risk preferences and flight-to-safety behavior."
Commodity Ratio (Oil/Gold)
Baur & McDermott (2010) demonstrated that "gold often functions as a safe haven during market turbulence, while oil typically performs better during risk-on environments, making their ratio an effective risk sentiment indicator."
Standardization Process
Each component undergoes z-score normalization to enable cross-asset comparisons, following the statistical approach advocated by Burdekin & Siklos (2012). The z-score transformation standardizes each variable by subtracting its mean and dividing by its standard deviation: Z = (X - μ) / σ
This approach allows for meaningful aggregation of different market signals regardless of their native scales or volatility characteristics.
Signal Integration
The four standardized components are equally weighted and combined to form a composite score. This democratic weighting approach is supported by Rapach et al. (2010), who found that "simple averaging often outperforms more complex weighting schemes in financial applications due to estimation error in the optimization process."
The final index is scaled to a 0-100 range, with:
Values above 70 indicating "Risk-On" market conditions
Values below 30 indicating "Risk-Off" market conditions
Values between 30-70 representing neutral risk sentiment
Limitations and Differences from Original Implementation
Proprietary Components
The original Goldman Sachs indicator incorporates additional proprietary elements not publicly disclosed. As Goldman Sachs Global Investment Research (2019) notes, "our comprehensive risk appetite framework incorporates proprietary positioning data and internal liquidity metrics that enhance predictive capability."
Technical Limitations
Pine Script v6 imposes certain constraints that prevent full replication:
Structural Limitations: Functions like plot, hline, and bgcolor must be defined in the global scope rather than conditionally, requiring workarounds for dynamic visualization.
Statistical Processing: Advanced statistical methods used in the original model, such as Kalman filtering or regime-switching models described by Ang & Timmermann (2012), cannot be fully implemented within Pine Script's constraints.
Data Availability: As noted by Kilian & Park (2009), "the quality and frequency of market data significantly impacts the effectiveness of sentiment indicators." Our implementation relies on publicly available data sources that may differ from Goldman Sachs' institutional data feeds.
Empirical Performance
While a formal backtest comparison with the original GSRAI is beyond the scope of this implementation, research by Froot & Ramadorai (2005) suggests that "publicly accessible proxies of proprietary sentiment indicators can capture a significant portion of their predictive power, particularly during major market turning points."
References
Ang, A., & Bekaert, G. (2002). "International Asset Allocation with Regime Shifts." Review of Financial Studies, 15(4), 1137-1187.
Ang, A., & Timmermann, A. (2012). "Regime Changes and Financial Markets." Annual Review of Financial Economics, 4(1), 313-337.
Baker, M., & Wurgler, J. (2006). "Investor Sentiment and the Cross-Section of Stock Returns." Journal of Finance, 61(4), 1645-1680.
Baur, D. G., & McDermott, T. K. (2010). "Is Gold a Safe Haven? International Evidence." Journal of Banking & Finance, 34(8), 1886-1898.
Burdekin, R. C., & Siklos, P. L. (2012). "Enter the Dragon: Interactions between Chinese, US and Asia-Pacific Equity Markets, 1995-2010." Pacific-Basin Finance Journal, 20(3), 521-541.
Connolly, R., Stivers, C., & Sun, L. (2005). "Stock Market Uncertainty and the Stock-Bond Return Relation." Journal of Financial and Quantitative Analysis, 40(1), 161-194.
Duca, M. L., Nicoletti, G., & Martinez, A. V. (2016). "Global Corporate Bond Issuance: What Role for US Quantitative Easing?" Journal of International Money and Finance, 60, 114-150.
Froot, K. A., & Ramadorai, T. (2005). "Currency Returns, Intrinsic Value, and Institutional-Investor Flows." Journal of Finance, 60(3), 1535-1566.
Goldman Sachs Global Investment Research (2019). "Risk Appetite Framework: A Practitioner's Guide."
Kilian, L., & Park, C. (2009). "The Impact of Oil Price Shocks on the U.S. Stock Market." International Economic Review, 50(4), 1267-1287.
Mosley, L., & Singer, D. A. (2008). "Taking Stock Seriously: Equity Market Performance, Government Policy, and Financial Globalization." International Studies Quarterly, 52(2), 405-425.
Oppenheimer, P. (2007). "A Framework for Financial Market Risk Appetite." Goldman Sachs Global Economics Paper.
Rapach, D. E., Strauss, J. K., & Zhou, G. (2010). "Out-of-Sample Equity Premium Prediction: Combination Forecasts and Links to the Real Economy." Review of Financial Studies, 23(2), 821-862.
Extended-hours Volume vs AVOL// ──────────────────────────────────────────────────────────────────────────────
// Extended-Hours Volume vs AVOL • HOW IT WORKS & HOW TO TRADE IT
// ──────────────────────────────────────────────────────────────────────────────
//
// ░ What this indicator is
// ------------------------
// • It accumulates PRE-MARKET (04:00-09:30 ET) and AFTER-HOURS (16:00-20:00 ET)
// volume on intraday charts and compares that running total with the stock’s
// 21-day average daily volume (“AVOL” by default).
// • Three live read-outs are shown in the data-window/table:
//
// AH – volume traded since the 16:00 ET close
// PM – volume traded before the 09:30 ET open
// Ext – AH + PM (updates in pre-market only)
// %AVOL – Ext ÷ AVOL × 100 (updates in pre-market)
//
// • It is intended for U.S. equities but the session strings can be edited for
// other markets.
//
// ░ Why it matters
// ----------------
// Big extended-hours volume almost always precedes outsized intraday range.
// By quantifying that volume as a % of “normal” trade (AVOL), you can filter
// which gappers and news names deserve focus *before* the bell rings.
//
// ░ Quick-start trade plan (educational template – tune to taste)
// ----------------------------------------------------------------
// 1. **Scan** the watch-list between 08:30-09:25 ET.
// ► Keep charts on 1- or 5-minute candles with “Extended Hours” ✔ checked.
// 2. **Filter** by `Ext` or `%AVOL`:
// – Skip if < 10 % → very low interest
// – Flag if 20-50 % → strong interest, Tier-1 candidate
// – Laser-focus if > 50 % → crowd favourite; expect liquidity & range
// 3. **Opening Range Breakout (long example)**
// • Preconditions: Ext ≥ 20 % & price above yesterday’s close.
// • Let the first 1- or 5-min bar complete after 09:30.
// • Stop-buy 1 tick above that bar (or pre-market high – whichever higher).
// • Initial stop below that bar low (or pre-market low).
// • First target = 1R or next HTF resistance.
// 4. **Red-to-Green reversal (gap-down long)**
// • Ext ≥ 30 % but pre-market gap is negative.
// • Enter as price reclaims yesterday’s close on live volume.
// • Stop under reclaim bar; scale out into VWAP / first liquidity pocket.
// 5. **Risk** – size so the full stop is ≤ 1 R of account. Volume fade or
// loss of %AVOL slope is a reason to tighten or exit early.
//
// ░ Tips
// ------
// • AVOL look-back can be changed in the input panel (21 days ⇒ ~1 month).
// • To monitor several symbols, open a multi-chart layout and sort your
// watch-list by %AVOL descending – leaders float to the top automatically.
// • Replace colour constants with hex if the namespace ever gets shadowed.
//
// ░ Disclaimer
// ------------
// For educational purposes only. Not financial advice. Trade your own plan.
//
// ──────────────────────────────────────────────────────────────────────────────
AlgoRanger Momentum + Trend - Following📘 AlgoRanger Momentum + Trend - Following
Dynamic Trend and Momentum Tracking Indicator
🔍 Overview:
This indicator combines trend direction and momentum strength using a dynamic multi-moving average ribbon (MA Ribbon). It helps traders clearly visualize both the direction and the power of price movement.
The ribbon lines automatically change color based on momentum:
🟢 Green = Bullish momentum
🔴 Red = Bearish momentum
📈 How to Use:
1. Identifying Trend Direction
When all lines are aligned upward and turn green → strong bullish trend
When all lines slope downward and turn red → strong bearish trend
2. Measuring Momentum Strength
Tight and close ribbon → weak momentum
Wide-spread ribbon → strong momentum
Frequent color flips → choppy or sideways market
3. Trading Strategy
Trend Following:
Enter Buy when the ribbon turns green and aligns upward
Enter Sell when the ribbon turns red and aligns downward
Filtering False Signals:
Avoid trading when the ribbon flips colors often or trends are flat
4. Exit Points / Take Profit
Ribbon turns green to red → Exit Buy
Ribbon turns red to green → Exit Sell
Combine with support/resistance or Supply & Demand Zones for confirmation
🧠 Pro Tips:
Combine with other AlgoRanger indicators for best results:
Use Smart Signal for auto entries
Use Supply & Demand Zones to validate price targets
Customize the ribbon speed:
Fast settings for scalping (1m, 5m charts)
Slower settings for swing trading (1h, 4h charts)
🔧 Features:
✅ Auto-color based on momentum shifts
✅ Multiple MA lines for better accuracy
✅ Works on all timeframes
✅ Combines trend and momentum in a single tool
💡 Best For:
Trend-following traders
Scalpers needing fast momentum tracking
Traders seeking signal filtering
All skill levels wanting to visualize trend strength
Super Strategy Indicator Zeenu This indicator predicts the continuous 20 % price moves and this is created for educational purpose only.
Combo Signal Bollinger basic, Chaikin 0, RSI 50, Ichimoku KidjunA combo signal for matching strategy signals from the following indicators:
- Price crossing of the central Bollinger axis
- Zero crossing by Chaikin oscillator
- The crossing of the 50 level by the RSI indicator
- Price crossing of the Kijun line of the Ichimoku indicator
The number of candles for analysis is determined in the settings
The output uses a signal of the intersection of the price centrally between the Bollinger axis and the Kijun Ichimoku line.
The number of candles for analysis is determined in the settings
Комбо сигнал на совпадение сигналов по стратегии от следующих индикаторов:
- Пересечение ценой центральной оси Боллинджера
- Пересечение нуля осцилятором Чайкина
- Пересечение уровня 50 индикатором RSI
- Пересечение ценой линии Киджун индикатора Ишимоку
Количество свечей для анализа определяется в настройках
На выход используется сигнал пересечения ценой центрально оси Боллинджера и линии Киджун Ишимоку.
Количество свечей для анализа определяется в настройках
Board HorizontalThis indicator allows you to quickly view all important parameters in a row.
The line consists of daily volume indicator, average volume for a certain period, volatility indicator (normalized ATR) and correlation coefficient.
This indicator is primarily useful for intraday traders and scalpers to quickly select an instrument for trading.
The indicator is edited by AI and there may be errors, the original script can be installed at
Fibs Has Lied What This Indicator Is
This indicator represents a reverse-engineered version of the popular FibsDontLie trading strategy that typically costs traders $100 per month in subscription fees . I've decoded the core mechanics of their EMA-based entry system and made it available for free to the trading community.
The Strategy Explained
The system identifies potential trade entries using two fundamental methods:
The creator of the strategy suggests using 3min/10min timeframe on YM (Dow Jones)
EMA Cross Method: Waits for the 100 EMA to cross above the 200 EMA, then looks for the first pullback to the 100 EMA as an entry opportunity.
EMA Reset Method: Activates when price makes a deeper retracement after an EMA cross. When price dips below the 200 EMA after a bullish cross (or above after a bearish cross), then returns above the 100 EMA, the indicator generates entry signal.
The indicator automatically should be adjusted to the parameters based on the index you're trading (US30, NQ, or SPX) in the settings, with customizable time filtering to focus on the most productive market hours.
Performance Claims vs. Reality
The original strategy creator claims an impressive 87% win rate "if you avoid consolidations" – a significant caveat that introduces discretionary elements not easily programmed.
Without this discretion, they suggest the strategy delivers a 50-65% win rate following signals mechanically.
While these numbers sound promising, our extensive backtesting reveals a different picture.
The raw mechanical signals don't consistently produce the suggested win rates across various market conditions and timeframes.
Why Share This?
My goal is to democratize trading knowledge and allow traders to make informed decisions before investing in expensive subscriptions. This indicator gives you the core mechanics to evaluate whether this approach aligns with your trading style.
Important Disclaimer
This is not financial advice. All trading involves risk. While this indicator reproduces the mechanical aspects of the original strategy, it cannot capture the discretionary elements that may significantly impact performance. Always conduct your own testing and trade responsibly.
Click the link below for comprehensive backtest results that show the strategy's actual performance across different market conditions.
[TehThomas] - Fair Value GapsThis script is designed to automatically detect and visualize Fair Value Gaps (FVGs) on your chart in a clean, intuitive, and highly responsive way. It’s built with active traders in mind, offering both dynamic updates and customization options that help you stay focused on price action without being distracted by outdated or irrelevant information.
What Are Fair Value Gaps?
Fair Value Gaps are areas on a chart where there’s an inefficiency in price, typically formed when price moves aggressively in one direction, leaving a gap between the wicks of consecutive candles. These gaps represent imbalanced price action where not all buy or sell orders were efficiently matched. As a result, they often become magnet zones where price returns later to "fill" the imbalance before continuing in its intended direction. Many traders use them as points of interest for entries, re-entries, or anticipating reversals and consolidations.
This concept is frequently used in Smart Money and ICT-based trading models, where understanding how price seeks efficiency is crucial to anticipating future moves. When combined with concepts like liquidity, displacement, and market structure, FVGs become powerful tools for technical decision-making.
Script Features & Functionality
1. Live Updating Gaps (Dynamic Shrinking)
One of the core features of this script is its ability to track and dynamically shrink Fair Value Gaps as price trades into them. Instead of leaving a static zone on your chart, the gap will adjust in real-time, reflecting the portion that has been filled. This gives you a much more accurate picture of remaining imbalance and avoids misleading zones.
2. Automatic Cleanup After Fill
Once price fully fills an FVG, the script automatically removes it from the chart. This helps keep your workspace clean and focused only on relevant price zones. There’s no need to manually manage your gaps, everything is handled behind the scenes to reduce clutter and distraction.
3. Static Mode Option
While dynamic updating is the default, some traders may prefer to keep the original size of the gap visible even after partial fills. For that reason, the script includes a toggle to switch from live-updating (shrinking) mode to static mode. In static mode, FVGs stay fixed from the moment they are drawn, giving you a more traditional visual reference point.
4. Multi-Timeframe Support (MTF)
You can now view higher timeframe FVGs, such as those from the 1H or 4H chart, while analyzing lower timeframes like the 5-minute. This allows you to see key imbalances from broader market context without having to flip between charts. FVGs from higher timeframes will be drawn distinctly so you can differentiate them at a glance.
5. Cleaner Visualization
The script is designed with clarity in mind. All drawings are streamlined, and filled gaps are removed to maintain a minimal, distraction-free chart. This makes it easier to combine this tool with other indicators or price-action-based strategies without overloading your workspace.
6. Suitable for All Market Types
This script can be used on any asset that displays candlestick-based price action — including crypto, forex, indices, and stocks. Whether you're scalping low-timeframe setups or swing trading with a higher timeframe bias, FVGs remain a useful concept and this script adapts to your trading style.
Use Case Examples
On a 5-minute chart, display 1-hour FVGs to catch major imbalance zones during intraday trading.
Combine the FVGs with liquidity levels and inducement patterns to build ICT-style trade setups.
Use live-updating gaps to monitor in-progress fills and evaluate whether a zone still holds validity.
Set the script to static mode to perform backtesting or visual replay with historical setups.
Final Notes
Fair Value Gaps are not a standalone trading signal, but when used with market structure, liquidity, displacement, and order flow concepts, they provide high-probability trade locations that align with institutional-style trading models. This script simplifies the visualization of those zones so you can react faster, stay focused on clean setups, and eliminate unnecessary distractions.
Whether you’re trading high volatility breakouts or patiently waiting for retracements into unfilled imbalances, this tool is designed to support your edge with precision and flexibility.
___________________________________
Thanks for your support!
If you found this indicator helpful or learned something new, drop a like 👍 and leave a comment, I’d love to hear your thoughts! 🚀
Make sure to follow me for more price action insights, free indicators, and trading strategies. Let’s grow and trade smarter together! 📈
Market Structure- ZigZag, Break of Structure & Order BlocksDescription:
This script is an all-in-one market structure tool designed for traders who follow price action, Smart Money Concepts (SMC), or institutional order flow. It combines Order Block detection , Break of Structure (BOS) , Internal Structure Shifts (CHoCH) , and a ZigZag swing framework to provide a clear and actionable view of market behavior.
Key Features:
Order Blocks (OB) :
-Detects Bullish (Green) and Bearish (Red) order blocks upon valid market structure shifts.
-Optional deletion of mitigated (touched) blocks to keep charts clean.
-Customizable block duration, fill color, and border color.
Break of Structure (BOS) :
-Marks BOS with horizontal dotted lines when price breaks previous swing highs/lows.
-Confirms new trends and structural shifts.
Internal Structure Shifts (CHoCH-like) :
-Detects early internal changes in direction before BOS.
-User-selectable logic: based on candle Open or High/Low.
-Plotted as small black triangle markers.
ZigZag Swings :
-Connects confirmed internal shifts with black zigzag lines.
-Visually simplifies trend structure and major swing points.
-Tracks last swing highs/lows for BOS validation.
Alerts :
-Bullish/Bearish Engulfments (OB signals)
-Internal Structure Shifts
-Bullish/Bearish Break of Structure
-OB Mitigation Events
Inputs & Settings :
-Show/Hide Bullish or Bearish Order Blocks
-Calculate internal shifts by: Open or High/Low
-Set order block fill and border colors
-Enable or disable automatic deletion of mitigated blocks
-Set duration for order block display
This tool is designed to support price action trading by visually mapping key structural changes and zones of interest directly on your chart. It is not intended to function as a standalone trading strategy , but rather as a supplementary tool to inform your own analysis and discretion.
ADR% & CDR% - Clean Hover View✅ What This Does:
ADR% and CDR% (Current Day Range) now show up in the Data Window (when you hover over the chart)
The chart still looks completely clean (the plots are fully transparent)
Chart scale is unaffected, because the values are typical % ranges (e.g., 1–10%)
Vector EMAThis script uses PVSRA candles and the 50 EMA to create buy and sell signals. Red and Green high volume candles crossing the 50 EMA in a supply to demand flip zone is a signal that price is going to continue in the direction of the alert signal.
Range & Pct Change Table (Interactive)Indicator creates an interactive element that displays two key metrics for any selected candle:
1. Range - The difference between high and low prices (H-L)
2. Percentage Change - The percent change from open to close ((C-O)/O × 100)
Key Features
- Interactive Reference Point: Users can select any candle as a reference point using the time input
- Customizable Table: The table can be shown/hidden and positioned in different chart locations
This indicator is particularly useful for quickly analyzing the volatility (range) and directional movement (percentage change) of specific candles without having to manually calculate these values.
Logarithmischer Trendkanal (sichtbar, in Preisskala + Stilwahl)3. verbesserte Version des frei konfigurierbaren Trendkanals für log Charts
Logarithmischer Trendkanal (sichtbar, in Preisskala + Stilwahl)Verbesserter Trendkanal Indikator. Flexibel einstellbar für log Charts
75-min RSI-EMA Crossover Alertnsdjcnisdncjsndcncnscj
dcsdcjsbcjbccbsc
dncjbsdscbscbshb
ncjsdcbsdhc sdc
Confluence Entry & Exit SignalsThis indicator provides confluence-based buy and sell signals by combining key market tools: EMAs, VWAP, volume momentum, and alignment of major tech stocks (AAPL, NVDA, MSFT, AMZN, META).
It is designed to support traders in identifying potential trend continuation or reversal setups.
Built for educational purposes. Use with risk management and alongside your trading plan.
Range Expansion Index (REI)Introduction and History
I'm sharing an indicator today that I have developed: the Range Expansion Index (REI). This powerful oscillator was developed by the renowned technical analyst Thomas DeM., known for his unique approach to market timing and price exhaustion. The REI was introduced as part of his comprehensive suite of technical tools, detailed in his influential work, such as "The New Science of Technical Analysis."
DeM. designed the REI to be a more refined momentum oscillator. His goal was to create an indicator that could accurately reflect the underlying strength or weakness of price movements while minimizing the false signals often generated by traditional oscillators during sideways or choppy markets. The REI achieves this by focusing on significant price expansions and contractions, comparing recent price behavior to the overall price changes over a specified lookback period.
You can find more information and the basis for this indicator here:
QuantifiedStrategies: www.quantifiedstrategies.com
Infront Help Center: infront-portfolio-manager.helpcenter.infront.co
How the REI Works
The core of the REI's calculation lies in identifying and quantifying "strong" price changes within a given period (typically 8 bars). It does this by evaluating specific price relationships and conditions between current and past bars. The indicator then computes a ratio comparing the sum of these "strong" price changes to the sum of the absolute total price changes over the lookback period, scaling the result to oscillate between -100 and +100.
The key levels for interpreting the REI are generally:
+60: Overbought Zone
-60: Oversold Zone
Unlike oscillators that might simply signal overbought/oversold upon entering these zones, the REI's interpretation, according to DeM., often focuses on the exit from these extreme areas.
Traditional Trading Signals
Based on DeM.'s methodology and the descriptions in the provided links, the primary trading signals generated by the REI occur when the indicator crosses back from an extreme zone:
Sell Signal: The REI moves above the +60 level and then crosses back down below +60. This suggests potential price weakness after a period of strong upward momentum.
Buy Signal: The REI moves below the -60 level and then crosses back up above -60. This indicates potential price strength after a period of strong downward momentum.
Duration Analysis: An Optional Signal Filter
The QuantifiedStrategies link highlights the concept of "Duration Analysis," suggesting that the amount of time (number of bars) the REI spends in the overbought or oversold region can add crucial context. A brief stay might precede a reversal, while a prolonged stay could indicate a strong, persistent trend.
The indicator incorporates this concept as an optional filter. You can enable this feature and specify a number of bars. When enabled, a buy or sell signal will only be triggered if the REI crosses the respective overbought/oversold level AND the duration of the REI being in that extreme zone precisely matches the number of bars you specify in the input settings.
Indicator Features in This Pine Script
The Pine Script code I have developed provides a comprehensive implementation of the REI with additional trading utilities:
REI Calculation: Implements the core REI formula based on conditional price changes and summations over a defined period.
Configurable REI Period: Easily adjust the main lookback period for the REI calculation.
Customizable Lookback Parameters: Fine-tune the specific lookback periods used in the internal conditions (n1L, n2L, n3L) as described in the calculation method.
Plotting: Displays the REI line in a separate pane, along with horizontal lines at +60 (Overbought), -60 (Oversold), and 0 (Zero Line) for clear visual analysis.
Configurable Alerts: Set up Buy and Sell alerts that trigger when the REI crosses the +60/-60 levels. Control global alert enabling, and specifically enable/disable Buy and Sell alerts.
Plot Shapes for Signals: Optionally display visual triangle shapes directly on the price chart (red triangle down for Sell above the bar, green triangle up for Buy below the bar) to easily spot signal occurrences. Control global shape enabling and specifically enable/disable Buy/Sell shapes.
Optional Duration Analysis Filter: Activate a filter that requires the REI to have spent an exact number of consecutive bars in the overbought/oversold zone at the moment of the cross for a signal to be considered valid. Configure the required number of bars.
How to Use This Code in TradingView
Open TradingView and navigate to the Pine Editor (usually the icon on the left sidebar or via the bottom panel).
Delete any existing code in the editor and paste the REI code.
Save the script (you can name it "Range Expansion Index with Duration Filter" or similar).
Add the indicator to your chart by clicking the "Add to Chart" button in the Pine Editor.
Access the indicator's settings on your chart to adjust the REI Period, Lookbacks, and enable/disable Alerts, Plot Shapes, and the optional Duration Filter (including setting the number of bars).
To receive actual notifications: You must set up alerts manually through the TradingView platform's alert system (right-click on the indicator -> Add alert on Range Expansion Index (REI)...). Select the specific conditions "REI Sell Signal" or "REI Buy Signal" from the dropdown menu and configure your desired notification methods (popup, email, etc.).
Disclaimer:
Trading financial markets involves risk, and past performance is not indicative of future results. This indicator is a tool for analysis and should be used as part of a comprehensive trading strategy, always combined with other techniques and proper risk management. Always conduct your own research and backtest the indicator to understand its behavior on the markets and timeframes you trade.