Break Previous Low AlertAlert for previous price bar low. When price creates a new low you will get an alert.
Indicatori e strategie
Fair Value Gap (FVG) Detector — ICT SMC BasedThis is an open-source Fair Value Gap (FVG) indicator, based on the principles taught in ICT (Inner Circle Trader) and Smart Money Concepts (SMC). It identifies imbalances or inefficiencies in price action where the body/wick of the middle candle in a three-candle formation does not overlap with the first and third candles.
🔹 What is an FVG?
An FVG is formed when there is a price imbalance, typically between three consecutive candles:
A bullish FVG forms when the low of candle 1 is above the high of candle 3.
A bearish FVG forms when the high of candle 1 is below the low of candle 3.
These gaps are believed to represent areas of institutional activity and are often used as potential entries, targets, or reaction zones.
🔹 Features:
Detects both bullish and bearish FVGs
Clean chart visuals using colored boxes
Adjustable box opacity and text alignment
Option to show or hide filled FVGs
Optional filter to only display gaps above a minimum size (e.g., 100 points)
Multi-timeframe support (if enabled in script settings)
Box label customization (text alignment: center/left/right)
🔹 How to Use:
Use the indicator on any timeframe or instrument
Larger gaps may indicate stronger price inefficiencies
Combine with market structure, liquidity zones, or order blocks for confirmation
This version is open-source, so traders can view and adapt the logic as needed.
The indicator is designed for transparency, education, and clarity of Smart Money Concepts.
SUPER_STRATEGY_For_Swing 20%This indicator is designed for swing traders looking to capture quick 20% gains from stocks that show strong rise/fall patterns. It identifies significant reversal points and sets a clear entry and target level based on past price action.
How it works:
Detects strong moves (up or down) and marks potential swing trade setups.
Entry is triggered when price returns to the identified level — a proven zone for high-probability trades.
If price does not return to the entry level within 1 year, the signal is considered invalid.
Ideal for spotting repeatable swing opportunities where risk-reward is favorable.
This strategy helps you time your entries with confidence and exit at logical target zones, cutting out the noise and emotional trades.
*please explore well on stock selection and back testing.
Sonic R + Regression + Supertrend sonic R , polynomial regession , super trend . i love you , i love you
Naked DWM LevelsThis indicator shows naked Daily, Weekly, Monthly levels
The indicator will automatically delete levels where the same time frame candle close has crossed one of these levels, when it is no longer naked or tapped by a wick.
These are HTF S/R levels that are highly respected for reversals, or even break and retests.
Enjoy!
RSI Divergence (Nikko)RSI Divergence by Nikko
🧠 RSI Divergence Detector — Nikko Edition This script is an enhanced RSI Divergence detector built with Pine Script v6, modified for better visuals and practical usability. It uses linear regression to detect bullish and bearish divergences between the RSI and price action — one of the most reliable early signals in technical analysis.
✅ Improvements from the Original:
- Clean divergence lines using regression fitting.
- Optional label display to reduce clutter (Display Labels toggle).
- Adjustable line thickness (Display Line Width).
- A subtle heatmap background to highlight RSI overbought/oversold zones.
- Uses max accuracy with high calc_bars_count and custom extrapolation window.
🔍 How It Works: The script applies linear regression (least squares method) on both RSI data, and Price (close) data.
It then compares the direction of RSI vs. direction of Price over a set length. If price is making higher highs while RSI makes lower highs, it's a bearish divergence. If price is making lower lows while RSI makes higher lows, it's a bullish divergence. Additional filters (e.g., momentum and slope thresholds) are used to validate only strong divergences.
🔧 Input Parameters: RSI Length: The RSI period (default: 14). RSI Divergence Length: The lookback period for regression (default: 25). Source: Which price data to calculate RSI from (default: close). Display Labels: Show/hide “Bullish” or “Bearish” labels on the chart. Display Line Width: Adjusts how thick the plotted divergence lines appear.
📣 Alerts: Alerts are built-in for both RSI Buy (bullish divergence) and RSI Sell (bearish divergence) so you can use it in automation or notifications.
🚀 Personal Note: I’ve been using this script daily in my own trading, which is why I took time to improve both the logic and visual clarity. If you want a divergence tool that doesn't clutter your chart but gives strong signals, this might be what you're looking for.
OI Bahavior MapThis indicator visualizes Open Interest (OI) changes for Binance Futures and highlights the behavior of market participants — whether takers or makers are opening or closing positions.
📊 Supported display modes:
• Taker or Maker
• Longs or Shorts
• Cumulative or Per-Bar
• Displayed in USD or Coins
💡 Each candle color reflects the dominant trade direction (delta):
🟢 Green = Aggressive buying (Delta Buy)
🔴 Red = Aggressive selling (Delta Sell)
OI direction (↑/↓) determines whether positions are being opened or closed.
🛠️ Optional metrics:
• Moving average of OI (SMA, EMA, WMA, VWMA, LSMA)
• Volatility channels (Bollinger Bands or Extremums)
⚙️ How it works:
• Fetches OI data from the SYMBOL_OI ticker (e.g., BTCUSDT_OI)
• Compares current OI with the previous bar
• Uses signed volume delta (close - open) to infer intent
• Classifies bar as open/close, long/short, taker/maker
• Displays the net effect as a colored candle on a secondary chart
🤔 How to interpret Taker and Maker?
• Taker: The aggressive participant who removes liquidity (initiates the trade)
• Maker: The passive participant who provides liquidity (places resting orders)
You can choose to display the same event from either the Taker or Maker perspective — the chart will look the same, but the interpretation changes.
🧠 Core Logic Mapping
```
🟢 Green: Taker Longs (Buy, OI↑) | Maker Shorts (Buy, OI↓)
🔴 Red: Taker Shorts (Sell, OI↑) | Maker Longs (Sell, OI↓)
```
⚠️ Limitations:
• Works only for Binance Futures
• Requires existence of SYMBOL_OI ticker on TradingView
• Represents approximate intent based on OI + volume behavior
💬 Open Source
The script is open for the community. Suggestions and feedback are welcome in the comments!
__________________________________________________________________________________
Этот индикатор визуализирует изменения открытого интереса (OI) для Binance Futures и показывает поведение участников рынка — открывают или закрывают позиции тейкеры или мейкеры.
📊 Доступные режимы отображения:
• Taker или Maker
• Longs или Shorts
• Кумулятивный или по бару
• В USD или в монетах
💡 Каждый цвет свечи отражает преобладающее направление сделок (дельта):
🟢 Зеленый = Агрессивные покупки (Delta Buy)
🔴 Красный = Агрессивные продажи (Delta Sell)
Направление OI (↑/↓) показывает, открываются или закрываются позиции.
🛠️ Дополнительные метрики:
• Скользящая средняя OI (SMA, EMA, WMA, VWMA, LSMA)
• Волатильностные каналы (Bollinger Bands или экстремумы)
⚙️ Как работает:
• Получает данные OI из тикера SYMBOL_OI (например, BTCUSDT_OI)
• Сравнивает текущий OI с предыдущим баром
• Использует направленную дельту объема (close - open) для определения намерения
• Классифицирует бар как открытие/закрытие, лонг/шорт, тейкер/мейкер
• Отображает итог в виде цветной свечи на дополнительном графике
🤔 Как интерпретировать Taker и Maker?
• Taker: Агрессивный участник, который изымает ликвидность (инициирует сделку)
• Maker: Пассивный участник, который создает ликвидность (выставляет лимитные заявки)
Вы можете выбрать отображение события с позиции тейкера или мейкера — график будет одинаковым, но смысл меняется.
🧠 Схема логики
```
🟢 Зеленый: Taker Longs (Покупка, OI↑) | Maker Shorts (Покупка, OI↓)
🔴 Красный: Taker Shorts (Продажа, OI↑) | Maker Longs (Продажа, OI↓)
```
⚠️ Ограничения:
• Работает только для Binance Futures
• Требуется наличие тикера SYMBOL_OI на TradingView
• Показывает приблизительное намерение на основе OI и дельты объема
💬 Open Source
Скрипт открыт для сообщества. Предложения и обратная связь приветствуются в комментариях!
Oscillator SignalsOscillator Signals – Smart Trading with RSI & Stochastic
Stop waiting for false reversals—trade the confirmed moves!
Developed by Marcelo Ulisses Sobreiro Ribeiro
Many traders struggle with the Stochastic Oscillator because it can linger in overbought (OB) or oversold (OS) zones for long periods, leading to premature entries. This script solves that problem by only triggering signals when Stochastic exits these zones, combined with RSI crossovers for higher-confidence trades.
🔹 Key Features:
✅ No More False Alerts – Avoids signals inside OB/OS zones—waits for Stochastic to exit (confirming momentum shift).
✅ RSI + Moving Average Crossovers – Adds a second layer of confirmation when RSI crosses its moving average.
✅ Combined Alerts – Strongest signals occur when:
Stochastic exits oversold (OS) and RSI crosses above its MA (▲ Bullish).
Stochastic exits overbought (OB) and RSI crosses below its MA (▼ Bearish).
✅ Fully Customizable – Adjust lengths, OB/OS levels, and toggle signals.
✅ Built-in Alerts – Never miss a setup.
🔹 Why It Works Better:
Traditional Stochastic signals often fail because price can stay stuck in OB/OS for extended periods. This script ignores entries inside the zones and only acts when:
Stochastic leaves OS (crosses above 20) + RSI confirms uptrend.
Stochastic leaves OB (crosses below 80) + RSI confirms downtrend.
Filters out weak reversals, focusing on high-probability breakouts.
🔹 Ideal For:
Traders tired of "whipsaws" from premature OB/OS entries.
Swing traders seeking confirmed reversals.
Combining with support/resistance for precision.
📌 Pro Tip: Pair this with price action (e.g., breakouts from key levels) for even stronger signals!
Try it now—trade less, profit more! 🚀
Key Improvements:
Problem-Solution Framework: Directly addresses the "Stochastic lingering" issue upfront.
Stronger Emphasis on Confirmation: Highlights how the script waits for OB/OS exits to avoid fakeouts.
Clearer Value Proposition: Positions the script as a filter for higher-quality signals.
SG Multi Entry/Exit IndicatorThis strategy is based on an entry and an exit indicator that can be selected from a range of indicators.
The entry / exit indicators are standard Stochastic, MACD, RSI and MA indicators.
The graphs for each indicator are normalised to between 0 and 100 and displayed on above the other with buy and sell indicators.
The Strategy can be enabled / disabled via the inputs as can the date range as can whether to put a dummy sell signal in for the last trading day to give an accurate Mark to Market performance.
MARSdx BTCUSD Strategy🔍 Strategy Overview
The MARSdx Strategy is a hybrid trend-following and momentum-based system designed specifically for Bitcoin trading(works also on other Crypto like ETHUSD). It combines four technical indicators—SMA, EMA, RSI, and ADX—to filter high-probability long entries during strong bullish phases.
✅ Entry Conditions
Price above SMA(50) → confirms long-term bullish trend
Price above EMA(7) → confirms short-term momentum
RSI(2) > ADX(2) → confirms strong bullish pressure
Only when all three conditions are met, a long position is opened.
❌ Exit Condition
RSI(2) < ADX(2) → momentum weakens, exit position
📊 Indicators Used
SMA (Simple Moving Average) – identifies overall trend
EMA (Exponential Moving Average) – captures short-term momentum
RSI (Relative Strength Index) – gauges strength of price movement
ADX (Average Directional Index) – filters based on trend strength
⚙️ Inputs
SMA Length: Default 50
EMA Length: Default 7
RSI Length: Default 2
ADX Length: Default 2
You can tweak these parameters to suit other timeframes or crypto assets.
⚠️ This strategy only takes long trades. It does not use any stop-loss or profit target logic and should be combined with sound risk management.
VWAP Deviation Channels with Probability (Lite)VWAP Deviation Channels with Probability (Lite)
Version 1.2
Overview
This indicator is a powerful tool for intraday traders, designed to identify high-probability areas of support and resistance. It plots the Volume-Weighted Average Price (VWAP) as a central "value" line and then draws statistically-based deviation channels around it.
Its unique feature is a dynamic probability engine that analyzes thousands of historical price bars to calculate and display the real-time likelihood of the price touching each of these deviation levels. This provides a quantifiable edge for making trading decisions.
Core Concepts Explained
This indicator is built on three key concepts:
The VWAP (Volume-Weighted Average Price): The dotted midline of the channels is the session VWAP. Unlike a Simple Moving Average (SMA) which only considers price, the VWAP incorporates volume into its calculation. This makes it a much more significant benchmark, as it represents the true average price where the most business has been transacted during the day. It's heavily used by institutional traders, which is why price often reacts strongly to it.
Standard Deviation Channels: The channels above and below the VWAP are based on standard deviations. Standard deviation is a statistical measure of volatility.
- Wide Bands: When the channels are wide, it signifies high volatility.
- Narrow Bands: When the channels are tight and narrow, it signifies low volatility and
consolidation (a "squeeze").
The Conditional Probability Engine: This is the heart of the indicator. For every deviation level, the script displays a percentage. This percentage answers a very specific question:
"Based on thousands of previous bars, when the last candle had a certain momentum (bullish or bearish), what was the historical probability that the price would touch this specific level?"
The probabilities are calculated separately depending on whether the previous candle was green (bullish) or red (bearish). This provides a nuanced, momentum-based edge. The level with the highest probability is highlighted, acting as a "price magnet."
How to Use This Indicator
Recommended Timeframes:
This indicator is designed specifically for intraday trading. It works best on timeframes like the 1-minute, 5-minute, and 15-minute charts. It will not display correctly on daily or higher timeframes.
Recommended Trading Strategy: Mean Reversion
The primary strategy for this indicator is "Mean Reversion." The core idea is that as the price stretches to extreme levels far away from the VWAP (the "mean"), it is statistically more likely to "snap back" toward it.
Here is a step-by-step guide to trading this setup:
1. Identify the Extreme: Wait for the price to push into one of the outer deviation bands (e.g., the -2, -3, or -4 bands for a buy setup, or the +2, +3, or +4 bands for a sell setup).
2. Look for the High-Probability Zone: Pay close attention to the highlighted probability label. This is the level that has historically acted as the strongest magnet for price. A touch of this level represents a high-probability area for a potential reversal.
3. Wait for Confirmation: Do not enter a trade just because the price has touched a band. Wait for a confirmation candle that shows momentum is shifting.
- For a Buy: Look for a strong bullish candle (e.g., a green engulfing candle or a hammer/pin
bar) to form at the lower bands.
- For a Sell: Look for a strong bearish candle (e.g., a red engulfing candle or a shooting star)
to form at the upper bands.
Define Your Exit:
- Take Profit: A logical primary target for a mean reversion trade is the VWAP (midLine).
- Stop Loss: A logical place for a stop-loss is just outside the next deviation band. For
example, if you enter a long trade at the -3 band, your stop loss could be placed just
below the -4 band.
Disclaimer: This indicator is a tool for analysis and should not be considered a standalone trading system. Trading involves significant risk, and past performance is not indicative of future results. Always use this indicator in conjunction with other forms of analysis and sound risk management practices.
ALP AT + KAMA Crossover This indicator is a powerful combination of two adaptive trend-following concepts: the AlphaTrend by Kivanc Ozbilgic and the Kaufman's Adaptive Moving Average (KAMA), often credited to Perry Kaufman (with the specific implementation based on HPotter's interpretation of KAMA).
The primary goal of this indicator is to provide a robust trend detection and dynamic support/resistance system, adapting to market volatility.
How it Works:
AlphaTrend Component: The green/red line is the AlphaTrend. It dynamically adjusts to market volatility (using ATR) and momentum (using MFI or RSI, configurable). It provides faster signals for trend changes.
KAMA Component: The black line is the Kaufman's Adaptive Moving Average. KAMA is designed to filter out market noise during choppy periods and follow the price closely during trending periods, making it a smoother and more reliable long-term trend indicator.
Color-Coded Trend Zones: The AlphaTrend line is color-coded to visually represent the current market condition based on the price's position relative to both AlphaTrend and KAMA:
Strong Uptrend (Lime Green): Price is above both AlphaTrend and KAMA.
Strong Downtrend (Red): Price is below both AlphaTrend and KAMA.
Uptrend Uncertainty (Orange): Price is above KAMA but below AlphaTrend (suggests consolidation or weakening uptrend).
Downtrend Uncertainty (Blue): Price is below KAMA but above AlphaTrend (suggests consolidation or strengthening downtrend within a downtrend).
Gray: Default/unclassified state.
The underlying logic is based on:
Bullish Crossover (Potential Buy Signal): When the AlphaTrend line crosses above the KAMA line.
Bearish Crossover (Potential Sell Signal): When the AlphaTrend line crosses below the KAMA line.
These crossovers indicate a shift in the adaptive trend momentum.
Customization:
Users can customize various parameters in the indicator's settings, including:
AlphaTrend Multiplier and Common Period.
KAMA Lengths and Alpha values.
All the color codes for different trend zones and lines, allowing for full personalization of the visual output.
Disclaimer:
This indicator is for informational and educational purposes only and should not be considered as financial advice. Trading involves substantial risk, and past performance is not indicative of future results. Always conduct your own thorough research and analysis before making any trading or investment decisions. This indicator is NOT a buy/sell/hold recommendation. Use it as a tool to aid your analysis, not as a sole basis for your trades.
ROGUE ICT PRORogue ICT PRO — Smart Money Confluence Tool
The Rogue ICT Buy/Sell indicator is a precision-built, multi-confirmation tool inspired by Inner Circle Trader (ICT) concepts. It identifies high-probability trade setups using market structure, fair value gaps, killzone sessions, and higher timeframe trend alignment.
✅ Core Features
🔹 Market Structure Shift (MSS)
Detects clean breaks of swing highs or lows, indicating potential trend continuation or reversal.
🔹 Fair Value Gap Detection (FVG)
Automatically highlights institutional imbalances — essential ICT confluence zones.
🔹 Smart Killzone Filtering
Signals only trigger during high-liquidity sessions:
Asian (19:00–22:00)
London (02:00–05:00)
New York (07:00–10:00)
Each session is color-highlighted on the chart.
🔹 HTF EMA Bias Filter
Only trades in the direction of the Higher Timeframe 50 EMA (e.g., 1H on 5M chart). This ensures entries align with institutional directional bias. I have default set to the Daily 9 EMA but can be changed to your preference.
🔹 ATR-Based Stop Loss & Take Profit Lines
SL is calculated using ATR × multiplier
TP is placed using a customizable Risk-Reward Ratio
Both levels are plotted on the chart with "SL" and "TP" labels.
🔹 Cooldown Logic
Prevents overtrading by requiring a minimum number of bars between each signal.
ORB Screener-Multiple Indicators [Marin adjusted]ORB screener for multiple instruments. it needs just the customization of time/ timezone.
Fair Value GapsFair Value Gaps Indicator
The Fair Value Gaps (FVG) Indicator is a sleek, lightweight tool designed to identify and display unfilled fair value price gaps on any chart and timeframe. It dynamically updates as price moves into gaps, shrinking the displayed area to show only the remaining unfilled portion until the gap is fully closed. With a user-friendly settings panel, traders can customize visuals to suit their style, including a minimalist version.
Features
When a valid FVG is detected through a three-candle pattern, a box appears, highlighting the precise gap range. As price enters the gap, the box adjusts to reflect the remaining unfilled area, and when fully filled, the gap is deleted, allowing new gaps to appear. The settings panel offers robust customization for a tailored experience.
Preset Styles :
Custom : Define your own color and zone extension settings. (Default)
Blue Boxes : Blue gaps with 85% transparency and zones extended to the right.
Minimalist Yellow : Yellow gaps with 75% transparency, confined to the original gap area on the candlestick.
Color : Change the gap color and transparency.
Extend FVG Zone : Enable or disable zone extension to the right.
Show Borders : Toggle subtle borders on or off for enhanced visibility.
Maximum FVGs Displayed : Change the number of gaps displayed on the chart.
Thank you for your interest in my work. I use these fair value gaps as part of my trade trigger for many of my trade entries almost every day. If you have any comments, bugs, or suggestions, please leave them here, or you can find me on Twitter or Discord.
@ ContrarianIRL
Open-source developer for over 25 years
Mutant Cycle - Volatility DriverMutant cycle _ volatility Driver
Punti di volatilità settimanali massimo e minimi forti
Profit Seeker📈 Profit Seeker — Precision Trend Signal Indicator
Profit Seeker is a trend-based multi-condition indicator designed to identify high-probability long and short trade setups by combining the strengths of multiple proven technical tools:
🔍 Core Features:
Heiken Ashi Mode (Optional): Smoothens price action to reduce noise and improve trend clarity.
Stochastic Ribbon Pivots: Detect trend reversals with built-in “HUNT” signals.
Chande Momentum Oscillator (CMO): Confirms weakening or strengthening momentum — labeled as “SIGHT”.
Bollinger Bands (BB): Pinpoint final entry triggers when price breaches volatility extremes — the “FIRE” signal.
Multi-Timeframe Trend Filtering: Trade only in the direction of a dominant higher-timeframe trend.
Color-coded Flags:
🟢 HUNT: Initial trend signal
🟢 SIGHT: Momentum alignment
🟢 FIRE: Volatility-based confirmation
Smart Alerts: Receive real-time long or short alerts when all conditions align.
🛠️ Use Cases:
Ideal for swing and intraday traders
Works on all asset classes: crypto, forex, equities, commodities
Compatible with manual trading or automated bots
ADT MSI TableKey Features:
1. Market Smith Methodology
Composite Rating: Combines price and volume strength
Relative Strength Rating: Measures stock performance vs benchmark
Base Pattern Detection: Identifies consolidation patterns
Breakout Signals: Detects valid breakouts with volume confirmation
2. Indian Market Adaptations
INR Currency Formatting: Displays prices in ₹, Lakhs, and Crores
Indian Benchmarks: NIFTY, SENSEX, NIFTY500 options
Market Cap Display: Formatted in Indian currency standards
Trading Hours Compatibility: Works with NSE/BSE data
3. Comprehensive Data Table
Real-time Metrics: Current price, daily change, volume analysis
Technical Indicators: MA positions, RS rating, composite rating
Performance Tracking: 3M, 6M, 12M returns
Signal Generation: BUY/SELL/HOLD recommendations
4. Visual Elements
Multiple Moving Averages: 10, 20, 50, 200 period MAs
Support/Resistance Levels: Dynamic pivot-based levels
Volume Analysis: Color-coded volume bars with surge detection
Trend Background: Color-coded background based on trend strength
Breakout Markers: Visual signals for valid breakouts
5. Customizable Parameters
Adjustable Periods: All timeframes can be modified
Table Positioning: 9 different table positions
Alert System: Customizable breakout and volume alerts
Display Options: Toggle any component on/off
6. Indian Market Specific
No Errors: Fully compatible with Indian stock data
Proper Formatting: All values in Indian currency format
Market Hours: Optimized for Indian trading sessions
Volume Calculations: Adapted for Indian market volume patterns
STRENGTH INDEX / Impulse SystemSTRENGTH INDEX / Impulse System Indicator
Developed by Marcelo Ulisses Sobreiro Ribeiro
This powerful TradingView indicator combines two distinct trading approaches in one versatile tool:
1. STRENGTH INDEX (Multiple EMA System)
The first section features a unique configuration of 17 exponential moving averages designed to identify market strength and trend direction. The system includes:
Core EMAs (6, 21, and 34 periods) plotted with distinct colors and weights
A dense cluster of 14 additional EMAs (7-20 periods) that create a "zone of strength"
2. Impulse System (Based on Dr. Alexander Elder's Work)
The second section implements a modified version of Dr. Alexander Elder's famous Impulse System from his classic book Trading for a Living, featuring:
Color-coded bars (green/red/blue) based on trend strength
Customizable MACD parameters (12,26,9 by default)
Optional moving average (SMA/EMA/WMA/VWMA) with adjustable periods
EMA baseline (13-period default) for trend identification
Key Features:
Switch between systems with one click
Fully customizable parameters
Clean visual presentation with adjustable line weights
Maximum 500 plotted lines for performance optimization
This indicator is ideal for traders who want to:
✔ Identify strong trends using the EMA cluster
✔ Follow the market's impulse with Elder's proven system
✔ Customize their analysis with multiple technical tools
Tip: Use the STRENGTH INDEX for trend identification and the Impulse System for entry/exit timing.
Reverse XReverse X is a visual tool that shows the price levels required to reach specific RSI values. It calculates and plots up to four reverse-engineered RSI lines directly on the chart. Each line can be customized with its own RSI target, color, line width, and visibility toggle. The lines are smoothed using EMA to reduce noise, and transparent fills between them highlight RSI zones. Ideal for traders who want to anticipate price movement needed to push RSI to key levels like 30, 50, or 70.
PE Bands w/ Persistent EPS ProxyThis Pine Script is a valuation overlay for any stock or index, built around the idea of tracking and projecting P/E (Price-to-Earnings) multiple bands using trailing EPS and a growth assumption. Here's a full breakdown:
🔍 Purpose:
To visualize price bands based on valuation multiples (like 16x, 18x, 20x, etc.) of forward EPS, estimated from actual reported EPS over the last 4 quarters.
🧱 Core Components:
✅ @version=6
Specifies the latest Pine Script version (v6), ensuring compatibility with the newest syntax.
✅ indicator(...)
Declares a chart overlay indicator titled 'PE Bands w/ Persistent EPS Proxy', meaning the plots will appear on top of the price chart.
1. 📈 Growth Assumption Input
pinescript
Copy
Edit
Growth = input.float(1.08, 'Growth')
User input for projected forward EPS growth (default: +8%). This models earnings growth from trailing 12 months to forward 12 months.
2. 🧮 Retrieve EPS Data
pinescript
Copy
Edit
epsRaw = request.earnings(syminfo.tickerid, earnings.actual, gaps = barmerge.gaps_off)
Uses the built-in request.earnings() function to fetch actual EPS.
Works with any symbol that supports earnings data.
barmerge.gaps_off ensures EPS only shows on report bars (not filled in between).
3. 🧠 Persistent Memory for Last 4 EPS Values
pinescript
Copy
Edit
var float eps1 = na
...
if not na(epsRaw)
eps4 := eps3
eps3 := eps2
eps2 := eps1
eps1 := epsRaw
Implements a shift register: keeps track of the last 4 quarterly EPS values, so it can compute a full TTM (trailing 12-month) EPS even though epsRaw only updates quarterly.
4. 📊 Trailing 12-Month EPS
pinescript
Copy
Edit
epsTTM = na(eps1) or na(eps2) or na(eps3) or na(eps4) ? na : eps1 + eps2 + eps3 + eps4
Sums the most recent 4 quarters to get a TTM earnings proxy.
If any value is still na, the result is na.
5. 🔮 Forward EPS Estimation
pinescript
Copy
Edit
fwdEPS = epsTTM * Growth
Projects forward EPS using a growth multiplier (1.08 = +8%).
You could customize this to vary over time (e.g., macro-modelled growth).
6. 📐 Valuation Bands
pinescript
Copy
Edit
pe16 = fwdEPS * 16
...
pe24 = fwdEPS * 24
Calculates price levels the stock/index would be trading at under different valuation multiples of forward EPS.
These become bands: 16x, 18x, 20x, etc.
7. 📉 Plot Bands
pinescript
Copy
Edit
plot(pe16, ...)
...
plot(pe24, ...)
Draws horizontal or sloped bands that reflect valuation ranges.
If SPX is above the 22x or 24x band, you might consider the market overvalued.
If it’s near 16x, potentially undervalued (depending on forward EPS quality).
✅ Summary:
This is a dynamic, earnings-based valuation overlay for use on equity or index charts. It uses:
Real EPS data (as it gets reported)
Persistent memory to calculate trailing 12M EPS
Growth modeling to estimate forward EPS
Price targets for different forward P/E multiples