Strategy-Based Breakout Backtest by AlturoiThis educational strategy is designed to help active traders learn how to turn trading ideas into data-driven decisions by testing strategies against historical price action before risking real capital.
The script walks through the step-by-step backtesting workflow on TradingView, showing how strategy logic, entries, exits, and risk rules translate into measurable performance metrics such as win rate, drawdown, and expectancy.
What this script helps you learn:
How to backtest on TradingView using Pine Script strategies
How the Strategy Tester calculates performance results
How to interpret win rate, drawdowns, and consistency
How to validate breakout and support/resistance concepts
How to identify structural edge — or flaws — before going live
This is not a signal service or financial advice. It is an educational framework meant to help traders understand proper backtesting techniques and avoid common mistakes when evaluating trading strategies.
Use this script as a learning template to experiment, modify logic, and improve your understanding of how professional backtesting on TradingView works.
지표 및 전략
SETUP XANDAO ETFEste setap é usado para operar nos futuros, usamos essas métricas para poder achar entradas
3 EMA IndicatorThis indicator is a combination og three EMA's
This indicator is a combination og three EMA's
This indicator is a combination og three EMA's
This indicator is a combination og three EMA's
This indicator is a combination og three EMA's
50SMA bounceScans stocks that closed above Weekly 10SMA and previous week closing below the weekly 10SMA
XAU Seasonality + Setup Quality + Month Strength | WarRoomXYZXAU Seasonality Engine is a technical analysis indicator developed for the study of recurring, calendar-based behavior on XAUUSD (Gold).
The tool blends month-of-year seasonality statistics with higher-timeframe context and a setup-quality gate to help users observe when market conditions historically lean strong, weak, or neutral — and how strict trade selection should be during each regime.
Indicator Concept
An indicator for XAUUSD that combines:
1. Seasonality Regime (Month-of-Year Bias)
► Classifies the current month as Strong / Weak / Neutral based on either:
• Preset months (user-defined)
or
• Auto mode (computed from historical monthly performance)
► Strong months suggest a bullish tailwind (not a signal).
► Weak months suggest headwind / caution and require stricter setup quality.
2. Monthly Performance Engine (Under the Hood)
► Uses the symbol’s monthly timeframe data to compute, per calendar month:
• Average monthly return (%)
• Win rate (%) — how often that month closes positive
• Month Strength Score (0–100) — a blended score derived from performance data
► The score is designed to provide a relative strength snapshot of seasonality by month.
3. Month Strength Histogram
► Plots a histogram (0–100) of the current month’s strength score.
• Higher bars = historically stronger month tendency
• Lower bars = historically weaker month tendency
► Optional horizontal reference lines mark “strong” and “weak” zones to make regimes obvious at a glance.
4. Setup Quality Meter (Confluence Filter)
► The indicator calculates a Setup Quality Score (0–100) using market structure and momentum components, such as:
• EMA trend alignment
• Momentum confirmation (EMA fast vs slow)
• Structure break confirmation (BOS)
• Liquidity sweep behavior
• Candle confirmation logic
► This score is intended as a trade-selectivity filter , not a trade executor.
5. Adaptive Rules for Weak Months (Strict Mode)
► When the indicator detects a weak seasonal regime, conditions automatically tighten:
• The A+ threshold increases (adaptive thresholding)
• Optional rule: Weak months require BOS + Sweep + FVG simultaneously before any A+ condition is considered valid
This forces the user into “higher-quality-only” behavior during historically weaker seasonal periods.
🔹1 Visual Components Included
• Seasonality regime label (Strong / Weak / Neutral)
• Optional background shading based on regime
• Month Strength Score histogram (0–100)
• Current month stats: Avg return + win rate
• Setup Quality Meter value (0–100)
• Adaptive A+ threshold display
• Weak-month confluence gate status (BOS / Sweep / FVG pass/fail)
• Optional alerts when strict criteria are met
➣What Means in the XAU Indicator
🔹 Definition (in THIS indicator)
Win Rate = the percentage of historical months that closed positive for the same calendar month.
It is NOT:
trade win rate ❌
signal accuracy ❌
It is a s tatistical seasonality metric .
How It’s Calculated
For each calendar month (January, February, etc.), the indicator:
1.Looks at historical monthly candles (Monthly timeframe).
2. Counts how many times that month:
•Closed higher than it opened (or higher than previous month close).
3. Divides:
Number of positive months
÷
Total number of observed months
× 100
Example: September
If over the last 20 years:
September closed green 14 times
September closed red 6 times
Then:
Win Rate = (14 / 20) × 100 = 70%
That’s what you see as in the dashboard.
What the Win Rate Is Used For
1️⃣ Part of the Month Strength Score
The indicator blends:
•Average Monthly Return (%) → measures magnitude
•Win Rate (%) → measures consistency
Combined into:
Month Strength Score (0–100)
This avoids a common trap:
•A month with 1 huge rally but many losses ≠ reliable
•A month with steady positive closes = higher quality environment
What Win Rate Tells You
High Win Rate (e.g. 65–75%)
•Gold more often closes higher in this month
•Continuation is statistically more likely
•Pullbacks are more likely to resolve in trend direction
Low Win Rate (e.g. 35–45%)
•Gold more often fails to close higher
•More chop, deeper retracements, false breakouts
•Continuation trades statistically struggle
What It Does NOT Tell You
🚫 It does NOT mean:
•“You will win 70% of your trades”
•“Every setup in this month works”
•“Direction is guaranteed”
Seasonality is context, not prediction.
Why This Is Powerful When Combined With Your System
On its own, win rate is just data.
But in your indicator, it’s used to:
•🔒 Raise the A+ threshold in weak months
•🧠 Force BOS + Sweep + FVG confluence
•❌ Block marginal setups automatically
So instead of guessing:
-“Why is gold so choppy this month?”
You know:
-“This month historically underperforms SO I must be stricter.”
➣What Means in the XAU Seasonality Indicator
🔹 Definition (in THIS indicator)
Avg Monthly Return = the average percentage gain or loss of XAUUSD for a specific calendar month, calculated across many years.
It measures magnitude , not frequency.
It is NOT:
•trade profit ❌
•expected return for the next month ❌
•guaranteed performance ❌
It is a historical seasonality tendency.
How It’s Calculated
For each calendar month (January, February, etc.), the indicator:
1.Takes every historical occurrence of that month.
2.Calculates the percentage change of the monthly candle:
(Monthly Close − Previous Monthly Close)
÷ Previous Monthly Close × 100
3. Adds all those percentage changes together.
4. Divides by the total number of observations.
Example: September
Assume over 20 years:
+2.4%, +1.1%, −0.6%, +3.0%, +1.8%, ...
If the sum of all September returns = +28% across 20 years:
Avg Monthly Return = +1.40%
That’s the number displayed in the indicator.
What Avg Monthly Return Is Used For
1️⃣ Measuring Strength of Movement
•Win Rate → “How often does it close green?”
•Avg Monthly Return → “How big are the moves when it works?”
Both are needed.
A month can:
•Win often but move very little
•Move a lot but only occasionally
The indicator combines both to avoid misleading conclusions.
How to Interpret Avg Monthly Return
Positive Avg Return (e.g. +0.8% to +2.0%)
•Gold tends to expand during this month
•Continuation phases are more likely
•Pullbacks are often absorbed
Near-Zero Avg Return (e.g. −0.2% to +0.2%)
•Market is statistically balanced
•Expect chop, rotations, false breaks
•Continuation is less reliable
Negative Avg Return (e.g. −0.5% or worse)
•Downward pressure or heavy mean reversion
•Rallies often fade
•Risk of aggressive stop hunts
What Avg Monthly Return Does NOT Mean
🚫 It does NOT mean:
•“Price will move +1.4% this month”
•“You should buy because the number is positive”
•“This is a guaranteed edge”
It describes historical behavior, not future certainty.
Why Avg Monthly Return Matters More Than People Think
Two months can have the same win rate but behave very differently:
Example:
Month Win Rate Avg Return Reality
Month A 65% +0.2% Small, choppy wins
Month B 55% +1.6% Fewer wins, but strong expansions
Your indicator would rank Month B as stronger, which is correct for continuation-based strategies.
How It Feeds the Month Strength Score
The indicator blends:
•60% Avg Monthly Return (normalized)
•40% Win Rate
This means:
•Big moves matter more than small consistency
•But consistency still matters enough to prevent distortion
Result:
Month Strength Score (0–100)
Which is then used to:
•tighten or relax A+ thresholds
•activate weak-month strict rules
•control trade frequency
🔹2. Intended Use
The indicator is designed as a discretionary analysis tool to support study of:
• seasonal bias and calendar tendencies
• relative strength/weakness across months
• how strict trade selection should be across different regimes
• confluence behavior when seasonal conditions are unfavorable
The tool does not generate forecasts, does not guarantee outcomes, and should not be relied upon as a stand-alone decision mechanism.
🔹3.How to Use XAU Seasonality Engine
Recommended charts: XAUUSD, intraday (5m–15m) with a HTF context (1H–4H).
1. Identify the Seasonal Regime
• Strong month → you can allow more continuation bias (still require structure).
• Neutral month → trade normally, standard criteria.
• Weak month → tighten selection, demand clean A+ conditions only.
2. Read the Month Strength Histogram
• If the score is high (e.g., 70+), the month has historically shown stronger tendency.
• If the score is low (e.g., 40 and below), expect slower conditions, deeper pullbacks, or more chop — and reduce marginal trades.
3. Use the Setup Quality Meter as the Gate
► In normal/strong months:
• A+ threshold is moderate (e.g., 70)
► In weak months:
• A+ threshold is higher (e.g., 80+)
• Optional strict mode: must also pass BOS + Sweep + FVG alignment
4. Example Trade Logic (Framework, Not Signals)
► Bullish framework in a Strong Month:
• Seasonal regime = Strong (tailwind)
• Structure supports bullish continuation (trend alignment)
• Sweep occurs into demand / liquidity grab
• Setup Quality reaches A+ threshold
• Entry: confirmation candle or retrace to key level
• SL: beyond sweep low / invalidation
• TP: nearest liquidity / prior highs / HTF level
► Weak Month rule-set (Strict Mode):
• Seasonal regime = Weak (headwind)
• Only consider trades if:
✅ BOS confirms direction
✅ Sweep occurs and rejects cleanly
✅ FVG exists recently (or is mitigated if you choose that model)
✅ Setup Quality exceeds the elevated adaptive threshold
If any one is missing → no trade
This is not meant to “predict” gold — it’s meant to enforce discipline when seasonality historically underperforms.
🔹4.Limitations and User Responsibility
► The indicator does not represent financial advice or imply performance expectations.
► Seasonality is statistical tendency, not certainty — macro conditions can override it.
► Results vary by broker feed, timeframe, and settings.
► Users should test thoroughly in simulation before applying to live markets.
► All trading decisions, risk management, and execution remain solely the responsibility of the user.
🔹5. Alerts
Optional alerts can notify when:
• a new month begins and the seasonal regime changes
• A+ criteria are met
• weak-month strict conditions pass (BOS + Sweep + FVG)
Alerts are informational only and do not constitute actionable recommendations.
Disclaimer
This script is provided for informational and educational purposes only . It does not provide financial, investment, or trading advice, and it does not guarantee profits or future performance. All decisions made based on this script are solely the responsibility of the user.
This script does not execute trades, manage risk, or replace the need for trader discretion. Market behavior can change quickly, and past behavior detected by the script does not ensure similar future outcomes.
Users should test the script on demo or simulation environments before applying it to live markets and must maintain full responsibility for their own risk management, position sizing, and trade execution.
Trading involves risk, and losses can exceed deposits. By using this script, you acknowledge that you understand and accept all associated risks.
Print Bar DataThis script print out the recent bar data. You can configure the position, bar numbers, of the data
ProTradersNetwork-inefficiencyInefficiency Candles Colored, No matter the timeframe, ensures clear visibility of which candles had the most momentum.
Fixed Time Frame EMA [TickDaddy]Show a 50 period EMA on the 15 minute timeframe on any other timeframe like 5 min, 1 min, 1 hour, etc.. etc..
it's all customizable, you choose the timeframe, ema, color, all that good stuff.
3 Trading Sessions [TickDaddy]Customizable 3 trading session indicator. Asia, Longdon, New York. Adjust times for each session, color, opacity. toggle if you want to see future sessions coming up.
High Vol Big Move (Up or Down)Nine million EP with 4% stock moved up or down, and today's volume is more than yesterday's volume.
Universal Moving Average🙏🏻 UMA (Universal Moving Average) represents the most natural and prolly ‘the’ final general universal entity for calculating rolling typical value for any type of time-series. Simply via different weighting schemes applied together, it encodes:
Location of each datapoint in corresponding fields (price, time, volume)
Informational relevance of each datapoint via using windowing functions that are fundamental in nature and go beyond DSP inventions & approximations
Innovation in state space (in our case = volatility)
The real beauty of this development: being simply a weighting scheme that can be applied to anything: be it weighted median , weighted quantile regression, or weighted KDE , or a simple weighted mean (like in this script). As long as a method accepts weights, you can harness the power of this entity. It means that final algorithmic complexity will match your initial tool.
As a moving ‘average’ it beats ALMA, KAMA, MAMA, VIDYA and all others because it is a simple and general entity, and all it does is encoding ‘all’ available information. I think that post might anger a lot of people, because lotta things will be realized as legacy and many paywalls gonna be ignored, specially for the followers of DSP cult, the ones who yet don’t understand that aggregated tick data is not a signal omg, it’s a completely different type of time series where your methods simply don’t fit even closely. I am also sorry to inform y’all, that spectral analysis is much closer to state-space methods in spirit than to DSP. But in fact DSP is cool and I love it, well for actual signals xD
...
Weights explained & how to use them: as I already said, the whole thing is based on combining different set of weights, and you can turn them on/off in script settings. Btw I've set em up defaults so you can use the thing on price data out of the box right away.
Price, Time, Volume weights: encode location of every datapoint in Price & TIme & Volume field
Howtouse: u have to disable one weight that corresponds to the field you apply UMA to. E.g if you apply UMA to prices, you turn off price weighting And turn on time and volume weighting. Or if you apply UMA to volume delta, you turn off volume weighting And turn on price and time weighting.
Higher prices are more important, this asymmetry is confirmed and even proved by the fact that prices can’t be negative (don’t even mention that incorrect rollover on CL contract in 2k20...).
Signal weights: encode actuality/importance/relevance of datapoints.
Howtouse: in DSP terms, it provides smoothing, but also compensates for the lag it introduces. This smoothness is useful if you use slope reversals for signal generation aka watching peaks and valleys in a moving average shape. It's also better to perturb smoothed outputs with this , this way you inject high freq content back, But in controlled way!
Signal = information.
The fundamental universal entity behind so-called “smoothing” in DSP has nothing to do with signals and goes eons beyond DSP. This is simply about measuring the relevance of data in time.
First, new datapoints need some time to be “embedded” into the timeline, you can think of it as time proof, kinda stuff needs time to be proved, accepted; while earliest datapoints lose relevance in time.
Second, along with the first notion, at the same time there’s the counter notion that simply weights new data more, acting as a counterweight from the down-weighting of the latest datapoints introduced by the first notion.
The first part can be represented as PDF of beta(2, 2) window (a set of weights in our case). It’s actually well known as the Welch window, that lives in between so called statistical and DSP worlds, emerges in multiple contexts. Mainstream DSP users tho mostly don’t use this one, they use primitive legacy windowing function, you can find all kinds on this wiki page.
Now the second part, where DSP adepts usually stop, is to introduce the second compensating windowing function. Instead they try to reduce window size, or introduce other kinds of volatility weights, do some tricks, but it ain’t provides obviously. The natural step here is to simply use the integral of the initial window; if the initial window is beta(2, 2) then what we simply need is CDF of beta(2, 2), in fact the vertically inverted shape of it aka survival function . That’s it bros. Simply as that.
When both of these are applied you have smth magical, your output becomes smooth and yet not lagging. No arbitrary windowing functions, tricks with data modification etc
Why beta(2, 2)? It naturally arises in many contexts, it’s based on one of the most fundamental functions in the universe: x^2. It has finite support. I can talk more bout it on request, but I am absolutely sure this is it.
^^ impulse response of the resulting weighs together (green) compared with uniform weights aka boxcar (red). Made with this script .
Weighing by state: encodes state-space innovation of each datapoint, basically magnitude of changes, strength of these changes, aka volatility.
Howtouse: this makes your moving average volatility aware in proper math ways. The influence of datapoints will be stronger when changes are stronger. This is weighting by innovations, or weighting by volatility by using squared returns.
Why squared returns? They encode state‑space innovations properly because the innovation of any continuous‑time semimartingale is about its quadratic variation, and quadratic variation is built from squared increments, not absolute increments.
Adaptive length is not the right way to introduce adaptivity by volatility xD. When you weight datapoints by squared returns you’re already dynamically varying ‘effective’ data size, you don’t need anything else.
...
It’s all good, progress happens, that’s how the Universe works, that's how Universal Moving Average works. Time to evolve. I might update other scripts with this complete weighting scheme, either by my own desire or your request.
...
∞
Order Blocks & ImbalanceThis indicator automatically identifies and plots Order Blocks (also known as Fair Value Gaps or Imbalances) based on Smart Money Concepts (SMC) and ICT methodology. It detects significant price inefficiencies (gaps between candles) that often act as institutional supply or demand zones.
How It Works (Technical Methodology)
1. Fair Value Gap (FVG) Detection
The indicator identifies classic 3-candle imbalances:
- Bullish Order Block (Demand): When the low of the current candle is significantly below the high of the candle two bars ago (low - high ).
- Bearish Order Block (Supply): When the high of the current candle is significantly above the low of the candle two bars ago (low - high ).
A minimum size threshold is enforced using ATR(14) × user-defined multiplier (default 0.5) to filter out minor gaps and focus on meaningful inefficiencies.
2. Zone Creation
- Bullish zones are created at the candle two bars ago (the "origin" candle where inefficiency occurred).
- Bearish zones use the same origin candle.
- Zone boundaries:
Top = high of origin candle
Bottom = low of origin candle
This captures the full range where price moved aggressively, leaving an imbalance that institutions may later revisit.
3. Mitigation Detection
Zones can be mitigated in two ways (user-selectable):
- "Close": Zone is considered touched only if the close price enters the zone.
- "Wick": Zone is touched if any wick (high/low) enters the zone (more sensitive).
When mitigated:
- Background becomes more transparent
- Border turns dotted
- Label changes to "Mitigated"
Broken zones (price fully closes beyond the opposite side) are automatically deleted.
4. Zone Lifecycle Management
- Active Zone: Strong color fill (green for demand, red for supply) with solid border.
- Mitigated Zone: Faded color, dotted border – indicates partial fill or reduced strength.
- Broken Zone: Automatically removed from chart to reduce clutter.
Old zones are also pruned when exceeding 450 total to maintain performance.
5. Smart Visibility Engine (Optional)
When enabled:
- All zones are initially hidden.
- Only the closest relevant zones are shown:
- Up to user-defined limit (default 10) highest bullish zones (closest below price)
- Up to user-defined limit (default 10) lowest bearish zones (closest above price)
- Visible zones are automatically extended to the right and styled appropriately.
This keeps the chart clean while highlighting the most actionable zones near current price.
6. Visual Elements
- Demand Zones: Green fill, labeled "OB Demand"
- Supply Zones: Red fill, labeled "OB Supply"
- Tiny text size to minimize chart clutter
- Zones drawn as boxes using bar_index positioning
How to Use
Order Blocks represent areas of price inefficiency where smart money likely entered/exited positions aggressively.
- Demand Zones (Green): Potential long entry areas when price returns. Expect buying pressure to defend these levels. Best setups when price retests an active (non-mitigated) zone.
- Supply Zones (Red): Potential short entry areas when price returns. Expect selling pressure to emerge.
- Mitigated Zones: Lower probability – may act as weaker support/resistance.
- Smart Visibility: Highly recommended for cleaner charts. Focuses attention on zones most likely to be tested soon.
- Combine with:
- Break of Structure (BOS)/Change of Character (CHOCH)
- Liquidity grabs
- Higher timeframe confluence
- Volume or momentum confirmation
Use higher FVG threshold (e.g., 0.8–1.0) for fewer, higher-quality zones. Lower threshold for more aggressive detection.
Disclaimer
This indicator is a technical analysis tool and should be used in conjunction with other forms of analysis. Past performance does not guarantee future results. Always use proper risk management.
VWAP Extreme Zones (Elite Style)Short Description
VWAP Extreme Zones (Elite Style) highlights statistically stretched price areas above and below VWAP, helping traders identify potential overextension, mean-reversion zones, and high-risk breakout areas during intraday sessions.
Disclaimer
This indicator is provided for educational and analytical purposes only.
It does not constitute financial advice or trade signals.
All trading involves risk. Always confirm with price action, market context, and proper risk management before taking any trade.
Elephant Edge Session Levels Predictor**Elephant Edge** is a robust trading tool designed to streamline decision-making for swing and intraday traders alike. It combines accuracy and simplicity to help you spot promising buy and sell signals with ease. The Session Levels Predictor+ feature draws upper and lower percentile lines derived from session data, enabling traders to pinpoint key support and resistance areas accurately. It computes these percentile projections from daily sessions automatically and displays them as sleek, adjustable lines—perfect for intraday and short-term strategies focused on statistical price boundaries.
For **swing traders**, Elephant Edge highlights pivotal market reversals and trend shifts, allowing you to seize bigger trends and maintain momentum. For **intraday traders**, it offers precise buy and sell thresholds, providing reliable entry and exit cues during active market hours.
No matter if you're chasing quick trades or sustaining positions over several sessions, Elephant Edge promotes a methodical and disciplined strategy. Its smart signals cut through market clutter, delivering a solid advantage while eliminating emotional biases.
With **Elephant Edge**, you shift from merely responding to the market to trading with **precision, assurance, and reliability**.
TradingSystems_AlphaLib_v1_FinalLibrary "TradingSystems_AlphaLib_v1_Final"
Master Library for Institutional Analysis v1
@author jmcanovelles
calc_ema(len)
Calculates standardized EMA
Parameters:
len (simple int)
calc_adx(len)
Calculates precise ADX and DI
Parameters:
len (simple int)
Quant VWAP System 3.8 This is the lower-indicator companion to the "Quant VWAP System." While the main chart tells you where the price is, this oscillator tells you how statistically significant the move is.
It uses a Z-Score algorithm to normalize price action. This means it ignores dollar amounts and instead measures how many Standard Deviations (SD) the price is away from its mean (VWAP). This allows you to instantly spot "Overbought" or "Oversold" conditions on any asset (Bitcoin, Forex, or Stocks) without needing to guess.
Key Features:
1. Normalized Extremes (The "Kill Zones")
±2.0 SD: These dotted lines represent statistical extremes. When the signal line crosses above +2.0, the asset is mathematically expensive (Overbought). When it crosses below -2.0, it is mathematically cheap (Oversold).
The Logic: Price rarely sustains movement beyond 2 Standard Deviations without a reversion or a pause.
2. The Squeeze Radar (Yellow Dots)
Volatility Detection: A row of Yellow Dots appearing on the center line indicates a "Squeeze."
What it means: The Standard Deviation bands are compressing. Energy is building.
Warning: DO NOT trade Mean Reversion when you see Yellow Dots. A squeeze often leads to a violent breakout. Wait for the dots to disappear to confirm the direction of the explosion.
3. Momentum Coloring
Green Line: Z-Score is rising (Bullish Momentum).
Red Line: Z-Score is falling (Bearish Momentum).
This helps you spot divergences (e.g., Price makes a Higher High, but the Oscillator makes a Lower High = Exhaustion).
How to Trade with It
Strategy A: The "Zero Bounce" (Trend Continuation)
Scenario: You are in a Bull Trend.
Signal: The Oscillator line pulls back to the Zero Line (White), turns Green, and curls upward.
Meaning: Price has tested the average (VWAP) and buyers have stepped in. This is a high-probability entry for trend continuation.
Strategy B: The "Extreme Fade" (Reversion)
Scenario: The Oscillator pushes deep into the Red Zone (+2.0 SD).
Signal: The line turns Red and crosses back down below the +2.0 dotted line. A small Red Triangle will appear.
Meaning: The statistical extension has failed, and price is likely snapping back to the mean.
Strategy C: Squeeze Breakout
Scenario: Yellow Dots appear on the center line.
Action: Stop trading. Wait.
Signal: The dots disappear, and the line shoots aggressively through +1.0 SD (Long) or -1.0 SD (Short). Ride the momentum.
Linear Regression ChannelsThis indicator dynamically identifies and plots the best-fit linear regression channels based on recent pivot points, optimizing for statistical strength across user-defined depths.
How It Works (Technical Methodology)
1. Pivot Point Detection
The indicator uses Pine Script's ta.pivothigh() and ta.pivotlow() functions with a configurable sensitivity length to detect swing highs and lows. All recent pivot indices are stored in an array (limited to avoid performance issues), providing potential starting points for regression calculations.
2. Multi-Depth Evaluation
Users input comma-separated "Pivot History Depths" (e.g., "5,20,50"). For each depth:
- The script evaluates regression fits starting from the most recent pivots, up to the specified depth count.
- It calculates linear regression statistics for each possible channel originating from those pivot bars backward to the current bar.
3. Linear Regression Calculation
For each candidate channel:
- Slope (m) and intercept (b) are computed using least-squares method.
- R-squared (R²) measures goodness of fit (how well price follows the trend line).
- Standard error of the estimate is calculated to quantify volatility around the regression line.
- A composite score = R² × log(length) prioritizes stronger fits on longer periods.
4. Best-Fit Selection and Validation
- Only channels with R² ≥ user-defined minimum (default 0.5) are considered valid.
- The channel with the highest score for each depth is selected and drawn.
- This ensures the most statistically significant and relevant channels are displayed, avoiding weak or short-term noise.
5. Channel Construction
- Mean Line: The regression trend line extended slightly into the future.
- Inner Channels: ± user-configurable standard deviation multiplier (default 2.0σ) around the mean.
- Outer Bands: ±1.5× the inner deviation for additional visual context.
- Filled areas between mean and inner channels for better visibility.
- Color: Green shades for upward slopes (bullish trend), red shades for downward slopes (bearish trend).
6. Dashboard and Statistics
- Optional table in the top-right corner displays for each depth:
- Depth value
- R² (colored green if >0.7, orange otherwise)
- Slope (Beta) – positive blue for uptrend, red for downtrend
- Current Z-Score: How many standard deviations the latest close is from the expected regression value (yellow if |Z| > 2)
How to Use
Regression channels help identify trending markets, potential mean reversion, and overextension.
- Upward Channels (Green): Price above the mean may indicate strength; pullbacks to the mean or lower band offer long opportunities. Overextension above upper band could signal exhaustion.
- Downward Channels (Red): Price below the mean may indicate weakness; rallies to the mean or upper band offer short opportunities. Overextension below lower band could signal capitulation.
- High R² (>0.7): Strong trending channel – trade in direction of slope.
- Low R²: Choppy/range-bound market – avoid trend-following trades.
- Z-Score: |Z| > 2 suggests price is statistically overextended from the trend (potential reversion setup).
- Multi-Depth: Smaller depths catch short-term trends; larger depths capture major trends. Use multiple for confluence across timeframes.
Combine with volume, support/resistance, or other indicators for confirmation.
Disclaimer
This indicator is a technical analysis tool and should be used in conjunction with other forms of analysis. Past performance does not guarantee future results. Always use proper risk management.
RVOL Text This script will give you the Relative volume at the time in a numbered text on your charts.
Prop ES EMA Cross during Single/Dual Trading SessionEMA crossover strategy for ES futures optimized for prop firm rules.
Choose long-only, short-only, or both directions.
Customizable short and long EMA lengths.
Enter trades during one or two configurable sessions specified in New York time.
Fixed TP/SL in ticks with forced close by 4:59 PM NY time.
cd_VW_Cx IMPROVED - Quant VWAP System: Regime, Magnets & Z-ScoQuant VWAP System: Regime, Magnets & Z-Score Matrix
This indicator is a comprehensive Quantitative Trading System designed to move beyond simple support and resistance. Instead of static lines, it uses Statistical Probability (Z-Score) and Standard Deviation to define the current market regime, identify institutional value zones, and project high-probability liquidity targets.
It is engineered for Day Traders and Scalpers (Crypto & Futures) who need to know if the market is Trending, Ranging, or preparing for a Breakout.
1. The "Regime" System (Standard Deviation Bands)
The core engine anchors a VWAP (Volume Weighted Average Price) to your chosen timeframe (Daily, Weekly, or Monthly) and projects volatility bands based on market variance.
The Trend Zone (Inner Band / 1.0 SD): This is the "Fair Value" zone. In a healthy trend, price will pull back into this zone and hold. A hold here signals a high-probability continuation (Trend Following).
The Reversion Zone (Outer Band / 2.0 SD): This represents a statistical extreme. Price rarely sustains movement beyond 2 Standard Deviations without a reversion. A touch of this band signals "Overbought" or "Oversold" conditions.
2. Liquidity Magnets (Virgin VWAPs)
The script automatically tracks "Unvisited VWAPs" from previous sessions. These are price levels where significant volume occurred but have not yet been re-tested.
The Logic: Algorithms often target these "open loops." The script visualizes them as Blue Dashed Lines with price tags.
Smart Scaling (Anti-Scrunch): Includes a custom "Ghost Engine" that automatically hides or "ghosts" magnets that are too far away. This prevents your chart from being squashed (scrunched) on lower timeframes, keeping your candles perfectly readable while still tracking targets in the background.
3. The Quant Matrix (Dashboard)
A real-time Heads-Up Display (HUD) that interprets the data for you:
Regime: Detects Volatility Squeezes. If the bands compress, it signals "⚠ SQUEEZE", warning you to stop mean-reversion trading and prepare for an explosive breakout.
Bias: Color-coded Trend Direction (Bullish/Bearish) based on VWAP slope.
Signal: actionable text prompts such as "BUY DIP" (Trend Following), "FADE EXT" (Mean Reversion), or "PREP BREAK" (Squeeze).
4. Visual Intelligence
Bold Day Separators: Clear, vertical dotted dividers with Date Stamps to instantly separate trading sessions.
Dynamic Labels: Floating labels on the right axis identify exactly which deviation level is which, preventing chart confusion.
How to Use
Strategy A: The Trend Pullback (continuation)
Check Matrix: Ensure Bias is BULLISH (Green).
Wait: Allow price to pull back into the Inner Band (Dark Green Zone).
Trigger: If price holds the Center VWAP or the -1.0 SD line, enter Long.
Target: The next Liquidity Magnet above or the +2.0 SD band.
Strategy B: The Reversion Fade (Counter-Trend)
Check Matrix: Ensure price is labeled "EXTREME" or Signal says "FADE EXT".
Trigger: Price touches or pierces the Outer Band (2.0 SD).
Action: Enter counter-trend (Short) with a target back to the Center VWAP (Mean Reversion).
Strategy C: The Magnet Target
Identify a "MAGNET" line (Blue Dashed) near current price.
These act as high-probability Take Profit levels. Price will often rush to these levels to "close the loop" before reversing.
Settings
Anchor: Daily (default), Weekly, or Monthly.
Magnet Focus Range: Adjusts how aggressively the script hides distant magnets to fix chart scaling (Default: 2%).
Visuals: Fully customizable colors, label sizes, and dashboard position.
Witch-Fire ALMA signals: Dynamic Liquidity & Trend GlowThe Witch-Fire ALMA is a high-precision trend bias and liquidity mapping tool designed for price action traders and Smart Money practitioners. Unlike traditional indicators that clutter your chart with lagging signals, this script provides a "clean-yet-powerful" visual anchor to help you stay on the right side of the market while identifying key Points of Interest (POIs).
At its core, the script utilizes an optimized Arnaud Legoux Moving Average (ALMA). Known for its superior ability to balance smoothness and responsiveness, the ALMA effectively filters out market noise and "whipsaws" that often plague standard EMAs.
Key Features:
The Witch-Fire Glow: A neon-styled ALMA line that shifts between Bullish Green and Bearish Red. The white core provides surgical precision for price intersection, while the outer glow visualizes the strength and dominance of the current trend.
Scaled Liquidity Levels: Automatically maps Buy Side Liquidity (BSL) and Sell Side Liquidity (SSL). These levels are dynamic—they scale proportionally with your ALMA settings. This ensures that the liquidity zones you see are always relevant to the trend cycle you are analyzing.
Strategic Bias Background: A subtle background tint provides an instant psychological filter. Only look for Longs in the green zone and Shorts in the red zone to maintain a high-probability strike rate.
How to Trade with Witch-Fire:
Identify the Bias: Look at the Fire ALMA. If the "fire" is red and the price is below the line, your bias is strictly bearish.
Watch the Sweeps: Wait for the price to "sweep" (pierce with a wick) the horizontal SSL (Green) or BSL (Red) lines.
Execution: Look for a strong rejection candle (long wick, small body) at these levels that closes back towards the ALMA line.
Best Used On: 15m, 1H, and 4H timeframes. Works exceptionally well for Crypto, Forex, and Indices.
EMA 1 & SALMA Intersection StrategyTrading Strategy: EMA 1 & SALMA Crossover System
This strategy is a Trend-Following system that focuses on the direct interaction between the price (represented by EMA 1) and a smoothed trendline (SALMA). Instead of relying on the color changes of the indicator, it uses mechanical crossover signals to enter and exit trades.
1. Indicators Used
EMA 1 (Exponential Moving Average): Since the period is 1, it effectively represents the Current Price. It reacts instantly to every market move.
SALMA v3.0 (Smoothed Adaptive Lattice Moving Average): A double-smoothed moving average that acts as the "Base Line" or "Trend Support/Resistance."
RSI (Relative Strength Index): Used as a Momentum Filter to ensure we don't trade against the market's strength.
2. Buy (Long) Entry Rules
You enter a Long position when the following conditions are met:
The Crossover: The EMA 1 (Price) crosses ABOVE the SALMA line. This indicates that the short-term momentum is shifting higher than the average trend.
The Filter (RSI): The RSI must be above 50. This confirms that the buyers are in control and the upward move has enough strength.
3. Sell (Short) Entry Rules
You enter a Short position when the following conditions are met:
The Crossunder: The EMA 1 (Price) crosses BELOW the SALMA line. This indicates a breakdown in price action.
The Filter (RSI): The RSI must be below 50. This confirms that the sellers are dominating and the downward momentum is real.
4. Key Advantages of This System
Objectivity: You don't guess based on the color of the line; you wait for a clear physical break (cross) of the line.
Precision: By using EMA 1, you get the earliest possible entry signal compared to slower moving averages.
False Signal Protection: The RSI 50 filter prevents you from entering "weak" trades where the price crosses the line but lacks the volume or momentum to continue.






















