BB Fill + Visible-Range Fib Retracement# BB Fill + Visible-Range Fib Retracement
A 2-in-1 Pine Script indicator that bundles a **Bollinger Bands volatility fill** and a **visible-range Fibonacci retracement** into a single script. If your TradingView plan limits the number of indicators you can have on a chart at once, this lets you get both tools for the price of one indicator slot.
## Bollinger Bands (grey fill)
Standard Bollinger Bands math is used under the hood:
- **Basis** = Simple Moving Average (SMA) of the source over the chosen length.
- **Upper band** = Basis + (StdDev of source over the length × multiplier).
- **Lower band** = Basis − (StdDev of source over the length × multiplier).
Unlike a typical BB indicator, the basis, upper, and lower lines are **not drawn**. Only the shaded area between the upper and lower bands is visible, giving a quick, uncluttered read on volatility/price range without adding extra lines to your chart.
**Inputs:**
- **BB Length** (default `20`) — number of bars used for the moving average and standard deviation.
- **BB Source** (default `close`) — price series the calculation is based on.
- **BB StdDev Multiplier** (default `2.0`) — how many standard deviations the bands extend from the basis.
- **BB Fill Color** (default grey) — color of the shaded band.
- **BB Fill Transparency %** (default `85`) — how transparent the shading is (higher = more transparent/subtle).
## Visible-Range Fibonacci Retracement
This tool automatically scans the bars **currently visible on your screen** to find the highest high and the lowest low, then draws the standard Fibonacci retracement levels between them:
`0, 0.236, 0.382, 0.5, 0.618, 0.786, 1`
The retracement direction is auto-detected: if the low occurred before the high in the visible range, it's treated as an uptrend (levels retrace down from the high); otherwise it's treated as a downtrend (levels retrace up from the low). Each level is drawn as a horizontal line spanning the visible range, with an optional price label at the right edge showing the level ratio and its price.
**Inputs:**
- **Show Fib Retracement** — toggles the fib lines on/off.
- **Show Fib Price Labels** — toggles the price labels next to each fib line on/off.
**Important behavior to understand:** the lines update to reflect the highest high/lowest low of whatever range you're viewing when you scroll or zoom the chart, but Pine Script only allows a script to redraw on the arrival of new bar/tick data or when the chart is reloaded — not on every scroll/zoom gesture by itself. In practice this means the levels catch up shortly after you stop interacting with the chart (or on the next price update), rather than tracking your viewport in real time. Because of this, the tool is a **discretionary visual aid** meant for manual chart reading, not a deterministic signal — it should not be used as input to automated strategies or backtests, since its output depends on your current viewport rather than a fixed, reproducible calculation.
## How to use
- Use the grey BB fill as quick visual context for current volatility — a wide band suggests an expansive/volatile market, a narrow band suggests consolidation.
- Use the fib levels as an on-the-fly support/resistance reference for whatever swing high/low is currently in view — zoom or scroll to the price range you care about, let the chart refresh, and read the levels as potential reaction zones.
- Combine both: watch for price reacting near a fib level while inside or near the BB shaded zone for added confluence.
## Settings summary
| Input | Default | Description |
|---|---|---|
| BB Length | 20 | Number of bars for the SMA basis and standard deviation. |
| BB Source | close | Price series used for the Bollinger Bands calculation. |
| BB StdDev Multiplier | 2.0 | Multiplier applied to standard deviation to set band width. |
| BB Fill Color | grey | Color of the shaded area between the bands. |
| BB Fill Transparency (%) | 85 | Transparency of the BB shading. |
| Show Fib Retracement | true | Toggles drawing of the fib retracement lines. |
| Show Fib Price Labels | true | Toggles price labels next to each fib line. |
## Limitations
- The fib retracement only redraws when new bar/tick data arrives or the chart reloads — it does not update live as you scroll or zoom, due to a Pine Script platform limitation.
- Not intended for automated strategy logic or backtesting: the visible-range calculation is viewport-dependent and not deterministic across runs.
- The script keeps an internal history array of bar times/highs/lows that grows as the chart's loaded history grows, which can add a small amount of memory/processing overhead on very long chart histories.
---
Last updated (UTC): 2026-09-13 08:41:01 UTC
指标

Bitcoin CME Gaps [PhantomCipher]Bitcoin CME Gaps
Bitcoin trades around the clock, but CME Bitcoin futures stop trading over the weekend. When CME reopens, its chart often opens away from Friday's close, leaving a "CME gap". This indicator draws the CME closing level on your Bitcoin chart for the whole weekend, so you can see how far price has moved from it while CME is closed.
SNAPSHOT: a 15m Bitcoin chart over one weekend, with the blue CME line and the shading between it and price
Recommended timeframe: 15 minutes
The weekend window is worked out from each candle's opening time, so the line needs candles small enough to start when CME closes and end when it reopens. The 15-minute chart is what this indicator is designed and tested for.
How it works
Weekend window: from Friday 21:00 UTC to Sunday 22:00 UTC. That matches CME Bitcoin futures hours while US daylight saving time is in effect. In winter, CME closes and reopens one hour later.
CME line: a blue line at the price where the weekend began. It's drawn only during the weekend and stops when CME reopens.
Shading: the area between the line and price is green while price is above the line and pink while it's below, so you can see the direction of the gap as it forms.
The weekend window check, with the day and hour in the chart's timezone (UTC for crypto):
(hour >= 21 and dayofweek == 6) or (dayofweek == 7) or (hour < 22 and dayofweek == 1)
SNAPSHOT: close-up of Sunday's reopen, with the line ending where CME resumes trading
Settings
Chart Price | CME Price: on by default, and the line uses your chart's own price at the start of the weekend. Turn it off to use CME:BTC1!'s last price instead, which can differ from spot or perpetual prices.
Only Show Weekend Gaps: on by default, and the line appears only in the weekend window above. Turn it off to draw a line whenever CME:BTC1! has no candle, which also covers CME's daily one-hour break and exchange holidays, at the cost of a busier chart.
Show +/-1% From Close: off by default. Adds yellow lines 1% above and 1% below the CME line.
Limitations
With "Only Show Weekend Gaps" on, lines appear only on crypto charts, index charts and charts in the UTC timezone.
The weekend window uses fixed UTC hours, so in winter it starts and ends one hour before CME's actual close and reopen.
The line marks the level while CME is closed. It does not keep drawing gaps that are still unfilled after CME reopens.
Example chart: BYBIT:BTCUSDT.P
This indicator marks where CME closed. It's not a trading signal on its own, and a gap is not guaranteed to fill, so combine it with your own analysis and risk management.
指标

策略

ATK/DEF Session Equilibrium State ATK/DEF - Session Equilibrium State is a session-based market analysis framework built around three defined market sessions: Asia, London, and New York.
The core structure consists of three independent session moving averages. Each moving average is assigned to a specific market session and calculated according to the selected moving-average type and length.
### Core Structure
* **Asia Session MA**
Independent moving average for the Asia session.
* **London Session MA**
Independent moving average for the London session.
* **New York Session MA**
Independent moving average for the New York session.
* **Session-Based MA Structure**
Three independent moving averages representing the three defined market sessions.
* **Global MA Reference**
Optional global moving average for additional structural reference.
* **Breakout / Fakeout State**
Records Break Up, Break Down, and Fakeout conditions based on the relationship between price and the corresponding session moving average.
* **Session State Panel**
Displays the defined state, direction, and result for each session.
### Session Equilibrium Framework
The framework uses independent moving-average structures to observe the relationship between price and the corresponding market session.
Asia, London, and New York are treated as separate session layers, with each layer maintaining its own moving-average structure and defined state conditions.
Breakout and Fakeout classifications are generated from the price and moving-average conditions defined within the script.
### Analytical Purpose
This script is intended solely for market observation, quantitative analysis, and defined decision-making.
Market direction and structural interpretation remain subject to the own analysis and decision-making.
**Market observation, quantitative analysis, and defined decision-making only.**
指标

ATK /DEF Super Temporal Session Sequence State EngineATK/DEF Super Temporal Session Sequence State Engine is a multi-dimensional quantitative market analysis framework combining multi-timeframe structure, multi-session sequencing, price position, volume relationships, volatility structure, swing references, and rule-based market-state classification.
The framework integrates multiple temporal layers across Monthly, Weekly, Daily, 4H, and 1H structures, together with Asian, London, and New York session data.
### Core Framework
* **Multi-Timeframe Structure** — Monthly, Weekly, Daily, 4H, and 1H market data.
* **Multi-Session Structure** — Asian, London, and New York session ranges and state relationships.
* **Session High / Low Reference** — Session-based structural boundaries and break conditions.
* **AVG Telescope** — Multi-period price-position aggregation across different temporal layers.
* **Volume Relationship** — Relative volume relationships across multiple periods.
* **Volatility Structure** — ATR-based volatility measurement and state classification.
* **Market-State Classification** — Rule-based classification derived from defined mathematical conditions.
* **Swing Structure** — Swing High and Swing Low structural references.
### Multi-Dimensional Architecture
The framework combines time, session structure, price position, volume, volatility, statistical relationships, and structural references into a unified analytical layer.
Rather than reducing market conditions to a single value, it presents multiple calculated dimensions and their relationships within the same framework.
All displayed values, states, classifications, and structural references are generated from the mathematical rules defined within the script.
### Analytical Purpose
Designed for market observation, quantitative analysis, and-defined decision-making..
**Market observation, quantitative analysis, and-defined decision-making only.**
指标

Atty Expected Move ConeA 0DTE option prices one thing: how far price can travel between now and this afternoon's settle. That number shrinks all day, because the time it is paying for is running out. This draws it.
The cone opens at the current price and reaches the session close. Its width there is the expected move still to come. As the session runs the cone re-anchors to price and the whole thing contracts, arriving at the closing bell with nothing left - the same shape an option's time value traces, for the same reason.
THE CLOCK IT USES
How much of a session's variance is still ahead is not the same as how much of the clock is still ahead. Measured on 997 ES sessions, 2021 to 2025:
first hour 28.0% of the session's variance
12:00 to 14:00 20.9%
last hour 16.0%
a flat clock would say 15.4% per hour
The opening fifteen minutes alone carry 8.5%, more than twice their share. So the cone decays on a variance clock built from that profile, not on the wall clock.
Tested against what actually happened, the variance clock keeps the normalised move far steadier across the day than clock time does - a dispersion of 0.029 against 0.064 over the fitting period, and it still wins on a year held back from the fitting. Clock time is available as an input for comparison, and it is the wrong answer: it draws the cone too wide at midday and too narrow into the close.
WHERE THE LEVEL COMES FROM
The shape is measured here. The level is whatever you feed it.
- 1-day volatility index. VIX1D is 1-day implied volatility on the S&P and is the right instrument for ES and SPX. Converted to a one-session move as index / 100 / sqrt(252).
- Manual expected move. Type the 0DTE straddle, in points or percent, from an options board. One number a morning.
- Realised trailing. Dispersion of the symbol's own open-to-close moves. No options needed, works on anything.
THE PREMIUM IS SHOWN, NOT HIDDEN
The table reports the implied move as quoted, the calibrated one, and the trailing ratio of realised to implied.
On ES that ratio sits near 0.40, and it matters what is inside it. Part is the volatility premium, which is real. Part is simply that VIX1D prices a whole calendar day while this cone spans the regular session only, so the index is answering a wider question than the one being asked. Calibration is therefore on by default: left off against a volatility index the cone is roughly two and a half times too wide for a regular session. A 0DTE straddle typed in by hand does not have that mismatch, since it expires at the settle and prices exactly this window.
I have not decomposed that ratio into its two parts. Doing so needs a history of the volatility index, and until it is done the calibration is an empirical correction that works rather than a number I can claim to understand.
THE BANDS
Drawn at measured containment rather than Gaussian multiples. Over 18,563 observations on the fitting period the 68th percentile of the outcome sits at 0.88 sigma and the 95th at 2.31, against the Gaussian 1.00 and 2.00 - sharply peaked with a long tail. The held-back year returned 0.80 and 2.07. Both are inputs; set them to 1.00 and 2.00 for plain Gaussian bands.
WHAT IS ASSUMED
That the variance profile measured on ES between 2021 and 2025 describes today. It is a four year average and a genuinely unusual session will not obey it. The profile is fixed in the code rather than learned live, so re-measure it before trusting this on another contract.
Nothing here forecasts direction. The cone is centred on the current price because that is the honest centre.
Runs on intraday charts. This measures and draws - there are no entries, stops, targets or signals, and nothing here is evidence of a trading edge. 指标

指标

Taught to Trade - Regime Tercile Dashboard🔵 OVERVIEW
Most strategies are tested across one stretch of history and judged on a single number. This splits that history into its low, middle and high volatility thirds and reports how the instrument actually behaved inside each one.
The question it answers is not "what happens next". It is "does the thing I found exist in all three regimes, or only in one". An edge that lives in a single regime is a bet on the regime continuing, which is a different and much shorter bet than the one most people think they are making.
Everything is computed from closed bars. Nothing repaints.
🔵 WHAT A VOLATILITY REGIME IS HERE
ATR is expressed as a percentage of price, so instruments at different price levels are comparable. The sample window is then cut at its own 33rd and 67th percentiles. Bars below the lower cutoff are the low third, above the upper cutoff the high third, and the rest the middle.
The cutoffs are relative to the instrument and the window, not to any fixed number. A quiet week in one market can be a violent one in another, and a fixed ATR threshold would hide that.
🔵 HOW TO READ THE TABLE
Bars and Share show how the window divides. If one third holds most of the sample, the window is not really covering three regimes and the comparison is weak.
Range is the average high-to-low of a bar in that regime, as a percentage of price. It should rise from low to high. If it does not, the classification is not separating anything.
Up is the share of bars in that regime that closed above their open. This is the column worth sitting with. Volatility is a measure of range, not of direction, so there is no reason for this number to be far from 50 percent in any regime, and when it is, that is a property of the sample rather than a rule about the future.
Follow is conditional persistence: of the bars that followed an up bar in that regime, how many also closed up. Read it against the Up column, not on its own.
Now, Regime changes and ATR% cutoffs describe stability. Few changes across a long window means the regimes are broad and slow. Many means the classification is flickering and the per-regime statistics are thinner than the bar counts suggest.
🔵 HOW TO USE IT
Bucket your own past trades by the regime of their entry bar. The background shading makes that quick to do by eye. If every winning trade sits in one shaded band, you have found a regime, not a strategy.
Set the sample window to match the window your strategy was tested on, not to a round number. Comparing regimes across a window your test never touched tells you nothing about your test.
Check whether Range actually separates. If low and high thirds have nearly the same average bar range, the instrument has no meaningful volatility structure in that window, and the rest of the table is noise.
🔵 SETTINGS
ATR length and sample window size. Background shading on or off, with adjustable transparency. Table position and text size. Three alert conditions cover entering the high third, entering the low third, and any regime change. None of them fire on their own; you arm them yourself in the alerts dialog. This script does not send buy or sell signals and never will.
🔵 WHERE IT FAILS
The terciles are computed inside the same window they are judging. That is close to circular: a window that happens to be uniformly quiet will still be cut into three parts and labelled low, middle and high, and the labels will mean much less than they appear to.
A third is not a regime. Real regime changes are driven by things ATR cannot see, and the boundary between the 33rd and 34th percentile is arbitrary. A bar one tick either side of a cutoff gets a different label and is not meaningfully different.
The Up and Follow columns are descriptive statistics on a few hundred bars. Differences of a few percentage points are well inside what chance produces at that sample size, and nothing here corrects for that. Treat only large, stable gaps as worth a second look, and even then as a question rather than an answer.
ATR is backward looking. The current classification uses recent bars, so a regime change is visible only after it has been under way for a while. This will not warn you about anything.
Regime persistence is not modelled at all. Knowing that 20 percent of bars were high volatility says nothing about how long the current state lasts.
It measures bars, not your trades. Attributing your results to a regime by eye is a rough operation, and a proper version needs your actual trade list.
Open source, so you can read every calculation instead of taking any of this on trust.
Educational tool only, not investment advice. It does not predict anything and does not generate signals. Trading involves substantial risk of loss. 指标

Rolling Z Score Reversion Map [Pineify]Rolling Z Score Reversion Map
Overview
This map keeps rolling price Z-score visible while separating reversion-eligible extremes from trend-aligned extremes. It describes context; it does not forecast returns or issue trades.
Problem Definition
Z-score measures distance from a rolling mean in deviation units. Fixed lines such as +2 and -2 treat every extreme alike. That fails when the mean moves: positive Z can persist with a rising mean, so a contrarian reading confuses extension with disequilibrium. The script preserves raw Z and asks separately whether aligned trend and range pressure should withhold a reversion watch.
Design Rationale
Raw Z remains unchanged so its units stay interpretable. Mean slope is expressed as ATR per bar for cross-market comparison. ATR uses a prior-only percentile to avoid fixed price units and candidate self-ranking. Sign alignment isolates positive deviation with rising mean and its negative mirror. High ATR rank adds pressure but cannot dominate alone. A finite closed-bar watch preserves event order; permanent extreme marks would duplicate events. Lag and confirmation delay are accepted for auditable states.
Key Features
Raw Z-score with symmetric rails.
ATR-normalized slope, prior-only ATR rank, and direction gate.
Confirmed watch with mean, pressure, data, and time exits.
Optional visuals, table, and two alerts.
How It Works
The script computes a rolling mean and deviation of closes. Raw Z is their price difference divided by deviation; a near-zero denominator returns no value.
ATR defines range scale. Its percentile is a midrank against N prior ATR values: lower samples vote one and ties half. Current ATR is excluded. Mean change over the slope span is divided by ATR and bar count to obtain ATR per bar.
The gate tests whether Z and slope share a sign. Pressure combines 65% aligned trend strength, 20% upper-half ATR expansion, and 15% trend-volatility interaction, bounded from zero to one. An extreme qualifies when absolute Z reaches its rail and pressure stays below the gate.
A newly qualified close freezes watch side and entry Z. The watch ends on a crossing of the evolving mean, expiry, invalid data, or an invalidation-rail extreme with excessive pressure. A crossing is only observed, not caused. Warm-up covers all windows and rank history. Live colors can change; watches, markers, and alerts update on confirmed bars.
How Multiple Indicators Work Together
The components form one filter. Z supplies distance but not reference motion. ATR-normalized slope supplies motion; sign alignment relates it to the deviation. Prior ATR rank adds portable range context. Together they decide whether an extreme starts a watch. Without slope, the fixed-threshold failure returns; without ATR, calm and expansion are alike; without the watch, event chronology disappears.
Trading Ideas and Insights
Use the map to organize observation, not assume reversal. Cyan means pressure is below the gate and an extreme can start a confirmed watch. Orange means the same raw distance has stronger continuation context, so a contrarian label is withheld. A gold zero-axis marker records a later mean crossing. Compare states to find where fixed Z thresholds misdescribe context.
Unique Aspects
The contribution is separating measurement from interpretation. Many filters rescale an oscillator, preventing comparison with ordinary Z rails. Here raw distance stays intact while a bounded, direction-sensitive, range-relative gate classifies events. The watch preserves sequence: qualification occurs first; later bars cross the evolving mean or invalidate. No result is moved backward and no probability is implied.
How to Use
After warm-up, read height as raw Z and color as context. Cyan marks a candidate or active watch, orange a higher-pressure extreme, and gray a balanced or unavailable state. Diamonds and alerts mark confirmed entry. A zero circle records a watched crossing; an orange cross records invalidation. Use 15-minute to weekly charts and Once Per Bar Close alerts. These are states, not trade instructions.
Customization
Z window sets reference horizon; Extreme threshold sets event distance. ATR window and rank length set range context and history needs. Slope span smooths motion; Full trend pressure maps ATR-per-bar slope to full strength. Lower Maximum pressure tightens qualification. Invalidation Z and Maximum watch bars bound observation life. Visual layers can be disabled independently while raw Z and rails remain. Colors support varied themes.
Assumptions and Limitations
Rolling statistics change as samples enter and leave; Z implies neither normality nor stationarity. ATR rank is empirical, not probability, and needs complete history. Weights are design choices, not optimized constants. Slope lags; gaps can outrun it. The watch targets an evolving mean, not the entry mean. Live visuals are provisional, and confirmed events still depend on feed history. Inputs, adjustments, and synthetic charts can change results. Execution, costs, sizing, news, structure, and future returns are outside scope. Pineify checks syntax, not market behavior.
Conclusion
The map adds auditable context without changing Z-score units. Distance remains distance; trend, volatility, and watch state change only its label. Keep lag, sensitivity, and scope explicit.
指标

Top Strategy Finder [SpokoStocks]Top Strategy Finder
What if your chart could tell you which trading rule has actually worked on it?
Add this script to any symbol, any timeframe, and it backtests up to 2,304 complete strategies on that exact chart, ranks them, and shows a leaderboard you can read like a sentence: "Buy when RSI(2) drops below 10, only in calm volatility, exit on the reverse signal." Pick a row. Its trades appear on your price chart, its open position shows entry, stop and target, and its alerts are ready. No coding, no settings to tune.
Then it does something most strategy finders never show you: it walks forward and reports, without hindsight, whether trusting its own picks would have made money.
The problem it solves
Every strategy finder finds a winner. That is the easy part. Test enough rules on the same data and something always looks brilliant. The question that decides whether you make money is different: would that rule have worked from the moment you picked it?
This script answers it on the chart. On every bar it re-ranks all strategies using only the bars seen so far and follows a basket of the current leaders. The blue curve is what following those picks, bar by bar, would have produced. The gold curve is the champion's in-sample record. The gap between them is selection bias, drawn in the open. When both rise, the edge survived being chosen. When only the gold one does, you were looking at luck.
What you get
Leaderboard
• The top strategies (6 by default, up to 10) in plain language: entry on the first line, exit and filter on the second
• Trades and win rate as a bar, profit factor, net and max drawdown, all heat-coloured, in a table kept narrow so the chart stays visible
• Rank 1 starred, your selected row highlighted
• A trading plan for the selected row: exactly when to buy or sell, in which market condition, and how to exit
• A walk-forward line: what following the top basket would have earned, and how often the champion changed
• A "now" line: what your selected strategy and the basket hold on this bar
Performance pane
• Growth from the same start bar: buy & hold, the walk-forward basket, the champion, your selected row
• Each curve named with its result at the right edge
• Basket profit or loss area, optional drawdown shading, optional log scale
Price chart
• The selected strategy's recent trades drawn as green or red segments
• Its open trade with entry, stop and target lines
• Exposure shading and markers whenever the followed strategy turns long, short or flat
Alerts
• Selected strategy enters long, enters short, exits
• Basket turns long or short
• Champion enters long or short, champion changed
What is tested
Each strategy = one entry signal × one direction × one exit rule × one market filter.
24 entries, each with a long and a mirrored short version: EMA 9/21 and 20/50 crosses · close crossing SMA 20 and SMA 50 · RSI(2) beyond 10/90 and 5/95 · RSI(14) leaving 30/70 and crossing 50 · close beyond the 2σ and 2.5σ Bollinger bands · 10, 20 and 55-bar breakouts · MACD histogram crossing zero · MACD line crossing signal · Supertrend (3,10) and (2,14) flips · Stochastic leaving 20/80 · inside-bar breakout · three closes against the trade · ADX above 20 with a DI cross · Williams %R beyond −90/−10 · fresh 10-bar extreme with a reversal close · gap continuation.
8 exits: after 5, 10 or 20 bars · stop 2 ATR / target 3 ATR · stop 1 ATR / target 2 ATR · stop and target 1.5 ATR · trailing stop 3 ATR · exit on the reverse signal.
6 filters: any market · with the 200-bar trend · against it · calm volatility · high volatility · with 20-bar momentum.
Search sizes: Quick 288 · Standard 768 · Deep 1,536 · Max 2,304.
How the backtest works
• Entries at the close of the signal bar.
• Stops and targets are checked against the following bars' highs and lows; if both are touched in one bar, the stop is assumed.
• Every side pays the cost you set (default 0.05%).
• A strategy must reach the minimum number of trades (default 30) and, by default, be net profitable to rank at all.
• Rank by Win %, SQN, profit factor, net profit, expectancy, return / drawdown, or average win / average loss.
• The champion keeps its title until a challenger beats it by a margin you set, so the title does not flip on noise.
• The walk-forward basket follows the top K (default 5) equally weighted, chosen at each bar's close and exposed to the next bar's move.
Repainting and data
All signals are evaluated on the chart's own OHLC data, with no higher-timeframe requests. Entries, exits and rankings are confirmed at the close of each bar; the walk-forward curve and every trade in the logs are built only from closed bars and do not change afterwards. The leaderboard order can change as new bars close, because new trades change the statistics; that is the ranking updating, not a redraw of history.
How to use it in five minutes
1. Add it to the chart you trade. Start with the Standard size.
2. Read the leaderboard. Favour rows with many trades and a modest drawdown over rows with a large net and few trades.
3. Look at the pane. Blue rising with gold: the edge survived being chosen. Blue flat while gold soars: the leaders are curve-fit to this chart.
4. Pick the row you want to trade. Read its plan under the table, check its drawn trades, set its alerts.
5. Switch the ranking metric. Rules that stay on top under several metrics are the robust ones.
What it is not
An indicator, not a strategy() script, so there is no order-by-order report from the built-in tester. It is a discovery tool: it tells you which rule to build and shows you, without hindsight, whether choosing that rule would have paid. Results depend on the bars tested (default the last 2,500) and on your cost setting. Past results do not guarantee future performance. This is not financial advice.
指标

GM Institutional LevelsGM Institutional Levels is a clean price-level indicator designed to highlight important psychological market levels where price may react, pause, reject or break through.
The indicator was originally built from my round-number logic on USDNOK and later adapted for Gold and other markets.
It separates levels into:
Minor Institutional Levels
Major Institutional Levels
For Gold, the default structure uses:
$50 Minor Institutional Levels
$100 Major Institutional Levels
The indicator also includes presets for Gold, Forex, Indices, Crypto and Custom markets, together with price labels, a dashboard and optional alerts when price approaches or crosses an important level.
These levels are not automatic buy or sell signals. They are intended as areas to watch for confirmation from price action, market structure, FVG/IFVG, divergence and other forms of confluence.
Main Features:
• Minor and Major Institutional Levels
• Gold, Forex, Index and Crypto presets
• Custom level spacing
• Full-chart horizontal levels
• Price labels
• Nearest-level dashboard
• Proximity alerts
• Cross alerts
• Clean and simple chart layout
The goal of GM Institutional Levels is to keep the chart simple and focus attention on important psychological price areas.
Trade the level.
Wait for confirmation.
Execute the setup. 指标

指标

Aggregated Funding Rate for Crypto with AlertsThis indicator aggregates perpetual futures funding rates across multiple major exchanges into a single unified view, weighted by open interest. Instead of checking each exchange separately, AFR gives you one clean reading that reflects the true market-wide funding sentiment for any perpetual contract.
How it works
Funding rates are periodic payments between long and short traders in perpetual futures markets. When funding is positive, longs pay shorts — the market is overheated to the upside. When negative, shorts pay longs — the market is leaning heavily short. Extremes in either direction often precede reversals or accelerations as overleveraged positions get squeezed.
This indicator pulls funding rate and open interest data from up to 5 exchanges simultaneously — Binance, Bybit, OKX, Bitget, and Coinbase — and aggregates them using open interest weighting by default. This means exchanges with more capital at stake have proportionally more influence on the final reading, giving a more accurate picture of where the majority of the market is positioned.
Settings
Mode — choose between Open Interest Weighted (recommended) or a simple average across enabled exchanges
Display — columns or line, personal preference
Measure — Rate (%), Total Spend Rate in USD, or Total Spend Rate in coins
Scaled Per — normalise the rate to 1 hour, 8 hours (default, one funding interval), 24 hours, or annualised
Exchanges — enable or disable individual exchanges; useful if a symbol is not listed on a particular exchange and you want to exclude it from the aggregation
How to use it
The most straightforward use is reading the absolute level. Funding consistently above 0.01% per 8 hours signals an overheated long market. Sustained negative funding signals excessive shorting. Neither extreme lasts forever.
More useful is watching for changes in direction after a prolonged period of stability. When funding has been flat for hours or days and then begins shifting meaningfully in one direction, it often signals a change in positioning before price reacts — traders are starting to lean one way and paying for it.
For multi-symbol scanning, add this indicator to a watchlist alert across your entire perpetual futures list. Symbols where funding is moving sharply relative to their recent norm are worth investigating further for potential setups.
Notes
OKX reports open interest in USD rather than coins, so the indicator automatically converts it using the current price to keep units consistent across exchanges
If a symbol does not exist on a particular exchange, that exchange is automatically excluded from the aggregation for that symbol via ignore_invalid_symbol
Funding rate data availability and update frequency depends on what TradingView receives from each exchange feed 指标

Universal Daily Leverage Simulator (Candles)Have you ever wondered what any Daily Leveraged ETF on your favorite stock, index, or crypto would look like over decades?
This open-source indicator transforms any standard asset chart into a simulated daily leveraged product. By calculating the exact compounding math and daily rebalancing mechanics, it accurately reveals the powerful growth—and the destructive beta slippage (volatility decay)—associated with leveraged holding over long timeframes.
🌟 Key Features:
Universal Compatibility: Works seamlessly on ANY chart (S&P 500, NASDAQ, individual stocks like NVDA or TSLA, and Cryptocurrencies).
True Candlestick Rendering: Unlike basic line overlays, this script computes synthetic Open, High, Low, and Close (OHLC) values to print actual candlesticks.
Fully Customizable Leverage: Want to test a 1.5x, 2x, 3x, or even a 4x leverage? Simply open the Pine Editor and change the leverageFactor variable at the very top of the script to your desired number.
🛠 How to use it:
Open the chart of your choice on a Daily (1D) timeframe.
Add this script to the chart.
Zoom out to observe how severe market crashes (like 2000, 2008, or 2022) mathematically impact leveraged capital through compounding decay.
Disclaimer: This script is an educational and analytical tool designed to visualize mathematical compounding. It does not constitute financial or investment advice. Leveraged products carry extreme risk of capital loss, especially in volatile or sideways markets. Past performance does not guarantee future results. 指标

ATK / DEF Temporal Session Position & Market State EngineATK / DEF — Temporal Session Position & Market State Engine is a quantitative market analysis framework built around multiple timeframes and multiple market sessions.
The framework combines HTF / MTF / LTF temporal structure with the Asian, London, and New York sessions, while calculating price position, volume relationships, volatility, statistical dispersion, and market states.
Unlike conventional multi-timeframe analysis, which primarily compares directional conditions across different periods, this framework extends the temporal structure into a quantitative relationship between price position, volume, volatility, session activity, and structural location.
## Multi-Timeframe Structure
The framework includes:
* Monthly — HTF
* Weekly — HTF
* Daily — MTF
* 4-Hour — LTF
* 1-Hour — LTF
Each timeframe provides calculated and volume data together with relative volume conditions.
The data from different periods is organized within the same analytical structure to observe changes in price position and volume relationships across multiple temporal layers.
## Multi-Session Structure
The framework calculates three major market sessions:
* Asian Session
* London Session
* New York Session
Each session maintains calculated:
* Open
* Close
* High
* Low
* Volume
Session data is further used to calculate:
* Drive
* Burst
* Decay
* Reversal
Session calculations use the exchange timezone of the selected symbol.
This creates two complementary temporal dimensions: **timeframe structure and market-session structure**.
## Quantitative Price Position
The framework calculates the current price position within the high-low range of the Monthly, Weekly, Daily, 4-Hour, and 1-Hour periods.
The multi-period position data is furth calculated into:
* Position Average
* Position Dispersion
* Alignment
* Divergence
Position Average represents the average calculated position across the available timeframe layers.
Position Dispersion represents the statistical separation between those timeframe positions.
These calculations provide a quantitative reference for observing alignment and differences between temporal layers.
## Volume & Volatility
Volume conditions are calculated through the relationship between current volume and its historical average.
Volatility is calculated using ATR relative to its ATR average and classified into:
* Very Low
* Normal
* High
* Extreme
The framework also identifies volatility state changes as:
* Expanding
* Contracting
* Flat
These states are generated from mathematical conditions defined within the script and represent calculated market-state classifications.
They do not claim to directly identify instl activity, capital flws, or specific market participants.
## Structural Reference
Swing High and Swing Low calculations provide structural price references with Support and Resistance labels.
These structural references are displayed together with timeframe position, session conditions, volume relationships, and volatility measurements.
## Statistical Observation
The core framework combines:
**Timeframe Structure
* Session Structure
* Price Position
* Volume Relationship
* Volatility
* Statistical Dispersion
The resulting structure provides a multi-dimensional analytical view of relationships between different timeframe layers and market sessions.
## Analytical Purpose
ATK / DEF is designed solely for market observation and analytical reference.
All displayed values and classifications are generated from defined mathematical conditions within the srpt. Different instr, data envir, and paras may produce different calculated results.
The displayed information is intended to remain subject to the own interpretation and defined decision-making.
Market observation, analytical reference, and decision-making only.**
指标

指标

指标

指标

Smart Money Concepts [AxeAlgo]Overview
- Smart Money Concepts is a clean, non-repainting indicator designed for traders who want to identify institutional market structure without clutter.
The indicator visualizes where smart money is likely to defend, attack, and accumulate positions by displaying order blocks, fair value gaps, liquidity pools, and premium/discount dealing ranges on your chart.
What It Shows
Market Structure (CHoCH and BOS)Identifies when the market changes direction (Change of Character) and when new directional commitment breaks prior structure (Break of Structure). Each signal confirms only after a specified number of bars, ensuring no repainting.
Order BlocksHighlights the price zones where the last aggressive institutional movement originated. These are areas where smart money entered positions and often acts as support or resistance on subsequent pullbacks.
Fair Value GapsDetects imbalances between candlesticks (gaps not filled by wicks). The indicator marks these zones because institutions often return to fill them as price moves away.
Liquidity PoolsAutomatically identifies clusters of equal highs and equal lows where retail traders typically set stop losses. The indicator marks when price breaks through these pools (institutional sweeps).
Premium and DiscountDisplays whether price is trading above (premium) or below (discount) the 50% equilibrium level between the most recent swing high and low. Extreme premium or discount often precedes reversals.
How to Use It
Enable individual components using the dashboard toggles: Show Structure, Show Order Blocks, Show Fair Value Gaps, Show Liquidity Pools, Show Premium/Discount.
Turn on the dashboard to see your current swing bias, internal structure direction, and range position at a glance.
Auto-Tune automatically scales all sensitivity parameters based on your chart timeframe. Turn it off if you prefer manual tuning.
Use Simple Mode to display only swing structure without internal noise for a cleaner chart.
Key Settings
Confirmation Bars: How many bars confirm a pivot before a structure signal fires. Higher values filter out false signals but add lag. Default is 2.
Min Displacement: The minimum price movement (in ATR multiples) required for a structure signal to register. Default is 1.0 ATR.
Zone Sizing: Controls the minimum and maximum height of order blocks and FVGs. Adjust to filter noise or capture smaller opportunities.
P/D Lookback: How many bars back to scan for the swing high and low that define your premium/discount range.
Dashboard Position and Size: Choose where the info table appears and how large you want it.
Colors: Customize bullish, bearish, and gap colors to match your chart theme.
What This Indicator Is For
Smart Money Concepts is intended for traders who want to visually identify institutional order flow patterns and understand where smart money accumulates and distributes. It helps you:
Spot areas where institutions likely accumulated or distributed (order blocks and FVGs)
Recognize when price is overextended and vulnerable to reversal (premium/discount extremes)
Distinguish real structural breaks from noise during choppy consolidation
Plan entries and stops around levels where smart money defends
How It Works
The indicator uses pivot-point analysis to identify swing highs and lows, then marks the price zones where directional movement originated (order blocks). Fair value gaps are detected using standard three-candle imbalance logic. Liquidity pools are identified by clustering equal price levels within a configurable tolerance.
All signals confirm only on closed bars. Zones never repaint, but they shrink or change state as price action develops.
Limitations
The indicator shows 5 active zones at a time to keep your chart clean. If multiple institutional structures are forming simultaneously, older zones will age out. This is by design to prioritize the most recent price action.
This indicator identifies structural levels and patterns. It does not predict price direction or guaranteed support/resistance. Use it as one component of a complete trading plan, not as a standalone signal.
Fair value gaps and order blocks are useful but not infallible. Price may skip through them or reverse before reaching them.
Important Disclaimer
This indicator is for educational and analytical purposes only. It does not provide financial advice, and past performance does not guarantee future results. Trading involves risk of loss. Always use proper risk management, stop losses, and position sizing. Never risk more than you can afford to lose.
The accuracy and effectiveness of this indicator depends on your market conditions, timeframe, and trading methodology. Results vary by trader and asset class.
指标

Market Stress RadarMarket Stress Radar
Which assets withstand a market selloff — and which recover first?
Market Stress Radar compares an asset with a selected benchmark during defined market stress episodes. It tracks their losses from a shared reference date, their recovery times, and whether initial relative strength turns into weakness.
READING THE CHART
• Green line: Asset return from its own pre-stress closing price.
• Blue line: Benchmark return from its own pre-stress closing price.
• Zero line: Each instrument’s respective reference price.
• Orange shading: Stress detection day.
• Green triangle: First asset recovery after detection.
• Orange triangle: Delayed relative weakness.
• Gray square: Observation window ended.
Both return lines use the same reference date. They appear during monitored episodes and remain blank between episodes.
HOW STRESS IS DETECTED
By default, the radar examines the benchmark’s three-day return.
A stress episode starts when the decline reaches the larger of:
• A minimum drop of 3%.
• 1.5 × pre-window ATR percentage × √3, using a 20-day ATR.
The volatility measurement comes from before the decline window. This is a scaling rule, not a statistical confidence level.
Detection requires a fresh transition into stress and a confirmed daily close. Only one episode is monitored at a time; additional triggers during that episode are ignored.
RECOVERY: FIRST TOUCH AND EPISODE COMPLETION
The reference prices are frozen at the closing prices immediately before the measured decline window.
D0 is the detection day. An instrument first recovers when it closes at or above its own frozen reference price. A value already above that price on D0 is recorded as D+0.
First recovery does not mean permanent recovery. An asset can recover and subsequently fall back below its reference.
The episode ends when:
• Both instruments close at or above their respective reference prices on the same day; or
• The observation limit is reached — 30 daily bars after detection by default.
Missing or misaligned data ends the episode separately. Elapsed days refer to daily chart bars, which are trading sessions for stocks.
ILLUSTRATIVE EXAMPLE
Suppose BTC falls 8% over the detection window while the chart coin falls 3%.
The coin initially leads BTC by 5 percentage points.
If the coin returns to its own reference price four daily bars after detection, its first recovery is recorded as D+4. If BTC remains below its reference, monitoring continues.
If either instrument never recovers within the observation window, that recovery remains NOT OBSERVED. A timeout is not counted as a successful recovery.
This is a hypothetical example, not a backtest result.
DELAYED RELATIVE WEAKNESS
An initially resilient asset can lose its advantage.
With the default settings, the radar issues one warning per episode when:
• The asset initially leads its benchmark by at least 0.5 percentage points; and
• Its lead later falls to −0.5 percentage points or below.
WEAKNESS OBSERVED records that this happened during the episode. It does not necessarily mean the asset is still underperforming; the latest returns and relative lead show the current relationship.
COMPACT DASHBOARD
The dashboard shows:
• Episode status.
• Asset and benchmark returns.
• First recovery day, or OPEN / NOT OBSERVED.
• Initial and latest relative lead.
• Detection date, elapsed daily bars and reference date.
• Counts of jointly recovered episodes, timeouts and data gaps.
After an episode ends, LAST EPISODE identifies the frozen final values. These are not current returns or trading win rates.
The dashboard can be placed in five positions.
SETUP
Use standard 1D candles.
Automatic benchmark selection:
• Crypto: BINANCE:BTCUSDT.
• USD stocks: AMEX:SPY.
A custom benchmark can also be selected. Use instruments with matching daily sessions and comparable quote currencies. No currency conversion is performed.
ALERTS
Six alert conditions are available:
• New market stress.
• First asset recovery.
• Late relative weakness.
• Both instruments recovered.
• Observation window ended.
• Data gap stopped the episode.
Configure alerts separately in TradingView.
METHOD AND LIMITATIONS
Calculations and event signals use confirmed daily closes. Markers are not backdated to the earlier reference date.
Results depend on the selected instruments, settings and available history. Historical data corrections can change results. Price returns account for splits but exclude dividend income.
Market Stress Radar is a descriptive analysis tool. It does not place trades, predict guaranteed recoveries or establish a profitable trading strategy. 指标

Quantum Trend Runtime - MTF Price Action [TrendRuntime]Quantum Trend Runtime — MTF Price Action
A multi-timeframe price-action engine built around percentage movement, impulse, rejection, volatility, market activity and confirmed structure.
Quantum Trend Runtime (QTR) was created around the way I personally analyze crypto markets.
Instead of depending primarily on traditional oscillators such as RSI or MACD, QTR focuses directly on price behavior:
How much has price moved?
Is that move significant for this market?
Is momentum continuing?
Is price rejecting the move?
Are multiple timeframes confirming the same idea?
Is the market active enough to trade at all?
QTR combines those questions into one visual runtime.
Recommended Timeframe
QTR is designed primarily around the:
2H chart
With the default configuration, the indicator analyzes three confirmed timeframes:
2H — Fast runtime
3H — Core runtime
4H — Slow runtime
The 3H timeframe receives the strongest weighting inside the QTR directional model.
Why Percentage Movement Matters
A market moving 0.30% is not behaving the same way as a market that has already moved 5%, 10%, 15% or more.
QTR therefore gives percentage expansion a central role.
For example, after a substantial bullish move, a strong bearish reaction can carry much more information than the same bearish candle appearing inside a flat market.
QTR measures both:
the latest confirmed candle movement;
the directional move that happened before it.
This allows the engine to identify both continuation and rejection environments.
QTR Market States
Each analyzed timeframe can display one of the following states:
BULL IMPULSE — Strong bullish expansion with continuation characteristics.
BEAR IMPULSE — Strong bearish expansion with continuation characteristics.
BULL REJECTION — Bullish reaction following meaningful downside movement.
BEAR REJECTION — Bearish reaction following meaningful upside movement.
NEUTRAL — The market is active, but no strong directional event is confirmed.
QUIET — Current movement is below QTR's activity requirements.
QTR is intentionally not designed to produce signals constantly.
Sometimes the most useful output is:
QUIET MARKET
In that environment, the indicator is effectively saying that the current contract may not offer enough movement to justify attention.
Adaptive Impulse Engine
QTR does not use one fixed percentage to decide whether a candle is significant.
Instead, it measures the normal absolute candle movement of the market and creates an adaptive impulse threshold.
Conceptually:
Adaptive Impulse =
max(
Minimum Impulse %,
Average Absolute Candle Body %
+ Multiplier × Body Dispersion
)
This allows QTR to adapt to markets with very different volatility profiles.
The dashboard displays this relationship through the IMPULSE multiple.
Examples:
0.70x = below the adaptive impulse threshold
1.00x = reaches the current impulse threshold
1.50x = 1.5 times the adaptive threshold
2.00x = approximately twice the normal impulse requirement
Prior Move
The dashboard's PRIOR% value measures the directional movement that occurred before the latest confirmed reaction.
This matters because context changes the meaning of a candle.
A bearish reaction after a +1% move is not necessarily equivalent to a bearish reaction after a +15% expansion.
Trend%
TREND% measures confirmed directional movement across the selected trend lookback.
It provides broader context around the immediate impulse or rejection signal.
Multi-Timeframe Direction
QTR combines the default timeframes using the following weighting:
2H = 25%
3H = 50%
4H = 25%
The core 3H runtime intentionally receives the greatest influence.
A normal opportunity generally requires agreement between multiple timeframes.
A strong confirmed rejection can optionally qualify independently when the remaining timeframes are not opposing it.
QTR Score
The directional score ranges approximately from:
-100 = strong bearish runtime
0 = neutral
+100 = strong bullish runtime
The score incorporates factors such as:
percentage candle movement;
adaptive impulse magnitude;
body efficiency;
directional closing strength;
rejection structure.
The QTR Score is a model output.
It is not a guaranteed probability of a successful trade.
Setup Quality
QTR also displays a quality grade.
The quality model considers:
directional score strength;
agreement between the 2H, 3H and 4H runtimes;
how many timeframes are currently active.
Possible grades include:
A+
A
B
C
LOW
Higher quality means the internal QTR components are agreeing more strongly.
It does not represent a guaranteed win rate.
Long and Short Opportunities
The main runtime can identify:
LONG OPPORTUNITY
or
SHORT OPPORTUNITY
These states mean that QTR has identified a directional environment worth evaluating.
They should not be interpreted as blind market orders.
The trader should still evaluate execution, liquidity, position sizing and personal risk tolerance.
QTR Projection
QTR includes a forward scenario engine.
When sufficient directional information is available, the indicator projects a potential price path across the next three core-timeframe intervals.
With the default 3H core timeframe:
T+1 ≈ 3 hours
T+2 ≈ 6 hours
T+3 ≈ 9 hours
The projection combines:
QTR directional score;
confirmed multi-timeframe trend;
recent percentage movement;
adaptive impulse magnitude;
impulse / rejection state;
momentum persistence.
Important: The QTR Projection is not an entry price.
If QTR displays:
SHORT OPPORTUNITY
QTR PROJECTION: -5.4%
this means the current runtime favors a bearish continuation scenario approximately toward that projected movement.
It does not mean that the trader should wait until the projected level is reached and then enter short.
The intended interpretation is:
OPPORTUNITY
↓
TRADE DECISION / EXECUTION
↓
RISK MANAGEMENT
↓
TARGET / QTR PROJECTION
Projection Corridor
The violet projection lines around the main QTR path represent a wider movement scenario.
The corridor responds to current volatility and QTR directional strength.
These levels are visual scenario estimates.
They are not statistically certified confidence intervals.
Trade Planning
When QTR identifies an opportunity, the indicator can display several planning references:
REF PRICE — Current price used as the planning reference.
INVALID — Structural invalidation beyond the confirmed core-timeframe candle.
1.25R — Reference target calculated from the selected reward/risk multiple.
RISK% — Distance between the reference price and invalidation.
TYPE — Whether the opportunity is primarily impulse- or rejection-driven.
The default reference reward/risk is:
1.25R
This value can be changed in the indicator settings.
REF PRICE is not an automatic entry signal.
It is provided to make the current risk structure easier to evaluate visually.
Percent Levels
QTR also includes customizable percentage levels around a confirmed anchor price.
Default levels are:
±4%
±7%
±15%
±25%
These levels reflect the percentage-based philosophy behind QTR and help visualize how far price has expanded from a known reference.
They should not be interpreted as guaranteed support or resistance.
Dashboard
The QTR dashboard is designed to summarize the market without requiring the trader to interpret multiple separate indicators.
For each timeframe it displays:
STATE — Current impulse, rejection, neutral or quiet classification.
CH% — Confirmed candle-body percentage change.
PRIOR% — Directional movement preceding the analyzed candle.
TREND% — Broader confirmed directional movement.
IMPULSE — Candle magnitude relative to its adaptive impulse threshold.
The lower part of the dashboard displays:
QTR projected direction;
T+1 / T+2 / T+3 projected prices;
projected percentage move;
current market activity;
trade-planning references;
current QTR action.
Market Activity
QTR also evaluates whether the market is currently worth watching.
Possible environments include:
QUIET
MODERATE
ACTIVE
HIGH
EXTREME
The objective is simple:
avoid forcing trades when the market is barely moving.
Confirmed Higher-Timeframe Data
QTR's multi-timeframe classifications are built from completed higher-timeframe candles.
The indicator intentionally avoids using unfinished future higher-timeframe candles for historical classifications.
This means confirmed signals can appear later than systems that use developing HTF candles, but the goal is to provide more consistent historical and live behavior.
The QTR Projection itself is a live scenario and can therefore change as current market price changes.
Alerts
QTR includes alert conditions for:
QTR Long Opportunity
QTR Short Opportunity
QTR High-Quality Long
QTR High-Quality Short
QTR Quiet Market
These alerts can help traders monitor multiple markets without keeping every chart open continuously.
How I Use QTR
My own workflow is focused on markets that are actually moving.
I generally look for:
Meaningful percentage expansion.
An active market rather than low-volatility price action.
Strong impulse or rejection behavior.
Agreement between the 2H, 3H and 4H runtimes.
A trade structure with acceptable reward relative to risk.
When the market is quiet, I would rather scan another contract than force a setup.
What QTR Is Not
QTR is not:
a guaranteed trading system;
a guaranteed price predictor;
a replacement for risk management;
a promise of future profitability;
a quantum-computing model.
Quantum Trend Runtime is the name of the TrendRuntime methodology and indicator.
The word "Quantum" is branding and does not imply that the Pine Script performs quantum computation.
Risk Disclaimer
Trading cryptocurrencies, perpetual futures and leveraged products involves substantial risk.
QTR provides quantitative price-action analysis, market classification and visual decision support only.
Any signal, projected path, target, score or market classification can fail.
Past performance does not guarantee future results.
Always determine position size, leverage, invalidation and maximum acceptable loss independently.
Built by Rudy — TrendRuntime
TrendRuntime
trendruntime.app
TradingView
www.tradingview.com
指标

Double U Strategy with Webhook AlertsDouble U Strategy with Webhook Alerts
Double U Strategy is a trend-following strategy built around two independent ATR-based engines, one for long entries and one for short entries. The idea comes from the ATR trailing-stop approach commonly associated with UT Bot, but Double U uses a different implementation and trading structure. The reason for separating the two sides is simple: bullish and bearish moves often behave differently, so forcing both directions to use exactly the same ATR settings is not always useful.
The long and short engines each have their own sensitivity and ATR period. A long entry can occur when price crosses above the long ATR trail while remaining above the trend EMA, while a short entry can occur when price crosses below the short ATR trail while remaining below the same EMA. The EMA is therefore used as a regime filter rather than as an entry signal by itself.
The strategy also supports pyramiding. If another valid signal appears while a position in the same direction is already open, the strategy can add to that position until the pyramiding limit is reached. The default limit is three entries, but this can be changed from the Strategy Properties.
Exits use a separate mechanism instead of simply waiting for the ATR engine to reverse. The script compares the current close with the close a configurable number of bars earlier and counts consecutive moves in the same direction. Once the required sequence is reached, the current position is closed. This keeps entry and exit logic independent: ATR behavior decides when to enter, while the sequence logic decides when an extended move has progressed far enough to exit.
The default configuration was selected as a practical starting point for testing rather than as a claim of universal optimization. The current setup uses a long-term EMA filter together with different ATR settings for long and short trades, reflecting the asymmetric design of the strategy. Results can change significantly between instruments and timeframes, so the parameters should be tested rather than treated as fixed recommendations.
Webhook alerts
Webhook support is built directly into the strategy. Entry and exit orders generate structured alert messages automatically, so there is no need to manually create separate JSON messages for buys, sells, or closes.
When creating a TradingView strategy alert, the Message field should contain only:
{{strategy.order.alert_message}}
The strategy includes a platform selector and an optional symbol override. If the symbol field is left empty, the chart ticker is sent in the webhook message. If an external execution system requires a different symbol, the required ticker can be entered directly. This is useful not only for crypto, but also for futures, forex, indices, metals, or any case where the TradingView symbol differs from the execution symbol.
For example, a strategy can run on a continuous futures chart while the webhook sends the currently tradable contract instead. The trading logic remains attached to the chart, while the execution symbol can be changed without modifying the Pine code.
Statistics
A compact statistics table is displayed on the chart to make parameter testing faster. It shows net profit, number of closed trades, win rate, profit factor, test period, pessimistic profit factor, maximum intratrade drawdown, and Sharpe ratio.
The drawdown value in this table is intentionally different from TradingView's portfolio-level maximum drawdown. It shows the largest adverse movement experienced inside any closed trade, which makes it useful when comparing parameter combinations and estimating how much floating loss a trade may have experienced before closing.
The Sharpe ratio is calculated from monthly equity returns using a 2% annual risk-free rate and is annualized from monthly observations.
Backtesting notes
The strategy uses 10% of equity as the default order size, allows up to three pyramided entries, processes orders on bar close, and includes 15 ticks of slippage by default. Commission is not hard-coded because the script can be tested on instruments with very different pricing models. Users should set commission, margin, slippage, and other Strategy Properties according to the broker, exchange, and instrument they actually intend to trade.
Historical results are hypothetical and depend on the selected market, timeframe, data source, execution assumptions, and parameters. The purpose of Double U Strategy is to provide a transparent strategy that can be backtested, adjusted, and connected to webhook-based execution, not to predict future performance. 策略

TDI - Goldminds / MMM Jakub Donovan RecreationTDI — Goldminds / MMM
> A Market Makers Method–style TDI combining RSI momentum, moving averages, and volatility bands to identify trend, momentum shifts, and overbought/oversold conditions.
The Traders Dynamic Index (TDI ) is a momentum and trend-following oscillator that combines RSI, moving averages, and volatility bands into a single indicator.
This version is based on the Goldminds TDI, adapted for the Market Makers Method (MMM) and reconstructed using the original parameters associated with the Jakub Donovan version.
Core Components:
RSI: 21-period RSI
Volatility Bands: 34-period SMA with a 1.6185 standard-deviation multiplier
Fast MA: 7-period SMA of RSI
Slow MA: 2-period SMA of RSI
Reference Levels: 20 / 30 / 50 / 70 / 80
The TDI can be used to identify momentum shifts, trend direction, overbought/oversold conditions, and potential reversals.
How to interpret it
Green & Red lines
The moving averages of RSI help identify changes in momentum. Crossovers can highlight potential shifts in short-term momentum.
Yellow line
The yellow line represents the RSI's broader average and acts as a useful reference for the overall momentum environment.
Blue bands
The volatility bands expand and contract based on RSI volatility, helping identify periods when momentum becomes unusually extended.
50 level
The 50 level acts as the key momentum midpoint:
* Above 50 → bullish momentum
* Below 50 → bearish momentum
30 / 70
Traditional oversold/overbought zones.
20 / 80
Extreme momentum zones that can help identify potentially exhausted moves.
> Important: The TDI should be used as a confirmation tool rather than as a standalone buy or sell signal. Combining it with price structure, support/resistance, volume, and market conditions can provide stronger trade setups.
指标
