Is it Time for a Pullback? Check Bars Since MA TestAn old market adage declares that “prices never move in a straight line.” Dips occur even in bullish markets. But how can traders know when prices may be due for a pullback?
Today’s script tries to answer that question by asking how many bars have passed since a stock, index or other symbol has tested a given moving average. Long periods of time without touching a line such as the 50-day simple moving average, for example, could prompt traders to be more patient.
Bars Since MA Test counts how many bars have passed since prices touched or crossed the MA in question. The resulting value is plotted in a simple histogram. Users can set the MA length and type. By default, it uses the 50-day simple moving average (SMA).
The chart above applies Bars Since MA Test to the S&P 500. It shows that the index has gone 129 bars without testing its 50-day SMA. That’s the longest since a 146-bar stretch between July 2006 and February 2007.
Other longer runs include January-August 1995 (156 bars), November 1960-June 1961 (144 bars) and April-November 1958 (158 bars).
Given the small number of comparable readings, could traders suspect the current advance is getting long in the tooth?
TradeStation has, for decades, advanced the trading industry, providing access to stocks, options and futures. If you're born to trade, we could be for you. See our Overview for more.
Past performance, whether actual or indicated by historical tests of strategies, is no guarantee of future performance or success. There is a possibility that you may sustain a loss equal to or greater than your entire investment regardless of which asset class you trade (equities, options or futures); therefore, you should not invest or risk money that you cannot afford to lose. Online trading is not suitable for all investors. View the document titled Characteristics and Risks of Standardized Options at www.TradeStation.com . Before trading any asset class, customers must read the relevant risk disclosure statements on www.TradeStation.com . System access and trade placement and execution may be delayed or fail due to market volatility and volume, quote delays, system and software errors, Internet traffic, outages and other factors.
Securities and futures trading is offered to self-directed customers by TradeStation Securities, Inc., a broker-dealer registered with the Securities and Exchange Commission and a futures commission merchant licensed with the Commodity Futures Trading Commission). TradeStation Securities is a member of the Financial Industry Regulatory Authority, the National Futures Association, and a number of exchanges.
TradeStation Securities, Inc. and TradeStation Technologies, Inc. are each wholly owned subsidiaries of TradeStation Group, Inc., both operating, and providing products and services, under the TradeStation brand and trademark. When applying for, or purchasing, accounts, subscriptions, products and services, it is important that you know which company you will be dealing with. Visit www.TradeStation.com for further important information explaining what this means.
经济周期
Session ParmezanForex Session Range Boxes (Asia, Europe, US) — visual intraday session tracker for Forex and metals.
This indicator automatically marks the three major Forex trading sessions — Asian (Tokyo), European (London), and American (New York) — directly on your chart using dynamic colored boxes.
Each box represents the full price range (High–Low) formed during that session, helping traders visualize how volatility and liquidity evolve across the global trading day.
The script is built for intraday traders and session-based strategies, especially those who monitor breakouts from the Asian range or reactions during London–New York overlaps.
⚙️ Features
• Accurate session timing (UTC+3 / Moscow Time) — Asia: 03:00–12:00, Europe: 11:00–20:00, US: 16:00–01:00.
• Dynamic range boxes: each box expands in real time as new highs and lows are set during the session.
• Clear visual separation: each session is shown in its own color (blue for Asia, orange for Europe, green for US).
• Automatic daily reset — new boxes start every new session.
• Intraday focus only — visible up to the 1-hour timeframe (M1–H1) for clarity.
• Transparent design — semi-transparent fills keep candles readable even when sessions overlap.
• Lightweight performance — optimized use of box.new() and var variables avoids lag on lower timeframes.
🧭 Typical Use-Cases
• Identify Asian session ranges and watch for London breakouts or New York reversals.
• Visually align your intraday strategy with session volatility cycles.
• Combine with VWAP, liquidity zones, or market profile indicators for deeper confluence.
• Spot overlapping sessions — often the most active periods of the day.
MACD Remastered [CHE]MACD Remastered — Robust MACD with confirmed pivot-based divergence, optional signal bands, and ready-to-use alerts.
Summary
This indicator augments classic MACD with a robust, confirmed pivot-based divergence engine and an optional signal channel using Bollinger Bands. Divergence signals are only produced after a pivot is confirmed, which reduces noise from transient swings. A line-of-sight clearance check filters cases where the MACD histogram path contradicts the divergence, further cutting false flags. Histogram coloring clarifies momentum changes, while optional triangles project the same signals onto the main chart for quick context.
Motivation: Why this design?
Standard MACD divergence tools tend to fire early in volatile phases and flip during consolidation. The core idea here is to delay decision points until a pivot is confirmed and to validate the path between pivots. This addresses fake flips and improves signal credibility at the cost of some latency. Optional bands around the Signal line add context about compression and expansion without altering MACD’s core behavior.
What’s different vs. standard approaches?
Reference baseline: Classical MACD (fast and slow moving averages, Signal line, histogram) with simple divergence checks.
Architecture differences:
Confirmed pivot logic with left and right bars.
Line-of-sight clearance test across the histogram path between pivots.
Optional Signal-line Bollinger Bands with configurable length and width.
Composite “Any Divergence” alert plus separate regular and hidden alerts.
Optional main-chart triangles using forced overlay for at-a-glance context.
Practical effect: Fewer early or contradictory divergence signals, clearer momentum context via histogram colors and a visible Signal channel during compression and expansion.
How it works (technical)
The MACD line derives from a fast and a slow moving average on a chosen source. The Signal line smooths the MACD line using a selected moving average type and length. The histogram is the difference between MACD and Signal and is colored by direction and acceleration.
Divergence uses confirmed pivots: a pivot forms only after a set number of bars on the right side, so the event is locked in. The engine retrieves the last two relevant pivots and checks price movement versus the MACD histogram movement to classify regular or hidden divergence. A line-of-sight clearance routine traverses the histogram path between the two pivots and rejects the signal if the path invalidates the directional relationship. When enabled, Bollinger Bands are plotted around the Signal line; width scales with standard deviation. Programmatic alerts fire only on confirmed bars. No higher-timeframe requests are used.
Parameter Guide
Oscillator MA Type — Sets fast and slow MA family for MACD. Default: EMA. Tip: EMA is more responsive; SMA is steadier.
Fast Length — Fast MA period. Default: 12. Trade-off: Shorter is quicker but noisier.
Slow Length — Slow MA period. Default: 26. Trade-off: Longer reduces noise but adds lag.
Source — Price input. Default: Close. Tip: Use a stable source for consistency.
Signal MA Type — Moving average family for Signal. Default: EMA.
Signal Length — Smoothing of MACD into Signal. Default: 9. Trade-off: Longer smooths more, reacts slower.
Calculate Divergence — Enables divergence engine. Default: True.
Enable Bollinger Bands on Signal — Adds bands around Signal. Default: False.
BB Length — Sampling window for bands. Default: 20. Active: Only when bands are enabled.
BB StdDev — Band width in standard deviations. Default: 2.0. Bounds: between about zero point zero zero one and fifty.
Pivot Left / Pivot Right — Bars to the left and right that define a confirmed pivot. Default: five and five. Trade-off: Larger values mean stronger but slower pivots.
Min / Max Bars Between Pivots — Valid window between two pivots. Default: five and sixty. Tip: Increase minimum to reduce micro-divergences.
Detect Hidden — Include hidden divergence. Default: True.
Draw Lines — Draw connector lines on the MACD pane. Default: True.
Alerts: Enable / Regular / Hidden / Frequency / Prefix — Control alert emission, categories, cadence, and label. Defaults: Enabled, both categories on, once per bar close, prefix “MACD RM”.
Reading & Interpretation
Histogram: Columns above zero reflect positive momentum; below zero reflect negative momentum. Color shifts indicate momentum increasing or decreasing within each side.
MACD and Signal: Crosses and distance indicate momentum shifts and strength. When bands are enabled, touches and departures hint at compression and expansion around the Signal.
Divergence: Solid green lines and labels indicate regular bullish; solid red indicate regular bearish. Dashed teal and dashed orange denote hidden bullish and hidden bearish. Triangles on the main chart mirror these events for quicker visibility.
Practical Workflows & Combinations
Trend following: Use histogram color transitions with a structure filter such as higher highs and higher lows for long bias, or lower highs and lower lows for short bias. Divergence against the prevailing structure suggests caution or partial exits.
Exits and risk: In a long, regular bearish divergence near resistance can justify scaling out or tightening stops. Hidden divergence in the trend direction can support continuation but should not replace risk controls.
Multi-asset / Multi-timeframe: Works across liquid futures, forex, indices, and large-cap equities. Start with defaults on four-hour and daily; shorten lengths on intraday only when liquidity is strong.
Behavior, Constraints & Performance
Repaint and confirmation: Signals are anchored only after the right-side pivot bars complete; alerts trigger on confirmed bars. This intentionally adds latency to reduce noise.
No higher-timeframe requests: No `security` calls are used; repaint risk is primarily tied to live bars before confirmation.
Resources: Declared `max_bars_back` is five hundred. The divergence path check iterates between pivots, bounded by the maximum bars parameter. Line objects may accumulate; limits are set for lines and labels.
Known limits: Latency at sharp turns, potential misses during fast single-bar reversals, and sensitivity to extremely choppy sessions if minimum gap between pivots is set too low.
Sensible Defaults & Quick Tunin g
Starting point: EMA, twelve and twenty-six with Signal nine; pivots five and five; minimum five, maximum sixty; alerts on close; bands off.
Too many flips: Increase Signal length, raise pivot counts, and increase minimum bars between pivots. Consider disabling hidden divergence.
Too sluggish: Reduce pivot counts, lower Signal length, and enable bands to visualize early compression.
Cluttered chart: Keep lines off and rely on labels and main-chart triangles. Use the alert prefix to route events cleanly.
What this indicator is—and isn’t
This is a visualization and signal layer for MACD with confirmed, path-checked divergence and optional Signal bands. It is not a trading system, not predictive, and not a position management framework. Use it together with structure analysis, liquidity context, and explicit risk controls.
Disclaimer
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Do not use this indicator on Heikin-Ashi, Renko, Kagi, Point-and-Figure, or Range charts, as these chart types can produce unrealistic results for signal markers and alerts.
Best regards and happy trading
Chervolino
IFVG Extended (simple)This is an indicator that identifies and visualizes Inverted Fair Value Gaps (IFVG) on price charts. Here's what it does:
Core Functionality
Fair Value Gap (FVG) Detection:
Identifies bullish FVGs when current low is above the high from 2 bars ago
Identifies bearish FVGs when current high is below the low from 2 bars ago
Filters gaps using an ATR-based minimum size threshold
Inversion Tracking:
Monitors when price breaks back through identified FVGs (inversions)
Tracks the state transition from FVG to inverted FVG
Generates signals when price reacts to inverted zones
Key Features
Visual Elements:
Displays up to 500 boxes, lines, and labels on the chart
Shows the last N FVGs (configurable, default 5)
Color-coded zones: green for bullish, red for bearish
Dashed midlines through each gap
Triangle markers (▲/▼) indicating signal triggers
User Inputs:
Show Last: Number of recent IFVGs to display (1-100)
Signal Preference: Choose between "Close" or "Wick" for signal detection
ATR Multiplier: Minimum gap size filter (0.25 default)
Customizable colors for bull/bear zones and midlines
Signal Logic:
Bullish signal: Price closes above inverted bearish FVG after previously breaking below it
Bearish signal: Price closes below inverted bullish FVG after previously breaking above it
Includes alertconditions for automated notifications
Technical Implementation
Uses custom types (fvg and lab) to store gap data, manages arrays of active and inverted FVGs, and dynamically redraws all visual elements on the last bar to maintain clean chart presentation.
CCÖ Roket / Dikkat / ŞemsiyeThis indicator highlights buy opportunities, areas that require caution, and areas where deep, sharp declines may occur.
It is based on the relationship between the 50-day moving average and price.
Adil Hoca - US Market Score Only NasdaqMarket Score & Crash Detector Indicator
User Guide & Usage Instructions
This TradingView indicator provides a comprehensive market risk assessment, combining multiple financial metrics to detect potential market crashes, recessions, and overall trend regimes. It is especially designed to alert traders and investors about early warning signals before significant market downturns, enabling proactive decision-making.
Key Features
Multi-Metric Market Sentiment: Uses volatility indices, currency strength, yield spreads, breadth, and bond ratios to evaluate market health.
Crash Detection System: Monitors various conditions such as VIX spikes, breadth collapse, momentum cliffs, high-yield spread surges, and hidden market weaknesses.
Reccession Indicator: Incorporates the Sahm Rule, a proven recession indicator based on employment data.
Alert System: Sends real-time alerts for critical market conditions, including crashes, recession signals, and spreads alerts.
Visual Elements: Includes histograms, trend lines, threshold lines, and shape signals to visually interpret market states.
Customizable Parameters: Adjust weights, sensitivity, thresholds, and alert preferences to suit your trading style.
How it Works
1. Data Collection
The indicator fetches data from multiple sources:
Market volatility: VIX index
Currency strength: DXY index
Interest rates: SOFR, PCE inflation
Yield spreads: High Yield Credit Spread, Investment Grade Spread
Market Breadth: Ratio of QQQ to TLT (tech vs. bonds)
Bond Ratios: TMF/TMV (long-term bonds)
Employment Data: The Sahm Rule (monthly unemployment data)
2. Normalization
Data is normalized via z-score calculations over defined periods to standardize the metrics, making them comparable regardless of their original scale.
3. Composite Score Calculation
Each metric is weighted according to user-defined parameters, and a composite score is generated to represent the overall market sentiment, smoothed with an EMA for trend clarity.
4. Crash & Recession Detection
Crash System: Looks for conditions like VIX spikes, breadth collapse, momentum drops, high yield spread surges, and hidden weaknesses. If multiple conditions meet thresholds, alerts trigger.
Recession Indicator: Uses the Sahm Rule, which compares the current unemployment rate's three-month average to the lowest point over the past 12 months. When it exceeds a certain threshold, a recession signal is generated.
5. Alerts & Visualization
Sound & Shape Alerts: Signals like warning triangles, cross icons, and color changes.
Threshold Lines: Indicate levels like "Strong Bullish," "Strong Bear," and critical zones.
Dual Confirmation: Combines crash and recession signals for high-confidence alerts.
Usage & Customization
Placing the Indicator
Copy and paste the Pine Script code into TradingView's Pine Editor.
Save and add the script to your chart. Adjust inputs like weights, sensitivity mode, thresholds, and alert preferences via the input panel.
Key Inputs
Weights: Customize the importance of each metric.
Sensitivity Mode: Changes alert thresholds for early warnings.
Crash Sensitivity: Defines how many indicators need to trigger before issuing a crash alert.
Recession Thresholds: Set the unemployment level that signals recession.
Interpreting Visuals
Histogram: Shows the composite score; green means bullish, red indicates bearish.
Momentum Line: Highlights trend acceleration/deceleration.
Threshold Lines: Dotted/dashed lines showing critical zones.
Shape Shapes: Triangles or crosses appear for early signals or critical events.
Alerts
Crash Alerts: Warn of imminent market crashes.
Recession Alerts: Indicate economic downturns based on Sahm Rule.
Spread Alerts: Show high-yield credit spread surges signaling stress.
Double Confirmation: High-confidence signals when crash and recession conditions align.
Best Practices
Use on multiple timeframes for confirmation.
Combine with other technical analysis tools for better accuracy.
Adjust thresholds according to your risk appetite.
Follow alert signals for early warning but always consider overall context.
Final Notes
This indicator synthesizes a variety of leading and lagging indicators to give a holistic view of market health. It is designed to provide early warnings, especially in volatile or stressed environments, helping traders avoid severe drawdowns or position ahead of major downturns.
Feel free to modify input parameters for your preferences, or integrate additional data sources for further refinement.
This detailed explanation can be directly included as a description or documentation within your TradingView script, helping users grasp its full capabilities and optimal usage.
✅ Market Maker Levels (v6 Labels + Prices, No Zones)this shows previous day and weeks high n low which helps in managing the trades to find support and resistance
Liquidity Pool TimesThis script automatically plots key liquidity pool times on your chart. I will release an updated script that plots the names on the far right when i can figure it out. Until then you will see Monthly Open/Close Weekly Open/Close and Midnight/10AM open
Bitcoin ATH and ATL CyclesDraws a vertical line for ATH and ATL cycles of Bitcoin.
Values are selected based on 1064-364 days analysis.
Rolling VWAP (7D/30D/90D/365D)his indicator calculates Volume-Weighted Average Price (VWAP) across multiple
rolling time periods: 7 days, 30 days, 90 days, and 365 days.
KEY FEATURES:
- Multi-timeframe VWAP calculation using hourly and daily data
- Automatic data source selection for stablecoin pairs (USDT/USDC/USD)
- Intelligent fallback system: attempts Binance data first, then uses current chart
- Three display modes: Lines, Bands (with volatility ranges), and Horizontal Lines
- Customizable colors, labels, and text for all timeframes
HOW IT WORKS:
- VWAP = Σ(Typical Price × Volume) / Σ(Volume) over specified period
- For 7D/30D/90D: uses 60-minute intervals (168/720/2160 bars)
- For 365D: uses daily intervals
- Bands mode adds ±5% standard deviation ranges around VWAP
- Updates in real-time for Lines/Bands modes
- Updates on confirmed bars for Horizontal Lines mode
Multi-Sigma Bands [fmb]Multi-Sigma Bands
What It Is
Multi-Sigma Bands is a volatility-based statistical channel that visualizes how far price deviates from its long-term mean in standard deviation (σ) units. It offers a high-signal, low-noise view of trend strength, volatility regimes, and statistical extremes directly on price, keeping the chart clean and focused without any secondary pane.
What It Does
The indicator calculates a central basis line—using SMA, EMA, RMA, or Linear Regression—and surrounds it with multi-sigma envelopes, typically at ±1σ, ±2σ, and ±3σ. These bands represent the statistically expected ranges of price movement. The blue zone (±1σ) reflects normal volatility where roughly two-thirds of price activity occurs. The yellow zone (±2σ) captures moderate extensions that account for most of the remaining moves, while the red zone (±3σ) marks rare extremes that fall outside the 99% probability boundary. Each region is color-coded for immediate visual interpretation, allowing you to see at a glance when price is trading in calm, stretched, or extreme conditions.
Why It Was Built
Conventional Bollinger Bands tend to compress and expand too aggressively over short windows, making it difficult to read structural volatility changes. Multi-Sigma Bands addresses this by providing a longer statistical view. It helps distinguish mean reversion from sustained breakouts, quantifies trend acceleration or exhaustion, and highlights when markets move into statistically unusual zones that often precede reversals or volatility resets. It is particularly effective on monthly or weekly charts for assessing where a market sits within its long-term distribution. For instance, when the S&P 500 trades above +2σ for several months, risk-reward conditions often tighten.
How It Works
You can choose your preferred basis type—SMA, EMA, RMA, or Linear Regression—and decide whether to force monthly data even on lower timeframes for consistent macro analysis. Adjustable parameters include length, sigma multipliers, and standard deviation smoothing for fine-tuning sensitivity. The script automatically fills the space between the bands, creating a layered color map that clearly shows each volatility zone.
How To Use
When price remains above +1σ, it often confirms strong upside momentum. Consistent rejections at ±2σ or ±3σ zones can suggest exhaustion and potential mean reversion. Narrowing bands often precede volatility expansion, signaling that a breakout or trend change may be near. Multi-Sigma Bands can be used on its own for macro context or as an overlay with directional systems to refine entries and exits.
Credits
Created by Fullym0bile
Enhanced with leading trend detection logic.
www.fullymobile.ca
GROK ALTIN B2 ))GROK GOLD PRO V2 is a high-performance scalping strategy designed for XAUUSD on the 5-minute timeframe, operating with a fixed 1-lot position. It generates signals using EMA 9/21 crossover, RSI above/below 50, and volume spikes, while an ATR × 2.0 dynamic stop protects against volatility. Profits are locked in three steps (+$20, +$50, +$100), with each exit triggering real-time phone alerts showing entry, exit price, and profit. One pip movement equals $100 P&L. The strategy delivers a 92%+ win rate, average profit of +$4,432 per trade, and max drawdown of -$1,280. Simple, transparent, and fully automated.
Reversal Setup TemplatePrice Chart with:
52-week highs and lows (dotted lines)
ATR overlay for volatility context
RSI Panel for momentum and oversold/overbought signals
MACD Panel for trend exhaustion and crossover confirmation
Volume Profile (conceptually integrated for reversal zones)
Oversold Screener · v4# Step-2 Oversold Screener · v3.3
US equities · 15-minute event engine · AVWAP entries A–F · optional CVD/RSI/Z guards
## What this script does
Finds short, emotion-driven selloffs in large, healthy US stocks and turns them into actionable, right-side opportunities.
On a qualified 15-minute close it:
1. emits a minimal webhook so your backend/AI can vet the news and fundamentals, and
2. anchors an Event-AVWAP and plots ±1/±2/±3σ bands to guide entries A–F as price mean-reverts.
The logic runs in a fixed 15-minute space, independent of the chart timeframe you view.
## How an event is detected (Step-2 signal)
All conditions are evaluated on 15-minute data, including extended hours.
Depth, measured vs yesterday’s RTH reference
* Reference = min(yesterday’s RTH VWAP proxy, yesterday’s Close).
* 4h depth: current price vs reference across 16×15m bars ≤ threshold (default −4%).
* 8h depth: lowest close across the last 32×15m bars vs reference ≤ threshold (default −6%).
Relative underperformance
* Versus market ETF (SPY/QQQ) and sector ETF (XLK/XLF/XLY… or KWEB/CQQQ).
* Uses the same 16/32×15m windows; stock must be weaker by at least the set margins (default −3%).
Macro circuit breakers (any one trips = suppress signal)
* VIX level ≥ fuse (default 28).
* Market 4h/8h drawdown ≤ limits (default −2.0% / −3.5%).
* Sector 4h/8h drawdown ≤ limits (default −2.5% / −4.0%).
Momentum and distribution guards
* RSI(1h) < 30 by default (computed from 15m series).
* Optional Z-score filters: stock Z ≤ zTrig, and macro Z floors for market/sector.
* Cooldown per symbol so you don’t get spammed by repeated events.
When the event closes, the script posts a tiny JSON to your alert webhook and pins an on-chart “S2” marker at the event bar.
## Event-AVWAP and bands
From the event bar forward the script computes AVWAP natively in 15m space and draws bands at ±1σ/±2σ/±3σ.
σ is a rolling standard deviation of typical price with optional EMA smoothing and an optional cap.
Why this helps
* AVWAP from the shock timestamp approximates the crowd’s average position after the selloff.
* Reclaiming key bands often marks the start of orderly mean reversion rather than a dead-cat bounce.
## Entry proposals A–F (right-side confirmations)
Each entry requires first touching a lower band, then reclaiming a higher band.
A touch ≤ −2σ, then cross up through −1σ
B touch ≤ −1σ, then reclaim AVWAP
C break above −1σ, retest near −1σ within N bars, then bounce
D after compression (low ATR%), reclaim AVWAP
E touch ≤ −3σ, then cross up through −2σ
F touch ≤ −3σ, then cross up through −1σ (fast, aggressive)
Labeling hygiene
* Only the first three occurrences of each type A–F are shown within a one-week window after the event.
* A debounce interval avoids over-labeling across adjacent bars.
## Optional CVD gate (order-flow confirmation)
When enabled, entries must also pass a 15-minute CVD gate that looks for sell pressure exhaustion and a turn-up in cumulative delta.
Defaults are conservative; start with CVD off until you’re comfortable, then enable to filter chop after capitulations.
## Alert payload (minimal by design)
On the event bar close the script fires one alert with a tiny JSON that is easy to route and process in bulk:
```json
{
"event": "Crash_signal_15m",
"symbol": "NVDA",
"symbol_id": "NASDAQ:NVDA",
"ts_alert_15m_ms": 1730898900000,
"ts_alert_15m_local": "2025-11-06 10:45"
}
```
Notes
* ts_alert_15m_ms is the 15-minute close time in milliseconds since epoch (UTC reference).
* ts_alert_15m_local uses your chart’s timezone for readability.
Optional: a 24-hour streaming mode can resend this minimal payload on every 15-minute close during the day after the event (tiny patch available on request).
## Inputs you will actually touch
Bench/Sector symbols
* Bench: SPY or QQQ. Sector: XLK/XLF/XLY… or KWEB/CQQQ depending on the name.
Depth and relative thresholds
* 4h depth ≤ −4%, 8h depth ≤ −6%.
* Relative to market/sector ≤ −3% each.
Macro fuses
* VIX ≥ 28; market ≤ −2.0%/−3.5%; sector ≤ −2.5%/−4.0%.
Z/RSI guards
* Z window 80 bars (15m), stock zTrig ≤ −1.5, macro floors ≥ −1.0.
* RSI(1h) < 30.
AVWAP band engine
* σ EMA length 3; σ cap off by default.
* Retest window for entry C: 24 bars (≈6 hours).
Presentation and hygiene
* One-week entry window; per-type cap 3; debounce 8×15m bars.
* Signal table on/off, label pinning on/off.
## How to run it
1. Open a 15-minute chart (extended hours enabled recommended).
2. Add the indicator and choose Bench/Sector for the names you are reviewing.
3. Create a single alert per chart with Condition = Any alert() function call and Options = Once per bar close.
4. Point the alert to your webhook URL (or use app/email if you don’t have a URL).
5. Let your backend/AI receive the minimal JSON, do the news/fundamentals check, and decide Allow / Hold / Reject.
6. For Allowed names, use the on-chart A–F markers to stage in; manage risk against Event-AVWAP and upper HVNs/POC.
## Defaults that work well
* RSI(1h) < 30
* Depth 4h/8h ≤ −4%/−6% vs yesterday’s reference
* Relative to market/sector ≤ −3%
* Z: stock ≤ −1.5; macro floors ≥ −1.0
* Fuses: VIX ≥ 28; market ≤ −2.0%/−3.5%; sector ≤ −2.5%/−4.0%
* Bands: σ EMA = 3; no σ cap; one-week window; 3 labels per type
## Notes and limitations
* This is an indicator, not an auto-trader. Position sizing and exits are up to you.
* Designed for liquid US equities; thin ADRs and micro-caps are noisy.
* All event logic and entries are evaluated on bar close; AVWAP and bands do not repaint.
* If you need to monitor many symbols without a server, a Scanner variant can batch 10–17 tickers per script and alert without a webhook.
Overnight Time Box Overnight Time Box (22:59 → 09:59, minutes & TZ)
Automatically draws a time-based box for a customizable window that can cross midnight. Perfect for marking the overnight range up to London open (e.g., 22:59–09:59 in Europe/Bucharest), but works with any minute-level window.
What it does
Builds a daily box covering all price action between two user-defined times (e.g., 22:59 → 09:59).
Tracks session High/Low in real time and can plot extended HL lines for reference.
Keeps historical boxes on the chart for backtesting and review (no flicker, no errors).
How to use
Add the script to an intraday chart.
Configure:
Time zone (default: Europe/Bucharest).
Interval (HHMM-HHMM) — e.g., 2259-0959 (minutes supported).
Optional: High/Low lines, fill color, border color, line width.
Use on intraday timeframes (M1–H4).
Note: On Daily/Weekly/Monthly, a heads-up label reminds you it’s designed for intraday use.
Inputs
Time zone: correct DST handling.
Interval (HHMM-HHMM): supports windows that span midnight.
Draw High/Low lines: extended HL guides for the session.
Colors & widths: full visual customization.
Use cases
Mark the overnight range into London open (10:00 RO).
Delimit Killzones / ICT Silver Bullet windows.
Study range, liquidity raids, FVGs before major sessions.
Tech notes
Built on Pine Script v5 using input.session → stable, DST-safe.
Increased max_boxes_count / max_lines_count to preserve history.
Boxes are “frozen” at session end and remain on chart.
Limitations
Intended for intraday only.
One interval per script instance; attach multiple instances for multiple windows.
BlackScrum Swing Boxes 1/2/3 After seeing influencers selling their indicator suite's online, I decided to start making replicas of them, maybe mine are better, maybe they are worse. I use them in my day to day trading and they help me make money, hopefully they help you make money.
Not financial advice, Do Your Own Research.
Everything provided without warranty or liability. If you stuff up, learn from it, get better, we all make mistakes.
// BlackScrum — 1/2/3-Bar Swing Boxes (auto timeframe)
//
// DESCRIPTION
// This indicator displays three swing-direction boxes (1B, 2B, 3B) in the top-right corner of the chart.
// The boxes automatically adapt to the chart's timeframe (15m, 1H, 4H, 1D, etc.).
// Each box represents the direction of the most recently confirmed swing pivot:
// • 1B → 1-bar swing (fastest, most sensitive)
// • 2B → 2-bar swing (medium confirmation)
// • 3B → 3-bar swing (slowest, strongest confirmation)
//
// COLORS
// • GREEN = last confirmed swing pivot was a higher low (up swing)
// • RED = last confirmed swing pivot was a lower high (down swing)
// • GREY = no clear swing yet (fresh/transition area)
//
// CONFLUENCE
// • ALL GREEN = bullish alignment across 1B, 2B, 3B → strong trend continuation signal
// • ALL RED = bearish alignment across all three → strong downtrend continuation signal
//
// HOW TO USE (TRADEPLAY)
//
// 1) ENTRIES
// • Aggressive entry → enter when ALL GREEN prints on your timeframe.
// • Safer pullback entry → wait for 1B to briefly turn red during a green 2B/3B,
// then flip back to green. Enter on the re-flip.
// • Multi-timeframe filter:
// Take longs only when higher TF (e.g., 1H/4H) boxes are at least neutral-to-green.
//
// 2) EXITS
// • Weakness exit → when 1B flips against your position while 2B is neutral/red.
// • Full exit → when ALL RED prints.
// • Time stop → if price hasn’t moved after several bars of your execution timeframe.
//
// 3) STOP-LOSS / RISK
// • Place stops beyond the latest opposite swing used by 2B or 3B.
// • Add 0.5–1× ATR buffer if your market has stop-hunt volatility.
// • Always size position based on the distance to the swing stop.
//
// 4) WHEN TO IGNORE SIGNALS
// • Chop zones → 1B flipping repeatedly while 2B/3B disagree.
// • News candles → wait for pivots to confirm on the *closed* bar.
//
// 5) USING WITH OTHER TOOLS
// • With a trend ribbon (e.g., Larsson-style):
// Only take ALL GREEN longs when the ribbon is UP, and ALL RED shorts when ribbon is DOWN.
// • With a Fear & Greed index:
// Prefer longs when F&G > 60,
// Avoid longs when F&G < 40 unless countertrend scalping.
//
// 6) TIMEFRAME GUIDANCE
// • Scalping: 5m / 15m, confirmed by 1H or 4H boxes.
// • Swinging: 1H / 4H with daily filter.
// • Positioning: 1D with weekly confirmation.
//
// 7) INTERPRETATION CHEATSHEET
// • 1B green, 2B grey, 3B red → short-term bounce inside higher timeframe downtrend.
// • 1B/2B green, 3B grey → early trend reversal forming.
// • All grey → fresh swing area; wait for direction.
//
// 8) CUSTOMIZATION
// • len1 / len2 / len3 control sensitivity (higher = slower & cleaner).
// • Can add a timeframe header box (e.g., “15m / 4H / 1D”).
// • Can add a multi-timeframe grid (e.g., 15m | 1H | 4H | 1D each with 1B/2B/3B).
//
// ====================================================================================================
XAutoTrade Alert Builder v1.1Automate Your NinjaTrader Trading with TradingView Alerts
The XAutoTrade Alert Builder is a flexible Pine Script strategy that bridges TradingView alerts with
NinjaTrader automated trading. Design custom entry signals, configure exit strategies, and execute trades
automatically on your NinjaTrader account - all from TradingView charts.
Key Features
📊 Flexible Signal Logic
- Configure buy/sell signals independently
- Compare any two indicators or price sources using crossover, crossunder, greater than, or less than
logic
- Visual buy/sell markers on chart for easy signal verification
🎯 Multiple Exit Methods
1. ATM Strategy - Leverage your existing NinjaTrader ATM templates for advanced order management
2. Source Signals - Exit positions based on opposite entry signals
3. Fixed Levels - Set stop loss and profit targets using ticks or percentage
⚙️ NinjaTrader Integration
- Direct webhook integration with XAutoTrade backend service
- Multi-account support (trade multiple accounts simultaneously)
- Position sizing and max position limits
- Market or limit order types with configurable offset
- Time-in-force options (DAY/GTC)
- Active hours filter (US ET timezone) to control when alerts execute
🔐 Secure & Reliable
- Webhook secret authentication
- Symbol override capability
- Real-time status indicator showing configuration readiness
How It Works
1. Configure Entry Signals - Choose your buy/sell logic by comparing any two data sources (price,
indicators, etc.)
2. Set Exit Strategy - Select ATM templates, signal-based exits, or fixed stop/profit levels
3. Connect to NinjaTrader - Enter your XAutoTrade webhook secret and account details
4. Create Alert - Use the strategy's alert system to send formatted JSON payloads to your XAutoTrade
webhook
5. Trade Futures & Stocks Automatically - TradingView alerts trigger real trades in your NinjaTrader account
Perfect For
- Traders wanting to automate TradingView strategies in NinjaTrader
- Users with existing ATM templates who want TradingView signal automation
- Multi-account traders managing several NinjaTrader accounts
- Anyone seeking a no-code bridge between TradingView and NinjaTrader
Requirements
- Active XAutoTrade account and subscription
- NinjaTrader 8 with XAutoTrade AddOn installed
- TradingView Premium/Pro account (for webhook alerts)
Documentation & Support
Full setup guide and API reference available at:
xautotrade.com/docs/api-reference/order-actions
License: Mozilla Public License 2.0
---
Note: This strategy is designed for use with the XAutoTrade automation service. A valid XAutoTrade
subscription and NinjaTrader setup is required for live trading functionality.
MOHANRAJ VANAM5 mins & 15 mins & 30 mins all candle color green when BG green to support scalping to enter the trade
Momentum 8% 4% 9M + EMA CrossoversUpdated version of my previous "Momentum 8% 4% 9M" script to now include visual EMA crossover markers for EMA 10/20, 20/50, and 50/200 pairs.
This update adds distinct plotshape symbols and colors for bullish and bearish crossovers similar in style to the existing volume marker.
KANNADI MOHANRAJA SCALPING INDICATORThis indicator is designed by Kannadi Mohanraja to help traders visually identify uptrend conditions using 3-minute Heikin Ashi candles only.
🔍 Concept:
Heikin Ashi candles smooth price movements and help traders identify the market direction clearly.
When a Heikin Ashi candle closes above its open (green candle), it indicates potential bullish momentum.
⚙️ How it Works:
The script requests Heikin Ashi data from the 3-minute timeframe.
When the Heikin Ashi close price is greater than the open, it highlights the background in green to signal a potential uptrend.
A small “BUY” triangle appears below bars during these uptrend phases.
🧠 Purpose:
This script helps traders quickly recognize uptrend phases visually without using multiple indicators.
It’s ideal for scalpers and short-term traders who use Heikin Ashi charts for smooth price action confirmation.
⚠️ Note:
This indicator uses only Heikin Ashi candles — no other indicators are included.
Works best on charts set to 3-minute timeframe.
Use this as a visual guide, not as standalone trading advice.
#HeikinAshi #Uptrend #KannadiMohanraja #PineScriptV6 #Scalping
//@version=6
// © Kannadi Mohanraja
// This script is open-source and free to use for educational and analytical purposes.
// You may copy, modify, or share it with proper credit to the original author.
// Not intended as financial advice. Use at your own risk.






















