Chart patterns
Daily Premarket High & LowThis script finds the premarket highs and lows and draws those levels on the intraday chart.
1-Hour Candlestick Patterns on 15m Chartplots 1 hour candlesticks on lower timeframe so there is no need to jump from higher time frame to lower time frame.
NR4/NR7 + 2BarNR/3BarNR + Trend + Refined MACD + VWAP📜 Description:
NR4, NR7, 2-Bar NR, and 3-Bar NR Compression Scanner with Trend & Momentum Filters
This script identifies extreme price compressions (NR4, NR7, 2-Bar NR, 3-Bar NR) combined with strict trend and momentum conditions for higher-probability setups.
It’s not just about spotting contraction — it’s about ensuring the right environment for expansion.
The scanner conditions are:
NR4 and NR7 patterns: Today's range must be the narrowest compared to the last 4 or 7 days.
2-Bar and 3-Bar Narrow Ranges: The narrowest two or three day ranges compared to the last 20 sets of two/three days.
Trend filter:
Price must be above the 20 EMA.
The 10 EMA must be above the 20 EMA.
MACD proximity filter:
The MACD fast line must either be above the slow line or within 5% range below the slow line.
VWAP filter:
Price must be trading above VWAP.
Visuals:
Background colours highlight detected compression patterns aligned with trend.
Shape markers above or below bars for quick visual confirmation.
📈 Why Use This?
Some have said that trading is a waiting game. I won't say they're wrong.
This scanner doesn't just throw every tight-range day at you. It finds the coils in context — trending, gaining momentum, ready to spring.
If you chase trades like a fool in a brothel, you'll get taken for a ride.
If you wait for the right compression, at the right moment, with the right backing...
Well, let's just say, you might just start looking like you actually know what you're doing.
🛠️ Built for Traders Who:
Prefer strong trends over messy ranges.
Want systematic setups, not random guessing.
Like stacking probabilities rather than praying to the trading gods.
Enjoy catching breakouts when everyone else is still scratching their heads.
Session-Based +/-% LinesSimple Script Just to Draw Lines Above 0.09 and Below 0.09 % based on Close Price
Tighter Support, Resistance, and Consolidation ZonesScript that shows Support, Resistance and Consolidation.
Returns & Distance from ATHHere’s what that Pine Script does, in everyday terms:
1. **Look back in time**
- It grabs the closing price from **3 months ago** and **1 month ago** by asking TradingView’s “monthly” data for the symbol.
2. **Calculate percentage changes**
- **3-month return** = (today’s close – close 3 months ago) ÷ (close 3 months ago) × 100
- **1-month return** = (today’s close – close 1 month ago) ÷ (close 1 month ago) × 100
3. **Track the highest price ever seen (ATH)**
- It keeps a running “all-time high” variable, updating it any time today’s high exceeds the previous ATH.
4. **Compute how far you are below ATH**
- **% from ATH** = (ATH – today’s close) ÷ ATH × 100
5. **Build a little stats table on your chart**
- It makes a 2-row by 3-column box in the **top-center** of your price panel.
- The **first row** has labels: “3M % Return”, “1M % Return”, “% from ATH”.
- The **second row** shows the three computed numbers, each formatted to two decimal places and suffixed with “%.”
6. **Refresh only once per bar**
- All of these values and the table get updated **at the close** of each bar, so your table always shows the latest stats without cluttering the chart with extra drawings.
In short, this indicator quietly collects the right historical prices, does three simple percent-change math steps, and then displays those three key numbers in a neat, always-visible box at the top of your TradingView chart.
NR4/NR7 + Refined Trend FilterThis version allows the candle to pull toward the 10 EMA without disqualifying the trend—but keeps things on a bullish leash.
NR4/NR7 + Strong Uptrend FilterNR4/NR7 Tight Range Breakout Scanner with Trend Confirmation
This script identifies explosive breakout candidates by scanning for NR4 (Narrowest Range in 4 days) and NR7 (Narrowest Range in 7 days) setups, only when the underlying stock is showing strong bullish alignment.
Why This Matters
Narrow range candles often precede volatility. When you combine that compression with a strong uptrend, you’re essentially spotting a coiled spring—just before the snap. Most traders chase moves. This one waits—quiet, deliberate, prepared.
Trend Filter Criteria
To ensure quality and avoid weak setups, the scanner only signals when:
The closing price is above the 10 EMA
The 10 EMA is above the 20 EMA
This confirms strong short-term momentum and trend alignment—what some call a “momentum staircase.” It keeps you on the frontside of the move and filters out chop, fakeouts, and death-by-a-thousand-wick scenarios.
Visuals
Orange Label → NR4 in a strong trend
Purple Label → NR7 in a strong trend
Background also highlights to give subtle visual cues
Best Use Case
Scan end-of-day or intraday on your watchlist. Combine it with:
MACD expansion
Low float + news catalysts
Volume surges
Breakout-ready chart structure
Result?
You don’t chase.
You don’t guess.
You stalk high-probability trades like a nobleman with a sniper rifle.
2HH2LL [CCE_Charts]Detects the "Two Higher Highs, Two Lower Lows" (2HH2LL) pattern formation and provides strength analysis with trade signals. The indicator displays visual markers, S/R zones, and clear signals for LONG or SHORT positions.
Pattern Description
The 2HH2LL pattern consists of two consecutive higher highs and two consecutive lower lows. This formation can signal potential trend reversals or continuations depending on market context.
Key Features
• Pattern strength analysis using S/R zone and volume confirmation
• Clear LONG or SHORT trade signals
• Visual markers highlighting pattern components
• Support/Resistance zone visualization
• Customizable alerts for real-time notifications
• Detailed information panel
How to Use This Indicator
1. Add the indicator to your chart
2. Configure settings based on your trading style
3. Look for the "2HH2LL" label when a valid pattern forms
4. Check the pattern strength (STRONG, MEDIUM, WEAK)
5. Note the trade direction signal (LONG or SHORT)
6. Verify the pattern with other technical tools
7. Set up alerts for real-time notifications
Settings Guide
Pattern Settings
• Lookback Period: Controls pivot point detection (5-50)
• Minimum Swing Strength: Required percentage change between highs/lows
Confirmation Settings
• S/R Zone Size: Size of support/resistance zone
• Volume Confirmation Threshold: Volume multiple required for confirmation
• Volume Average Period: Bars used for volume average calculation
Visual Settings
• Show H1/H2/L1/L2 Labels: Toggle pattern component labels
• Show S/R Zone: Toggle support/resistance zone display
Signal Settings
• Trade Direction: How trade direction is determined (SHORT, LONG, AUTO)
Alert Settings
• Alert on All Patterns: Trigger alerts for all valid patterns
• Alert on STRONG Patterns Only: Only alert on strong patterns
• Alert on Direction: Filter alerts by trade direction
Pattern Strength Analysis
The indicator classifies pattern strength into three categories:
• STRONG: Both confirmation factors present (S/R test and volume)
• MEDIUM: One confirmation factor present
• WEAK: No confirmation factors present
For best results, use this indicator in combination with other technical tools and always consider the broader market context.
Dettsec SM ALERTSThe DETTSEC SilverMic Strategy is a precision-engineered trend-following system designed to identify key market reversals using dynamic ATR-based stop levels. Built with the aim of riding trends while avoiding noise and false signals, this strategy uses the Average True Range (ATR) to calculate adaptive stop zones that respond to market volatility. With a combination of smart trailing logic and visual aids, it offers traders clear entry signals and real-time direction tracking.
At the core of this strategy lies a dual-layer stop system. When the market is trending upwards, the strategy calculates a Long Stop by subtracting the ATR from the highest price (or close, depending on user settings) over a specified period. Conversely, in a downtrend, it calculates a Short Stop by adding ATR to the lowest price (or close). These stops are not static — they trail in the direction of the trend and only reset when a reversal is confirmed, ensuring the system remains adaptive yet stable.
The strategy detects trend direction based on price behavior relative to these stops. When the price closes above the Short Stop, the system identifies a potential bullish reversal and shifts into a long mode. Similarly, a close below the Long Stop flips the system into a bearish mode. These directional changes trigger Buy or Sell signals, plotted clearly on the chart with optional label markers and circular highlights.
To enhance usability, the strategy includes visual elements such as color-filled backgrounds indicating the active trend state (green for long, red for short). Traders can customize whether to display Buy/Sell labels, use closing prices for extremum detection, and highlight state changes. Additionally, real-time alerts are built-in for direction changes and trade entries — empowering traders to stay informed even when off the charts.
Whether you're a manual trader seeking confirmation for your entries, or an algo-enthusiast automating entries based on clean signals, the DETTSEC SilverMic Strategy is designed to deliver clarity, reliability, and precision. As always, it's optimized for performance and simplicity.
Issued By Dettsec Algo Pvt Ltd,
Created By - Gaurav Sanghvi - Co-Founder Dettsec Algo Pvt Ltd
Tanmay Joshi - Founder Dettsec Algo Pvt Ltd
ADR% Extension Levels from SMA 50I created this indicator inspired by RealSimpleAriel (a swing trader I recommend following on X) who does not buy stocks extended beyond 4 ADR% from the 50 SMA and uses extensions from the 50 SMA at 7-8-9-10-11-12-13 ADR% to take profits with a 20% position trimming.
RealSimpleAriel's strategy (as I understood it):
-> Focuses on leading stocks from leading groups and industries, i.e., those that have grown the most in the last 1-3-6 months (see on Finviz groups and then select sector-industry).
-> Targets stocks with the best technical setup for a breakout, above the 200 SMA in a bear market and above both the 50 SMA and 200 SMA in a bull market, selecting those with growing Earnings and Sales.
-> Buys stocks on breakout with a stop loss set at the day's low of the breakout and ensures they are not extended beyond 4 ADR% from the 50 SMA.
-> 3-5 day momentum burst: After a breakout, takes profits by selling 1/2 or 1/3 of the position after a 3-5 day upward move.
-> 20% trimming on extension from the 50 SMA: At 7 ADR% (ADR% calculated over 20 days) extension from the 50 SMA, takes profits by selling 20% of the remaining position. Continues to trim 20% of the remaining position based on the stock price extension from the 50 SMA, calculated using the 20-period ADR%, thus trimming 20% at 8-9-10-11 ADR% extension from the 50 SMA. Upon reaching 12-13 ADR% extension from the 50 SMA, considers the stock overextended, closes the remaining position, and evaluates a short.
-> Trailing stop with ascending SMA: Uses a chosen SMA (10, 20, or 50) as the definitive stop loss for the position, depending on the stock's movement speed (preferring larger SMAs for slower-moving stocks or for long-term theses). If the stock's closing price falls below the chosen SMA, the entire position is closed.
In summary:
-->Buy a breakout using the day's low of the breakout as the stop loss (this stop loss is the most critical).
--> Do not buy stocks extended beyond 4 ADR% from the 50 SMA.
--> Sell 1/2 or 1/3 of the position after 3-5 days of upward movement.
--> Trim 20% of the position at each 7-8-9-10-11-12-13 ADR% extension from the 50 SMA.
--> Close the entire position if the breakout fails and the day's low of the breakout is reached.
--> Close the entire position if the price, during the rise, falls below a chosen SMA (10, 20, or 50, depending on your preference).
--> Definitively close the position if it reaches 12-13 ADR% extension from the 50 SMA.
I used Grok from X to create this indicator. I am not a programmer, but based on the ADR% I use, it works.
Below is Grok from X's description of the indicator:
Script Description
The script is a custom indicator for TradingView that displays extension levels based on ADR% relative to the 50-period Simple Moving Average (SMA). Below is a detailed description of its features, structure, and behavior:
1. Purpose of the Indicator
Name: "ADR% Extension Levels from SMA 50".
Objective: Draw horizontal blue lines above and below the 50-period SMA, corresponding to specific ADR% multiples (4, 7, 8, 9, 10, 11, 12, 13). These levels represent potential price extension zones based on the average daily percentage volatility.
Overlay: The indicator is overlaid on the price chart (overlay=true), so the lines and SMA appear directly on the price graph.
2. Configurable Inputs
The indicator allows users to customize parameters through TradingView settings:
SMA Length (smaLength):
Default: 50 periods.
Description: Specifies the number of periods for calculating the Simple Moving Average (SMA). The 50-period SMA serves as the reference point for extension levels.
Constraint: Minimum 1 period.
ADR% Length (adrLength):
Default: 20 periods.
Description: Specifies the number of days to calculate the moving average of the daily high/low ratio, used to determine ADR%.
Constraint: Minimum 1 period.
Scale Factor (scaleFactor):
Default: 1.0.
Description: An optional multiplier to adjust the distance of extension levels from the SMA. Useful if levels are too close or too far due to an overly small or large ADR%.
Constraint: Minimum 0.1, increments of 0.1.
Tooltip: "Adjust if levels are too close or far from SMA".
3. Main Calculations
50-period SMA:
Calculated with ta.sma(close, smaLength) using the closing price (close).
Serves as the central line around which extension levels are drawn.
ADR% (Average Daily Range Percentage):
Formula: 100 * (ta.sma(dhigh / dlow, adrLength) - 1).
Details:
dhigh and dlow are the daily high and low prices, obtained via request.security(syminfo.tickerid, "D", high/low) to ensure data is daily-based, regardless of the chart's timeframe.
The dhigh / dlow ratio represents the daily percentage change.
The simple moving average (ta.sma) of this ratio over 20 days (adrLength) is subtracted by 1 and multiplied by 100 to obtain ADR% as a percentage.
The result is multiplied by scaleFactor for manual adjustments.
Extension Levels:
Defined as ADR% multiples: 4, 7, 8, 9, 10, 11, 12, 13.
Stored in an array (levels) for easy iteration.
For each level, prices above and below the SMA are calculated as:
Above: sma50 * (1 + (level * adrPercent / 100))
Below: sma50 * (1 - (level * adrPercent / 100))
These represent price levels corresponding to a percentage change from the SMA equal to level * ADR%.
4. Visualization
Horizontal Blue Lines:
For each level (4, 7, 8, 9, 10, 11, 12, 13 ADR%), two lines are drawn:
One above the SMA (e.g., +4 ADR%).
One below the SMA (e.g., -4 ADR%).
Color: Blue (color.blue).
Style: Solid (style=line.style_solid).
Management:
Each level has dedicated variables for upper and lower lines (e.g., upperLine1, lowerLine1 for 4 ADR%).
Previous lines are deleted with line.delete before drawing new ones to avoid overlaps.
Lines are updated at each bar with line.new(bar_index , level, bar_index, level), covering the range from the previous bar to the current one.
Labels:
Displayed only on the last bar (barstate.islast) to avoid clutter.
For each level, two labels:
Above: E.g., "4 ADR%", positioned above the upper line (style=label.style_label_down).
Below: E.g., "-4 ADR%", positioned below the lower line (style=label.style_label_up).
Color: Blue background, white text.
50-period SMA:
Drawn as a gray line (color.gray) for visual reference.
Diagnostics:
ADR% Plot: ADR% is plotted in the status line (orange, histogram style) to verify the value.
ADR% Label: A label on the last bar near the SMA shows the exact ADR% value (e.g., "ADR%: 2.34%"), with a gray background and white text.
5. Behavior
Dynamic Updating:
Lines update with each new bar to reflect new SMA 50 and ADR% values.
Since ADR% uses daily data ("D"), it remains constant within the same day but changes day-to-day.
Visibility Across All Bars:
Lines are drawn on every bar, not just the last one, ensuring visibility on historical data as well.
Adaptability:
The scaleFactor allows level adjustments if ADR% is too small (e.g., for low-volatility symbols) or too large (e.g., for cryptocurrencies).
Compatibility:
Works on any timeframe since ADR% is calculated from daily data.
Suitable for symbols with varying volatility (e.g., stocks, forex, cryptocurrencies).
6. Intended Use
Technical Analysis: Extension levels represent significant price zones based on average daily volatility. They can be used to:
Identify potential price targets (e.g., take profit at +7 ADR%).
Assess support/resistance zones (e.g., -4 ADR% as support).
Measure price extension relative to the 50 SMA.
Trading: Useful for strategies based on breakouts or mean reversion, where ADR% levels indicate reversal or continuation points.
Debugging: Labels and ADR% plot help verify that values align with the symbol’s volatility.
7. Limitations
Dependence on Daily Data: ADR% is based on daily dhigh/dlow, so it may not reflect intraday volatility on short timeframes (e.g., 1 minute).
Extreme ADR% Values: For low-volatility symbols (e.g., bonds) or high-volatility symbols (e.g., meme stocks), ADR% may require adjustments via scaleFactor.
Graphical Load: Drawing 16 lines (8 upper, 8 lower) on every bar may slow the chart for very long historical periods, though line management is optimized.
ADR% Formula: The formula 100 * (sma(dhigh/dlow, Length) - 1) may produce different values compared to other ADR% definitions (e.g., (high - low) / close * 100), so users should be aware of the context.
8. Visual Example
On a chart of a stock like TSLA (daily timeframe):
The 50 SMA is a gray line tracking the average trend.
Assuming an ADR% of 3%:
At +4 ADR% (12%), a blue line appears at sma50 * 1.12.
At -4 ADR% (-12%), a blue line appears at sma50 * 0.88.
Other lines appear at ±7, ±8, ±9, ±10, ±11, ±12, ±13 ADR%.
On the last bar, labels show "4 ADR%", "-4 ADR%", etc., and a gray label shows "ADR%: 3.00%".
ADR% is visible in the status line as an orange histogram.
9. Code: Technical Structure
Language: Pine Script @version=5.
Inputs: Three configurable parameters (smaLength, adrLength, scaleFactor).
Calculations:
SMA: ta.sma(close, smaLength).
ADR%: 100 * (ta.sma(dhigh / dlow, adrLength) - 1) * scaleFactor.
Levels: sma50 * (1 ± (level * adrPercent / 100)).
Graphics:
Lines: Created with line.new, deleted with line.delete to avoid overlaps.
Labels: Created with label.new only on the last bar.
Plots: plot(sma50) for the SMA, plot(adrPercent) for debugging.
Optimization: Uses dedicated variables for each line (e.g., upperLine1, lowerLine1) for clear management and to respect TradingView’s graphical object limits.
10. Possible Improvements
Option to show lines only on the last bar: Would reduce visual clutter.
Customizable line styles: Allow users to choose color or style (e.g., dashed).
Alert for anomalous ADR%: A message if ADR% is too small or large.
Dynamic levels: Allow users to specify ADR% multiples via input.
Optimization for short timeframes: Adapt ADR% for intraday timeframes.
Conclusion
The script creates a visual indicator that helps traders identify price extension levels based on daily volatility (ADR%) relative to the 50 SMA. It is robust, configurable, and includes debugging tools (ADR% plot and labels) to verify values. The ADR% formula based on dhigh/dlow
Historical Volatility Scale [ChartPrime]// This source code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
// © ExoMaven
//@version=5
indicator(title = "Historical Volatility Scale ", shorttitle = "Historical Volatility Scale ", overlay = true, scale = scale.none, max_lines_count = 100)
//░█████╗░██╗░░██╗░█████╗░██████╗░████████╗ ██████╗░██████╗░██╗███╗░░░███╗███████╗
//██╔══██╗██║░░██║██╔══██╗██╔══██╗╚══██╔══╝ ██╔══██╗██╔══██╗██║████╗░████║██╔════╝
//██║░░╚═╝███████║███████║██████╔╝░░░██║░░░ ██████╔╝██████╔╝██║██╔████╔██║█████╗░░
//██║░░██╗██╔══██║██╔══██║██╔══██╗░░░██║░░░ ██╔═══╝░██╔══██╗██║██║╚██╔╝██║██╔══╝░░
//╚█████╔╝██║░░██║██║░░██║██║░░██║░░░██║░░░ ██║░░░░░██║░░██║██║██║░╚═╝░██║███████╗
//╚════╝░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚═╝░░░╚═╝░░░ ╚═╝░░░░░╚═╝░░╚═╝╚═╝╚═╝░░░░░╚═╝╚══════╝
//--------------------------------------------------------------------------------
//░█████╗░██████╗░███████╗░█████╗░████████╗███████╗██████╗░ ██████╗░██╗░░░██╗
//██╔══██╗██╔══██╗██╔════╝██╔══██╗╚══██╔══╝██╔════╝██╔══██╗ ██╔══██╗╚██╗░██╔╝
//██║░░╚═╝██████╔╝█████╗░░███████║░░░██║░░░█████╗░░██║░░██║ ██████╦╝░╚████╔╝░
//██║░░██╗██╔══██╗██╔══╝░░██╔══██║░░░██║░░░██╔══╝░░██║░░██║ ██╔══██╗░░╚██╔╝░░
//╚█████╔╝██║░░██║███████╗██║░░██║░░░██║░░░███████╗██████╔╝ ██████╦╝░░░██║░░░
//░╚════╝░╚═╝░░╚═╝╚══════╝╚═╝░░╚═╝░░░╚═╝░░░╚══════╝╚═════╝░ ╚═════╝░░░░╚═╝░░░
//███████╗██╗░░██╗░█████╗░███╗░░░███╗░█████╗░██╗░░░██╗███████╗███╗░░██╗
//██╔════╝╚██╗██╔╝██╔══██╗████╗░████║██╔══██╗██║░░░██║██╔════╝████╗░██║
//█████╗░░░╚███╔╝░██║░░██║██╔████╔██║███████║╚██╗░██╔╝█████╗░░██╔██╗██║
//██╔══╝░░░██╔██╗░██║░░██║██║╚██╔╝██║██╔══██║░╚████╔╝░██╔══╝░░██║╚████║
//███████╗██╔╝╚██╗╚█████╔╝██║░╚═╝░██║██║░░██║░░╚██╔╝░░███████╗██║░╚███║
//╚══════╝╚═╝░░╚═╝░╚════╝░╚═╝░░░░░╚═╝╚═╝░░╚═╝░░░╚═╝░░░╚══════╝╚═╝░░╚══╝
//-------------------------------------------------------------------------------
len = input.int(title = "Length", defval = 50)
vol = ta.stdev(close / close , len, true)
vol_percentile = ta.percentrank(vol, len)
scale_offset = 5
scale_width = 10
pin_offset = 5
pin_size = size.huge
inv = color.new(color.black, 100)
polar_size = size.huge
var scale = array.new_line()
var line mover = na
var label pin = na
var label heat = na
var label snooze = na
if barstate.isfirst
for i = 0 to 99
array.push(scale, line.new(1, i, 1, i + 1, width = scale_width))
pin := label.new(na, na, color = inv, size = pin_size, text = "◀", style = label.style_label_left)
heat := label.new(na, na, color = inv, size = polar_size, text = "🔥", style = label.style_label_down)
snooze := label.new(na, na, color = inv, size = polar_size, text = "😴", style = label.style_label_up)
if barstate.islast
for i = 0 to array.size(scale) - 1
branch = array.get(scale, i)
line.set_xloc(branch, bar_index + scale_offset, bar_index + scale_offset, xloc.bar_index)
line.set_color(branch, color.from_gradient(i, 0, 100, color.green, color.red))
label.set_xloc(pin, bar_index + pin_offset, xloc.bar_index)
label.set_y(pin, vol_percentile)
label.set_textcolor(pin, color.from_gradient(vol_percentile, 0, 100, color.green, color.red))
label.set_xloc(heat, bar_index + scale_offset, xloc.bar_index)
label.set_y(heat, 100)
label.set_xloc(snooze, bar_index + scale_offset, xloc.bar_index)
label.set_y(snooze, 0)
Master LTC/BTC Mining Energy Ratio, Usage (GW) & Miner CountThis Pine Script indicator, "Master LTC/BTC Mining Energy Ratio, Usage (GW) & Miner Count," calculates and visualizes key metrics for Litecoin (LTC) and Bitcoin (BTC) mining operations. Using IntoTheBlock hashrate data, it estimates the number of L7 (LTC) and S19 (BTC) miners, computes energy consumption in gigawatts (GW) based on calibrated efficiency values, and derives the LTC/BTC energy ratio as a percentage. The script plots these metrics—energy ratio, LTC/BTC energy usage, and miner counts (in thousands)—and displays a concise table summarizing the results. Assuming most miners use previous-generation hardware, it provides a clear comparison of the energy dynamics between LTC’s Scrypt and BTC’s SHA-256 algorithms.
NR4/NR7 + Trend + Refined MACD + VWAP FilterRefined Trend-Following Strategy with NR4/NR7, MACD, and VWAP Filters
This trading strategy combines multiple technical filters to identify high-probability momentum setups, using a refined approach to the MACD for added precision. It’s designed for active traders looking to capitalise on strong trends while avoiding false signals.
Key Features:
Narrow Range Days (NR4/NR7): The strategy first looks for stocks with a narrow range, either NR4 (lowest range of the last four days) or NR7 (lowest range of the last seven days). This identifies stocks that have consolidated and may be preparing for a breakout or strong move.
Trend Analysis with EMAs: Price must be above the 20-period EMA, confirming a bullish trend. Additionally, the 10-period EMA must be above the 20-period EMA, ensuring that the short-term trend is aligned with the longer-term trend, adding to the setup’s strength.
Refined MACD Filter:
If the fast MACD line (12-period) is above the slow MACD line (26-period), the strategy accepts any difference, allowing for a full range of momentum opportunities.
If the fast MACD line is below the slow MACD line, the difference must be no more than 5%. This allows the strategy to capture tight price action setups without excluding potential trends due to a small discrepancy.
VWAP Confirmation: The strategy requires the price to be above the Volume Weighted Average Price (VWAP), adding a layer of volume-based confirmation to ensure that the stock is in a strong, positive trend relative to its average price.
Why This Works: This system is designed to take advantage of stocks that show consolidation (NR4/NR7) and then provide a clear, systematic approach for confirming their breakout potential through trend-following indicators like EMAs, MACD, and VWAP. The nuanced MACD filter adds a layer of flexibility, ensuring that no potential trend is overlooked while preventing false signals due to slight technical discrepancies.
By combining multiple layers of trend confirmation and dynamic filters for volatility, momentum, and volume, the strategy offers a refined approach to capturing high-probability setups, helping traders avoid overfitting to noise and focus on the most promising opportunities.
NR4/NR7 + Trend + MACD + VWAP FilterThe Ultimate Momentum-Compression Strategy
This strategy merges the power of price compression and trend confirmation, ensuring you're trading when the market is coiled and ready to move. By combining multiple filters—NR4/NR7, trend alignment, MACD momentum, and VWAP support—this setup identifies high-probability trade opportunities in dynamic, trending stocks. Here's how it works:
NR4/NR7 Patterns: These are narrow-range days where the current price range is smaller than the previous 4 or 7 days. This signals potential breakout or continuation setups, as the market is compressing before making a move.
Trend Confirmation: To ensure you're not trading against the current trend, the price must be above the 20 EMA, and the 10 EMA must be above the 20 EMA. This confirms a bullish structure, with the price trending in your favour.
MACD Momentum: The fast MACD line must be above the slow MACD line, confirming the trend is not only intact but also gaining momentum.
VWAP Filter: Price must be above the VWAP (Volume Weighted Average Price). This is the final confirmation that the market is in a strong, bullish phase, with buyers dominating the market.
By requiring all these conditions to align, this strategy takes the guesswork out of day trading. It ensures you're trading within a well-established trend, with compression patterns and momentum backing your trade. The result? You’re entering positions with confidence and clarity, poised to ride strong, sustained moves.
This strategy is for the trader who values both flexibility and discipline—able to capture dynamic moves while staying aligned with market structure and momentum. It’s a refined, systematic approach that makes decisions clear, without the emotional second-guessing.
NR4/NR7 + Trend + MACD Filter📈 NR4/NR7 Breakout Scanner — with Trend & Momentum Filters
This script scans for NR4 and NR7 patterns—tight inside days that often precede explosive moves. But we don’t stop there. We filter for high-probability setups only, using:
✅ Trend Confirmation:
Price is above the 20 EMA
10 EMA is above the 20 EMA
(We’re not buying weakness. The structure must be bullish.)
✅ Momentum Confirmation (MACD Filter):
The MACD fast line is above the signal line
(Momentum must already be in gear—not catching a falling knife.)
This combo gives you a coiled spring setup—tight range, in a clear trend, with momentum pushing in your favour.
It’s ideal for breakout traders, swing traders, and anyone who wants to avoid false starts on the wrong side of the tape.
NR4 setups are marked orange,
NR7 setups are marked purple.
Stick to the right side of the trend, and let the squeeze do the rest.
NR4/NR7 IndicatorWhat It Does:
Detects NR4 = today's range smaller than last 3
Detects NR7 = today's range smaller than last 6
Plots coloured labels + background so you can spot ‘em at a glance
NR4/NR7 + 10 EMA Trend Filter📝 Description:
This script spots NR4 and NR7 days—those deceptively quiet candles where price volatility contracts... right before a potential breakout.
But here’s the twist:
It only highlights setups when the stock is above the 10 EMA, filtering for bullish trends with real momentum behind them.
We’re not interested in weak sauce. We want spring-loaded coils in strong uptrends.
🧠 What It Does:
🔍 NR4 (Narrow Range 4): Today's range is the smallest of the last 4 days
🧨 NR7 (Narrow Range 7): Today's range is the smallest of the last 7 days
🧭 Trend Filter: Highlights only when price is above the 10-period EMA
🎯 Visual Cues: Orange background and label for NR4, purple for NR7
SPY 0DTE Scalper - Auto AlertsTimeframes:
Main chart: 1-minute (for precision entries)
Confirmations: 3-minute or 5-minute (to avoid fakeouts)
Indicators I Use:
VWAP – Orange line → Institutional fair value
EMA 9 – Green line → Short-term momentum
EMA 21 – Red line → Trend filter
Custom Pullback Signal Script – Marks buy/sell/pullback signals with labels (triangles)
Above VWAP = Bullish Bias
Below VWAP = Bearish Bias
Institutions treat this as the "fair price" — so I do too.
EMA 9 (Green):
If price hugs or bounces off EMA 9 = 🔥 strong continuation move.
I use this as my guide for momentum.
EMA 21 (Red):
Great for trend confirmation.
Above EMA 21 = Trend building to the upside.
Below EMA 21 = Weakness or possible reversal.
💸 Step 3: How I Read the Signals
✅ BUY Signal:
Price breaks above VWAP with volume 1.5x+ average
Candle must close strong (not a wickfest)
EMA 9 becomes my trailing stop for the move
🚨 SELL Signal:
Price breaks below VWAP with strong volume
Clean body close below → momentum shift to the downside
EMA 9 again = trailing resistance guide
🔵 Pullback Long (Blue Triangle Under Candle):
Bullish continuation entry
Price pulls back to EMA 9 or 21, but stays above VWAP
Low-risk re-entry after a breakout
🟣 Pullback Short (Purple Triangle Above Candle):
Bearish continuation entry
Price retraces into EMA 9, but stays below VWAP & EMA 21
Ideal for catching second legs after breakdowns
Scalper Signal PRO (EMA + RSI + Stoch)How to use it
Buy Signal:
. EMA 5 crosses above EMA 13
. Price is above EMA 50
. RSI near or just above 30
Sell Signal:
. EMA 5 crosses below EMA 13
. Price is below EMA 50
. RSI near or just below 30
Scalper Signal PRO (EMA + RSI + Stoch)//@version=5
indicator("Scalper Signal PRO (EMA + RSI + Stoch)", overlay=true)
// === INPUTS ===
emaFastLen = input.int(5, "EMA Fast")
emaSlowLen = input.int(13, "EMA Slow")
rsiLen = input.int(14, "RSI Length")
rsiBuy = input.int(30, "RSI Buy Level")
rsiSell = input.int(70, "RSI Sell Level")
kPeriod = input.int(5, "Stoch K")
dPeriod = input.int(3, "Stoch D")
slowing = input.int(3, "Stoch Smoothing")
// === SESSION TIME ===
sessionStart = timestamp ("GMT+8", year, month, dayofmonth, 8, 0)
sessionEnd = timestamp("GMT+8" ,year, month, dayofmonth, 18, 0)
withinSession = time >= sessionStart and time <= sessionEnd
// === LOGIC ===
emaFast = ta.ema(close, emaFastLen)
emaSlow = ta.ema(close, emaSlowLen)
emaBullish = emaFast > emaSlow and ta.crossover(emaFast, emaSlow)
emaBearish = emaFast < emaSlow and ta.crossunder(emaFast, emaSlow)
rsi = ta.rsi(close, rsiLen)
k = ta.sma(ta.stoch(close, high, low, kPeriod), slowing)
d = ta.sma(k, dPeriod)
buyCond = emaBullish and rsi < rsiBuy and k > d and withinSession
sellCond = emaBearish and rsi > rsiSell and k < d and withinSession
// === PLOTS ===
showSignals = input.bool(true, "Show Buy/Sell Signals?")
plotshape(showSignals and buyCond, location=location.belowbar, style=shape.labelup, color=color.green, text="BUY", title="Buy Signal")
plotshape(showSignals and sellCond, location=location.abovebar, style=shape.labeldown, color=color.red, text="SELL", title="Sell Signal")
plot(emaFast, "EMA Fast", color=color.orange)
plot(emaSlow, "EMA Slow", color=color.blue)
// === ALERTS ===
alertcondition(buyCond, title="Buy Alert", message="Scalper PRO Buy Signal")
alertcondition(sellCond, title="Sell Alert", message="Scalper PRO Sell Signal")
// === DASHBOARD ===
var table dash = table.new(position.top_right, 2, 5, frame_color=color.gray, frame_width=1)
bg = color.new(color.black, 85)
table.cell(dash, 0, 0, "Scalper PRO", bgcolor=bg, text_color=color.white, text_size=size.normal)
table.cell(dash, 0, 1, "Trend", bgcolor=bg)
table.cell(dash, 1, 1, emaFast > emaSlow ? "Bullish" : "Bearish", bgcolor=emaFast > emaSlow ? color.green : color.red, text_color=color.white)
table.cell(dash, 0, 2, "RSI", bgcolor=bg)
table.cell(dash, 1, 2, str.tostring(rsi, "#.0"), bgcolor=color.gray, text_color=color.white)
table.cell(dash, 0, 3, "Stoch K/D", bgcolor=bg)
table.cell(dash, 1, 3, str.tostring(k, "#.0") + "/" + str.tostring(d, "#.0"), bgcolor=color.navy, text_color=color.white)
table.cell(dash, 0, 4, "Session", bgcolor=bg)
table.cell(dash, 1, 4, withinSession ? "LIVE" : "OFF", bgcolor=withinSession ? color.green : color.red, text_color=color.white)