Enhanced Price Direction Predictor📊 Core Mechanism: Rule-Based Scoring:
The indicator relies on a simplified scoring model where it checks for nine specific conditions on the bullish side and nine corresponding conditions on the bearish side.
Bullish/Bearish Score Calculation:The script initializes bullish_score and bearish_score to $0.0$.It then checks a predefined list of features (e.g., $5$-period Rate of Change, $5/20$ EMA crossover, RSI level, Order Flow direction) and adds a fixed point value (weight) to the appropriate score if the condition is met.
Overbought/Oversold Penalty:It includes a built-in risk-management element by applying a $-0.10$ penalty if the RSI is in extreme territory:RSI(14) $>$ 70 (Overbought) $\rightarrow$ Penalty to bullish_score.RSI(14) $<$ 30 (Oversold) $\rightarrow$ Penalty to bearish_score.
Probability Conversion:The probability_up is calculated by taking the ratio of the bullish_score to the total_score (sum of bullish and bearish scores):$$\text{Probability\_Up} = \frac{\text{Bullish\_Score}}{\text{Bullish\_Score} + \text{Bearish\_Score}}$ MIL:IF the total_score is zero (i.e., no strong conditions are met), the probability defaults to $0.5$ (neutral).
Indikatoren und Strategien
Session 30 Second OR DeviationsThis indicator will plot the -4, -6, and -8 levels in color coded fashion based on session. We look for price reactions at these levels. It will plot the Asia session first 30 second candle, same with London, and New York.
⚡ Zero-Lag 60s Binary Predictor🧠 Core Anti-Lag Philosophy
The indicator's primary goal is to overcome the inherent lag of traditional indicators like the Simple Moving Average (SMA) or standard Relative Strength Index (RSI). It achieves this by focusing on:
Leading Indicators: Using derivatives of price/momentum (like acceleration and jerk—the second and third derivatives of price) to predict turns before the price action is clear.
Instantaneous Metrics: Using short lookback periods (e.g., ta.change(close, 1) or fastLength = 5) and heavily weighting the most recent data (e.g., in instMomentum).
Market Microstructure: Incorporating metrics like Tick Pressure and Order Flow Imbalance (OFI), which attempt to measure internal bar dynamics and buying/selling aggression.
Zero-Lag Techniques: Specifically, the Ehlers Zero Lag EMA, which is mathematically constructed to eliminate phase lag by predicting where the price will be rather than where it was.
Relative Volume (Multi-TF, D, W, M)Relative Volume (Multi-TF, Candle-Matched Colors)
This indicator measures Relative Volume (RVOL) — the ratio of current volume to average historical volume — across any higher timeframe (Daily, Weekly, or Monthly) and displays it as color-coded columns that match the candle colors of the chart you’re viewing.
RVOL reveals how active today’s market participation is compared to its typical rhythm.
RVOL = 1.0 → normal volume
>1.5 → rising interest
>2.0–3.0 → strong institutional participation
>5.0 → climax or exhaustion levels
Features
Works on any chart timeframe while computing RVOL from your chosen higher timeframe (e.g., show Daily RVOL while trading on a 5-minute chart).
Column colors automatically match your chart’s candle colors (green/red/neutral).
Adjustable lookback period (len) and selectable source timeframe (D, W, or M).
Pre-drawn horizontal guide levels at 1.0, 1.2, 1.5, 2, 3, and 5 for quick interpretation.
Compatible with all chart types, including Heikin Ashi or custom color schemes.
Typical Use
Swing trading:
Look for quiet bases where RVOL stays 0.4–0.9, then expansion ≥2 on breakout days.
Confirm follow-through when green days keep RVOL ≥1.2–1.5 and red pullbacks stay below 1.0.
Day trading:
Watch intraday RVOL (on 1–5m charts) for bursts ≥2 that sustain for several bars — this signals crowd engagement and valid momentum.
Interpretation Summary
RVOL Value Meaning Typical Action
0.4–0.9 Quiet base / low interest Watch for setup
1.0 Normal activity Neutral
1.2–1.5 Valid participation Early confirmation
2–3 Strong expansion Momentum / breakout
≥5 Climax / exhaustion Take profits or avoid new entries
Author’s note:
RVOL isn’t directional; it tells how many players are active, not who’s winning. Combine it with structure (levels, VWAP, or trend) to see when the market crowd truly commits.
Auto Session Fib/Open LevelsThis indicator automatically plots fib levels and key opening levels so you don't have to (:
Default levels are set to Longhorn Trades (Peter Kennedy) fib settings and two key openings of my liking.
Advanced Order Blocks - Z-Score DetectionThis advanced Pine Script indicator identifies high-probability order blocks using statistical Z-score analysis combined with trend filtering.Key Features:
-Z-Score Detection: Identifies institutional order blocks by detecting abnormal price movements using statistical deviation analysis
-Smart Zone Mapping: Automatically draws and manages bullish/bearish order block zones with customizable colors and transparency
-EMA Trend Filter: 750-period EMA filter ensures signals align with the dominant trend (bullish signals above EMA, bearish below)
-Rejection Signals: Detects when price bounces off order block zones, indicating strong support/resistance
-Zone Management: Automatic zone extension, mitigation detection, and age-based expiration
-Overlap Prevention: Optional setting to avoid cluttered charts by preventing overlapping zones
-Fully Customizable: Adjustable Z-score threshold, lookback periods, colors, and rejection sensitivity
How It Works:
The indicator calculates the Z-score of price changes to identify impulse moves. When an abnormal move occurs (beyond the threshold), it marks the preceding consolidation zone as an order block where institutions likely placed their orders. The EMA filter ensures you only trade in the direction of the overall trend.Perfect for swing traders and institutional-style trading on any timeframe.
Curvature Tensor Pivots🌀 Curvature Tensor Pivots
Curvature Tensor Pivots: Geometric Pivot Detection Through Differential Geometry
Curvature Tensor Pivots applies mathematical differential geometry to market price analysis, identifying pivots by measuring how price trajectories bend through space. Unlike traditional pivot indicators that rely solely on price highs and lows, this system calculates the actual geometric curvature of price paths and detects inflection points where the curvature changes sign or magnitude—the mathematical hallmarks of directional transitions.
The indicator combines three components: precise curvature measurement using second-derivative calculus, tensor weighting that multiplies curvature by volatility and momentum, and a tension-based prediction system that identifies compression before pivots form. This creates a forward-looking pivot detector with built-in confirmation mechanics.
What Makes This Original
Pure Mathematical Foundation
This indicator implements the classical differential geometry curvature formula κ = |y''| / (1 + y'²)^(3/2), which measures how sharply a curve bends at any given point. In price analysis, high curvature indicates sharp directional changes (active pivots), while curvature approaching zero indicates straight-line motion (inflection points forming). This mathematical approach is fundamentally different from pattern recognition or statistical pivots—it measures the actual geometry of price movement.
Tensor Weighting System
The core innovation is the tensor scoring mechanism, which multiplies geometric curvature by two market-state variables: volatility (ATR expansion/compression) and momentum (rate of change strength). This creates a multi-dimensional strength metric that distinguishes between meaningful pivots and noise. A high tensor score means high curvature is occurring during significant volatility with strong momentum—a genuine structural turning point. Low tensor scores during high curvature indicate choppy, low-conviction moves.
Tension-Based Prediction
The system calculates tension as the inverse of curvature (Tension = 1 - κ). When curvature is low, tension is high, indicating price is moving in a straight line and approaching an inflection point where it must curve. The tension cloud visualizes this compression, tightening before pivots form and expanding after they complete. This provides anticipatory signals rather than purely reactive confirmation.
Integrated Confirmation Architecture
Rather than simply flagging high curvature, the system requires convergence of four elements: geometric inflection detection (sign changes in second derivative or curvature extrema), traditional price structure pivots (pivot highs/lows), tensor strength above threshold, and minimum spacing between signals. This multi-layer confirmation prevents false signals while maintaining sensitivity to genuine turning points.
This is not a combination of existing indicators—it's an application of pure mathematical concepts (differential calculus and tensor algebra) to market geometry, creating a unique analytical framework.
Core Components and How They Work Together
1. Differential Geometry Engine
The foundation is calculus-based trajectory analysis. The system treats price as a function y(t) and calculates:
First derivative (y'): The slope of the price trajectory, representing directional velocity
Second derivative (y''): The acceleration of slope change, representing how quickly direction is shifting
Curvature (κ): The normalized geometric bend, calculated using the formula κ = |y''| / (1 + y'²)^(3/2)
This curvature value is then normalized to a 0-1 range using adaptive statistical bounds (mean ± 2 standard deviations over a rolling window). High κ values indicate sharp bends (active pivots), while κ approaching zero indicates inflection points where the trajectory is straightening before changing concavity.
2. Tensor Weighting Components
The raw curvature is weighted by market dynamics to create the tensor score:
Volatility Component: Calculated as current ATR divided by baseline ATR (smoothed average). Values above 1.0 indicate expansion (higher conviction moves), while values below 1.0 indicate compression (lower reliability). This ensures pivots forming during volatile periods receive higher scores than those in quiet conditions.
Momentum Component: Measured using rate of change (ROC) strength normalized by recent average. High momentum indicates sustained directional pressure, confirming that curvature changes represent genuine trend shifts rather than noise.
Tensor Score Fusion: The final tensor score = κ × Volatility × Momentum × Direction × Gain. This creates a directional strength metric ranging from -1 (strong bearish curvature) to +1 (strong bullish curvature). The magnitude represents conviction, while the sign represents direction.
These components work together by filtering geometric signals through market-state context. A high curvature reading during low volatility and weak momentum produces a low tensor score (likely noise), while the same curvature during expansion and strong momentum produces a high tensor score (likely genuine pivot).
3. Inflection Point Detection System
Inflection points occur where the second derivative changes sign (concave to convex or vice versa) or where curvature reaches local extrema. The system detects these through multiple methods:
Sign change detection: When y'' crosses zero, the price trajectory is transitioning from curving upward to downward (or vice versa)
Curvature extrema: When κ reaches a local maximum or minimum, indicating peak bend intensity
Near-zero curvature: When κ falls below an adaptive threshold, indicating straight-line motion before a directional change
These geometric signals are combined with traditional pivot detection (pivot highs and lows using configurable lookback/lookahead periods) to create confirmed inflection zones. The geometric math identifies WHERE inflections are forming, while price structure confirms WHEN they've completed.
4. Tension Cloud Prediction
Tension is calculated as 1 - κ, creating an inverse relationship where low curvature produces high tension. This represents the "straightness" of price trajectory—when price moves in a straight line, it's building tension that must eventually release through a curved pivot.
The tension cloud width adapts to this tension value: it tightens (narrows) when curvature is low and tension is high, providing visual warning that a pivot is forming. After the pivot completes and curvature increases, tension drops and the cloud expands, confirming the turn.
This creates a leading indicator component within the system: watch for the cloud to compress, then wait for the pivot marker and tensor direction confirmation to enter trades.
5. Multi-Layer Visualization System
The visual components work hierarchically:
Curvature ribbons (foundation): Width expands with curvature magnitude, color shifts with tensor direction (green bullish, red bearish)
Tension cloud (prediction): Purple overlay that compresses before pivots and expands after
Tensor waves (context): Harmonic oscillating layers driven by three phase accumulators (curvature, tensor magnitude, volatility), creating visual texture that becomes erratic before pivots and smooth during trends
Inflection zones (timing): Golden background highlighting when geometric conditions indicate inflection points forming
Pivot markers (confirmation): Triangles marking confirmed pivots where geometric inflection + price structure + tensor strength all align
Each layer adds information without redundancy: ribbons show current state, tension shows prediction, waves show regime character, zones show geometric timing, and markers show confirmed entries.
Calculation Methodology
Phase 1 - Derivative Calculations
Price is normalized by dividing by a 50-period moving average to improve numerical stability. The first derivative is calculated as the bar-to-bar change, then smoothed using a configurable smoothing length (default 3 bars) to reduce noise while preserving structure.
The second derivative is calculated as the bar-to-bar change in the first derivative, also smoothed. This represents the acceleration of directional change—positive values indicate price is curving upward (concave up), negative values indicate curving downward (concave down).
Phase 2 - Curvature Formula
The classical curvature formula is applied:
Calculate y'² (first derivative squared)
Calculate (1 + y'²)^1.5 as the denominator
Divide |y''| by this denominator to get raw curvature κ
This formula ensures curvature is properly normalized regardless of the steepness of the trajectory. A vertical line with high slope (large y') can still have low curvature (straight), while a gradual slope with changing direction produces high curvature (curved).
The raw curvature is then normalized to 0-1 range using adaptive bounds (rolling mean ± 2 standard deviations), allowing the system to adapt to different market volatility regimes.
Phase 3 - Tensor Weighting
ATR is calculated over the specified volatility length (default 14). Current ATR is divided by smoothed ATR to create the volatility ratio. Momentum is calculated as the rate of change over the momentum length (default 10), normalized by recent average ROC.
The tensor score is computed as: Curvature × Volatility × Momentum × Tensor Gain × Direction Sign
This creates the final directional strength metric used for ribbon coloring and signal generation.
Phase 4 - Inflection Detection
Multiple conditions are evaluated simultaneously:
Second derivative sign changes (y'' × y'' < 0)
Curvature local maxima (previous bar κ > current bar κ AND previous bar κ > two bars ago κ)
Curvature local minima (opposite condition)
Low curvature threshold (current κ < adaptive threshold)
Any of these conditions triggers inflection zone highlighting. For confirmed pivot signals, inflection detection must coincide with traditional pivot highs/lows AND tensor magnitude must exceed threshold AND minimum spacing since last signal must be satisfied.
Phase 5 - Tension Calculation
Tension = 1 - κ (smoothed)
This inverse relationship creates the compression/expansion dynamic. When curvature approaches zero (straight trajectory), tension approaches 1 (maximum compression). When curvature is high (sharp bend), tension approaches zero (released).
The tension cloud bands are calculated as: Basis ± (Ribbon Width × Tension)
This creates the visual tightening effect before pivots.
Phase 6 - Wave Generation
Three phase accumulators are maintained:
Phase 1: Accumulates based on curvature magnitude (0.1 × κ per bar)
Phase 2: Accumulates based on tensor magnitude (0.15 × tensor per bar)
Phase 3: Accumulates based on volatility (0.08 × volatility per bar)
For each wave layer (2-8 configurable), a unique frequency is used (layer number × 0.6). The wave offset is calculated as:
Amplitude × (sin(phase1 × frequency) × 0.4 + sin(phase2 × frequency × 1.2) × 0.35 + sin(phase3 × frequency × 0.8) × 0.25)
This creates complex harmonic motion that reflects the interplay of curvature, strength, and volatility. When these components are aligned, waves are smooth; when misaligned (pre-pivot conditions), waves become chaotic.
All calculations are deterministic and execute on closed bars only—there is no repainting.
How to Use This Indicator
Setup and Configuration
Apply the indicator to your chart with default settings initially
Enable the main dashboard (top right recommended) to monitor curvature, tensor, and tension metrics in real-time
Enable the curvature matrix (bottom right) to see historical patterns in the heatmap
Choose your ribbon mode: "Dual Ribbon" shows both bullish and bearish zones, "Tension Cloud" emphasizes the compression zones
For your first session, observe how the tension cloud behaves before confirmed pivots—you'll notice it consistently tightens (narrows) before pivot markers appear, then expands after.
Signal Interpretation
High Pivot (Bearish) - Red triangle above price:
Occurs when price makes a pivot high (local maximum)
Second derivative is negative (concave down curvature)
Tensor magnitude exceeds threshold (strong confirmation)
Minimum spacing requirement met (noise filter)
Interpretation: A confirmed bearish inflection point has formed. Price trajectory has curved over and is transitioning from upward to downward movement.
Low Pivot (Bullish) - Blue triangle below price:
Occurs when price makes a pivot low (local minimum)
Second derivative is positive (concave up curvature)
Tensor magnitude exceeds threshold
Spacing requirement met
Interpretation: A confirmed bullish inflection point has formed. Price trajectory has curved upward and is transitioning from downward to upward movement.
Dashboard Metrics
κ (Curvature): 0-100% reading. Above 70% = sharp active pivot, 40-70% = moderate curve, below 40% = gentle or approaching inflection
Tensor: Directional strength. Arrow indicates bias (⬆ bullish, ⬇ bearish, ⬌ neutral). Magnitude indicates conviction.
Volatility: Current ATR expansion state. Above 70% = high volatility (pivots more significant), below 40% = compressed (pivots less reliable)
Momentum: Directional strength. High values confirm trend continuation, low values suggest exhaustion
Tension: 0-100% reading. Above 70% = pivot forming soon (high compression), below 40% = pivot recently completed (expanded)
State: Real-time regime classification:
"🟢 STABLE" = normal trending conditions
"🟡 TENSION" = pivot forming (high compression)
"🔴 HIGH κ" = active sharp pivot in progress
"⚠ INFLECTION" = geometric inflection zone (critical transition)
Curvature Matrix Heatmap
The matrix shows the last 30 bars (configurable 10-100) of historical data across five metrics:
κ row: Curvature evolution (green = low, yellow = moderate, red = high)
Tension row: Purple intensity shows compression building
Tensor row: Strength evolution (green = strong, yellow = moderate, red = weak)
Volatility row: Expansion state
Momentum row: Directional conviction
Pattern recognition: Look for purple clustering in the tension row followed by red spikes in the κ row—this shows compression → release pivot sequence.
Trading Workflow
Step 1 - Monitor Tension:
Watch the tension cloud and dashboard tension metric. When tension rises above 60-70% and the cloud visibly tightens, a pivot is building. The matrix will show purple bands clustering.
Step 2 - Identify Inflection Zone:
Wait for the golden background glow (inflection zone) to appear. This indicates the geometric conditions are met: curvature is approaching zero, second derivative is near sign change, or curvature extrema detected. The dashboard state will show "⚠ INFLECTION ZONE".
Step 3 - Confirm Direction:
Check the tensor arrow in the dashboard:
⬆ (bullish tensor) = expect bullish pivot
⬇ (bearish tensor) = expect bearish pivot
Also verify the y'' status in the dashboard:
"🔵↑ Concave Up" = bullish curvature forming
"🔴↓ Concave Down" = bearish curvature forming
Step 4 - Wait for Pivot Marker:
Do not enter on inflection zones alone—wait for the confirmed pivot marker (triangle). This ensures all confirmation layers have aligned: geometric inflection + price structure pivot + tensor strength + spacing filter.
Step 5 - Execute Entry:
Long entry: Blue triangle below price + ⬆ tensor + tension releasing (dropping)
Short entry: Red triangle above price + ⬇ tensor + tension releasing
Step 6 - Manage Risk:
Initial stop: Place beyond the opposite ribbon edge plus one ATR buffer
Trailing stop: Follow the ribbon edge (basis ± adaptive width) as curvature sustains in your direction
Exit signal: If tension spikes again quickly (another inflection forming), consider taking profit—the trend may be reversing
Best Practices
Use multiple timeframe confirmation: Check that higher timeframe tensor aligns with your trade direction
Respect the spacing filter: If a pivot just fired, wait for minimum spacing before taking another signal
Distinguish regime: In "🔴 HIGH κ" state (choppy), reduce position size; in "🟢 STABLE" state, full confidence
Combine with support/resistance: Pivots near key levels have higher probability
Watch particle density: Clustering of particles indicates rising curvature intensity
Observe wave texture: Smooth flowing waves = trending environment (pivots are reversals); chaotic erratic waves = reversal environment (pivots are trend starts)
Ideal Market Conditions
Best Performance
Liquid markets with clear swing structure (forex majors, large-cap stocks, major indices)
Timeframes from 15-minute to daily (the system adapts across timeframes)
Markets with periodic swings and clear directional phases (where geometric curvature is meaningful)
Trending markets with consolidation phases (where tension builds before breakouts)
Challenging Conditions
Extremely choppy/sideways markets for extended periods (high curvature but low tensor magnitude—system will reduce signals appropriately)
Very low liquidity instruments (erratic price action creates false geometric signals)
Ultra-low timeframes (1-minute or below) where spread and noise dominate structure
Markets in deep consolidation (the system will show high tension but no clean pivot confirmation)
The indicator is designed to adapt: in poor conditions, tensor scores remain low and signals reduce naturally. In optimal conditions, tension compression → inflection → pivot confirmation sequences occur cleanly.
Parameter Optimization by Trading Style
Scalping (5-15 Minute Charts)
Curvature Window: 3-5 (faster response)
Curvature Smoothing: 2 (minimal lag)
Volatility Length: 10-14
Momentum Length: 8-10
Tensor Gain: 1.2-1.5 (moderate sensitivity)
Inflection Threshold: 0.10-0.15 (more sensitive)
Min Pivot Spacing: 3-5 bars
Pivot Mode: Aggressive
Ribbon Mode: Dual Ribbon (clearer entries)
Day Trading (15-60 Minute Charts)
Curvature Window: 5 (default)
Curvature Smoothing: 3 (balanced)
Volatility Length: 14
Momentum Length: 10
Tensor Gain: 1.5 (default)
Inflection Threshold: 0.15 (default)
Min Pivot Spacing: 5-8 bars
Pivot Mode: Normal or Adaptive
Ribbon Mode: Dual Ribbon
Swing Trading (4-Hour to Daily Charts)
Curvature Window: 7-10 (smoother)
Curvature Smoothing: 4-5 (noise reduction)
Volatility Length: 20-30
Momentum Length: 14-20
Tensor Gain: 1.8-2.5 (higher conviction requirement)
Inflection Threshold: 0.20-0.30 (more selective)
Min Pivot Spacing: 8-12 bars
Pivot Mode: Conservative
Ribbon Mode: Tension Cloud (focus on compression zones)
Performance Optimization
If you experience lag on lower-end systems:
Reduce Wave Layers: 4 → 2 (50% reduction in calculations)
Lower Particle Density: 3 → 1 (66% reduction in label creation)
Decrease Matrix History: 30 → 15 bars (50% reduction in table size)
Disable Tensor Waves entirely if not needed for your trading
Important Disclaimers
- This indicator is a technical analysis tool designed to identify potential pivot points through mathematical analysis of price trajectory geometry. It should not be used as a standalone trading system. Always combine with proper risk management, position sizing, and additional confirmation methods (support/resistance, volume analysis, multi-timeframe alignment).
- The curvature and tensor calculations are deterministic mathematical formulas applied to historical price data—they do not predict future price movements with certainty. Past geometric patterns do not guarantee future pivot behavior. The tension-based prediction system identifies conditions where pivots are likely to form based on trajectory straightness, but market conditions can change rapidly.
- All trading involves risk. Use appropriate stop losses and never risk more than you can afford to lose. The signal spacing filters and tensor confirmation layers are designed to reduce noise, but no indicator can eliminate false signals entirely.
This system is most effective when combined with sound trading principles, market context awareness, and disciplined execution.
Technical Notes
All calculations execute on closed bars only (no repainting)
Lookback functions limited to 5000 bars maximum
Arrays are fixed-size (waves) or hard-capped (particles at 80 labels)
Dashboard and matrix update only on the last bar to minimize computational load
Particle generation throttled to every 2 bars
Phase accumulators use modulo operations to prevent overflow
Statistical normalization (mean ± 2σ) automatically adapts to different volatility regimes
— Dskyz, Trade with insight. Trade with anticipation.
Auto Option Premium Viewer - csgnanamThat's a great idea! Clear documentation is key for anyone using your script. Since your selected code block is the dedicated space for documentation, I'll provide an explanation tailored for that context, covering the main features of your "Auto Option Premium Viewer" Canvas.
Here is a detailed explanation of the script's core functionality, which you can use in your Canvas description or in a separate document to help users understand it.
I will not edit the Canvas itself, as you requested a separate explanation.
***
### Explanation of the "Auto Option Premium Viewer" Canvas
This Pine Script indicator, **"Auto Option Premium Viewer — Full Auto Symbols (NSE format, improved detection),"** is designed to automatically fetch and display the At-The-Money (ATM) Call and Put option premiums for major NSE indices (NIFTY, BANKNIFTY, MIDCPNIFTY, FINNIFTY) in real-time.
The primary goal is to provide a single, clean chart overlay showing the total premium (CE + PE) for the options closest to the current spot price, without requiring the user to manually enter strike prices or steps.
#### 1. Automatic Index Detection (`AUTO` Functionality)
* **Smart Underlying Detection:** The script attempts to automatically detect the index you are currently viewing (`activeUnderlying`). For example, if your chart is set to `BANKNIFTY`, the indicator automatically focuses on Bank Nifty options.
* **Spot Ticker Mapping (The Fix):** To accurately find the spot price, the script uses a helper function (`getSpotTicker`) to map the common index name (like `FINNIFTY`) to the specific underlying ticker required by TradingView (like `CNXFINANCE` or `NIFTY_MID_SELECT`). This ensures accurate price referencing for ATM calculation across all indices.
#### 2. Fully Automated Strike & Step Sizing
* **No Base Strike Inputs:** The script dynamically calculates the At-The-Money (ATM) strike price based on the live spot price of the underlying index.
* **Fixed Strike Steps:** The strike increment (`current_step`) is hardcoded based on market conventions:
* **100:** NIFTY, BANKNIFTY, FINNIFTY
* **50:** MIDCPNIFTY
* **Dynamic ATM Calculation:** The live spot price is rounded to the nearest valid strike based on the correct step size. This automatically determines the central strike (B), along with the adjacent strikes (A and C) to ensure the fetched data is always relevant.
#### 3. Data Fetching and Display
* **Symbol Construction:** The `buildSymbol` function creates the exact NSE option symbol string (e.g., `NSE:NIFTY251028C26000`) required by the `request.security` function.
* **Option Price Request:** The script uses `request.security` to fetch the closing price (`close`) of the Call and Put options for the three relevant strikes (A, B, C) on a fixed **5-minute** timeframe (`dataTF`).
* **Plots:** The indicator displays three lines on the chart's lower panel:
1. **ATM CE Premium:** The price of the Call option closest to ATM.
2. **ATM PE Premium:** The price of the Put option closest to ATM.
3. **ATM Total Premium:** The sum of CE + PE, often used as a proxy for the minimum expected range or implied volatility.
This automatic setup makes the Canvas extremely efficient for quick analysis without needing to manually adjust any numerical settings.
Cruce TEMA SMMA con Alarma a 12 Barras LLUCes un cruce de TEMA SMMA, luego del cruce contar 12 barras controladas por otros
Gold vs Bitcoin (2012=100)**Chart Description: Gold vs. Bitcoin Performance Index (2012=100)**
This chart presents a comparative analysis of the price performance of Gold and Bitcoin, indexed to a common baseline of 100 in the year 2012. This methodology allows for a direct and proportional comparison of their growth trajectories over the subsequent period.
The visualization pits Gold, the quintessential traditional store of value and a safe-haven asset for millennia, against Bitcoin, a decentralized digital currency that has emerged as a prominent new asset class, often referred to as "digital gold."
The indexed performance starkly illustrates the profound divergence in the assets' valuation paths since 2012. Gold's trajectory reflects its established role as a stable, low-volatility hedge against economic uncertainty, demonstrating modest and steady appreciation. In contrast, Bitcoin's path is characterized by exponential, albeit highly volatile, growth. This highlights its nature as a high-risk, high-reward asset, driven by factors such as network effects, technological adoption, and speculative interest.
Ultimately, this comparative view offers a powerful narrative on the shifting landscape of value storage and investment. It captures the disruptive potential of digital assets in the modern financial ecosystem and provides a clear illustration of the contrasting risk and return profiles between traditional and emerging safe-haven assets over the past decade.
Todays Session Open LN,NYWhen are the Asian, London and New York open for each session simple stuff trading view made me right more stuff so i can publish this what to do c'est la vie
EXTPO TRENDIndicator designed for traders who prefer quick scalping or day trading.
Applicable to timeframes below M15.
Currently, I’m using it on BTC M1.
Note:
When the status is Buy, only buy signals will appear.
When the status is Sell, only sell signals will appear.
When the status is Off, no signals will appear because one of the entry conditions is not met.
Luxy BIG beautiful Dynamic ORBThis is an advanced Opening Range Breakout (ORB) indicator that tracks price breakouts from the first 5, 15, 30, and 60 minutes of the trading session. It provides complete trade management including entry signals, stop-loss placement, take-profit targets, and position sizing calculations.
The ORB strategy is based on the concept that the opening range of a trading session often acts as support/resistance, and breakouts from this range tend to lead to significant moves.
What Makes This Different?
Most ORB indicators simply draw horizontal lines and leave you to figure out the rest. This indicator goes several steps further:
Multi-Stage Tracking
Instead of just one ORB timeframe, this tracks FOUR simultaneously (5min, 15min, 30min, 60min). Each stage builds on the previous one, giving you multiple trading opportunities throughout the session.
Active Trade Management
When a breakout occurs, the indicator automatically calculates and displays entry price, stop-loss, and multiple take-profit targets. These lines extend forward and update in real-time until the trade completes.
Cycle Detection
Unlike indicators that only show the first breakout, this tracks the complete cycle: Breakout → Retest → Re-breakout. You can see when price returns to test the ORB level after breaking out (potential re-entry).
Failed Breakout Warning
If price breaks out but quickly returns inside the range (within a few bars), the label changes to "FAILED BREAK" - warning you to exit or avoid the trade.
Position Sizing Calculator
Built-in risk management that tells you exactly how many shares to buy based on your account size and risk tolerance. No more guessing or manual calculations.
Advanced Filtering
Optional filters for volume confirmation, trend alignment, and Fair Value Gaps (FVG) to reduce false signals and improve win rate.
Core Features Explained
### 1. Multi-Stage ORB Levels
The indicator builds four separate Opening Range levels:
ORB 5 - First 5 minutes (fastest signals, most volatile)
ORB 15 - First 15 minutes (balanced, most popular)
ORB 30 - First 30 minutes (slower, more reliable)
ORB 60 - First 60 minutes (slowest, most confirmed)
Each level is drawn as a horizontal range on your chart. As time progresses, the ranges expand to include more price action. You can enable or disable any stage and assign custom colors to each.
How it works: During the opening minutes, the indicator tracks the highest high and lowest low. Once the time period completes, those levels become your ORB high and low for that stage.
### 2. Breakout Detection
When price closes outside the ORB range, a label appears:
BREAK UP (green label above price) - Price closed above ORB High
BREAK DOWN (red label below price) - Price closed below ORB Low
The label shows which ORB stage triggered (ORB5, ORB15, etc.) and the cycle number if tracking multiple breakouts.
Important: Signals appear on bar close only - no repainting. What you see is what you get.
### 3. Retest Detection
After price breaks out and moves away, if it returns to test the ORB level, a "RETEST" label appears (orange). This indicates:
The original breakout level is now acting as support/resistance
Potential re-entry opportunity if you missed the first breakout
Confirmation that the level is significant
The indicator requires price to move a minimum distance away before considering it a valid retest (configurable in settings).
### 4. Failed Breakout Detection
If price breaks out but returns inside the ORB range within a few bars (before the breakout is "committed"), the original label changes to "FAILED BREAK" in orange.
This warns you:
The breakout lacked conviction
Consider exiting if already in the trade
Wait for better setup
Committed Breakout: The indicator tracks how many bars price stays outside the range. Only after staying outside for the minimum number of bars does it become a committed breakout that can be retested.
### 5. TP/SL Lines (Trade Management)
When a breakout occurs, colored horizontal lines appear showing:
Entry Line (cyan for long, orange for short) - Your entry price (the ORB level)
Stop Loss Line (red) - Where to exit if trade goes against you
TP1, TP2, TP3 Lines (same color as entry) - Profit targets at 1R, 2R, 3R
These lines extend forward as new bars form, making it easy to track your trade. When a target is hit, the line turns green and the label shows a checkmark.
Lines freeze (stop updating) when:
Stop loss is hit
The final enabled take-profit is hit
End of trading session (optional setting)
### 6. Position Sizing Dashboard
The dashboard (bottom-left corner by default) shows real-time information:
Current ORB stage and range size
Breakout status (Inside Range / Break Up / Break Down)
Volume confirmation (if filter enabled)
Trend alignment (if filter enabled)
Entry and Stop Loss prices
All enabled Take Profit levels with percentages
Risk/Reward ratio
Position sizing: Max shares to buy and total risk amount
Position Sizing Example:
If your account is $25,000 and you risk 1% per trade ($250), and the distance from entry to stop loss is $0.50, the calculator shows you can buy 500 shares (250 / 0.50 = 500).
### 7. FVG Filter (Fair Value Gap)
Fair Value Gaps are price inefficiencies - gaps left by strong momentum where one candle's high doesn't overlap with a previous candle's low (or vice versa).
When enabled, this filter:
Detects bullish and bearish FVGs
Draws semi-transparent boxes around these gaps
Only allows breakout signals if there's an FVG near the breakout level
Why this helps: FVGs indicate institutional activity. Breakouts through FVGs tend to be stronger and more reliable.
Proximity setting: Controls how close the FVG must be to the ORB level. 2.0x means the breakout can be within 2 times the FVG size - a reasonable default.
### 8. Volume & Trend Filters
Volume Filter:
Requires current volume to be above average (customizable multiplier). High volume breakouts are more likely to sustain.
Set minimum multiplier (e.g., 1.5x = 50% above average)
Set "strong volume" multiplier (e.g., 2.5x) that bypasses other filters
Dashboard shows current volume ratio
Trend Filter:
Only shows breakouts aligned with a higher timeframe trend. Choose from:
VWAP - Price above/below volume-weighted average
EMA - Price above/below exponential moving average
SuperTrend - ATR-based trend indicator
Combined modes (VWAP+EMA, VWAP+SuperTrend) for stricter filtering
### 9. Pullback Filter (Advanced)
Purpose:
Waits for price to pull back slightly after initial breakout before confirming the signal.
This reduces false breakouts from immediate reversals.
How it works:
- After breakout is detected, indicator waits for a small pullback (default 2%)
- Once pullback occurs AND price breaks out again, signal is confirmed
- If no pullback within timeout period (5 bars), signal is issued anyway
Settings:
Enable Pullback Filter: Turn this filter on/off
Pullback %: How much price must pull back (2% is balanced)
Timeout (bars): Max bars to wait for pullback (5 is standard)
When to use:
- Choppy markets with many fake breakouts
- When you want higher quality signals
- Combine with Volume filter for maximum confirmation
Trade-off:
- Better signal quality
- May miss some valid fast moves
- Slight entry delay
How to Use This Indicator
### For Beginners - Simple Setup
Add the indicator to your chart (5-minute or 15-minute timeframe recommended)
Leave all default settings - they work well for most stocks
Watch for BREAK UP or BREAK DOWN labels to appear
Check the dashboard for entry, stop loss, and targets
Use the position sizing to determine how many shares to buy
Basic Trading Plan:
Wait for a clear breakout label
Enter at the ORB level (or next candle open if you're late)
Place stop loss where the red line indicates
Take profit at TP1 (50% of position) and TP2 (remaining 50%)
### For Advanced Traders - Customized Setup
Choose which ORB stages to track (you might only want ORB15 and ORB30)
Enable filters: Volume (stocks) or Trend (trending markets)
Enable FVG filter for institutional confirmation
Set "Track Cycles" mode to catch retests and re-breakouts
Customize stop loss method (ATR for volatile stocks, ORB% for stable ones)
Adjust risk per trade and account size for accurate position sizing
Advanced Strategy Example:
Enable ORB15 only (disable others for cleaner chart)
Turn on Volume filter at 1.5x with Strong at 2.5x
Enable Trend filter using VWAP
Set Signal Mode to "Track Cycles" with Max 3 cycles
Wait for aligned breakouts (Volume + Trend + Direction)
Enter on retest if you missed the initial break
### Timeframe Recommendations
5-minute chart: Scalping, very active trading, crypto
15-minute chart: Day trading, balanced approach (most popular)
30-minute chart: Swing entries, less screen time
60-minute chart: Position trading, longer holds
The indicator works on any intraday timeframe, but ORB is fundamentally a day trading strategy. Daily charts don't make sense for ORB.
DEFAULT CONFIGURATION
ON by Default:
• All 4 ORB stages (5/15/30/60)
• Breakout Detection
• Retest Labels
• All TP levels (1/1.5/2/3)
• TP/SL Lines (Detailed mode)
• Dashboard (Bottom Left, Dark theme)
• Position Size Calculator
OFF by Default (Optional Filters):
• FVG Filter
• Pullback Filter
• Volume Filter
• Trend Filter
• HTF Bias Check
• Alerts
Recommended for Beginners:
• Leave all defaults
• Session Mode: Auto-Detect
• Signal Mode: Track Cycles
• Stop Method: ATR
• Add Volume Filter if trading stocks
Recommended for Advanced:
• Enable ORB15 + ORB30 only (disable 5 & 60)
• Enable: Volume + Trend + FVG
• Signal Mode: Track Cycles, Max 3
• Stop Method: ATR or Safer
• Enable HTF Daily bias check
## Settings Guide
The settings are organized into logical groups. Here's what each section controls:
### ORB COLORS Section
Show Edge Labels: Display "ORB 5", "ORB 15" labels at the right edge of the levels
Background: Fill the area between ORB high/low with color
Transparency: How see-through the background is (95% is nearly invisible)
Enable ORB 5/15/30/60: Turn each stage on or off individually
Colors: Assign colors to each ORB stage for easy identification
### SESSION SETTINGS Section
Session Mode: Choose trading session (Auto-Detect works for most instruments)
Custom Session Hours: Define your own hours if needed (format: HHMM-HHMM)
Auto-Detect uses the instrument's natural hours (stocks use exchange hours, crypto uses 24/7).
### BREAKOUT DETECTION Section
Enable Breakout Detection: Master switch for signals
Show Retest Labels: Display retest signals
Label Size: Visual size for all labels (Small recommended)
Enable FVG Filter: Require Fair Value Gap confirmation
Show FVG Boxes: Display the gap boxes on chart
Signal Mode: "First Only" = one signal per direction per day, "Track Cycles" = multiple signals
Max Cycles: How many breakout-retest cycles to track (6 is balanced)
Breakout Buffer: Extra distance required beyond ORB level (0.1-0.2% recommended)
Min Distance for Retest: How far price must move away before retest is valid (2% recommended)
Min Bars Outside ORB: Bars price must stay outside for committed breakout (2 is balanced)
### TARGETS & RISK Section
Enable Targets & Stop-Loss: Calculate and show trade management
TP1/TP2/TP3 checkboxes: Select which profit targets to display
Stop Method: How to calculate stop loss placement
- ATR: Based on volatility (best for most cases)
- ORB %: Fixed % of ORB range
- Swing: Recent swing high/low
- Safer: Widest of all methods
ATR Length & Multiplier: Controls ATR stop distance (14 period, 1.5x is standard)
ORB Stop %: Percentage beyond ORB for stop (20% is balanced)
Swing Bars: Lookback period for swing high/low (3 is recent)
### TP/SL LINES Section
Show TP/SL Lines: Display horizontal lines on chart
Label Format: "Short" = minimal text, "Detailed" = shows prices
Freeze Lines at EOD: Stop extending lines at session close
### DASHBOARD Section
Show Info Panel: Display the metrics dashboard
Theme: Dark or Light colors
Position: Where to place dashboard on chart
Toggle rows: Show/hide specific information rows
Calculate Position Size: Enable the position sizing calculator
Risk Mode: Risk fixed $ amount or % of account
Account Size: Your total trading capital
Risk %: Percentage to risk per trade (0.5-1% recommended)
### VOLUME FILTER Section
Enable Volume Filter: Require volume confirmation
MA Length: Average period (20 is standard)
Min Volume: Required multiplier (1.5x = 50% above average)
Strong Volume: Multiplier that bypasses other filters (2.5x)
### TREND FILTER Section
Enable Trend Filter: Require trend alignment
Trend Mode: Method to determine trend (VWAP is simple and effective)
Custom EMA Length: If using EMA mode (50 for swing, 20 for day trading)
SuperTrend settings: Period and Multiplier if using SuperTrend mode
### HIGHER TIMEFRAME Section
Check Daily Trend: Display higher timeframe bias in dashboard
Timeframe: What TF to check (D = daily, recommended)
Method: Price vs MA (stable) or Candle Direction (reactive)
MA Period: EMA length for Price vs MA method (20 is balanced)
Min Strength %: Minimum strength threshold for HTF bias to be considered
- For "Price vs MA": Minimum distance (%) from moving average
- For "Candle Direction": Minimum candle body size (%)
- 0.5% is balanced - increase for stricter filtering
- Lower values = more signals, higher values = only strong trends
### ALERTS Section
Enable Alerts: Master switch (must be ON to use any alerts)
Breakout Alerts: Notify on ORB breakouts
Retest Alerts: Notify when price retests after breakout
Failed Break Alerts: Notify on failed breakouts
Stage Complete Alerts: Notify when each ORB stage finishes forming
After enabling desired alert types, click "Create Alert" button, select this indicator, choose "Any alert() function call".
## Tips & Best Practices
### General Trading Tips
ORB works best on liquid instruments (stocks with good volume, major crypto pairs)
First hour of the session is most important - that's when ORB is forming
Breakouts WITH the trend have higher success rates - use the trend filter
Failed breakouts are common - use the "Min Bars Outside" setting to filter weak moves
Not every day produces good ORB setups - be patient and selective
### Position Sizing Best Practices
Never risk more than 1-2% of your account on a single trade
Use the built-in calculator - don't guess your position size
Update your account size monthly as it grows
Smaller accounts: use $ Amount mode for simplicity
Larger accounts: use % of Account mode for scaling
### Take Profit Strategy
Most traders use: 50% at TP1, 50% at TP2
Aggressive: Hold through TP1 for TP2 or TP3
Conservative: Full exit at TP1 (1:1 risk/reward)
After TP1 hits, consider moving stop to breakeven
TP3 rarely hits - only on strong trending days
### Filter Combinations
Maximum Quality: Volume + Trend + FVG (fewest signals, highest quality)
Balanced: Volume + Trend (good quality, reasonable frequency)
Active Trading: No filters or Volume only (many signals, lower quality)
Trending Markets: Trend filter essential (indices, crypto)
Range-Bound: Volume + FVG (avoid trend filter)
### Common Mistakes to Avoid
Chasing breakouts - wait for the bar to close, don't FOMO into wicks
Ignoring the stop loss - always use it, move it manually if needed
Over-leveraging - the calculator shows MAX shares, you can buy less
Trading every signal - quality > quantity, use filters
Not tracking results - keep a journal to see what works for YOU
## Pros and Cons
### Advantages
Complete all-in-one solution - from signal to position sizing
Multiple timeframes tracked simultaneously
Visual clarity - easy to see what's happening
Cycle tracking catches opportunities others miss
Built-in risk management eliminates guesswork
Customizable filters for different trading styles
No repainting - what you see is locked in
Works across multiple markets (stocks, forex, crypto)
### Limitations
Intraday strategy only - doesn't work on daily charts
Requires active monitoring during first 1-2 hours of session
Not suitable for after-hours or extended sessions by default
Can produce many signals in choppy markets (use filters)
Dashboard can be overwhelming for complete beginners
Performance depends on market conditions (trends vs ranges)
Requires understanding of risk management concepts
### Best For
Day traders who can watch the first 1-2 hours of market open
Traders who want systematic entry/exit rules
Those learning proper position sizing and risk management
Active traders comfortable with multiple signals per day
Anyone trading liquid instruments with clear sessions
### Not Ideal For
Swing traders holding multi-day positions
Set-and-forget / passive investors
Traders who can't watch market open
Complete beginners unfamiliar with trading concepts
Low volume / illiquid instruments
## Frequently Asked Questions
Q: Why are no signals appearing?
A: Check that you're on an intraday timeframe (5min, 15min, etc.) and that the current time is within your session hours. Also verify that "Enable Breakout Detection" is ON and at least one ORB stage is enabled. If using filters, they might be blocking signals - try disabling them temporarily.
Q: What's the best ORB stage to use?
A: ORB15 (15 minutes) is most popular and balanced. ORB5 gives faster signals but more noise. ORB30 and ORB60 are slower but more reliable. Many traders use ORB15 + ORB30 together.
Q: Should I enable all the filters?
A: Start with no filters to see all signals. If too many false signals, add Volume filter first (stocks) or Trend filter (trending markets). FVG filter is most restrictive - use for maximum quality but fewer signals.
Q: How do I know which stop loss method to use?
A: ATR works for most cases - it adapts to volatility. Use ORB% if you want predictable stop placement. Swing is for respecting chart structure. Safer gives you the most room but largest risk.
Q: Can I use this for swing trading?
A: Not really - ORB is fundamentally an intraday strategy. The ranges reset each day. For swing trading, look at weekly support/resistance or moving averages instead.
Q: Why do TP/SL lines disappear sometimes?
A: Lines freeze (stop extending) when: stop loss is hit, the last enabled take-profit is hit, or end of session arrives (if "Freeze at EOD" is enabled). This is intentional - the trade is complete.
Q: What's the difference between "First Only" and "Track Cycles"?
A: "First Only" shows one breakout UP and one DOWN per day maximum - clean but might miss opportunities. "Track Cycles" shows breakout-retest-rebreak sequences - more signals but busier chart.
Q: Is position sizing accurate for options/forex?
A: The calculator is designed for shares (stocks). For options, ignore the share count and use the risk amount. For forex, you'll need to adapt the lot size calculation manually.
Q: How much capital do I need to use this?
A: The indicator works for any account size, but practical day trading typically requires $25,000 in the US due to Pattern Day Trader rules. Adjust the "Account Size" setting to match your capital.
Q: Can I backtest this strategy?
A: This is an indicator, not a strategy script, so it doesn't have built-in backtesting. You can visually review historical signals or code a strategy script using similar logic.
Q: Why does the dashboard show different entry price than the breakout label?
A: If you're looking at an old breakout, the ORB levels may have changed when the next stage completed. The dashboard always shows the CURRENT active range and trade setup.
Q: What's a good win rate to expect?
A: ORB strategies typically see 40-60% win rate depending on market conditions and filters used. The strategy relies on positive risk/reward ratios (2:1 or better) to be profitable even with moderate win rates.
Q: Does this work on crypto?
A: Yes, but crypto trades 24/7 so you need to define what "session start" means. Use Session Mode = Custom and set your preferred daily reset time (e.g., 0000-2359 UTC).
## Credits & Transparency
### Development
This indicator was developed with the assistance of AI technology to implement complex ORB trading logic.
The strategy concept, feature specifications, and trading logic were designed by the publisher. The implementation leverages modern development tools to ensure:
Clean, efficient, and maintainable code
Comprehensive error handling and input validation
Detailed documentation and user guidance
Performance optimization
### Trading Concepts
This indicator implements several public domain trading concepts:
Opening Range Breakout (ORB): Trading strategy popularized by Toby Crabel, Mark Fisher and many more talanted traders.
Fair Value Gap (FVG): Price imbalance concept from ICT methodology
SuperTrend: ATR-based trend indicator using public formula
Risk/Reward Ratio: Standard risk management principle
All mathematical formulas and technical concepts used are in the public domain.
### Pine Script
Uses standard TradingView built-in functions:
ta.ema(), ta.atr(), ta.vwap(), ta.highest(), ta.lowest(), request.security()
No external libraries or proprietary code from other authors.
## Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice.
Trading involves substantial risk of loss and is not suitable for every investor. Past performance shown in examples is not indicative of future results.
The indicator provides signals and calculations, but trading decisions are solely your responsibility. Always:
Test strategies on paper before using real money
Never risk more than you can afford to lose
Understand that all trading involves risk
Consider seeking advice from a licensed financial advisor
The publisher makes no guarantees regarding accuracy, profitability, or performance. Use at your own risk.
---
Version: 3.0
Pine Script Version: v6
Last Updated: October 2024
For support, questions, or suggestions, please comment below or send a private message.
---
Happy trading, and remember: consistent risk management beats perfect entry timing every time.
Risk Leverage ToolRisk Leverage Tool – Calculate Position Size and Required Leverage
This script automatically calculates the optimal position size and the leverage needed based on the amount of capital you are willing to risk on a trade. It is designed for traders who want precise control over their risk management.
The script determines the distance between the entry and stop-loss price, calculates the maximum position size that fits within the defined risk, and derives the notional value of the trade. Based on the available margin, it then calculates the required leverage. It also displays the percentage of margin at risk if the stop-loss is hit.
All results are displayed in a table in the top-right corner of the chart. Additionally, a label appears at the entry price level showing the same data.
To use the tool, simply input your planned entry price, stop-loss price, the maximum risk amount in dollars, and the available margin in the settings menu. The script will update all values automatically in real time.
This tool works with any market where capital risk is expressed in absolute terms (such as USD), including futures, CFDs, and leveraged spot positions. For inverse contracts or percentage-based stops, manual adjustment is required.
DXY ChecklistDxy Checklist
Used to stay on track on what the market is performing on index market.
Check list asks questions, when performed we acknowledge the deal done on index.
EXTPO TRENDIndicator designed for traders who prefer quick scalping or day trading.
Applicable to time frames below M15.
Currently, I’m using it on BTC M1.
Note:
When the status is Buy, only buy signals will appear.
When the status is Sell, only sell signals will appear.
When the status is Off, no signals will appear because one of the entry conditions is not met.
Adaptive Trend SelectorThe Adaptive Trend Selector is a comprehensive trend-following tool designed to automatically identify the optimal moving average crossover strategy. It features adjustable parameters and an integrated backtester that delivers institutional-grade insights into the recommended strategy. The model continuously adapts to new data in real time by evaluating multiple moving average combinations, determining the best performing lengths, and presenting the backtest results in a clear, color-coded table that benchmarks performance against the buy-and-hold strategy.
At its core, the model systematically backtests a wide range of moving average combinations to identify the configuration that maximizes the selected optimization metric. Users can choose to optimize for absolute returns or risk-adjusted returns using the Sharpe, Sortino, or Calmar ratios. Alternatively, users can enable manual optimization to test custom fast and slow moving average lengths and view the corresponding backtest results. The label displays the Compounded Annual Growth Rate (CAGR) of the strategy, with the buy-and-hold CAGR in parentheses for comparison. The table presents the backtest results based on the fast and slow lengths displayed at the top:
Sharpe = CAGR per unit of standard deviation.
Sortino = CAGR per unit of downside deviation.
Calmar = CAGR relative to maximum drawdown.
Max DD = Largest peak-to-trough decline in value.
Beta (β) = Return sensitivity relative to buy-and-hold.
Alpha (α) = Excess annualized risk-adjusted returns.
Win Rate = Ratio of profitable trades to total trades.
Profit Factor = Total gross profit per unit of losses.
Expectancy = Average expected return per trade.
Trades/Year = Average number of trades per year.
This indicator is designed with flexibility in mind, enabling users to specify the start date of the backtesting period and the preferred moving average strategy. Supported strategies include the Exponential Moving Average (EMA), Simple Moving Average (SMA), Wilder’s Moving Average (RMA), Weighted Moving Average (WMA), and Volume-Weighted Moving Average (VWMA). To minimize overfitting, users can define constraints such as a minimum and maximum number of trades per year, as well as an optional optimization margin that prioritizes longer, more robust combinations by requiring shorter-length strategies to exceed this threshold. The table follows an intuitive color logic that enables quick performance comparison against buy-and-hold (B&H):
Sharpe = Green indicates better than B&H, while red indicates worse.
Sortino = Green indicates better than B&H, while red indicates worse.
Calmar = Green indicates better than B&H, while red indicates worse.
Max DD = Green indicates better than B&H, while red indicates worse.
Beta (β) = Green indicates better than B&H, while red indicates worse.
Alpha (α) = Green indicates above 0%, while red indicates below 0%.
Win Rate = Green indicates above 50%, while red indicates below 50%.
Profit Factor = Green indicates above 2, while red indicates below 1.
Expectancy = Green indicates above 0%, while red indicates below 0%.
In summary, the Adaptive Trend Selector is a powerful tool designed to help investors make data-driven decisions when selecting moving average crossover strategies. By optimizing for risk-adjusted returns, investors can confidently identify the best lengths using institutional-grade metrics. While results are based on the selected historical period, users should be mindful of potential overfitting, as past results may not persist under future market conditions. Since the model recalibrates to incorporate new data, the recommended lengths may evolve over time.
Market Order BubblesMarket Order Bubbles is a streamlined, volume-driven overlay indicator designed to spotlight sudden spikes in trading activity, highlighting potential shifts in market momentum.
By detecting deviations in volume from its recent average, it plots intuitive bubble markers to reveal aggressive order flows—ideal for traders seeking early warnings of exhaustion or reversal setups in fast-moving markets.
What makes this indicator different
This indicator draws inspiration from established volume analysis tools but stands out with a refined, lightweight approach. Unlike more complex models that layer multiple filters or emulate cumulative metrics, it leverages a weighted moving average (WMA) of volume paired with statistical deviation for a direct, responsive measure of "surge intensity."
This results in cleaner signals with less noise, making it particularly suited for intraday scalpers or swing traders who value simplicity without sacrificing depth. The focus on excess volume relative to a dynamic baseline ensures bubbles only emerge during truly anomalous activity, setting it apart from generic volume oscillators or basic footprint indicators that often flood charts with irrelevant data.
Core Mechanics
At its heart, the indicator computes a smoothed volume baseline using a WMA over a user-defined period, then applies a volatility-adjusted threshold derived from the standard deviation of that same period. A "surge" triggers when actual volume exceeds this baseline plus the threshold, with the excess amount determining bubble size. Price direction (bullish or bearish close) classifies the surge as buying or selling pressure:
Buy Surges (plotted as blue bubbles above the bar): Indicate potential overextension in upward moves.
Sell Surges (plotted as red bubbles below the bar): Flag possible downside fatigue.
Bubble opacity and size scale with surge magnitude—fainter, smaller bubbles for mild excesses; bolder, larger ones for extreme outliers—providing a visual gradient of intensity at a glance.
How to use this tool:
Use this tool as a contrarian edge to anticipate potential pullbacks or reversals, rather than chasing the trend. Large clusters of buy bubbles during a rally could signal "capitulation" from late entrants or forced covers, priming the market for a downside move. Conversely, sell bubbles in a downward move can mark bottoming exhaustion, cueing possible upside bounces.
For best results:
Confluence: Pair with price action, momentum indicators, or other orderflow tools.
Timeframe Flexibility: Excels on low timeframe for day trading; scale up to hourly for swings.
Treat bubbles as filters, not standalone signals—always confirm with broader context.
In essence bubbles don't predict direction but can illuminate when the crowd's aggression might soon flip.
Bubble Sizing and Interpretation
Bubbles are tiered by surge strength for quick assessment:
Small Bubbles: Minor excess — a little more pressure on volume.
Medium Bubbles: Notable excess — moderate alert.
Large Bubbles: Major excess — high-impact event.
Customizing Settings
The indicator keeps things minimal with just two changeable inputs, highlighting quick tweaks without overwhelming options.
WMA Length (default: 100): Controls the lookback for the volume baseline. Increase for smoother, less reactive signals (fewer but more reliable bubbles in volatile assets). Decrease for heightened sensitivity (more frequent alerts in choppy sessions).
Threshold Multiplier (default: 1.5): Scales the deviation buffer. Higher values tighten criteria, reducing bubble frequency for more conservative filtering; lower values loosen it, capturing subtler surges but risking more noise.
These adjustments let traders dial in the indicator to their style.
Better DEMAThe Better DEMA is a new tool designed to recreate the classical moving average DEMA, into a smoother, more reliable tool. Combining many methodologies, this script offers users a unique insight into market behavior.
How does it work?
First, to get a smoother signal, we need to calculate the Gaussian filter. A Gaussian filter is a smoothing filter that reduces noise and detail by averaging data with weights following a Gaussian (bell-shaped) curve.
Now that we have the source, we will calculate the following:
n2 = n/2 (half of the user defined length)
a = 2/(1+n)
ns
Now that we have that out of the way, it is time to get into the core.
Now we calculate 2 EMAs:
slow EMA => EMA over n
fast EMA => EMA over n2 period
Rather then now doing this:
DEMA = fast EMA * 2 - slow EMA
I found this to be better:
DEMA = slow EMA * (1-a) + fast EMA * a
As a last touch I took a little something from the HMA, and used a EMA with period of √n to smooth the entire the thing.
The Trend condition at base is the following (but feel free to FAFO with it):
Long = dema > dema yesterday and dema < src
Short = dema < dema yesterday and dema > src
Methodology
While the DEMA is an amazing tool used in many great indicators, it can be far too noisy.
This made me test out many filters, out of which the Gaussian performed best.
Then I tried out the non subtractive approach and that worked too, as it made it smoother.
Compacting on all I learned and smoothing it bit by bit, I think I can say this is worth looking into :).
Use cases:
Following Trends => classic, effective :)
Smoothing sources for other indicators => if done well enough, could be useful :)
Easy trend visualization => Added extra options for that.
Strategy development => Yes
Another good thing is it does not a high lookback period, so it should be better and less overfit.
That is all for today Gs,
Have fun and enjoy!




















