Trendlines & SR ZonesIt's a comprehensive indicator (Pine Script v6) that represents two powerful technical analysis tools: automatic trendline detection based on pivot points and volume delta analysis with support/resistance zone identification. This overlay indicator helps traders identify potential trend directions and key price levels where significant buying or selling pressure has occurred.
Features: =
1. Price Trendlines
The indicator automatically identifies and draws trendlines based on pivot points, creating dynamic support and resistance levels.
Key Components:
Pivot Detection: Uses configurable left and right bars to identify significant pivot highs and lows
Trendline Filtering: Only draws downward-sloping resistance trendlines and upward-sloping support trendlines
Zone Creation: Creates filled zones around trendlines based on average price volatility
Automatic Management: Maintains only the 3 most recent significant trendlines to avoid chart clutter
Customization Options:
Left/Right Bars for Pivot: Adjust sensitivity of pivot detection (default: 10 bars each side)
Extension Length: Control how far trendlines extend past the second pivot (default: 50 bars)
Average Body Periods: Set the lookback period for volatility calculation (default: 100)
Tolerance Multiplier: Adjust the width of the trendline zones (default: 1.0)
Color Customization: Separate colors for high (resistance) and low (support) trendlines and their fills
2. Volume Delta % Bars
The indicator analyzes volume distribution across price levels to identify significant supply and demand zones.
Key Components:
Volume Profile Analysis: Divides the price range into rows and calculates volume delta at each level
Delta Visualization: Displays horizontal bars showing the percentage difference between buying and selling volume
Zone Identification: Automatically identifies the most significant supply and demand zones
Visual Integration: Connects volume delta bars with corresponding support/resistance zones on the price chart
Customization Options:
Lookback Period: Set the number of bars to analyze for volume (default: 200)
Price Rows: Control the granularity of the volume analysis (default: 50 rows)
Delta Sections: Adjust the number of horizontal delta bars displayed (default: 20)
Panel Appearance: Customize width, position, and direction of the delta panel
Zone Settings: Control the number of supply/demand zones and their extension (default: 3 zones)
How It Works-
Trendline Logic:
The script continuously scans for pivot highs and lows based on the specified left and right bars
When a pivot is detected, it creates a horizontal line at that price level
The script then looks for the previous pivot of the same type (high or low)
It connects these pivots with a trendline, extending it based on the user-specified setting
A parallel line is created to form a zone, with the distance based on average price volatility
The script filters out invalid trendlines (upward-sloping resistance and downward-sloping support). Only the 3 most recent trendlines are maintained to prevent chart clutter
Volume Delta Logic:
The script divides the price range over the lookback period into the specified number of rows
For each bar in the lookback period, it categorizes volume as bullish (close > open) or bearish (close < open). This volume is assigned to the appropriate price level based on the HLC3 price.
The price levels are grouped into sections, and the net delta (bullish - bearish volume) is calculated for each Horizontal bars are drawn to represent these delta percentages.
The most significant positive and negative deltas are identified and displayed as support and resistance zones. These zones are extended to the left on the price chart and connected to the delta panel with dotted lines.
Ideal Timeframes:
The indicator is versatile and can be used across multiple timeframes, but it performs optimally on specific timeframes depending on your trading style:
For Day Trading:
Optimal Timeframes: 15-minute to 1-hour charts
Why: These timeframes provide a good balance between noise reduction and sufficient volume data. The volume delta analysis is particularly effective on these timeframes as it captures intraday accumulation/distribution patterns while the trendlines remain reliable enough for intraday trading decisions.
For Swing Trading:
Optimal Timeframes: 1-hour to 4-hour charts
Why: These timeframes offer the best combination of reliable trendline formation and meaningful volume analysis. The trendlines on these timeframes are less prone to whipsaws, while the volume delta analysis captures multi-day trading sessions and institutional activity.
For Position Trading:
Optimal Timeframes: Daily and weekly charts
Why: On these higher timeframes, trendlines become extremely reliable as they represent significant market structure points. The volume delta analysis reveals longer-term accumulation and distribution patterns that can define major support and resistance zones for weeks or months.
Timeframe-Specific Adjustments:
Lower Timeframes (1-15 minutes):
Reduce left/right bars for pivots (5-8 bars)
Decrease lookback period for volume delta (50-100 bars)
Increase tolerance multiplier (1.2-1.5) to account for higher volatility
Higher Timeframes (Daily+):
Increase left/right bars for pivots (15-20 bars)
Extend lookback period for volume delta (300-500 bars)
Consider increasing the number of price rows (70-100) for more detailed volume analysis
Usage Guidelines-
For Trendline Analysis:
Use the trendlines as dynamic support and resistance levels
Price reactions at these levels can indicate potential trend continuation or reversal points
The filled zones around trendlines represent areas of price volatility or uncertainty
Consider the slope of the trendline as an indication of trend strength
For Volume Delta Analysis:
The horizontal delta bars show where buying or selling pressure has been concentrated
Green bars indicate areas where buying volume exceeded selling volume (demand)
Red bars indicate areas where selling volume exceeded buying volume (supply)
The highlighted supply and demand zones on the price chart represent significant price levels
These zones can act as future support or resistance areas as price revisits them
Customization Tips:
Trendline Sensitivity: Decrease left/right bars values to detect more pivots (more sensitive) or increase them for fewer, more significant pivots
Zone Width: Adjust the tolerance multiplier to make trendline zones wider or narrower based on your trading style
Volume Analysis: Increase the lookback period for a longer-term volume profile or decrease it for more recent activity
Visual Clarity: Adjust colors and transparency settings to match your chart theme and preferences
Conclusion:
This indicator provides traders with a comprehensive view of both trend dynamics and volume-based support/resistance levels. With these two analytical approaches, the indicator offers valuable insights for identifying potential entry and exit points, trend strength, and key price levels where significant market activity has occurred. The extensive customization options allow traders to adapt the indicator to various trading styles and timeframes, with optimal performance on 15-minute to daily charts depending on their trading horizon.
Chart Attached: NSE HINDZINC, EoD 12/12/25
DISCLAIMER: This information is provided for educational purposes only and should not be considered financial, investment, or trading advice. Please do boost if you like it. Happy Trading.
Educational
Auto Trend [theUltimator5]The Auto Trend indicator was designed to be a unique pattern detection indicator without the use of standard pivot point logic or high/low lines. It is a study in pattern detection by using iterative best-fit logic.
The indicator automatically identifies and draws trend channels by analyzing price action across configurable lookback periods. It finds optimal high and low trendlines that contain price movement, with a middle line marking the trend's center.
Key Features:
Automatic Pattern Detection - Intelligently searches for the best lookback period where price stays within the channel boundaries
Dual Pattern Modes - Choose between Short (20-66 bars) for quick patterns or Long (50-500 bars) for extended trends. Note - the long pattern is fully configurable and can be set anywhere up to 5000 bars.
Smart Caching - Optimized performance that only recalculates when necessary
Customizable Starting Point - Click directly on the chart to set where the trend channel begins
Flexible Lookback Range - Set minimum and maximum lookback periods to match your trading style
Visual Debugging - Optional label displays the active lookback period and violation count
How It Works:
The indicator divides the lookback period into thirds, finds the highest and lowest closes in the first and last thirds, then draws trendlines connecting these points. It can automatically search through different lookback periods to find the one with the fewest price violations (closes outside the channel).
Settings:
Use Auto Lookback - Enable automatic optimal lookback detection
Pattern Length - Short (faster, 1-bar increments) or Long (broader, 5-bar increments)
Min/Max Lookback - Define the search range for the Long pattern
Manual Lookback - Override auto-detection with a fixed period
Custom Colors - Personalize the high, low, and middle line colors
Starting Point - Select where the trend analysis begins
Use Cases:
Identify dominant trend channels across different timeframes
Spot potential support and resistance levels
Determine trend strength and consistency
Time entries and exits based on channel position
The indicator supports up to 5000 bars of historical data for comprehensive trend analysis.
ZigZag++ UltraAlgo EditionLagging indicator used to understand trends and entry / exit points. Suggest using at 4h - 1d intervals first, then 1-2h, to identify zones of opportunities and validate your position.
GVWAP_Core (CalendarSpan + EventSpike)GVWAP Core Indicator
General Description (Public)
GVWAP (Generalized Volume-Weighted Average Price) is an advanced anchoring and averaging framework designed to reveal market structure rather than predict price. Unlike traditional VWAP, GVWAP is not limited to volume weighting or session-based anchoring. It can operate on any input series (price, indicators, transforms) and supports multiple weighting schemes, decay behavior, and structural reset logic.
At its core, GVWAP answers a simple question: “Where is the statistically relevant center of activity since the last meaningful structural event?”
The indicator continuously updates a weighted average of the input series, gradually forgetting older data using exponential decay. The anchor point can reset on calendar boundaries (day, week, month, etc.) or on statistically significant events such as abnormal volume spikes. Robust dispersion bands based on mean absolute deviation (MAD) surround the average, providing context for trend, rotation, and compression regimes.
GVWAP is not a trading signal by itself. It is best used as a structural reference layer or as an intermediate transform feeding other indicators, strategies, or regime filters.
Mathematical Description (Quantitative)
Let x_t be an arbitrary input series and w_t a selectable weight function. GVWAP is defined as a normalized exponentially decayed weighted estimator:
GVWAP_t = N_t / D_t
with recursive updates:
N_t = (1 − α)·N_{t−1} + α·w_t·x_t
D_t = (1 − α)·D_{t−1} + α·w_t
where α = 1 − 2^(−1/H) and H is the decay half-life in bars.
Weights may be defined as:
• w_t = V_t (volume)
• w_t = 1 (equal weight)
• w_t = 1 / ATR_t (volatility-normalized)
• w_t = f(n_t) (time-weighted, where n_t is bars since reset)
The estimator resets when a structural condition R_t is satisfied, at which point:
N_t = w_t·x_t, D_t = w_t
For event-based anchoring, volume surprise is computed using a Student‑t–compressed z‑score:
z_t = (V_t − μ_V) / σ_V
tZ_t = z_t / sqrt(1 + z_t² / ν)
A reset occurs when tZ_t exceeds a threshold τ.
Dispersion is measured via a decayed Mean Absolute Deviation:
MAD_t = (Σ λ^{t−i} w_i |x_i − GVWAP_t|) / (Σ λ^{t−i} w_i)
Bands are defined as GVWAP_t ± k·MAD_t.
GVWAP therefore represents a bounded-memory, robust, non‑Gaussian estimator of the local conditional expectation of x_t under dynamic anchoring and weighting.
S&R Detector by Rakesh Sharma📊 Support & Resistance Auto-Detector
Automatically identifies key Support and Resistance levels with strength ratings
✨ Key Features:
🎯 Intelligent S/R Detection
Automatically finds Support and Resistance levels based on swing highs/lows
Shows strength rating (Very Strong, Strong, Medium, Weak)
Displays number of touches at each level
📅 Key Time-Based Levels
Previous Day High/Low (PDH/PDL) - Blue lines
Previous Week High/Low (PWH/PWL) - Purple lines
Optional Round Numbers for psychological levels
⚙️ Fully Customizable
Adjust sensitivity (5-20 pivot length)
Filter by minimum touches (1-10)
Control maximum levels displayed (3-20)
Optional S/R zones (shaded areas)
📊 Live Dashboard
Shows nearest Support/Resistance
Distance to key levels
Total S/R levels detected
🔔 Smart Alerts
PDH/PDL breakout signals
Visual markers on chart
Perfect for: Intraday traders, Swing traders, Price action analysis
VX-Session-Boxes-(AM/PM Split)(Customizable) by Ikaru-s-VX-Session-Boxes-(AM/PM Split) is a session-based visualization tool for TradingView that highlights major market sessions directly on the chart using dotted range boxes and an optional AM/PM split.
The indicator allows traders to visually separate market behavior across different sessions while keeping the chart clean and readable.
🔹 Key Features
Custom Session Definitions
Define up to 4 independent sessions using TradingView’s session format (HHMM-HHMM + weekdays).
Timezone-Aware
All sessions are calculated using a user-defined timezone (IANA or UTC offset), ensuring accurate session alignment across markets.
Dotted Session Boxes
Each session is drawn as a dotted box based on the session’s high/low range, providing a clear view of volatility and price structure.
AM / PM Split Visualization
Sessions can be visually split into AM and PM parts:
Separate box shading for AM and PM
Optional dotted vertical split line at the AM → PM transition (12:00 in the selected timezone)
Session Labels
Optional labels at the start of each session for quick identification (e.g. Sydney, Tokyo, London, New York).
Fully Customizable Visuals
Adjustable opacity, border width, and visibility toggles for boxes, split lines, and labels.
🔹 Use Cases
Session-based market analysis (Asia / London / New York)
Identifying session ranges and volatility expansion
Observing price behavior differences between AM and PM
Studying session transitions and liquidity shifts
🔹 Notes
Session boxes are based on session high and low, not full chart height.
AM/PM split is based on 12:00 (noon) in the selected timezone.
Designed for clarity and performance on intraday timeframes.
🔹 Compatibility
Pine Script® v6
Works on all intraday timeframes
Overlay indicator (draws directly on the price chart)
Breakout/Breakdown DetectorBreakout/Breakdown Detector - Quick Overview
What it does:
This indicator automatically identifies when price breaks through key support or resistance levels, signaling potential trading opportunities.
Key Features:
📈 Breakout Detection - Alerts when price breaks ABOVE resistance (bullish signal)
📉 Breakdown Detection - Alerts when price breaks BELOW support (bearish signal)
🔊 Volume Confirmation - Optionally requires high volume to confirm the break (filters false signals)
📊 Visual Signals - Shows green triangles (breakout) and red triangles (breakdown) on chart
🎨 Support/Resistance Lines - Automatically draws key levels based on recent price action
Settings You Can Adjust:
Lookback Period (default 20) - How many candles back to find support/resistance
Volume Multiplier (default 1.5x) - How much volume needed to confirm
Breakout Threshold (default 0.5%) - How far price must break through the level
How to Use:
Add to any chart (stocks, crypto, forex, etc.)
Green triangle below bar = BUY signal (breakout)
Red triangle above bar = SELL signal (breakdown)
Set alerts to get notified automatically
Perfect for: Swing traders, breakout traders, and anyone who wants to catch momentum moves early! 🚀
Support & Resistance Auto-Detector by Rakesh SharmaVersion 1.1 Update:
- Fixed: S/R lines now extend infinitely to the right
- Fixed: Lines move with chart when scrolling
- Added: Toggle to control line extension
- Improved: Better visibility across all timeframes
Neosha Concept V4 (NY Time)
Imagine the financial market as a huge ocean. Millions of traders throw orders into it every second. But beneath all the noise, there is a powerful current that quietly controls where the waves move. That current is not a person, not a trader, and not random—it is an algorithm.
This algorithm is called the Interbank Price Delivery Algorithm (IPDA).
Think of it as the “navigation system” that guides price through the market.
IPDA has one job:
to move prices in a way that keeps the market efficient and liquid.
To do this, it constantly looks for two things:
1. Where liquidity is hiding
Liquidity is usually found above highs and below lows—where traders place stop losses. The algorithm moves price there first to collect that liquidity.
2. Where price became unbalanced
Sometimes price moves too fast and creates gaps or imbalances. IPDA returns to those areas later to “fix” the missing orders.
Once you start looking at the charts with this idea in mind, everything makes more sense:
Why price suddenly spikes above a high and crashes down
Why big moves leave gaps that price later fills
Why the market reverses right after taking stops
Why trends begin only after certain levels are hit
These are not accidents.
They are the algorithm doing its job.
Price moves in a repeating cycle:
Gather liquidity
Make a strong move (displacement)
Return to fix inefficiency
Deliver to the next target
Most beginners only see the candles.
But once you understand IPDA, you see the intention behind the candles.
Instead of guessing where price might go, you begin to understand why it moves there.
And once you understand the “why,” your trading becomes clearer, calmer, and far more accurate.
S&R Detector by Rakesh SharmaSupport & Resistance Auto-Detector
Automatically identifies key Support and Resistance levels with strength ratings
✨ Key Features:
🎯 Intelligent S/R Detection
Automatically finds Support and Resistance levels based on swing highs/lows
Shows strength rating (Very Strong, Strong, Medium, Weak)
Displays number of touches at each level
📅 Key Time-Based Levels
Previous Day High/Low (PDH/PDL) - Blue lines
Previous Week High/Low (PWH/PWL) - Purple lines
Optional Round Numbers for psychological levels
⚙️ Fully Customizable
Adjust sensitivity (5-20 pivot length)
Filter by minimum touches (1-10)
Control maximum levels displayed (3-20)
Optional S/R zones (shaded areas)
📊 Live Dashboard
Shows nearest Support/Resistance
Distance to key levels
Total S/R levels detected
🔔 Smart Alerts
PDH/PDL breakout signals
Visual markers on chart
Perfect for: Intraday traders, Swing traders, Price action analysis
S&R Detector by Rakesh Sharma📊 Support & Resistance Auto-Detector
Automatically identifies key Support and Resistance levels with strength ratings
✨ Key Features:
🎯 Intelligent S/R Detection
Automatically finds Support and Resistance levels based on swing highs/lows
Shows strength rating (Very Strong, Strong, Medium, Weak)
Displays number of touches at each level
📅 Key Time-Based Levels
Previous Day High/Low (PDH/PDL) - Blue lines
Previous Week High/Low (PWH/PWL) - Purple lines
Optional Round Numbers for psychological levels
⚙️ Fully Customizable
Adjust sensitivity (5-20 pivot length)
Filter by minimum touches (1-10)
Control maximum levels displayed (3-20)
Optional S/R zones (shaded areas)
📊 Live Dashboard
Shows nearest Support/Resistance
Distance to key levels
Total S/R levels detected
🔔 Smart Alerts
PDH/PDL breakout signals
Visual markers on chart
Perfect for: Intraday traders, Swing traders, Price action analysis
SB - Ultimate Clean Trend Pro Uses dynamic Moving colour coding for spotting chage of bias. Use set up with keeping VWAP in reference.
Smart WhaleOverview The Smart Whale Breakout System is a pure momentum strategy designed for Swing Traders who want to capture high-probability breakouts while managing risk with a mechanical trailing stop.
Unlike indicators that try to guess "bottoms," this system follows the "Smart Money" approach: buying strength when institutional volume enters, and riding the trend until the momentum breaks.
How it Works
1. The Entry (The Hunter) The system identifies a valid BREAKOUT signal only when four specific conditions align:
Trend Filter: Price must be above the 150 SMA. We only trade with the long-term trend.
Momentum: RSI > 50. Ensuring bulls are in control.
Volume Spike (Whale Activity): Current volume must be significantly higher than the average (Default: 1.5x). This filters out weak retail moves.
Price Action: A bullish candle closing higher than it opened.
2. The Exit (The Manager) Once in a trade, the system activates a dynamic Trailing Stop line. You never have to guess when to sell. You can choose between two exit logic modes in the settings:
ATR Trailing (Default): Adapts to volatility. The stop moves up based on a multiple of the Average True Range (ATR). Great for volatile stocks (e.g., TSLA, NVDA).
Percent Trailing: A fixed percentage drop from the highest high. (e.g., "Sell if price drops 10% from peak").
3. The Context (Optional Filter)
Squeeze Filter: Includes a built-in Bollinger/Keltner squeeze detection. If enabled in settings, the system will only signal a buy if the price recently broke out of a consolidation (squeeze). Default is OFF to catch all momentum moves.
Key Features
NO Repainting: Signals are confirmed at candle close.
Visual Risk Management: A Red Trailing Stop line clearly shows where your invalidation point is.
Fully Customizable: Adjust the Volume multiplier, ATR sensitivity, or Percentage drop to fit your asset class (Crypto/Stocks/Forex).
Clean Visuals: Only colors the Breakout and Sell candles to keep your chart clean.
Settings Guide
Trend SMA Length: Define the long-term trend baseline (Default: 150).
Volume Spike (xAvg): How much volume is needed to trigger a buy? (1.5 = 150% of average).
Exit Method: Choose between "ATR Trailing" or "Percent Trailing".
ATR Multiplier: Tighter stop (2.0) vs Looser stop (3.0).
Require Squeeze?: Check this to filter for breakouts that only happen after a consolidation period.
Disclaimer This tool is for educational purposes only. Always use proper risk management.
Prince Break and RetestHow to use the new visuals (super simple)
When the script prints RETEST BUY or RETEST SELL, you will instantly see:
ENTRY line (lime)
SL line (orange)
TP1 line (teal)
TP2 line (purple)
Entry Mode options
Close = enter at the close of the retest signal candle (simplest)
Box Edge = enter at the box edge (more “limit-order-ish”)
For your style (break + retest), start with Close.
Bassi MA Entry Helper MTF EMA , VWMA Swing , ADX , SMA200 , TPBassi MA Entry Helper is an advanced multi-timeframe confluence system designed to identify high-probability entries using trend, volume, market structure, and volatility filters.
It is built for traders who want cleaner signals, fewer false entries, and strong multi-confirmation setups.
Key Features
Multi-Timeframe EMA Crossovers – HTF signal engine
SMA200 Trend Filter – prevents counter-trend trades
VWMA Swing Confirmation – volume-validated micro-swings
ADX Filter – only trade when the trend has strength
Fractal Structure Mapping – identifies swing highs/lows
Retracement Filter – confirms pullbacks before entries
TP/SL Automation – ATR or percentage based
Clean Entry Labels – main & additional entry signals
Highly Customizable – mode, timeframe, filters, visuals
This script is ideal for:
Scalping • Intraday • Swing • Trend continuation • Volume-based setups • Multi-timeframe alignment
How It Works
Main Buy/Sell Signals
Triggered when:
✔ Fast EMA crosses Slow EMA (HTF)
✔ Price aligned with trend
✔ SMA200 filter valid
✔ VWMA confirmation (optional)
✔ ADX strong
✔ Retracement valid (optional)
Additional Buy/Sell Signals
Triggered when VWMA crosses Slow EMA during trend continuation.
TP/SL System
You can choose between:
%-based take-profit & stop-loss
ATR-based dynamic levels
Automatically projects clean visual levels on your chart.
Notes
This indicator does not repaint and is suitable for both real-time and historical analysis.
Always combine signals with proper risk management.
Initial Release – v1.0
Added multi-timeframe EMA engine
Added SMA200 trend filter
Added VWMA swing entries
Added ADX strength filter
Added retracement filter
Added fractal swing detection
Added TP/SL auto plotting
Added main & additional entry labels
Performance optimized
Cup & Handle Finder by Mashrab🚀 New Tool Alert: The "Perfect Cup" Finder
Hey everyone! I’ve built a custom indicator to help us find high-quality Cup & Handle setups before they breakout.
Most scripts just look for random highs and lows, but this one uses a geometric algorithm to ensure the base is actually round (avoiding those messy V-shapes).
How it works:
🔵 Blue Arc: This marks a verified, institutional-quality Cup.
🟠 Orange Box: This is the "Handle Zone." If you see this connecting to the current candle, it means the setup is live and ready for a potential entry!
Best Usage:
Works best on Weekly (1W) charts.
It’s designed to be an "Early Warning" system—alerting you while the handle is still forming so you don't miss the move.
Give it a try and let me know what you find! 📉📈
ORB + FVG + PDH/PDL ORB + FVG + PDH/PDL is an all-in-one day-trading overlay that plots:
Opening Range (ORB) high/low with optional box and extension
Fair Value Gaps (FVG) with optional “unmitigated” levels + mitigation lines
Previous Day High/Low history (PDH/PDL) drawn as one-day segments (yesterday’s levels plotted across today’s session only)
Includes presets (ORB only / FVG only / Both) and optional alerts for ORB touches, ORB break + retest, FVG entry, and PDH/PDL touches.
Volatility Targeting: Single Asset [BackQuant]Volatility Targeting: Single Asset
An educational example that demonstrates how volatility targeting can scale exposure up or down on one symbol, then applies a simple EMA cross for long or short direction and a higher timeframe style regime filter to gate risk. It builds a synthetic equity curve and compares it to buy and hold and a benchmark.
Important disclaimer
This script is a concept and education example only . It is not a complete trading system and it is not meant for live execution. It does not model many real world constraints, and its equity curve is only a simplified simulation. If you want to trade any idea like this, you need a proper strategy() implementation, realistic execution assumptions, and robust backtesting with out of sample validation.
Single asset vs the full portfolio concept
This indicator is the single asset, long short version of the broader volatility targeted momentum portfolio concept. The original multi asset concept and full portfolio implementation is here:
That portfolio script is about allocating across multiple assets with a portfolio view. This script is intentionally simpler and focuses on one symbol so you can clearly see how volatility targeting behaves, how the scaling interacts with trend direction, and what an equity curve comparison looks like.
What this indicator is trying to demonstrate
Volatility targeting is a risk scaling framework. The core idea is simple:
If realized volatility is low relative to a target, you can scale position size up so the strategy behaves like it has a stable risk budget.
If realized volatility is high relative to a target, you scale down to avoid getting blown around by the market.
Instead of always being 1x long or 1x short, exposure becomes dynamic. This is often used in risk parity style systems, trend following overlays, and volatility controlled products.
This script combines that risk scaling with a simple trend direction model:
Fast and slow EMA cross determines whether the strategy is long or short.
A second, longer EMA cross acts as a regime filter that decides whether the system is ACTIVE or effectively in CASH.
An equity curve is built from the scaled returns so you can visualize how the framework behaves across regimes.
How the logic works step by step
1) Returns and simple momentum
The script uses log returns for the base return stream:
ret = log(price / price )
It also computes a simple momentum value:
mom = price / price - 1
In this version, momentum is mainly informational since the directional signal is the EMA cross. The lookback input is shared with volatility estimation to keep the concept compact.
2) Realized volatility estimation
Realized volatility is estimated as the standard deviation of returns over the lookback window, then annualized:
vol = stdev(ret, lookback) * sqrt(tradingdays)
The Trading Days/Year input controls annualization:
252 is typical for traditional markets.
365 is typical for crypto since it trades daily.
3) Volatility targeting multiplier
Once realized vol is estimated, the script computes a scaling factor that tries to push realized volatility toward the target:
volMult = targetVol / vol
This is then clamped into a reasonable range:
Minimum 0.1 so exposure never goes to zero just because vol spikes.
Maximum 5.0 so exposure is not allowed to lever infinitely during ultra low volatility periods.
This clamp is one of the most important “sanity rails” in any volatility targeted system. Without it, very low volatility regimes can create unrealistic leverage.
4) Scaled return stream
The per bar return used for the equity curve is the raw return multiplied by the volatility multiplier:
sr = ret * volMult
Think of this as the return you would have earned if you scaled exposure to match the volatility budget.
5) Long short direction via EMA cross
Direction is determined by a fast and slow EMA cross on price:
If fast EMA is above slow EMA, direction is long.
If fast EMA is below slow EMA, direction is short.
This produces dir as either +1 or -1. The scaled return stream is then signed by direction:
avgRet = dir * sr
So the strategy return is volatility targeted and directionally flipped depending on trend.
6) Regime filter: ACTIVE vs CASH
A second EMA pair acts as a top level regime filter:
If fast regime EMA is above slow regime EMA, the system is ACTIVE.
If fast regime EMA is below slow regime EMA, the system is considered CASH, meaning it does not compound equity.
This is designed to reduce participation in long bear phases or low quality environments, depending on how you set the regime lengths. By default it is a classic 50 and 200 EMA cross structure.
Important detail, the script applies regime_filter when compounding equity, meaning it uses the prior bar regime state to avoid ambiguous same bar updates.
7) Equity curve construction
The script builds a synthetic equity curve starting from Initial Capital after Start Date . Each bar:
If regime was ACTIVE on the previous bar, equity compounds by (1 + netRet).
If regime was CASH, equity stays flat.
Fees are modeled very simply as a per bar penalty on returns:
netRet = avgRet - (fee_rate * avgRet)
This is not realistic execution modeling, it is just a simple turnover penalty knob to show how friction can reduce compounded performance. Real backtesting should model trade based costs, spreads, funding, and slippage.
Benchmark and buy and hold comparison
The script pulls a benchmark symbol via request.security and builds a buy and hold equity curve starting from the same date and initial capital. The buy and hold curve is based on benchmark price appreciation, not the strategy’s asset price, so you can compare:
Strategy equity on the chart symbol.
Buy and hold equity for the selected benchmark instrument.
By default the benchmark is TVC:SPX, but you can set it to anything, for crypto you might set it to BTC, or a sector index, or a dominance proxy depending on your study.
What it plots
If enabled, the indicator plots:
Strategy Equity as a line, colored by recent direction of equity change, using Positive Equity Color and Negative Equity Color .
Buy and Hold Equity for the chosen benchmark as a line.
Optional labels that tag each curve on the right side of the chart.
This makes it easy to visually see when volatility targeting and regime gating change the shape of the equity curve relative to a simple passive hold.
Metrics table explained
If Show Metrics Table is enabled, a table is built and populated with common performance statistics based on the simulated daily returns of the strategy equity curve after the start date. These include:
Net Profit (%) total return relative to initial capital.
Max DD (%) maximum drawdown computed from equity peaks, stored over time.
Win Rate percent of positive return bars.
Annual Mean Returns (% p/y) mean daily return annualized.
Annual Stdev Returns (% p/y) volatility of daily returns annualized.
Variance of annualized returns.
Sortino Ratio annualized return divided by downside deviation, using negative return stdev.
Sharpe Ratio risk adjusted return using the risk free rate input.
Omega Ratio positive return sum divided by negative return sum.
Gain to Pain total return sum divided by absolute loss sum.
CAGR (% p/y) compounded annual growth rate based on time since start date.
Portfolio Alpha (% p/y) alpha versus benchmark using beta and the benchmark mean.
Portfolio Beta covariance of strategy returns with benchmark returns divided by benchmark variance.
Skewness of Returns actually the script computes a conditional value based on the lower 5 percent tail of returns, so it behaves more like a simple CVaR style tail loss estimate than classic skewness.
Important note, these are calculated from the synthetic equity stream in an indicator context. They are useful for concept exploration, but they are not a substitute for professional backtesting where trade timing, fills, funding, and leverage constraints are accurately represented.
How to interpret the system conceptually
Vol targeting effect
When volatility rises, volMult falls, so the strategy de risks and the equity curve typically becomes smoother. When volatility compresses, volMult rises, so the system takes more exposure and tries to maintain a stable risk budget.
This is why volatility targeting is often used as a “risk equalizer”, it can reduce the “biggest drawdowns happen only because vol expanded” problem, at the cost of potentially under participating in explosive upside if volatility rises during a trend.
Long short directional effect
Because direction is an EMA cross:
In strong trends, the direction stays stable and the scaled return stream compounds in that trend direction.
In choppy ranges, the EMA cross can flip and create whipsaws, which is where fees and regime filtering matter most.
Regime filter effect
The 50 and 200 style filter tries to:
Keep the system active in sustained up regimes.
Reduce exposure during long down regimes or extended weakness.
It will always be late at turning points, by design. It is a slow filter meant to reduce deep participation, not to catch bottoms.
Common applications
This script is mainly for understanding and research, but conceptually, volatility targeting overlays are used for:
Risk budgeting normalize risk so your exposure is not accidentally huge in high vol regimes.
System comparison see how a simple trend model behaves with and without vol scaling.
Parameter exploration test how target volatility, lookback length, and regime lengths change the shape of equity and drawdowns.
Framework building as a reference blueprint before implementing a proper strategy() version with trade based execution logic.
Tuning guidance
Lookback lower values react faster to vol shifts but can create unstable scaling, higher values smooth scaling but react slower to regime changes.
Target volatility higher targets increase exposure and drawdown potential, lower targets reduce exposure and usually lower drawdowns, but can under perform in strong trends.
Signal EMAs tighter EMAs increase trade frequency, wider EMAs reduce churn but react slower.
Regime EMAs slower regime filters reduce false toggles but will miss early trend transitions.
Fees if you crank this up you will see how sensitive higher turnover parameter sets are to friction.
Final note
This is a compact educational demonstration of a volatility targeted, long short single asset framework with a regime gate and a synthetic equity curve. If you want a production ready implementation, the correct next step is to convert this concept into a strategy() script, add realistic execution and cost modeling, test across multiple timeframes and market regimes, and validate out of sample before making any decision based on the results.
Sideways Zone Breakout 📘 Sideways Zone Breakout – Indicator Description
Sideways Zone Breakout is a visual market-structure indicator designed to identify low-volatility consolidation zones and highlight potential breakout opportunities when price exits these zones.
This indicator focuses on detecting periods where price trades within a tight range, often referred to as sideways or consolidation phases, and visually marks these zones directly on the chart for clarity.
🔍 Core Concept
Markets often spend time moving sideways before making a directional move.
This indicator aims to:
Detect price compression
Visually highlight the sideways zone
Signal when price breaks above or below the zone boundaries
Instead of predicting direction, it simply reacts to range expansion after consolidation.
⚙️ How the Indicator Works
1️⃣ Sideways Zone Detection
The indicator looks back over a user-defined number of candles
It calculates the highest high and lowest low within that window
If the total price range remains within a defined percentage of the current price, the market is considered sideways
This helps filter out trending and highly volatile conditions.
2️⃣ Visual Zone Representation
When a sideways condition is detected:
A clear price zone is drawn between the recent high and low
The zone is displayed using a soft gradient fill for better visibility
Outer borders are added to enhance zone clarity without cluttering the chart
This makes consolidation areas easy to spot at a glance.
3️⃣ Breakout Identification
Once a sideways zone is active:
A bullish breakout is marked when price closes above the upper boundary
A bearish breakout is marked when price closes below the lower boundary
Directional arrows and labels are plotted directly on the chart to indicate these events.
📊 Visual Elements Included
Sideways consolidation zones with gradient fill
Upper and lower zone boundaries
Buy and Sell arrows on breakout
Optional text labels for clear interpretation
All visuals are designed to remain lightweight and readable on any chart theme.
🔧 User Inputs
Sideways Lookback (candles): Controls how many past candles are used to define the range
Max Range % (tightness): Determines how tight the range must be to qualify as sideways
Adjusting these inputs allows users to adapt the indicator to different instruments and timeframes.
📈 Usage Guidelines
Can be applied to any market or timeframe
Works well as a context or confirmation tool
Best used alongside volume, trend, or risk management tools
Signals should be validated with proper trade planning
⚠️ Disclaimer
This indicator is provided as open-source for educational and analytical purposes only.
It does not generate trade recommendations or guarantee outcomes.
Market conditions vary, and users are responsible for their own trading decisions.
S&R + EMA ToolkitThis script is a market-structure toolkit that combines several indicators into a single view to help understand where price is, where it may react, and what the current trend context is.
EMAs (12, 26, 50, 200)
Help define short-, medium-, and long-term trend context and momentum alignment.
Support & Resistance Channels
Help identify key price zones where the market has historically reacted (areas of acceptance, rejection, and consolidation).
Supertrend
Helps confirm directional bias and trend persistence.
Oversold / Overbought RSI Zones (external source)
Help identify market conditions rather than timing entries.
SB-VDEMA + PivotsBest use - Intraday Scalping ( 1 Mt, 3 Mts, 5 Mts )
Uses Volatility weighted DEMA for smoother and reliable signals.
One can use dynamic colour coding of VWDEMA for entering call or puts. VWAP and Henkin ashi Supertrend is also there but, i think VWDEMA is quite enogh for decision making.
FL Core Signals Only FL Core shows only what matters: where to enter, where to exit, and where prof
No indicator noise — just confirmed decision points on a clean chart.
Designed for traders who value structure, patience, and clarity.
What FL Core Does
FL Core marks:
ENTER LONG
ENTER SHORT
AND
EXIT SHORT
TP1 / TP2 / TP3 profit targets
All signals are generated using a fixed, non-repainting ruleset and are confirmed only after candle close.
How It Trades (High Level)
Identifies momentum shifts using internal trend logic
Requires a full candle confirmation before signaling entries
Holds trades until momentum breaks, then signals exit
Tracks profit targets automatically in points
No guessing. No anticipation. No repainting.
Session Rules
FL Core is hard-wired to operate only between 4:00 AM and 4:00 PM (exchange time).
Signals outside of this window are intentionally ignored to avoid low-liquidity and overnight conditions.
Chart Design Philosophy
This version intentionally hides all underlying indicators and displays only:
Clean entry markers
Clean exit markers
Profit plate
A single gold Exit Rail that visually guides trade management
The focus stays on execution and decision-making, not indicator interpretation.
Profit Targets
Default profit targets are:
TP1: 25 points
TP2: 40 points
TP3: 60 p
Targets can be adjusted by the user.
Note: Default profit targets are optimized for NQ/MNQ, which was the primary instrument used during testing.
Traders using ES/MES should reduce target distances to better match volatility.
Important Notes
FL Core is an indicator, not an automated trading system
Stop-loss placement is handled manually according to your trading plan
Signals are designed to encourage discipline and patience, not over-trading
Marker placement (above/below bar) is intentional and should not be changed
Who This Is For
✔ Beginner traders
✔ Traders overwhelmed by indicators
✔ Traders who want clear structure and rules
✔ Traders focused on execution discipline
Who This Is NOT For
✘ Traders looking for fully automated execution
✘ Traders who want constant signals
✘ Traders who ignore risk management
Final Thought
FL Core does not try to predict the market.
It helps you wait for confirmation, execute cleanly, and manage trades with structure.
If you want fewer decisions, clearer trades, and a calmer trading experience — this is where you start.
Session Levels (Daily & Weekly Targets)This indicator provides market structure and contextual reference only. It does not generate trade signals, entries, or trading advice.
Plots rolling previous daily and weekly highs/lows as potential target levels. Levels automatically remove once touched (including wicks). Default visibility is NY session with optional toggles for London and Asia. Designed for intraday structure, confluence, and target identification.






















