RSI + VWAP Strategy by vipindaskr🔍 This script combines RSI and VWAP for intraday trend-based entries.
✅ *Buy Signal:*
- Price above VWAP
- RSI > 60
- Green background + up triangle shown
❌ *Sell Signal:*
- Price below VWAP
- RSI < 40
- Red background + down triangle shown
📈 Ideal for Nifty 50 intraday traders using 5-minute chart.
Developed by vipindaskr 💻
Bill Williams Indicators
Improved Weinstein Stage AnalysisThe code provides an actionable, disciplined, and visually informative implementation of the “Stage Analysis” approach pioneered by Stan Weinstein, with enhancements to modernize, automate, and clarify the methodology for today’s traders using TradingView. It faithfully follows the workflow recommended: identify long-term cycles, confirm with volume and relative strength, and only engage aggressively with the market during the advancing (bullish) stage with all “clues” aligned.
William's Awesome Oscillator (AO) - Log-scaledA 5-34-5 MACD plotted as a histogram, aka William's Awesome Oscillator, scaled to log price
William's Accelerator Oscillator (AC) - Log-ScaledA 5-34-5 MACD Histogram, aka William's Accelerator Oscillator, scaled to log price
9:15 Range with 0.09% BufferThis strategy is based on the first 9:15 AM candle for Nifty, which is considered a key reference point (also called the "GAN level entry"). It defines a range around the high and low of the 9:15 candle with a 0.09% buffer on both sides.
The upper buffer level acts as a potential resistance.
The lower buffer level acts as a potential support.
When the price crosses above the upper buffer, it signals a possible entry for a Call option (CE) or a long position.
When the price crosses below the lower buffer, it signals a possible entry for a Put option (PE) or a short position.
This approach helps traders identify early breakout opportunities based on the opening candle range, aiming to capture momentum moves in either direction during the trading session.
SMC Structure Levels – BOS & CHoCH for XAUUSDThis is a custom-made TradingView indicator designed to visualize high-confidence market structure shifts based on Smart Money Concepts (SMC), focusing on Break of Structure (BOS) and Change of Character (CHoCH) points. The tool is optimized for XAUUSD but works across all major forex, crypto, and index markets.
It identifies key pivot points and filters them using both price distance and bar spacing, helping traders focus only on meaningful structural changes — not noisy signals. This makes it ideal for traders looking to track institutional-style price behavior with clarity.
🔑 Key Features:
Clean BOS & CHoCH Labels: The indicator plots “BOS” above candles when a structural break occurs in the trend direction, and “CHoCH” below candles when early signs of a reversal appear.
Spaced Signals: Only plots structure shifts that meet both time and price distance filters, preventing clutter and overplotting on the chart.
Swing-Based Logic: Built on pivot high/low analysis with adjustable sensitivity, ensuring flexible structure detection on any timeframe.
Fully Customizable: Modify:
Swing Sensitivity (number of bars before/after pivot)
Minimum bar spacing between BOS/CHoCH signals
Minimum price movement (in pips) between labels
Toggle BOS or CHoCH visibility individually
No Repainting: Once confirmed, signals remain fixed on the chart for historical review.
Zero Clutter: Unlike typical SMC tools that flood the chart, this indicator prioritizes clarity and signal quality.
🧠 What is BOS & CHoCH?
Break of Structure (BOS): Indicates continuation of the current market trend.
Change of Character (CHoCH): Suggests a potential early trend reversal or shift in momentum.
These tools are often used by Smart Money traders to mark significant turning points and trend confirmations.
⚙️ Use Cases:
Structural tracking in Smart Money Concepts (SMC)
Identifying trend continuation or early reversal
XAUUSD (Gold) swing and intraday analysis
Support for Order Blocks, Liquidity Grabs, and FVG confluence
Backtesting market structure break behavior
📌 Best Pairs:
XAUUSD (Gold)
Any asset where structure-based analysis is relevant
📎 Release Notes:
v1.0 – Initial release of BOS/CHoCH structure tool with spacing and pip-distance filtering for XAUUSD analysis.
⚠️ Disclaimer:
This indicator is built for educational and analytical purposes only. It does not constitute trading advice or guarantee profitable signals. Always use with a proper risk management strategy and confirm signals with additional confluence.
✅ This matches the exact quality and structure of the description you showed earlier.
Just copy this into your TradingView script page when publishing. If you'd like the next version with Order Blocks or FVG, say the word.
Confirmed Entry Grid Pro//@version=5
indicator("Confirmed Entry Grid Pro", overlay=true)
// === المتوسطات ===
ma9 = ta.sma(close, 9)
ma21 = ta.sma(close, 21)
ma200 = ta.sma(close, 200)
// === الاتجاه ===
trendBull = close > ma200
trendBear = close < ma200
// === الزخم ===
rsi = ta.rsi(close, 14)
rsiBull = rsi > 50
rsiBear = rsi < 50
// === الحجم ===
volMA = ta.sma(volume, 20)
volHigh = volume > volMA
// === شموع ابتلاعية ===
bullEngulf = close > open and open < close and close > open
bearEngulf = close < open and open > close and close < open
// === بولنجر باند ===
basis = ta.sma(close, 20)
dev = ta.stdev(close, 20)
upper = basis + 2 * dev
lower = basis - 2 * dev
bbBreakUp = close > upper
bbBreakDown = close < lower
// === دعم / مقاومة ديناميكية ===
support = ta.lowest(low, 20)
resistance = ta.highest(high, 20)
nearSupport = math.abs(close - support) / close < 0.015
nearResistance = math.abs(close - resistance) / close < 0.015
// === تقاطع المتوسطات ===
crossUp = ta.crossover(ma9, ma21)
crossDown = ta.crossunder(ma9, ma21)
// === ATR ===
atr = ta.atr(14)
atrActive = atr > ta.sma(atr, 14)
// === SMC: BOS + CHOCH ===
bosUp = high > high and low > low
bosDown = low < low and high < high
chochUp = close > high and close < high
chochDown = close < low and close > low
smcBuy = bosUp and chochUp
smcSell = bosDown and chochDown
// === مناطق السيولة ===
liqHigh = ta.highest(high, 30)
liqLow = ta.lowest(low, 30)
liquidityBuyZone = close < liqLow
liquiditySellZone = close > liqHigh
// === حساب النقاط لكل صفقة ===
buyScore = (trendBull ? 1 : 0) + (rsiBull ? 1 : 0) + (volHigh ? 1 : 0) + (bullEngulf ? 1 : 0) + (smcBuy ? 1 : 0) + (bbBreakUp ? 1 : 0) + (nearSupport ? 1 : 0) + (crossUp ? 1 : 0) + (atrActive ? 1 : 0) + (liquidityBuyZone ? 1 : 0)
sellScore = (trendBear ? 1 : 0) + (rsiBear ? 1 : 0) + (volHigh ? 1 : 0) + (bearEngulf ? 1 : 0) + (smcSell ? 1 : 0) + (bbBreakDown ? 1 : 0) + (nearResistance ? 1 : 0) + (crossDown ? 1 : 0) + (atrActive ? 1 : 0) + (liquiditySellZone ? 1 : 0)
// === شروط الإشارات مع منع التكرار خلال آخر 5 شموع ===
var int lastBuyBar = na
var int lastSellBar = na
canBuy = buyScore >= 5 and (na(lastBuyBar) or bar_index - lastBuyBar > 5)
canSell = sellScore >= 5 and (na(lastSellBar) or bar_index - lastSellBar > 5)
if canBuy
lastBuyBar := bar_index
if canSell
lastSellBar := bar_index
showBuy = canBuy
showSell = canSell
// === طول الخطوط ===
var int lineLen = 5
// === رسم الإشارات ===
plotshape(showBuy, title="BUY", location=location.belowbar, style=shape.triangleup, size=size.small, color=color.green)
plotshape(showSell, title="SELL", location=location.abovebar, style=shape.triangledown, size=size.small, color=color.red)
// === خطوط الصفقة ===
var line buyLines = array.new_line(0)
var line sellLines = array.new_line(0)
if (showBuy)
entry = low
tpLevels = array.new_float(5)
array.set(tpLevels, 0, 0.618)
array.set(tpLevels, 1, 1.0)
array.set(tpLevels, 2, 1.272)
array.set(tpLevels, 3, 1.618)
array.set(tpLevels, 4, 2.0)
slLevel = -0.618
for i = 0 to 4
tp = entry + array.get(tpLevels, i) * atr
line = line.new(bar_index, tp, bar_index + lineLen, tp, color=color.green)
array.push(buyLines, line)
sl = entry + slLevel * atr
slLine = line.new(bar_index, sl, bar_index + lineLen, sl, color=color.red)
array.push(buyLines, slLine)
if (showSell)
entry = high
tpLevels = array.new_float(5)
array.set(tpLevels, 0, -0.618)
array.set(tpLevels, 1, -1.0)
array.set(tpLevels, 2, -1.272)
array.set(tpLevels, 3, -1.618)
array.set(tpLevels, 4, -2.0)
slLevel = 0.618
for i = 0 to 4
tp = entry + array.get(tpLevels, i) * atr
line = line.new(bar_index, tp, bar_index + lineLen, tp, color=color.green)
array.push(sellLines, line)
sl = entry + slLevel * atr
slLine = line.new(bar_index, sl, bar_index + lineLen, sl, color=color.red)
array.push(sellLines, slLine)
// === نسبة المخاطرة ===
label.new(bar_index, showBuy ? low : na, "Risk: 38.2%", style=label.style_label_left, textcolor=color.white, size=size.tiny, color=color.gray)
label.new(bar_index, showSell ? high : na, "Risk: 38.2%", style=label.style_label_left, textcolor=color.white, size=size.tiny, color=color.gray)
Williams FractalsBoaBias Fractals High & Lows is an indicator based on Bill Williams' fractals that helps identify key support and resistance levels on the chart. It displays horizontal lines at fractal highs (red) and lows (green), which extend to the current bar. Lines automatically disappear if the price breaks through them, leaving only the relevant levels. Additionally, the indicator shows the price values of active fractals on the price scale for convenient monitoring.
Key Features:
Customizable Fractals: Choose between 3-bar or 5-bar fractals (default: 3-bar).
Period: Adjust the number of periods for calculation
Visualization: Red lines for highs (resistance), green for lows (support). Lines are fixed on the chart and persist during scrolling or scaling changes.
Alert System: Notifications for the formation of a new fractal high/low and for level breaks (Fractal High Formed, Fractal Low Formed, Fractal High Broken, Fractal Low Broken).
How to Use:
Add the indicator to the chart.
Configure parameters: select the fractal type (3 or 5 bars) and period.
Set up alerts in TradingView to receive notifications about new fractals or breaks.
Use the lines as levels for entry/exit positions, stop-losses, or take-profits in fractal-based strategies.
Troubleshooting: If Levels Are Not Fixed on the Chart
If the levels (fractal lines) do not stay fixed on the chart and fail to move with it during scrolling or scaling (e.g., they remain stationary while the chart shifts), this is typically due to the indicator's scale settings in TradingView. The indicator may be set to "No scale," causing the lines to desynchronize from the chart's price scale.
What to Do:
Locate the Indicator Label: On the chart, find the indicator label in the top-left corner of the pane (or where "BoaBias Fractals High & Lows" is displayed).
Right-Click the Label: Click the right mouse button on this label.
Adjust the Scale:
In the context menu, look for the "Scale" or "Pin to scale" option.
If it shows "Pin to scale (now no scale)" or similar, select "Pin to right scale" (or "Pin to left scale," depending on your chart's main price scale—usually the right).
Refresh the Chart: After changing the setting, refresh the chart (press F5 or reload the page), or toggle the indicator off and on again to apply the changes.
After this, the lines should move and scale with the chart during scrolling (horizontal or vertical) or zooming. If the issue persists, check:
TradingView Limits: The indicator may draw too many lines (maximum ~500 per script). If there are many historical fractals, older lines might not display.
Chart Settings: Ensure the chart is not in logarithmic scale (if applicable) or that auto-scaling is enabled.
Indicator Version: Verify you are using the latest script version (Pine Script v6) and check for errors in the TradingView console.
This indicator is ideal for traders working with Bill Williams' chaos theory or those seeking dynamic support/resistance levels. It is based on standard fractals but with enhancements for convenience: automatic removal of broken levels and integration with the price scale.
Note: The indicator does not provide trading signals on its own — use it in combination with other tools. Test on historical data before real trading.
Code written in Pine Script v6. Original template: Mit Nayi.
MA Crossover with Dots📘 Strategy Description – Moving Average Crossover with Dot Signals
This indicator is based on a Simple Moving Average (SMA) crossover strategy, which is a classic method to identify trend changes and potential buy/sell signals in the market.
📊 Core Logic:
It calculates two SMAs:
Fast SMA: 20-period moving average (short-term trend)
Slow SMA: 50-period moving average (longer-term trend)
✅ Buy Signal (Green Dot):
When the Fast SMA crosses above the Slow SMA, a Buy signal is generated.
This suggests bullish momentum or the start of an uptrend.
❌ Sell Signal (Red Dot):
When the Fast SMA crosses below the Slow SMA, a Sell signal is generated.
This suggests bearish momentum or the start of a downtrend.
📍 Visual Representation:
The Buy and Sell signals are plotted as colored dots at different levels:
Green dot = Buy
Red dot = Sell
The dots are plotted at fixed vertical positions in a separate panel below the chart for better clarity and to avoid overlap.
Student-t Weighted Acceleration & Velocity⚙️ Student-t Weighted Acceleration & Velocity
Author: © GabrielAmadeusLau
Category: Momentum, Smoothing, Divergence Detection
🔍 Overview
Student-t Weighted Acceleration & Velocity is a precision-engineered momentum indicator designed to analyze the rate of price change (velocity) and rate of change of velocity (acceleration). It leverages Student-t weighted smoothing, bandpass filtering, and divergence detection to reveal underlying momentum trends, shifts, and potential reversals with high sensitivity and low noise.
🧠 Key Features
🌀 1. Student-t Weighted Moving Average
Applies Student-t distribution weights to price data.
Controlled by:
ν (Degrees of Freedom): Lower ν increases weight on recent data, improving sensitivity to fast-moving markets.
Window Length: Sets the lookback period for weighted averaging.
🚀 2. Velocity & Acceleration Calculation
Velocity: Measures how fast price is moving over time.
Acceleration: Measures the change in velocity, revealing turning points.
Both are calculated via:
Butterworth High-pass Filter
Super Smoother Low-pass Filter
Fast Root Mean Square (RMS) normalization
Optionally smoothed using a Super Smoother EMA.
🎯 3. Signal Conditions
Strong Up: When smoothed velocity crosses above the overbought threshold and acceleration is positive.
Strong Down: When smoothed velocity crosses below the oversold threshold and acceleration is negative.
Visual cues:
Green & red triangle shapes for signals.
Colored histogram & column plots.
Optional bar coloring based on A/V behavior.
🔎 4. Divergence Detection Engine
Built-in multi-timeframe divergence system with:
Bullish/Bearish Regular Divergence
Bullish/Bearish Hidden Divergence
Customizable settings:
Pivot detection, confirmation logic, lookback limits.
Heikin Ashi mode for smoothed divergence detection.
Configurable line style, width, and color.
Visual plots of divergence lines on price chart.
⚙️ Custom Inputs
A/V Calculation Parameters:
Lookback period, filter lengths (Butterworth, Super Smoother, RMS), EMA smoothing.
Divergence Settings:
Enable/disable confirmation, show last divergence only.
Adjustable pivot period and max lookback bars.
Heikin Ashi Mode:
Option to use Heikin Ashi candles for divergence detection only (without switching chart type).
Thresholds:
Overbought/Oversold Sigma levels for strong signal detection.
🔔 Alerts Included
Strong Up Alert: Momentum and acceleration aligned bullishly.
Strong Down Alert: Momentum and acceleration aligned bearishly.
All Divergence Types:
Bullish/Bearish Regular Divergence
Bullish/Bearish Hidden Divergence
Aggregated Divergence Alerts
📌 Use Cases
Spot momentum bursts and reversals with confirmation from both velocity and acceleration.
Identify divergence-based signals for early entries/exits.
Apply across multiple timeframes or pair with other trend filters.
combo EMAS Session [Indexprofx]🧠 Description:
This indicator highlights the New York and London trading sessions directly on the chart, offering a clear visual reference for intraday trading.
It is a complementary tool designed to work seamlessly with our main system: Intraday Signal.
✔️ Displays the most active market hours.
✔️ Enhances precision in entry and exit decisions.
✔️ Perfect for XAUUSD (Gold) traders and other high-volatility instruments.
🧠 Description:
This indicator plots three key Exponential Moving Averages (EMAs) to help traders identify market trends and potential entry/exit points with precision:
EMA 8 (Green) – Fast trend, useful for scalping or short-term signals
EMA 50 (Blue) – Mid-term trend filter
EMA 150 (Red) – Long-term bias and trend direction
It is part of the IndexProFX toolkit and integrates smoothly with other tools like Intraday Signal and Session Zones for enhanced confluence trading.
✔️ Clean structure
✔️ Easy-to-read color-coded EMAs
✔️ Supports scalping, day trading, and swing trading strategies
IB Breakout Strategy with Fib, CVD, and DivergenceEntry rules and signals- I wait for the 5min IB(initial balance) to form every session for eg-(first 5min candle of london session or ny session, marking top wick to bottom wick of first 5 min candle with a midpoint in that zone.Then look for CVD(cumulative volume delta) if it's alining with my analysis.I also mark previous session fib levels for scalp entries on .618 or .78 level.Also i do mark previous day VAH(value area high),VAL(value area low) and POC(point of control) for better understanding of direction.
Initial stop loss and take profit values-Initial stop loss varies from 200$ to 500$ and take profit varies from 250$ to 500$.
Number of contracts you plan to trade based on system stats and risk management-I plan to trade 1-2 contracts until i reach the safety net.Once safety net is achieved based on my entry level i decide the contract size which varies from 1-4 contracts.
Trade management and any trailing stop methods-I trail the stop once i feel like there's enough room for the trade.I manage the trade on the basis of strength of a candle, if its taking much time without strength i exit the trade.
RSI with Background Colorhis script implements a trading strategy based on an EMA (Exponential Moving Average) crossover, confirmed by the RSI (Relative Strength Index), and includes a built-in stop-loss and take-profit.
Robbin hoodsomething good, this is ewrfiwevdcbdkjsdbvkj vasfdkjvsdvkjae dk;v asd vk;jsbdvkaeskv jkjsD v.kj awerekrv
SMA Fecho na Máxima, Mínima e NormalLarry Williams' Strategy - Short Moving Average Channel
✅ Indicators used:
High SMA: 3 periods
Low SMA: 3 periods
30-period Closing SMA: used as a trend filter
上涨动能This indicator calculates and visualizes the difference between the 20-period EMA and the 120-period EMA, helping traders identify medium-term momentum shifts in price action.
What It Does:
✅ Calculates the difference: Diff=EMA20 − EMA120
✅ Plots a line representing this difference for clear trend tracking.
✅ Plots a histogram (colored bars): Green bars indicate the EMA20 is above EMA120, suggesting bullish momentum. Red bars indicate the EMA20 is below EMA120, suggesting bearish momentum.
✅ Includes a zero baseline for easy reference: When the value crosses above zero, it indicates a potential bullish shift. When it crosses below zero, it indicates a potential bearish shift.
How to Use:
✅Use this indicator to visualize trend momentum in your crypto, forex, or stock trading.
✅Combine with your entry/exit signals (e.g., RSI, volume spikes, price action levels) to refine your strategy.
✅A rising Diff suggests strengthening bullish momentum, while a falling Diff suggests strengthening bearish momentum.
Why It’s Useful:
✅ Filters noise by using EMA smoothing on both short and long periods.
✅ Helps identify momentum shifts early without being overly sensitive to short-term volatility.
✅ Easy to integrate into trend-following or pullback strategies.
Fair Value Gap [Custom]📌 FVG Indicator – Smart Money Concepts Tool
This script is based on Smart Money Concepts (SMC) and automatically detects and marks Fair Value Gaps (FVG) on the chart, helping traders identify unbalanced price areas left behind by institutional moves.
🧠 What is an FVG?
An FVG (Fair Value Gap) is the price gap formed when the market moves rapidly, leaving behind a candle range where no trading occurred — typically between Candle 1’s high and Candle 3’s low (in a three-candle pattern). These gaps often signal imbalance, created during structural breaks or liquidity grabs, and may act as retrace zones or entry points.
🛠 Features:
✅ Automatically detects and highlights FVG zones (high-low range)
✅ Differentiates between open (unfilled) and closed (filled) FVGs
✅ Adjustable timeframe settings (works best on 1H–4H charts)
✅ Option to toggle display of filled FVGs
✅ Great for identifying pullback entries, continuation zones, or reversal setups
💡 Recommended Use:
After BOS/CHoCH, watch for price to return to the FVG for entry
Combine with Order Blocks and liquidity zones for higher accuracy
Best used as part of an ICT or SMC-based trading system
Williams VIX For Bottoms [DCD]Williams VIX Original - Authentic Volatility Fear Gauge
What This Indicator Does
The Williams VIX Fix measures market fear by calculating how far current lows deviate from recent highs, identifying potential market bottoms during high volatility periods. This implementation provides Larry Williams' original formula in its purest form.
How It Works
Core Formula:
VIX Fix = ((Highest High over 22 periods - Current Low) / Highest High over 22 periods) × 100
The calculation process:
Measures Relative Distance: Compares current low to highest high over lookback period
Converts to Percentage: Normalizes values for cross-market comparison
Applies Statistical Analysis: Uses Bollinger Bands (2 std dev) around VIX Fix values
Filters with Percentiles: 85th percentile threshold removes noise
Signal Generation
Green Flash Signals trigger when either condition is met:
VIX Fix exceeds upper Bollinger Band (2 standard deviations above 20-period MA)
VIX Fix exceeds Range High (85th percentile of recent values)
This dual-condition approach reduces false signals while capturing genuine volatility spikes.
What Makes This Original
Pure Formula Implementation: Uses Williams' exact original calculation without modifications
Dual Confirmation System: Combines Bollinger Bands with percentile analysis
Professional Visualization: Histogram display, background highlighting, and live value table
Comprehensive Alerts: Signal start/end notifications plus Green Flash alerts
How to Use
Primary Purpose: Spot high-probability reversal zones during market fear climaxes
Signal Interpretation:
Green triangle + background highlight = High volatility reversal zone
Higher VIX Fix values = Stronger fear/better reversal potential
Use with price action confirmation for best results
Optimal Settings:
Timeframes: 4H, Daily, Weekly
Markets: All (stocks, crypto, forex, commodities)
Combine with support levels and candlestick patterns
Key Parameters:
VIX Fix Length (22): Lookback period for highest high
Std Dev Multiplier (2.0): Bollinger Band sensitivity
Percentile High (0.85): Only top 15% of readings trigger signals
The VIX Fix excels at identifying market fear climaxes that coincide with significant price bottoms, making it valuable for swing traders seeking high-probability entries during market stress.
Stephis Supply & Demand Zones v3
📉 Support
Definition: Support is a price level where a downtrend can be expected to pause or reverse due to a concentration of buying interest.
Why it matters: When the price of an asset falls to a support level, traders expect buyers to step in, preventing the price from falling further.
Visual clue: On a chart, support often appears as a horizontal line where the price has bounced up multiple times.
📈 Demand
Definition: Demand refers to the willingness and ability of buyers to purchase an asset at a given price.
In trading context: High demand typically pushes prices up, while low demand can lead to price drops.
Relation to support: A support level exists because of demand—buyers are willing to buy at that price, creating a floor.
🧠 How They Work Together
When price approaches a support level, traders watch to see if demand increases—if it does, the price may bounce.
If the support level is broken, it may signal that demand has weakened, and the price could fall further.
🔁 Opposite Concept: Resistance & Supply
Resistance is the opposite of support—it's a level where selling pressure (supply) may stop a price from rising.
Just like demand creates support, supply creates resistance.
Zigzag Simple [SCL]🟩 OVERVIEW
Draws zigzag lines from pivot Highs to pivot Lows. You can choose between three different ways of calculating pivots:
• True Highs and Lows
• Williams pivots
• Oscillator pivots
🟩 HOW TO USE
This indicator can be used to understand market structure, which is arguably the primary thing you need to be aware of when trading. The zigzag by itself does not display a market structure bias, nor any information about prices of pivots, HH and HL labels, or anything like that. Nevertheless, a simple zigzag is perhaps the easiest and most intuitive way to understand what price is doing.
Choose a pivot style that you like, customise the colours and line style, and enjoy!
🟩 PIVOT TYPES EXPLAINED
True Highs and Lows
This is not an invention of mine (all credit to my humble mentor), but I haven't seen anyone else code them up. A true High is a close below the low of the candle with the highest high. A true Low is a close above the high of a candle with the lowest low. These are solid, price action-based pivots that can sometimes confirm quickly.
Williams pivots
This is how most people calculate pivots. They're simply the highest high for x bars back and x bars forwards. They're the vanilla of pivots IMO: serviceable but not very interesting. They're very convenient to code because there are built-in Pine functions for them: ta.pivothigh and ta.pivotlow . They confirm a predictable number of bars after they happen, which is great for coding but also makes the trader wait for confirmation.
Oscillator pivots
This is a completely different concept, which uses momentum in order to define pivots. For example, when you get a rise in momentum and momentum then drops a configurable amount, it confirms a pivot high, and vice versa for a pivot low. I don't know if anyone else does it –- although some indicators do mark pivots in momentum itself, and plenty do divergences, I wasn't able to find one that specifically marked *pivots in price* because of pivots in momentum 🤷♂️
Anyway, while this approach needs a whole investigation on its own, here we simply plot some pivots in a smoothed RSI. This indicator doesn't plot the actual momentum values -- for a more visual understanding of how this works, refer to the examples in the OscillatorPivots library.
🟩 UNIQUE ADVANTAGES
In contrast to other zigzag indicators available, this one lets you choose between the standard and some more unique methods of generating the zigzags. Additionally, because it's based on libraries, it is relatively easy for programmers to use as a basis for experimentation.
🟩 GEEK STUFF
Although there is considerable practical use for pivot-based zigzags in trading, this script is primarily a demonstration in coding -- specifically the power of libraries!
Most of the script consists of setup, especially defining inputs. The final section sacrifices some readability for conciseness, simply to emphasise how little code you need when the heavy lifting is done by libraries .
The actual calculations and drawing are achieved in just 8 lines.
The equivalent code in the libraries is ~250 lines long.
All libraries used are my own, public and open-source:
• MarketStructure
• DrawZigZag
• OscillatorPivots
VIDYA (Chande)This script brings you VIDYA – the Variable Index Dynamic Average, developed by Tushar Chande. It’s not your typical moving average. Unlike the standard SMA or EMA, VIDYA adapts its speed and smoothness based on real-time market momentum using the Chande Momentum Oscillator (CMO).
Think of it like a moving average that gets faster during strong trends and slows down during sideways or choppy markets — just like how a smart trader would!
🧠 What Makes VIDYA Different?
Traditional moving averages use fixed smoothing, so they lag more during big moves or chop during weak trends.
VIDYA fixes that by adapting its behavior dynamically:
When momentum is strong → VIDYA reacts faster 🚀
When momentum is weak → VIDYA smooths out the noise 🧘
⚙️ How It Works (Explained Simply):
1️⃣ CMO Calculation (Chande Momentum Oscillator):
We look at the past cmoLength candles (default 9) and:
i) Add up all the positive price changes (gains)
ii) Add up all the negative price changes (losses)
iii) Use those to compute a normalized momentum score between -100 and +100
📌 CMO = (Gains - Losses) / (Gains + Losses)
• This gives us a momentum reading that powers the next step.
2️⃣ Dynamic Alpha Smoothing:
• We convert the absolute value of the CMO into an alpha — this is the "speed" of the VIDYA.
📌 Higher momentum = higher alpha → faster response
📌 Lower momentum = lower alpha → smoother behavior
3️⃣ VIDYA Formula:
• Finally, we apply the smoothing:
📌 VIDYA = α × Price + (1 - α) × Previous VIDYA
• This equation continuously adapts to market behavior — trending or ranging.
📊 What’s Plotted?
🟠 The VIDYA Line:
A smooth, responsive line plotted on your price chart that adjusts in real-time with price momentum.
🔎 How to Use It:
✅ Use it like a moving average, but smarter:
• Price > VIDYA and rising → Trend is likely up
• Price < VIDYA and falling → Trend is likely down
• Flat VIDYA = Possible consolidation or sideways market
✅ Combine with:
• Breakout strategies (VIDYA confirms momentum)
• Reversal entries (look for price crossing VIDYA)
• Volatility filters (ignore signals when VIDYA flattens)
🧪 Bonus Tip:
Pair this with a volume indicator (like my Volume Confirmation Bars or Volume Strength Highlight) to confirm whether momentum is backed by real participation or just a fakeout.
📩 Want alerts, dual-timeframe overlays, or VIDYA with other base inputs (like typical price or HLC3)? Let me know — happy to expand this for your setup!
Stay adaptive, not reactive — trade smarter with VIDYA! 🧠📉📈