Anchored VWAP + Bands + Signals//@version=5
indicator("Anchored VWAP + Bands + Signals", overlay=true)
// ===== INPUTS =====
anchorTime = input.time(timestamp("2025-12-02 00:00"), "Anchor Date/Time")
std1 = input.float(1.0, "±1σ Band")
std2 = input.float(2.0, "±2σ Band")
// ===== VWAP CALCULATION =====
var float cumPV = 0.0
var float cumVol = 0.0
if time >= anchorTime
cumPV += close * volume
cumVol += volume
vwap = cumVol != 0 ? cumPV / cumVol : na
// ===== STANDARD DEVIATION =====
barsSinceAnchor = bar_index - ta.valuewhen(time >= anchorTime, bar_index, 0)
sd = barsSinceAnchor > 1 ? ta.stdev(close, barsSinceAnchor) : 0
// ===== BANDS =====
upper1 = vwap + std1 * sd
lower1 = vwap - std1 * sd
upper2 = vwap + std2 * sd
lower2 = vwap - std2 * sd
plot(vwap, color=color.orange, title="VWAP")
plot(upper1, color=color.green, title="+1σ Band")
plot(lower1, color=color.green, title="-1σ Band")
plot(upper2, color=color.red, title="+2σ Band")
plot(lower2, color=color.red, title="-2σ Band")
// ===== SIGNALS =====
buySignal = ta.crossover(close, lower1)
sellSignal = ta.crossunder(close, upper1)
plotshape(buySignal, style=shape.triangleup, location=location.belowbar, color=color.green, size=size.small, title="Buy Signal")
plotshape(sellSignal, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small, title="Sell Signal")
alertcondition(buySignal, title="Buy Alert", message="Price touched lower 1σ band – Buy Opportunity")
alertcondition(sellSignal, title="Sell Alert", message="Price touched upper 1σ band – Sell Opportunity")
バンドとチャネル
Higher Timeframe MA High Low BandsHigher Timeframe Customer MA High Low Bands. There are 3 different Moving Average Parameters Available. Indicator will plot 3 lines of MA Length With Source of High, Close and Low. User can change relevant MA parameters / Show or Hide MA.
Happy Trading
My script//@version=6
indicator("ISIN demo")
// Define inputs for two symbols to compare.
string symbol1Input = input.symbol("NASDAQ:AAPL", "Symbol 1")
string symbol2Input = input.symbol("GETTEX:APC", "Symbol 2")
if barstate.islastconfirmedhistory
// Retrieve ISIN strings for `symbol1Input` and `symbol2Input`.
var string isin1 = request.security(symbol1Input, "", syminfo.isin)
var string isin2 = request.security(symbol2Input, "", syminfo.isin)
// Log the retrieved ISIN codes.
log.info("Symbol 1 ISIN: " + isin1)
log.info("Symbol 2 ISIN: " + isin2)
// Log an error message if one of the symbols does not have ISIN information.
if isin1 == "" or isin2 == ""
log.error("ISIN information is not available for both symbols.")
// If both symbols do have ISIN information, log a message to confirm whether both refer to the same security.
else if isin1 == isin2
log.info("Both symbols refer to the same security.")
else
log.info("The two symbols refer to different securities.")
NIFTY Weekly Option Seller DirectionalHere’s a straight description you can paste into the TradingView “Description” box and tweak if needed:
---
### NIFTY Weekly Option Seller – Regime + Score + Management (Single TF)
This indicator is built for **weekly option sellers** (primarily NIFTY) who want a **structured regime + scoring framework** to decide:
* Whether to trade **Iron Condor (IC)**, **Put Credit Spread (PCS)** or **Call Credit Spread (CCS)**
* How strong that regime is on the current timeframe (score 0–5)
* When to **DEFEND** existing positions and when to **HARVEST** profits
> **Note:** This is a **single timeframe** tool. The original system uses it on **4H and 1D separately**, then combines scores manually (e.g., using `min(4H, 1D)` for conviction and lot sizing).
---
## Core logic
The script classifies the market into 3 regimes:
* **IC (Iron Condor)** – range/mean-reversion conditions
* **PCS (Put Credit Spread)** – bullish/trend-up conditions
* **CCS (Call Credit Spread)** – bearish/trend-down conditions
For each regime, it builds a **0–5 score** using:
* **EMA stack (8/13/34)** – trend structure
* **ADX (custom DMI-based)** – trend strength vs range
* **Previous-day CPR** – in CPR vs break above/below
* **VWAP (session)** – near/far value
* **Camarilla H3/L3** – for IC context
* **RSI (14)** – used as a **brake**, not a primary signal
* **Daily trend / Daily ADX** – used as **hard gates**, not double-counted as extra points
Then:
* Scores for PCS / CCS / IC are **cross-penalised** (they pull each other down if conflicting)
* Final scores are **smoothed** (current + previous bar) to avoid jumpy signals
The **background colour** shows the current regime and conviction:
* Blue = IC
* Green = PCS
* Red = CCS
* Stronger tint = higher regime score
---
## Scoring details (per timeframe)
**PCS (uptrend, bullish credit spreads)**
* +2 if EMA(8) > EMA(13) > EMA(34)
* +1 if ADX > ADX_TREND
* +1 if close > CPR High
* +1 if close > VWAP
* RSI brake:
* If RSI < 50 → PCS capped at 2
* If RSI > 75 → PCS capped at 3
* Daily gating:
* If daily EMA stack is **not** uptrend → PCS capped at 2
**CCS (downtrend, bearish credit spreads)**
* +2 if EMA(8) < EMA(13) < EMA(34)
* +1 if ADX > ADX_TREND
* +1 if close < CPR Low
* +1 if close < VWAP
* RSI brake:
* If RSI > 50 → CCS capped at 2
* If RSI < 25 → CCS capped at 3
* Daily gating:
* If daily EMA stack is **not** downtrend → CCS capped at 2
**IC (range / mean-reversion)**
* +2 if ADX < ADX_RANGE (low trend)
* +1 if close inside CPR
* +1 if near VWAP
* +0.5 if inside Camarilla H3–L3
* +1 if daily ADX < ADX_RANGE (daily also range-like)
* +0.5 if RSI between 45 and 55 (classic balance zone)
* Daily gating:
* If daily ADX ≥ ADX_TREND → IC capped at 2 (no “strong IC” in strong trends)
**Cross-penalty & smoothing**
* Each regime’s raw score is reduced by **0.5 × max(other two scores)**
* Final IC / PCS / CCS scores are then **smoothed** with previous bar
* Scores are always clipped to ** **
---
## Regime selection
* If one regime has the highest score → that regime is selected.
* If there is a tie or close scores:
* When ADX is high, trend regimes (PCS/CCS) are preferred in the direction of the EMA stack.
* When ADX is low, IC is preferred.
The selected regime’s score is used for:
* Background colour intensity
* Minimum score gate for alerts
* Display in the info panel
---
## DEFEND / HARVEST / REGIME alerts
The script also defines **management signals** using ATR-based buffers and Camarilla breaks:
* **DEFEND**
* Price moving too close to short strikes (PCS/CCS/IC) relative to ATR, or
* Trend breaks through Camarilla with ADX strong
→ Suggests rolling away / widening / converting to reduce risk.
* **HARVEST**
* Price has moved far enough from your short strikes (in ATR multiples) and market is still range-compatible
→ Suggests booking profits / rolling closer / reducing risk.
* **REGIME CHANGED**
* Regime flips (IC ↔ PCS/CCS) with cooldown and minimum score gate
→ Suggests switching playbook (range vs trend) for new entries.
Each of these has a plotshape label plus an `alertcondition()` for TradingView alerts.
---
## UI / Panel
The **top-right panel** (optional) shows:
* Strategy + final regime score (IC / PCS / CCS, x/5)
* ADX / RSI values
* CPR status (Narrow / Normal / Wide + %)
* EMA Stack (Up / Down / Mixed) and EMA tightness
* VWAP proximity (Near / Away)
* Final **IC / PCS / CCS** scores (for this timeframe)
* H3/L3, H4/L4, CPR Low/High and VWAP levels (rounded)
These values are meant to be **read quickly at the decision time** (e.g. near the close of the 4H bar or daily bar).
---
## Intended workflow
1. Run the script on **4H** and **1D** charts separately.
2. For each timeframe, read the panel’s **IC / PCS / CCS scores** and regime.
3. Decide:
* Final regime (IC vs PCS vs CCS)
* Combined score (e.g. `AlignScore = min(Score_4H, Score_1D)`)
4. Map that combined score to **your own lot-size buckets** and trade rules.
5. During the life of the position, use **DEFEND / HARVEST / REGIME** alerts to adjust.
The script does **not** auto-calculate lot size or P&L. It focuses on giving a structured, consistent **market regime + strength + levels + management** layer for weekly option selling.
---
## Disclaimer
This is a discretionary **decision-support tool**, not a guarantee of profit or a replacement for risk management.
No performance is implied or promised. Always size positions and manage risk according to your own capital, rules, and regulations.
Grok/Claude Turtle Soup Alert SystemReplaces previous Turtle Soup Strategy/Indicator as Tradingview will not let me update it.
# 🥣 Turtle Soup Strategy (Enhanced)
## A Mean-Reversion Strategy Based on Failed Breakouts
---
## Historical Origins
### The Original Turtle Traders (1983-1988)
The Turtle Trading system is one of the most famous experiments in trading history. In 1983, legendary commodities trader **Richard Dennis** made a bet with his partner **William Eckhardt** about whether great traders were born or made. Dennis believed trading could be taught; Eckhardt believed it was innate.
To settle the debate, Dennis recruited 23 ordinary people through newspaper ads—including a professional blackjack player, a fantasy game designer, and an accountant—and taught them his trading system in just two weeks. He called them "Turtles" after turtle farms he had visited in Singapore, saying *"We are going to grow traders just like they grow turtles in Singapore."*
The results were extraordinary. Over the next five years, the Turtles reportedly earned over **$175 million in profits**. The experiment proved Dennis right: trading could indeed be taught.
#### The Original Turtle Rules:
- **Entry:** Buy when price breaks above the 20-day high (System 1) or 55-day high (System 2)
- **Exit:** Sell when price breaks below the 10-day low (System 1) or 20-day low (System 2)
- **Stop Loss:** 2x ATR (Average True Range) from entry
- **Position Sizing:** Based on volatility (ATR)
- **Philosophy:** Pure trend-following—catch big moves by riding breakouts
The Turtle system was a **trend-following** strategy that assumed breakouts would lead to sustained trends. It worked brilliantly in trending markets but suffered during choppy, range-bound conditions.
---
### The Turtle Soup Strategy (1990s)
In the 1990s, renowned trader **Linda Bradford Raschke** (along with Larry Connors) observed something interesting: many of the breakouts that the Turtle system traded actually *failed*. Price would spike above the 20-day high, trigger Turtle buy orders, then immediately reverse—trapping the breakout traders.
Raschke realized these failed breakouts were predictable and tradeable. She developed the **Turtle Soup** strategy, which does the *exact opposite* of the original Turtle system:
> *"Instead of buying the breakout, we wait for it to fail—then fade it."*
The name "Turtle Soup" is a clever play on words: the strategy essentially "eats" the Turtles by trading against them when their breakouts fail.
#### Original Turtle Soup Rules:
- **Setup:** Price makes a new 20-day high (or low)
- **Qualifier:** The previous 20-day high must be at least 3-4 days old (not a fresh breakout)
- **Entry Trigger:** Price reverses back inside the channel (failed breakout)
- **Entry:** Go SHORT (against the failed breakout above), or LONG (against the failed breakdown below)
- **Philosophy:** Mean-reversion—fade false breakouts and profit from trapped traders
#### Turtle Soup Plus One Variant:
Raschke also developed a more conservative variant called "Turtle Soup Plus One" which waits for the *next bar* after the breakout to confirm the failure before entering. This reduces false signals but may miss some opportunities.
---
## Our Enhanced Turtle Soup Strategy
We have taken the classic Turtle Soup concept and enhanced it with modern technical indicators and filters to improve signal quality and adapt to today's markets.
### Core Logic Preserved
The fundamental strategy remains true to Raschke's original concept:
| Turtle (Original) | Turtle Soup (Our Strategy) |
|-------------------|---------------------------|
| BUY breakout above 20-day high | SHORT when that breakout FAILS |
| SELL breakout below 20-day low | LONG when that breakdown FAILS |
| Trend-following | Mean-reversion |
| "The trend is your friend" | "Failed breakouts trap traders" |
---
### Enhancements & Improvements
#### 1. RSI Exhaustion Filter
**Addition:** RSI must confirm exhaustion before entry
- **For SHORT entries:** RSI > 60 (buyers exhausted)
- **For LONG entries:** RSI < 40 (sellers exhausted)
**Why:** The original Turtle Soup had no momentum filter. Adding RSI ensures we only fade breakouts when the market is showing signs of exhaustion, significantly reducing false signals. This enhancement was inspired by later traders who found RSI extremes (originally 90/10, softened to 60/40) dramatically improved win rates.
#### 2. ADX Trending Filter
**Addition:** ADX must be > 20 for trades to execute
**Why:** While the original Turtle Soup was designed for ranging markets, we found that requiring *some* trend strength (ADX > 20) actually improves results. This ensures we're trading in markets with enough directional movement to create meaningful failed breakouts, rather than random noise in dead markets.
#### 3. Heikin Ashi Smoothing
**Addition:** Optional Heikin Ashi calculations for breakout detection
**Why:** Heikin Ashi candles smooth out price noise and make trend reversals more visible. When enabled, the strategy uses HA values to detect breakouts and failures, reducing whipsaws from erratic price spikes.
#### 4. Dynamic Donchian Channels with Regime Detection
**Addition:** Color-coded channels based on market regime
- 🟢 **Green:** Bullish regime (uptrend + DI+ > DI- + OBV bullish)
- 🔴 **Red:** Bearish regime (downtrend + DI- > DI+ + OBV bearish)
- 🟡 **Yellow:** Neutral regime
**Why:** Visual regime detection helps traders understand the broader market context. The original Turtle Soup had no regime awareness—our enhancement lets traders see at a glance whether conditions favor the strategy.
#### 5. Volume Spike Detection (Optional)
**Addition:** Optional filter requiring volume surge on the breakout bar
**Why:** Failed breakouts are more significant when they occur on high volume. A volume spike on the breakout bar (default 1.2x average) indicates more traders got trapped, creating stronger reversal potential.
#### 6. ATR-Based Stops and Targets
**Addition:** Configurable ATR-based stop losses and profit targets
- **Stop Loss:** 1.5x ATR (default)
- **Profit Target:** 2.0x ATR (default)
**Why:** The original Turtle Soup used fixed stop placement. ATR-based stops adapt to current volatility, providing tighter stops in calm markets and wider stops in volatile conditions.
#### 7. Signal Cooldown
**Addition:** Minimum bars between trades (default 5)
**Why:** Prevents overtrading during choppy conditions where multiple failed breakouts might occur in quick succession.
#### 8. Real-Time Info Panel
**Addition:** Comprehensive dashboard showing:
- Current regime (Bullish/Bearish/Neutral)
- RSI value and zone
- ADX value and trending status
- Breakout status
- Bars since last high/low
- Current setup status
- Position status
**Why:** Gives traders instant visibility into all strategy conditions without needing to check multiple indicators.
---
## Entry Rules Summary
### SHORT Entry (Fading Failed Breakout Above)
1. ✅ Price breaks ABOVE the 20-period Donchian high
2. ✅ Previous 20-period high was at least 1 bar ago
3. ✅ Price closes back BELOW the Donchian high (failed breakout)
4. ✅ RSI > 60 (exhausted buyers)
5. ✅ ADX > 20 (trending market)
6. ✅ Cooldown period met
→ **Enter SHORT**, betting the breakout will fail
### LONG Entry (Fading Failed Breakdown Below)
1. ✅ Price breaks BELOW the 20-period Donchian low
2. ✅ Previous 20-period low was at least 1 bar ago
3. ✅ Price closes back ABOVE the Donchian low (failed breakdown)
4. ✅ RSI < 40 (exhausted sellers)
5. ✅ ADX > 20 (trending market)
6. ✅ Cooldown period met
→ **Enter LONG**, betting the breakdown will fail
---
## Exit Rules
1. **ATR Stop Loss:** Position closed if price moves 1.5x ATR against entry
2. **ATR Profit Target:** Position closed if price moves 2.0x ATR in favor
3. **Channel Exit:** Position closed if price breaks the exit channel in the opposite direction
4. **Mid-Channel Exit:** Position closed if price returns to channel midpoint
---
## Best Market Conditions
The Turtle Soup strategy performs best when:
- ✅ Markets are prone to false breakouts
- ✅ Volatility is moderate (not too low, not extreme)
- ✅ Price is oscillating within a broader range
- ✅ There are clear support/resistance levels
The strategy may struggle when:
- ❌ Strong trends persist (breakouts follow through)
- ❌ Volatility is extremely low (no meaningful breakouts)
- ❌ Markets are in news-driven directional moves
---
## Default Settings
| Parameter | Default | Description |
|-----------|---------|-------------|
| Lookback Period | 20 | Donchian channel period |
| Min Bars Since Extreme | 1 | Bars since last high/low |
| RSI Length | 14 | RSI calculation period |
| RSI Short Level | 60 | RSI must be above this for shorts |
| RSI Long Level | 40 | RSI must be below this for longs |
| ADX Length | 14 | ADX calculation period |
| ADX Threshold | 20 | Minimum ADX for trades |
| ATR Period | 20 | ATR calculation period |
| ATR Stop Multiplier | 1.5 | Stop loss distance in ATR |
| ATR Target Multiplier | 2.0 | Profit target distance in ATR |
| Cooldown Period | 5 | Minimum bars between trades |
| Volume Multiplier | 1.2 | Volume spike threshold |
---
## Philosophy
> *"The Turtle system made millions by following breakouts. The Turtle Soup strategy makes money when those breakouts fail. In trading, there's always someone on the other side of the trade—this strategy profits by being the smart money that fades the trapped breakout traders."*
The beauty of the Turtle Soup strategy is its elegant simplicity: it exploits a known, repeatable pattern (failed breakouts) while using modern filters (RSI, ADX) to improve timing and reduce false signals.
---
## Credits
- **Original Turtle System:** Richard Dennis & William Eckhardt (1983)
- **Turtle Soup Strategy:** Linda Bradford Raschke & Larry Connors (1990s)
- **RSI Enhancement:** Various traders who discovered RSI extremes improve reversal detection
- **This Implementation:** Enhanced with Heikin Ashi smoothing, regime detection, ADX filtering, and comprehensive visualization
---
*"We're not following the turtles—we're making soup out of them."* 🥣
Enhanced Ichimoku CloudDYNAMIC INDICATOR... im a beginer at this so i like to enhance my indicator by adding Visual Elements so that its easier to read for me... here is a visual representation of trend changes.
Price Band LevelsThis indicator allows you to specify a base price. Once set, it automatically draws three price bands above the base and three bands below it, giving you a structured visual range around the selected level.
Harami Reversal Alerts BB Touch (Strict First Candle)Harami Reversal Alerts BB Touch (Strict First Candle)
Harami Reversal Alerts BB Touch (Strict First Candle)Harami Reversal Alerts BB Touch (Strict First Candle)Harami Reversal Alerts BB Touch (Strict First Candle)Harami Reversal Alerts BB Touch (Strict First Candle)Harami Reversal Alerts BB Touch (Strict First Candle)
DH EMA 28/72/200 Unified Ribbon (Scaled HTF)Unified EMA Ribbon (28/72/200)
This indicator merges two popular EMA systems — 21/55/200 and 34/89/200 — into a single, smoother trend-tracking ribbon.
Each pair of EMAs is averaged to create:
EMA 28 (average of 21 & 34)
EMA 72 (average of 55 & 89)
EMA 200 retained as long-term trend filter
The unified ribbon reduces noise, improves trend clarity, and provides clean pullback zones for high-probability entries, especially on the H1 timeframe.
BTC Price Prediction Model [Global PMI]V2🇺🇸 English Guide
1. Introduction
This indicator was created by GW Capital using Gemini Vibe Coding technology. It leverages advanced AI coding capabilities to reconstruct complex macroeconomic models into actionable trading tools.
2. Credits
Special thanks to the original model author, Marty Kendall. His research into the correlation between Bitcoin's price and macroeconomic factors lays the foundation for this algorithm.
3. Model Principles & Formula
This model calculates the "Fair Value" of Bitcoin based on four key macroeconomic pillars. It assumes that Bitcoin's price is a function of Global Liquidity, Network Security, Risk Appetite, and the Economic Cycle.
💡 Unique Insight: PMI & The 4-Year Cycle
A key distinguishing feature of this model is the hypothesis that Bitcoin's famous "4-Year Halving Cycle" may be intrinsically linked to the Global Business Cycle (PMI), rather than just supply shocks.
Therefore, the model incorporates PMI as a valuation "Amplifier".
Note: Due to TradingView data limitations, US PMI is currently used as the proxy for the global cycle.
The Formula
$$\ln(BTC) = \alpha + (1 + \beta \cdot PMI_{z}) \times $$
Global Liquidity (M2): Sum of M2 supply from US, China, Eurozone, and Japan (converted to USD). Represents the pool of fiat money available to flow into assets.
Network Security (Hashrate): Bitcoin's hashrate, representing the physical security and utility of the network.
Risk Appetite (S&P 500): Used as a proxy for global risk sentiment.
Economic Cycle (PMI Z-Score): US Manufacturing PMI is used to amplify or dampen the valuation based on where we are in the business cycle (Expansion vs. Contraction).
4. How to Use
The indicator plots the Fair Value (White Line) and four sentiment bands based on statistical deviation (Z-Score).
Sentiment Zones
🚨 Extreme Greed (Red Zone): Price > +0.3 StdDev. Historically indicates a market top or overheated sentiment.
⚠️ Greed (Orange Zone): Price > +0.15 StdDev. Bullish momentum is strong but caution is advised.
⚖️ Fair Value (White Line): The theoretical "correct" price based on macro data.
😨 Fear (Teal Zone): Price < -0.15 StdDev. Undervalued territory.
💎 Extreme Fear (Green Zone): Price < -0.3 StdDev. Historically a generational buying opportunity.
Sentiment Score (0-100)
100: Maximum Greed (Top)
50: Fair Value
0: Maximum Fear (Bottom)
5. Usage Recommendations
Timeframe: Daily (1D) or Weekly (1W) ONLY.
Reason: The underlying data sources (M2, PMI) are updated monthly. The S&P 500 and Hashrate are daily. Using this indicator on intraday charts (e.g., 15m, 1h, 4h) adds no value because the fundamental data does not change that fast.
Long-Term View: This is a macro-cycle indicator designed for identifying cycle tops and bottoms over months and years, not for day trading.
6. Disclaimer
This indicator is for educational and informational purposes only. It does not constitute financial advice. The model relies on historical correlations which may not hold true in the future. All trading involves risk. GW Capital and the creators assume no responsibility for any trading losses.
7. Support Us ❤️
If you find this indicator useful, please Boost 👍, Comment, and add it to your Favorites! Your support keeps us going.
🇨🇳 中文说明 (Chinese Version)
1. 简介
本指标由 GW Capital 使用 Gemini Vibe Coding 技术制作。利用先进的 AI 编程能力,将复杂的宏观经济模型重构为可执行的交易工具。
2. 致谢
特别感谢模型原作者 Marty Kendall。他对这一算法的研究奠定了基础,揭示了比特币价格与宏观经济因素之间的深层联系。
3. 模型原理与公式
该模型基于四大宏观经济支柱计算比特币的“公允价值”。它假设比特币的价格是全球流动性、网络安全性、风险偏好和经济周期的函数。
💡 独家洞察:PMI 与 4年周期
本模型的一个核心独特之处在于:我们认为比特币著名的“4年减半周期”背后的真正驱动力,可能与全球商业周期 (PMI) 高度同步,而不仅仅是供应减半。
因此,模型特别引入 PMI 作为估值的“放大器” (Amplifier)。
注:由于 TradingView 数据源限制,目前采用历史数据最详尽的美国 PMI 作为全球周期的代理指标。
模型公式
$$\ln(BTC) = \alpha + (1 + \beta \cdot PMI_{z}) \times $$
全球流动性 (M2): 美、中、欧、日四大经济体的 M2 总量(折算为美元)。代表可流入资产的法币资金池。
网络安全性 (Hashrate): 比特币全网算力,代表网络的物理安全性和实用价值。
风险偏好 (S&P 500): 作为全球风险情绪的代理指标。
经济周期 (PMI Z-Score): 美国制造业 PMI 用于根据商业周期(扩张 vs 收缩)来放大或抑制估值。
4. 指标用法
指标会在图表上绘制 公允价值 (白线) 以及基于统计偏差 (Z-Score) 的四条情绪带。
情绪区间
🚨 极度贪婪 (红色区域): 价格 > +0.3 标准差。历史上通常预示市场顶部或情绪过热。
⚠️ 一般贪婪 (橙色区域): 价格 > +0.15 标准差。多头动能强劲,但需谨慎。
⚖️ 公允价值 (白线): 基于宏观数据的理论“正确”价格。
😨 一般恐惧 (青色区域): 价格 < -0.15 标准差。进入低估区域。
💎 极度恐惧 (绿色区域): 价格 < -0.3 标准差。历史上通常是代际级别的买入机会。
情绪评分 (0-100)
100: 极度贪婪 (顶部)
50: 公允价值
0: 极度恐惧 (底部)
5. 使用建议
周期: 仅限日线 (1D) 或周线 (1W)。
原因: 底层数据源(M2, PMI)是月度更新的。标普500和算力是日度更新的。在日内图表(如15分钟、1小时、4小时)上使用此指标没有任何意义,因为基本面数据不会变化得那么快。
长期视角: 这是一个宏观周期指标,旨在识别数月甚至数年的周期顶部和底部,而非用于日内交易。
6. 免责声明
本指标仅供教育和参考使用,不构成任何财务建议。该模型依赖于历史相关性,未来可能不再适用。所有交易均涉及风险。GW Capital 及制作者不对任何交易损失承担责任。
MA + ATR Channel V2This script creates a dynamic volatility channel (similar to a Keltner Channel). It plots a central Moving Average (SMA or EMA) to represent the baseline trend and uses the Average True Range (ATR) to calculate the Upper and Lower bands. The channel automatically widens during high volatility and narrows during low volatility.
Usage
Mean Reversion: In sideways markets, prices touching the outer bands often tend to revert back to the central line.
该脚本构建了一个基于波动率的动态通道(类似肯特纳通道)。它以**移动平均线(SMA或EMA)为中轴判断趋势,并利用真实波幅(ATR)**计算通道宽度。通道范围会随市场波动加剧而变宽,随波动平缓而收窄。
用法
震荡回归: 在横盘行情中,价格触及通道边缘时,往往有回调至中轴的倾向。
BTC Price Prediction Model [Global PMI]🇨🇳 中文说明 (Chinese Version)
1. 简介
本指标由 GW Capital 使用 Gemini Vibe Coding 技术制作。利用先进的 AI 编程能力,将复杂的宏观经济模型重构为可执行的交易工具。
2. 致谢
特别感谢模型原作者 Marty Kendall。他对这一算法的研究奠定了基础,揭示了比特币价格与宏观经济因素之间的深层联系。
3. 模型原理与公式
该模型基于四大宏观经济支柱计算比特币的“公允价值”。它假设比特币的价格是全球流动性、网络安全性、风险偏好和经济周期的函数。
模型公式
$$\ln(BTC) = \alpha + (1 + \beta \cdot PMI_{z}) \times $$
全球流动性 (M2): 美、中、欧、日四大经济体的 M2 总量(折算为美元)。代表可流入资产的法币资金池。
网络安全性 (Hashrate): 比特币全网算力,代表网络的物理安全性和实用价值。
风险偏好 (S&P 500): 作为全球风险情绪的代理指标。
经济周期 (PMI Z-Score): 美国制造业 PMI 用于根据商业周期(扩张 vs 收缩)来放大或抑制估值。
4. 指标用法
指标会在图表上绘制 公允价值 (白线) 以及基于统计偏差 (Z-Score) 的四条情绪带。
情绪区间
🚨 极度贪婪 (红色区域): 价格 > +0.3 标准差。历史上通常预示市场顶部或情绪过热。
⚠️ 一般贪婪 (橙色区域): 价格 > +0.15 标准差。多头动能强劲,但需谨慎。
⚖️ 公允价值 (白线): 基于宏观数据的理论“正确”价格。
😨 一般恐惧 (青色区域): 价格 < -0.15 标准差。进入低估区域。
💎 极度恐惧 (绿色区域): 价格 < -0.3 标准差。历史上通常是代际级别的买入机会。
情绪评分 (0-100)
100: 极度贪婪 (顶部)
50: 公允价值
0: 极度恐惧 (底部)
5. 使用建议
周期: 仅限日线 (1D) 或周线 (1W)。
原因: 底层数据源(M2, PMI)是月度更新的。标普500和算力是日度更新的。在日内图表(如15分钟、1小时、4小时)上使用此指标没有任何意义,因为基本面数据不会变化得那么快。
长期视角: 这是一个宏观周期指标,旨在识别数月甚至数年的周期顶部和底部,而非用于日内交易。
6. 免责声明
本指标仅供教育和参考使用,不构成任何财务建议。该模型依赖于历史相关性,未来可能不再适用。所有交易均涉及风险。GW Capital 及制作者不对任何交易损失承担责任。
🇺🇸 English Guide (英文说明)
1. Introduction
This indicator was created by GW Capital using Gemini Vibe Coding technology. It leverages advanced AI coding capabilities to reconstruct complex macroeconomic models into actionable trading tools.
2. Credits
Special thanks to the original model author, Marty Kendall. His research into the correlation between Bitcoin's price and macroeconomic factors lays the foundation for this algorithm.
3. Model Principles & Formula
This model calculates the "Fair Value" of Bitcoin based on four key macroeconomic pillars. It assumes that Bitcoin's price is a function of Global Liquidity, Network Security, Risk Appetite, and the Economic Cycle.
The Formula
$$\ln(BTC) = \alpha + (1 + \beta \cdot PMI_{z}) \times $$
Global Liquidity (M2): Sum of M2 supply from US, China, Eurozone, and Japan (converted to USD). Represents the pool of fiat money available to flow into assets.
Network Security (Hashrate): Bitcoin's hashrate, representing the physical security and utility of the network.
Risk Appetite (S&P 500): Used as a proxy for global risk sentiment.
Economic Cycle (PMI Z-Score): US Manufacturing PMI is used to amplify or dampen the valuation based on where we are in the business cycle (Expansion vs. Contraction).
4. How to Use
The indicator plots the Fair Value (White Line) and four sentiment bands based on statistical deviation (Z-Score).
Sentiment Zones
🚨 Extreme Greed (Red Zone): Price > +0.3 StdDev. Historically indicates a market top or overheated sentiment.
⚠️ Greed (Orange Zone): Price > +0.15 StdDev. Bullish momentum is strong but caution is advised.
⚖️ Fair Value (White Line): The theoretical "correct" price based on macro data.
😨 Fear (Teal Zone): Price < -0.15 StdDev. Undervalued territory.
💎 Extreme Fear (Green Zone): Price < -0.3 StdDev. Historically a generational buying opportunity.
Sentiment Score (0-100)
100: Maximum Greed (Top)
50: Fair Value
0: Maximum Fear (Bottom)
5. Usage Recommendations
Timeframe: Daily (1D) or Weekly (1W) ONLY.
Reason: The underlying data sources (M2, PMI) are updated monthly. The S&P 500 and Hashrate are daily. Using this indicator on intraday charts (e.g., 15m, 1h, 4h) adds no value because the fundamental data does not change that fast.
Long-Term View: This is a macro-cycle indicator designed for identifying cycle tops and bottoms over months and years, not for day trading.
6. Disclaimer
This indicator is for educational and informational purposes only. It does not constitute financial advice. The model relies on historical correlations which may not hold true in the future. All trading involves risk. GW Capital and the creators assume no responsibility for any trading losses.
Dual TF Bearish Divergence (Working)//@version=6
indicator("Dual TF Bearish Divergence (Working)", overlay=true)
// ----------------- SIMPLE BEARISH DIVERGENCE FUNCTION -------------------
bearDiv(src, rsiLen, lookbackMin, lookbackMax) =>
r = ta.rsi(src, rsiLen)
ph = ta.pivothigh(src, lookbackMin, lookbackMin)
ph_rsi = ta.pivothigh(r, lookbackMin, lookbackMin)
ph2 = ph
ph2_rsi = ph_rsi
priceHH = not na(ph) and not na(ph2) and ph > ph2
rsiLH = not na(ph_rsi) and not na(ph2_rsi) and ph_rsi < ph2_rsi
barsOk = lookbackMin >= lookbackMin and lookbackMin <= lookbackMax
priceHH and rsiLH and barsOk
// ----------------- TF CALLS -------------------
b60 = request.security(syminfo.tickerid, "60", bearDiv(close, 14, 10, 15))
b240 = request.security(syminfo.tickerid, "240", bearDiv(close, 14, 10, 15))
dual = b60 and b240
// ----------------- PLOT -------------------
plotshape(dual, title="Dual Bear Div", style=shape.labeldown,
color=color.red, size=size.small, text="🔻BearDiv")
// ----------------- ALERT -------------------
alertcondition(dual, "Dual Bearish Div 60+240",
"Bearish Divergence on both 60m & 240m")
Daily Anchored VWAPAnchors VWAP to whatever time you want instead of the usual start of session. I use it for BTC so that I can anchor around NY open instead of the night before.
Traders edge indicator1Trend Confirmation: The primary trend is determined by the alignment of the long-term EMAs (e.g., 100 and 200). The trade direction should align with this overall trend.
Entry/Exit Signals: Shorter EMAs (e.g., 9 or 20) are used for high-probability entry points. Pullbacks to these faster EMAs within the context of a strong trend are common entry signals.
Dynamic Support and Resistance: The various EMAs and the VWAP line often act as magnetic levels where price tends to pause, reverse, or consolidate.
VWAP as Mean Reversion Target: In a volatile market, if the price moves significantly away from the VWAP, it may be considered "overextended," and a mean-reversion move back towards the VWAP is often anticipated.
21-50-100 EMA Crossover indicatorSimple EMA crossover indicator visualizing 21-50-100 EMA crossovers.
SPY EMA + VWAP Day Trading Strategy (Market Hours Only)//@version=5
indicator("SPY EMA + VWAP Day Trading Strategy (Market Hours Only)", overlay=true)
// === Market Hours Filter (EST / New York Time) ===
nySession = input.session("0930-1600", "Market Session (NY Time)")
inSession = time(timeframe.period, "America/New_York") >= time(nySession, "America/New_York")
// EMAs
ema9 = ta.ema(close, 9)
ema21 = ta.ema(close, 21)
// VWAP
vwap = ta.vwap(close)
// Plot EMAs & VWAP
plot(ema9, "EMA 9", color=color.green, linewidth=2)
plot(ema21, "EMA 21", color=color.orange, linewidth=2)
plot(vwap, "VWAP", color=color.blue, linewidth=2)
// ----------- Signals -----------
long_raw = close > ema9 and ema9 > ema21 and close > vwap and ta.crossover(ema9, ema21)
short_raw = close < ema9 and ema9 < ema21 and close < vwap and ta.crossunder(ema9, ema21)
// Apply Market Hours Filter
long_signal = long_raw and inSession
short_signal = short_raw and inSession
// Plot Signals
plotshape(long_signal,
title="BUY",
style=shape.labelup,
location=location.belowbar,
color=color.green,
size=size.small,
text="BUY")
plotshape(short_signal,
title="SELL",
style=shape.labeldown,
location=location.abovebar,
color=color.red,
size=size.small,
text="SELL")
// Alerts
alertcondition(long_signal, title="BUY Alert", message="BUY Signal (Market Hours Only)")
alertcondition(short_signal, title="SELL Alert", message="SELL Signal (Market Hours Only)")
Mean Reversion — BB + Z-Score + RSI + EMA200 (TP at Opposite Z)This is a systematic mean-reversion framework for index futures and other liquid assets.
This strategy combines Bollinger Bands, Z-Score dislocation, RSI extremes, and a trend-filtering EMA200 to capture short-term mean-reversion inefficiencies in NQ1!. It is designed for high-volatility conditions and uses a precise exit model based on opposite-side Z-Score targets and dynamic mid-band failure detection.
🔍 Entry Logic (Mean Reversion) :
The strategy enters trades only when multiple confluence signals align:
Long Setup
Price at or below the lower Bollinger Band
Z-Score ≤ –Threshold (deep statistical deviation)
RSI ≤ oversold level
Price below the EMA-200 (countertrend mean-reversion only)
Cooldown must be completed
No open position
Short Setup
Price at or above the upper Bollinger Band
Z-Score ≥ Threshold
RSI ≥ overbought level
Price above the EMA-200
Cooldown complete
No open position
This multi-signal gate filters out weak reversions and focuses on mature dislocations.
🎯 Take-Profit Model: Opposite-Side Z-Score Target :
Once in a trade, take-profit is set by solving for the price where the Z-Score reaches the opposite side:
Long TP = Z = +Threshold
Short TP = Z = –Threshold
This creates a symmetric statistical exit based on reverting to equilibrium plus overshoot.
🛡️ Stop-Loss System (Volatility-Aware) :
Stop losses combine:
A fixed base stop (points)
A standard-deviation volatility component
This adapts the SL to regime changes and avoids being shaken out during rare volatility spikes.
⏳ Half-Life Exit :
If a trade has not reverted within a fixed number of bars, it automatically closes.
This prevents “mean-reversion traps” during trending periods.
📉 Advanced Mid-Band Exit Logic (BB Basis Failure) :
This is the unique feature of the system.
After entry:
Wait for price to cross the Bollinger Basis (middle band) in the direction of the mean.
Start a 5-bar delay timer.
After 5 bars, the strategy becomes “armed.”
Once armed:
If price fails back through the mean, exit immediately.
Intrabar exits trigger precisely (with tick-level precision if Bar Magnifier is enabled).
This protects profits and exits trades at the first sign of mean-failure.
⏱️ Cooldown System :
After each closed trade, a cooldown period prevents immediate re-entry.
This avoids clustering and improves statistical independence of trades.
🖥️ What This Strategy Is Best For :
High-volatility intraday NQ conditions
Statistical mean reversion with structured confluence
Traders who want clean, rule-based entries
Avoiding trend-day traps using EMA and half-life logic
📊 Included Visual Elements :
Bollinger Bands (Upper, Basis, Lower)
BUY/SELL markers at signal generation
Optional alerts for automated monitoring
🚀 Summary :
This is a precision mean-reversion system built around volatility bands, statistical dislocation, and price-behavior confirmation. By combining Z-Score, RSI, EMA200 filtering, and a sophisticated mid-band failure exit, this model captures high-probability reversions while avoiding the common pitfalls of naive band-touch systems.
NQ-VIX Expected Move LevelsNQ -VIX Daily Price Bands
This indicator plots dynamic intraday price bands for NQ futures based on real-time volatility levels measured by the VIX (CBOE Volatility Index). The bands evolve throughout the trading day, providing volatility-adjusted price targets.
Formulas:
Upper Band = Daily Open + (NQ Price × VIX ÷ √252 ÷ 100)
Lower Band = Daily Open - (NQ Price × VIX ÷ √252 ÷ 100)
The calculation uses the square root of 252 (trading days per year) to convert annualized VIX volatility into an expected daily move, then scales it as a percentage adjustment from the current day's open.
Features:
Real-time band calculation that updates throughout the trading session
Upper band (green) extends from the current day's open
Lower band (red) contracts from the current day's open
Inner upper band (green) at 50% of expected move
Inner lower band (red) at 50% of expected move
Middle Inner upper band (green) at 80% of expected move
Middle Inner lower band (red) at 80% of expected move
Information table displaying:
Current NQ price and VIX level
Daily Open
Expected move
NQ-VIX Expected Move LTF LevelsNQ -VIX LTF Price Bands
This indicator plots dynamic intraday price bands for NQ futures based on real-time volatility levels measured by the VIX (CBOE Volatility Index). The bands evolve throughout the trading day, providing volatility-adjusted price targets.
Formulas:
Upper Band = (Input TF Open) + (NQ Price × VIX x √(Input TF ÷ (23h in min) ) ÷ 100
Lower Band = Daily Open - (NQ Price × VIX x √(Input TF ÷ (23h in min) ) ÷ 100
The calculation uses the square root of Input TF ÷ (23h in min) to convert annualized VIX volatility into an expected TF move, then scales it as a percentage adjustment from the current TF input's open.
Features:
Real-time band calculation that updates throughout the trading session
Upper band (green) extends from the current TF's open
Lower band (red) contracts from the current TF's open
Inner upper band (green) at 50% of expected move
Inner lower band (red) at 50% of expected move
Middle Inner upper band (green) at 80% of expected move
Middle Inner lower band (red) at 80% of expected move
Information table displaying:
Current input TF
Current NQ price and VIX level
Current input TF Open
Expected move
ES-VIX Expected Move LTF LevelsES-VIX LTF Price Bands
This indicator plots dynamic intraday price bands for ES futures based on real-time volatility levels measured by the VIX (CBOE Volatility Index). The bands evolve throughout the trading day, providing volatility-adjusted price targets.
Formulas:
Upper Band = (Input TF Open) + (ES Price × VIX x √(Input TF ÷ (23h in min) ) ÷ 100
Lower Band = Daily Open - (ES Price × VIX x √(Input TF ÷ (23h in min) ) ÷ 100
The calculation uses the square root of Input TF ÷ (23h in min) to convert annualized VIX volatility into an expected TF move, then scales it as a percentage adjustment from the current TF input's open.
Features:
Real-time band calculation that updates throughout the trading session
Upper band (green) extends from the current TF's open
Lower band (red) contracts from the current TF's open
Inner upper band (green) at 50% of expected move
Inner lower band (red) at 50% of expected move
Middle Inner upper band (green) at 80% of expected move
Middle Inner lower band (red) at 80% of expected move
Information table displaying:
Current input TF
Current ES price and VIX level
Current input TF Open
Expected move
Bitcoin Power Law Zones (Dunk)Introduction When viewed on a standard linear chart, Bitcoin’s long-term price action can appear chaotic and exponential. However, when analyzed through the lens of physics and network growth models, a distinct structure emerges.
This indicator implements the Bitcoin Power Law , a mathematical model that suggests Bitcoin’s price evolves in a straight line when plotted against time on a "log-log" scale. By calculating parallel bands around this regression line, we create a "Rainbow" of valuation zones that help investors visualize whether the asset is historically overheated, undervalued, or sitting at fair value.
The Math Behind the Model The Power Law dictates that price scales with time according to the formula: Price = A * (days since genesis)^b
This script uses the specific parameters popularized by recent physics-based analyses of the network: Slope (b): 5.78 (Representing the scaling law of the network adoption). Amplitude (A): 1.45 x 10^-17 (The intercept coefficient).
While simple moving averages react to price, this model is predictive based on time and network growth physics, providing a long-term "gravity" center for the asset.
Guide to the Valuation Zones
Upper Bands (Red/Orange): Extr. Overvalued, High Premium, Overvalued. Historically, these zones have marked cycle peaks where price moved too far, too fast ahead of the network's steady growth. The Baseline (Black Line): Fair Value. The mathematical mean of the Power Law. Price has historically oscillated around this line, treating it as a center of gravity. Lower Bands (Green/Blue): Undervalued, Discount, Deep Discount. These zones represent periods where the market price has historically lagged behind the network's intrinsic value, often marking accumulation phases.
Note: The lowest theoretical tiers ("Bitcoin Dead") have been trimmed from this chart to focus on relevant historical support levels.
How to Use Logarithmic Scale: You MUST set your chart to "Log" scale (bottom right of the TradingView window) for this indicator to function correctly. On a linear chart, the bands will appear to curve upwards aggressively; on a Log chart, they will appear as smooth, parallel channels. Timeframe: This is a macro-economic indicator. It is best viewed on Daily or Weekly timeframes. Overlay Labels: The indicator includes dynamic labels on the right-side axis, allowing you to instantly see the current price requirements for each valuation zone without manually tracing lines.
Credits This script is based on the Power Law theory popularized by Giovanni Santostasi and the original Corridor concepts by Harold Christopher Burger .
Disclaimer This tool is for educational and informational purposes only. It visualizes historical mathematical trends and does not constitute financial advice. Past performance of a model is not indicative of future results.
Further Reading
www.hcburger.com
giovannisantostasi.medium.com






















