Days of WeekSplits the days of the week by UTC 00:00 and writes the day with a customizable light gray colored text.
Narzędzia Pine
Multifactor trend analysis1) Overview
◆ A 30-minute technical-analysis framework combining:
◆ Higher-timeframe trend structure
◆ SMA-spread chop-risk filter
◆ Linear-regression slope classification
◆ 30-min breakout-style triggers
◆ Multi-indicator consensus layer
(MACD, RSI, Stoch, Ichimoku, CCI, PSAR, Williams %R, Heikin-Ashi, Force Index)
◆ Adaptive sizing & loss-pause module
◆ Two separate downward-signal branches with different logic and time-weighting
2) Core Components
Higher-Timeframe Structure
◆Up-bias: close > long-MA AND short-MA > long-MA
◆Down-bias: close < short-MA AND short-MA < long-MA
Chop-Risk Filter
◆Require MA-spread > threshold to avoid sideways noise.
Trend Slope
◆Linear-regression slope divided into strength categories.
Trigger (30-min)
◆Upward: high breaks above prior short-MA
◆Downward: low breaks below prior long-MA
◆Both include bar-state confirmation.
Consensus Score
◆Multiple indicators → +1 / -1 / 0 → combined score guiding downward logic.
Weekly Adjustments
◆Certain thresholds adapt at weekly cycle boundaries.
3) Conditions & Sizing
Upward Activation
Needs:
◆ HTF up-bias
◆Chop-filter pass
◆Upward breakout relative to prior MA
Adaptive Sizing
Based on:
◆Recent negative streaks
◆Slope category
◆User-defined limits
Downward Logic
Branch A
◆HTF down-bias
◆Down-MA breakout
◆Slope-acceleration requirement
◆Size increases with setup strength
Branch B
◆Close below SMA-deviation threshold
◆Down-bias consensus score > limit
◆Regression slope below requirement
◆Weekly thresholds
◆Time-window weighting
Interval Control
◆Must exceed minimum bar spacing.
Loss-Pause
◆After too many negative sequences → temporary cooldown.
4) Originality
◆ Dual-layer filtering: structure + chop
◆ Slope ranges instead of simple slope up/down
◆ Multi-indicator consensus
◆ Adaptive sizing + pause logic
◆ Designed for stable behavior in historical directional phases
5) Usage
◆ Default: 30-minute timeframe
◆ Not tied to any market/product
◆ Chop-filter reduces action in sideways periods
◆ Exits/trails adjustable
◆ Suitable only for study and research, not performance expectations
6) Disclaimer
- Educational only — no trading advice
◆ No recommendations, no predictions
◆ Past data ≠ future results
◆ Not responsible for outcomes
◆ No order execution
◆ Markets can be high-risk
◆ Invite-Only access; no source code; no refunds
◆ User assumes all risks
✅ 教育用途/策略研究
✅ 不提供投資建議/不代操
✅ 不保證績效/過去不代表未來
✅ Invite‑Only 授權 10,000 TWD per month /不提供原始碼
✅ 數位授權啟用後不退款
✅ 使用者自行承擔交易風險
Release Notes
v1.0: Initial release
v1.1: Added cooling / drawdown-limit mechanism
v1.2: Optimize the Bull algorithm
Market Conditions Panel [ARC Trade]
## 📊 ARC Trade – Bias & Decision Panel
**ARC Trade Panel** is a **decision-support indicator** designed to help traders evaluate market conditions **before entering a trade**.
This is **not a signal indicator**. Its purpose is to answer a simple but critical question:
> *Should I trade now, or should I wait?*
---
### 🔍 What does the panel show?
**• Market Direction (At a Glance)**
The panel header updates dynamically:
* **BULL**
* **BEAR**
* **RANGE**
This allows traders to instantly understand the current market environment without overloading the chart.
---
**• Timeframe Alignment (HTF ↔ LTF)**
Checks whether higher timeframe and lower timeframe are aligned.
When timeframes are not aligned, the panel automatically warns the trader to be cautious.
---
**• Market Structure (MSS & BOS Logic)**
Market Structure Shift and continuation logic are evaluated internally.
This helps reduce fake breakouts and premature entries.
---
**• Market Warning (Trade Decision Guidance)**
The panel produces clear decision messages:
* **BUY possible**
* **SELL possible**
* **WATCH / WAIT**
These messages are generated by combining structure, trend, alignment, volatility, and market conditions.
---
**• Trend Strength (ADX – Explained)**
Instead of showing raw ADX values only, the panel classifies trend strength:
* Weak
* Moderate
* Strong
This helps traders avoid range-bound conditions and low-quality setups.
---
**• Risk Mode (Position Size Psychology)**
Automatically evaluates market risk and displays:
* **LOW**
* **MEDIUM**
* **HIGH**
Risk Mode is based on volatility expansion, daily range usage, ADX strength, and timeframe alignment.
The goal is to guide traders toward **better position sizing decisions**, not just entries.
---
**• Signal Freshness (Timing Awareness)**
When a BUY or SELL becomes available, the panel tracks how fresh the signal is:
* Fresh
* Normal
* Late
This feature helps prevent chasing late entries.
---
**• Daily Movement & Remaining Potential (ATR-based)**
Shows how much of the daily range has already been used and estimates the remaining potential movement.
This helps traders avoid entering trades when the market is already overextended.
---
### 🎯 Who is this panel for?
✔ Traders who want structure and discipline
✔ Traders who want to reduce overtrading
✔ Traders who struggle with fake breakouts
✔ Traders who want a clear **pre-trade checklist**
✔ Traders who prefer decision support over raw signals
---
### ⚠️ Disclaimer
This indicator does **not** provide investment advice.
It is intended for **educational and analytical purposes only**.
Always apply your own risk management.
KD Weekly Oversold Golden Cross (v6)KD Weekly Oversold Golden Cross (v6)
This is a screener for weekly KD indicator bullish crossovers at oversold levels, where the K value does not exceed 25.
[Invite-Only] HHFF1B Hybrid Trend Strategy Overview The HHFF1B Hybrid Trend Strategy is an asymmetric trend-following system designed to capture high-probability breakouts while filtering out false signals in choppy markets. Unlike traditional symmetrical strategies, this script applies distinct logic for Long and Short entries to adapt to different market behaviors.
Core Logic
1. Asymmetric Entry Conditions The strategy differentiates between bullish trends and bearish breakdowns:
Long Entry (Trend Confirmation): Focuses on stability. A position is opened only when the price breaks above the Bollinger Band Upper Rail, confirmed by the Parabolic SAR, and is trading above key Long-Term EMAs (100 & 200). An RSI filter (30-70) is applied to avoid buying at extreme overbought levels.
Short Entry (Volatility Explosion): Focuses on momentum. Short entries require high volatility confirmed by ADX (Average Directional Index) and DMI. It looks for a "Bollinger Band Squeeze" release combined with a breakdown below the Lower Rail.
2. Risk Management & Profit Protection This is not a "fire and forget" system. It includes active trade management:
Dynamic Stop Loss: Initial stops are set based on percentage risk, but the strategy includes a "Breakeven Trigger." Once the trade moves favorably by a specific percentage (0.6% for Longs, 0.8% for Shorts), the stop moves to the entry price to protect capital.
Guard Exit Mechanism: A specialized logic that monitors the Parabolic SAR. If the trade is in profit (>0.45%) but the SAR signals a potential reversal, the strategy exits early to lock in gains before the trend collapses.
Trailing Stop: Uses ATR-based trailing stops to let winning trades run while the trend persists.
Settings & Customization Users can adjust risk per trade, lookback periods, and specific ADX thresholds to fit different assets (Crypto, Forex, or Stocks).
Disclaimer This strategy is for educational and analytical purposes only. Past performance does not guarantee future results. Trading involves significant risk.
Access This is an Invite-Only script.
To gain access, please check the links in my Signature below or send me a Private Message.
概述 HHFF1B 混合趋势策略 是一套非对称的趋势跟踪系统,旨在捕捉高概率的突破行情,同时在震荡市场中过滤虚假信号。与传统的对称策略不同,本脚本针对“做多”和“做空”采用了完全不同的底层逻辑,以适应市场上涨缓和与下跌急促的不同特性。
核心逻辑
1. 非对称入场机制
多头入场 (Long): 侧重于趋势确认。仅当价格突破布林带上轨,且同时满足抛物线 SAR 指标翻转、位于长周期均线(EMA 100 & 200)之上时才会触发。同时引入 RSI 过滤器(30-70区间),避免在极端超买区域追高。
空头入场 (Short): 侧重于爆发力。空头信号需要高波动率支持,通过 ADX (平均趋向指标) 和 DMI 进行筛选。策略会寻找“布林带挤压 (Squeeze)”后的向下爆发点,确保在动能最强时介入。
2. 动态风控与利润卫士 本策略包含主动的仓位管理机制,而非简单的固定止盈止损:
保本机制 (Breakeven): 当浮盈达到一定比例(多头0.6%,空头0.8%)时,止损线自动上移至开仓价,实现“无风险”持仓。
SAR 反转保护 (Guard Exit): 这是一个特殊的保护逻辑。如果当前持仓已有微利(>0.45%)但 SAR 指标显示短期反转信号,策略会立即离场,防止利润回撤。
ATR 移动止盈: 使用基于 ATR 的追踪止损,在趋势延续时让利润奔跑。
设置与自定义 用户可以根据不同的交易品种(加密货币、外汇或股票)调整每笔风险、布林带周期以及 ADX 阈值等参数。
免责声明 本脚本仅供学习和辅助分析使用。历史回测数据不代表未来表现。交易有风险,入市需谨慎。
如何获取 这是一个“仅限邀请 (Invite-Only)”的脚本。
如需申请访问权限,请查看下方我的 个人签名 (Signature) 或直接 私信 (Private Message) 联系我。
GHOST | Market Sessions Ranges MTF👻 GHOST | Market Sessions Ranges MTF
Master Time and Price with Ghost-Level Precision
Stop cluttering your charts with old, irrelevant levels. GHOST is a professional-grade tool designed for traders who prioritize institutional liquidity and crystal-clear price action.
This isn't just a level-drawer; it’s a dynamic liquidity manager that understands when and where price matters.
💎 Why GHOST is a Game Changer:
⚡ Smart Mitigation: Lines automatically disappear ("ghosting") as soon as price taps them. You only see the fresh liquidity that hasn't been mitigated yet.
🕒 Pro Session Filtering: Sync your levels with specific trading windows (London, New York, Asia). Colors and ranges adapt to the exact time you trade.
📊 True MTF Power: Monitor Daily, Weekly, and Monthly Highs and Lows (PDH/L, PWH/L, PMH/L) independently.
🎨 Minimalist "Ghost" Aesthetic: Say goodbye to lines crossing your entire screen. GHOST uses short, dashed lines with right-aligned labels and adjustable forward projection, keeping your "candle field" clean.
🛠️ Key Features & Customization:
✅ Dynamic Length: You control where the line starts and how far it projects into the future.
✅ One-Click Visibility: Toggle Daily, Weekly, or Monthly levels on/off instantly via the settings panel.
✅ 100% Free: A premium-quality tool shared openly with the global trading community.
💎 Key Features:
⚡ Smart Mitigation: Lines "ghost" away automatically once price taps them, keeping your chart focused on fresh liquidity.
🕒 Session Confluence: Sync your ranges with specific time zones (NY, London, Tokyo) to find the perfect trade window.
🎨 Clean Aesthetic: Labels are perfectly aligned to the right, ensuring your price action reading is never obstructed.
Autor : The ghost of trading 👻
Ultra Position Calculator v2Ultra Position Calculator v2 (UPC v2) Precision Position Sizing & Trade Simulation
The Ultra Position Calculator v2 is a massive upgrade to our professional risk management tool. Beyond just calculating position size, v2 now also acts as a Trade Simulator, allowing you to visually track the outcome of your setups (Waiting, Filled, TP Hit, or SL Hit) directly on the chart.
New in v2:
Smart Trade Simulation: The indicator now "replays" your setup. It detects if price hit your Entry, and subsequently if it hit TP or SL.
Visual Status Tracking:
Dashed Lines: Pending orders (Waiting).
Solid Lines: Active/Triggered orders.
Labels: Clearly displays "WAITING", "FILLED", "TP HIT", or "SL HIT".
Bilingual Support: Fully supports English and Chinese (中文) interfaces.
Key Features
Instant Position Sizing
Input your fixed risk (e.g., $100).
The tool calculates exactly how much Position Size (USDT) you need. Never guess your leverage again.
Interactive Setup (4-Point Click)
Use the "Confirm" inputs to click directly on the chart:
Start Time (Where the trade analysis begins)
Entry Price
Stop Loss
Take Profit
Pro Dashboard
Displays Risk Amount, Calculated Position Size, Estimated Profit, R:R Ratio, and exact price levels in a clean, high-contrast panel.
Validation Logic
Automatically prevents invalid setups (e.g., if TP and SL are on the same side relative to Entry).
How to Use
Add the indicator to your chart.
Open Settings or use the interactive input mode.
Set your Risk: Default is $100 (Adjustable in settings).
Define the Setup:
If using interactive mode, click 4 times on the chart (Time -> Entry -> SL -> TP).
Read the Panel: The bottom-right panel shows your Open Size (U). Open your exchange and enter this amount.
中文介紹 (Traditional Chinese)
Ultra Position Calculator v2 (UPC v2) 是一款專業的風控與倉位計算工具。v2 版本不僅能計算倉位,還新增了**「模擬回測功能」**,能自動判斷該交易計畫是「等待中」、「已進場」還是「已止盈/止損」。
核心功能:
自動計算倉位 (Position Size): 輸入您的止損金額 (如 100 U),指標會自動算出該開多少倉位,精準控制風險。
交易模擬 (Simulation): 虛線代表掛單中,實線代表已成交。圖表會自動顯示 TP HIT (止盈) 或 SL HIT (止損)。
互動式面板: 包含預期獲利、盈虧比 (R:R)、進出場點位資訊。
雙語介面: 完整支援中文顯示。
Designed for professional traders. Powered by Linear Alpha.
Volume Delta Waterfall (Anchored, No Reset)What this helps you see (simple)
Delta (ΔV) = UpVolume − DownVolume (estimated from lower timeframe).
Positive ΔV ⇒ more “up” volume inside the bar → buying pressure dominates.
Negative ΔV ⇒ more “down” volume inside the bar → selling pressure dominates.
The waterfall is cumulative delta: each bar starts at the previous bar close and moves up/down by ΔV.
Divergence idea:
Bearish divergence: price makes Higher High, but cumulative delta at that swing makes Lower High → rally is weaker (often exhaustion / distribution).
Bullish divergence: price makes Lower Low, but cumulative delta at that swing makes Higher Low → selloff is weaker (often absorption / reversal risk).
Simple Perps Calculator## Simple Perps Calculator (Long & Short)
A lightweight on-chart trade calculator that visualizes **entry, take-profit, and liquidation levels** with leverage-adjusted returns — designed for fast planning and clean charts.
This indicator automatically detects **long or short positions** based on your target price and adjusts calculations accordingly. All key levels are displayed as **colored horizontal price lines** with matching labels positioned near the price scale for easy reference.
---
### Features
- Entry, Take-Profit, and Liquidation price levels
- Automatic **long / short detection**
- Leverage slider up to **1000×**
- Leveraged **percent gain** calculation
- Color-coded horizontal price lines:
- 🟡 Entry
- 🟢 Take-Profit
- 🔴 Liquidation
- Adjustable label positioning (left or right of chart)
- Horizontal offset control to move labels out of the way
- Clean, minimal, non-intrusive design
---
### How to Use
1. Set your **Entry Price**
2. Set your **Target Price**
3. Adjust **Leverage**
4. Move labels using the **horizontal offset** slider if needed
If the target price is above entry, the script assumes a **long** position. If below, it assumes a **short** position and places the liquidation level above entry automatically.
---
### Notes
- Liquidation price uses a simplified isolated-margin model
- Intended for **planning and visualization only**
- Actual exchange liquidation prices may vary due to fees and maintenance margin requirements
Market Structure MTF [HH/HL/LH/LL + CHoCH + BOS]Automatic market structure detection with pivot classification (HH/HL/LH/LL), Change of Character (CHoCH) and Break of Structure (BOS) signals. Multi-timeframe support allows overlaying higher timeframe structure on any chart.
█ OVERVIEW
This indicator automatically detects and classifies pivot points to visualize market structure. It identifies trend direction through the sequence of highs and lows, and signals potential reversals through Change of Character (CHoCH) and trend continuation through Break of Structure (BOS).
█ CONCEPTS
Market structure analysis is based on the relationship between consecutive pivot points:
Bullish Structure:
• HH (Higher High): A swing high that exceeds the previous swing high
• HL (Higher Low): A swing low that stays above the previous swing low
• Sequence: HH → HL → HH → HL confirms uptrend
Bearish Structure:
• LH (Lower High): A swing high that fails to exceed the previous swing high
• LL (Lower Low): A swing low that breaks below the previous swing low
• Sequence: LH → LL → LH → LL confirms downtrend
Structure Shifts:
• CHoCH (Change of Character): Signals when the expected sequence breaks, suggesting potential trend reversal
• BOS (Break of Structure): Confirms trend continuation when price breaks a pivot level in trend direction
█ FEATURES
• Automatic pivot detection using configurable lookback period
• Smart classification comparing each pivot to its predecessor
• CHoCH detection when trend sequence is violated
• BOS signals with anti-repetition filter to reduce noise in consolidation zones
• Multi-Timeframe (MTF) support to display higher timeframe structure
• Horizontal dashed lines marking HTF pivot levels
• Clean visual output with color-coded labels
█ SETTINGS
Structure Settings:
• Pivot Length: Number of bars on each side required to confirm a pivot (default: 5)
- Lower values (2-3) = more sensitive, detects minor swings
- Higher values (10-20) = less sensitive, only major structure
Multi-Timeframe:
• Show HTF Structure: Enable/disable higher timeframe overlay
• HTF Timeframe: Select the higher timeframe to display (D, W, M, etc.)
Visualization:
• Show Local Structure: Toggle visibility of current timeframe pivots
Filters:
• BOS Buffer: Minimum bars between BOS signals to avoid repetition
█ HOW TO USE
The indicator offers three visualization modes:
1. LOCAL STRUCTURE ONLY (default)
├─ Show Local Structure: ✓ Enabled
├─ Show HTF Structure: ✗ Disabled
└─ Use case: Analyze structure on the current timeframe only
2. HIGHER TIMEFRAME ONLY (recommended for clarity)
├─ Show Local Structure: ✗ Disabled
├─ Show HTF Structure: ✓ Enabled
├─ HTF Timeframe: Select desired TF (D, W, M)
└─ Use case: View higher TF context on lower TF charts without clutter
3. BOTH TIMEFRAMES (advanced)
├─ Show Local Structure: ✓ Enabled
├─ Show HTF Structure: ✓ Enabled
└─ Use case: See confluence between timeframes
⚠️ WARNING: This mode can make the chart visually crowded.
Recommended only for experienced users who need both layers simultaneously.
█ RECOMMENDED SETTINGS BY TIMEFRAME
| Chart TF | Pivot Length | Suggested HTF |
|----------|--------------|---------------|
| 1H | 10-15 | 4H or D |
| 4H | 5-10 | D or W |
| 1D | 5-7 | W |
| 1W | 3-5 | M |
The goal is to make pivots on lower timeframes represent equivalent time context.
█ VISUAL REFERENCE
Local Structure Labels:
• 🟩 Green (above): HH - Higher High
• 🟥 Red (above): LH - Lower High
• 🟩 Green (below): HL - Higher Low
• 🟥 Red (below): LL - Lower Low
• 🟧 Orange: CHoCH - Change of Character
• 🟦 Blue: BOS - Break of Structure
HTF Structure Labels:
• 🩵 Teal: HH/HL - Bullish HTF structure
• 🟫 Maroon: LH/LL - Bearish HTF structure
• 🟨 Yellow: CHoCH - HTF trend shift
• 🟦 Navy: BOS - HTF structure break
• ┈┈ Dashed lines mark HTF pivot price levels
█ INTERPRETATION GUIDELINES
Reading the sequence:
• Consistent HH + HL = Bullish bias, look for long opportunities
• Consistent LH + LL = Bearish bias, look for short opportunities
• CHoCH after trending sequence = Potential reversal, exercise caution
• BOS in trend direction = Trend continuation confirmed
Combining timeframes:
• HTF structure defines the primary bias
• Local structure provides entry timing
• Confluence (both TFs aligned) = Higher probability setups
█ LIMITATIONS
• Pivots are confirmed with a delay equal to the Pivot Length parameter
• In ranging markets, multiple CHoCH signals may appear (this is correct behavior - the market IS changing direction frequently)
• CHoCH signals potential reversal, not guaranteed reversal
• Works best on liquid markets with clean price action
█ TECHNICAL NOTES
• Uses ta.pivothigh() and ta.pivotlow() for pivot detection
• request.security() fetches higher timeframe data
• Anti-repetition logic prevents BOS signal clustering in consolidation
• All crossover/crossunder calculations are performed at global scope for consistency (Pine Script v6 compliance)
█ CREDITS
Developed for swing traders and position traders who use market structure for trend analysis and trade timing.
Feedback and suggestions are welcome.
Multi-KI-Agenten Strategie FINAL-PROMulti-AI agent trading system, including EMA 50, 100 & 200, Fibonacci retracement, supply and demand, RSI, and much more. Simply add the data, set alerts, and you're ready to go.
Please use this system solely to confirm your own analyses. It should never be used as a 100% reference.
AlphaTrend and Turtle Trading StrategiesThis is a composite trading strategy based on the **AlphaTrend indicator** and the **Turtle Trading System**, with the following key features:
## Core Logic
### 1. **Main Trading Signal System**
- **AlphaTrend Indicator**: Constructs dynamic support and resistance lines using MFI/RSI and ATR.
- **Turtle Channels**: Uses 44-period and 20-period breakout channels.
- Generates a buy signal when the AlphaTrend line crosses above its lagging line and a sell signal when it crosses below.
### 2. **Multiple Filtering Conditions**
- **Trend Confirmation**: The ADX indicator ensures sufficient trend strength (>12).
- **Volatility Filtering**: Donchian width + ATR ensures sufficient price volatility.
- **Volume Filtering**: Volume must exceed 1.3 times the moving average.
- **RSI Filtering**: Avoid opening positions in overbought (RSI>70) or oversold (RSI<30) areas.
### 3. **Position Management**
- **Risk Control**: Single trade risk 1%, maximum position 36%
- **Stop-Loss Settings**: 2% percentage stop-loss (ATR stop-loss optional but off by default)
- **Dynamic Position Calculation**: Calculates position size based on stop-loss distance and account funds
### 4. **Averaging Down Mechanism**
- **Signal Consistency Averaging Down**: Averaging down when the Turtle system issues a signal in the same direction during the holding period.
- **Averaging Down Per Trade**: Calculates the averaging down amount using the same risk amount.
### 5. **Stop-Loss Reversal**
- **Turtle Risk Control Stop-Loss**: When the held position breaks through the Turtle exit line in the opposite direction.
- **Double Reversal**: Immediately reverses the position after a stop-loss, doubling the original position size.
## Feature Summary
1. **Trend Following**: Primarily captures medium- to long-term trends.
2. **Multiple Confirmations**: Ensures signal quality.
3. **Strict Risk Control**: Comprehensive stop-loss and position management.
4. **Averaging Down Strategy**: Increases profits when the trend continues.
5. **Reversal Mechanism:** Quickly reverses direction, reducing losses during sideways trading.
6. **Data:** Backtesting on a 4-hour chart, profit factor 4.86, profitable trades 63.64%, annualized return 60%, maximum backtest 23.6%.
This is a relatively complex quantitative strategy, suitable for operation in market environments with clear trends. It reduces false signals through multiple filters, while optimizing the profit/loss ratio through position averaging and reversal mechanisms.
AT trading systemIn the AT trading system, AT LONG means closing a long position and AT short means closing a long position and shorting.
CME Gap Tracker [captainua]CME Gap Tracker - Advanced Gap Detection & Tracking System
Overview
This indicator provides comprehensive gap detection and tracking capabilities for both consecutive bar gaps and weekly CME trading session gaps. It automatically detects gaps, tracks their fill progress in real-time, provides detailed statistics, and includes backtesting features to validate gap trading strategies. The script is optimized for CME futures trading but works with any instrument, automatically handling ticker conversion between CME futures and spot markets.
Gap Detection Types
Consecutive Bar Gaps:
Detects gaps between any two consecutive bars on the current timeframe. Two detection modes are available:
- High/Low Mode: Detects gaps when current bar's low > previous bar's high (gap up) or current bar's high < previous bar's low (gap down). This is more sensitive and detects more gaps.
- Close/Open Mode: Detects gaps when current bar's open > previous bar's close (gap up) or current bar's open < previous bar's close (gap down). This is more conservative.
Weekly CME Gaps:
Detects gaps between weekly trading sessions, specifically designed for CME futures markets. The script automatically detects the first bar of each new week and compares the current week's open with the previous week's close/high/low. This is particularly useful for tracking weekend gaps in CME futures markets where price can gap significantly between Friday close and Monday open.
Smart Ticker Detection
The script automatically converts between CME futures tickers (e.g., BTC1!, ETH1!) and spot tickers (e.g., BTCUSDT, ETHUSDT). When viewing a CME futures chart, it can automatically detect and use the corresponding spot ticker for gap analysis, and vice versa. This allows traders to:
- View CME futures but track spot market gaps
- View spot markets but track CME futures gaps
- Manually override with custom ticker specification
The ticker validation system uses caching to prevent race conditions during initial script load, ensuring reliable ticker resolution.
Gap Filtering & Tolerance
Static Tolerance:
Set minimum and maximum gap sizes as percentages (default: show only gaps > 0.333% and < 100%). This filters out noise and focuses on significant gaps.
Dynamic Tolerance:
When enabled, tolerance is calculated dynamically based on ATR (Average True Range). The formula: Dynamic Tolerance = (ATR × ATR Multiplier / Close Price) × 100%. This adapts to market volatility - in volatile markets, only larger gaps are shown; in calm markets, smaller gaps are displayed. This is particularly useful for instruments with varying volatility.
Absolute Size Filtering:
In addition to percentage filtering, gaps can be filtered by absolute price size (e.g., show only gaps > $100). This is useful for instruments where percentage alone doesn't capture significance (e.g., high-priced stocks).
Fill Confirmation System
To reduce false gap closure signals, the script requires multiple consecutive bars to confirm gap closure. The default is 2 bars, but can be adjusted from 1-10 bars. Lower values (1) confirm faster but may produce false signals from temporary wicks. Higher values (3-5) reduce false fill signals but delay confirmation. This prevents temporary price spikes from triggering false gap closure alerts.
Gap Fill Tracking
The script tracks gap fill progress in real-time:
- Fill Percentage: How much of the gap has been filled (0-100%)
- Fill Speed: Whether fill is accelerating, decelerating, or constant
- Time to Fill: For closed gaps, how many bars it took to fill
- Fill Status: Unfilled, partially filled, or fully filled
Visual Features
Heatmap Colors:
Gap colors can be adjusted based on gap size, with larger gaps appearing more intense and smaller gaps more faded.
Adaptive Line Width:
Line thickness automatically adjusts based on gap size, making larger gaps more prominent.
Age-Based Coloring:
Gaps can be color-coded by age, with newer gaps appearing brighter and older gaps more faded.
Confluence Zones:
Areas where multiple gaps overlap are highlighted with enhanced visuals, indicating stronger support/resistance zones.
Gap Statistics
A comprehensive statistics table provides:
- Total gaps created, open, and closed
- Fill rates by direction (up vs down) and size category (small, medium, large)
- Average fill time, fastest fill, slowest fill
- Oldest gap and oldest unfilled gap
- Backtesting results: success rate, reversal rate, average move after fill
- CME gap expiration statistics: Gaps expired unfilled (for Weekly CME gaps only)
Statistics can be filtered by period (All Time, Last 100/500/1000/5000 bars) and can be reset via toggle button.
Backtesting
When enabled, the script tracks price movement after gap fills:
- Price after fill: Captures price when gap closes
- Move after fill: Percentage price movement after closure
- Success/Reversal tracking: Determines if price continued in fill direction or reversed
- Success rate: Percentage of gaps where price continued in fill direction
This data helps validate gap trading strategies and understand gap fill behavior.
Gap Re-opening Detection
When enabled, the script detects when a previously filled gap reopens (price gaps back through the filled gap zone). This is useful for identifying when support/resistance levels break and can signal trend reversals.
CME-Specific Features
Monday Opening Volume Analysis:
For Weekly CME gaps detected on Monday openings, the script tracks Monday opening volume relative to average volume. Higher Monday volume ratios indicate stronger gap significance. This ratio is integrated into gap strength calculations and can be displayed in gap labels. Gaps with Monday volume > 1.5x average receive priority score boosts.
CME Gap Expiration Tracking:
Weekly CME gaps that remain unfilled beyond a configurable threshold (default 1000 bars) are automatically marked as "expired" and tracked separately in statistics. This helps identify gaps that act as strong support/resistance levels and never fill. Expired gaps are displayed with special labeling and counted in the "Gaps Expired (CME)" statistic.
CME Gap Priority Scoring Enhancement:
The priority scoring system includes special boosts for CME gaps:
- Monday gaps: +10 points (gaps detected on Monday openings)
- High Monday volume gaps: +15 points (Monday volume ratio > 1.5x average)
- Gaps at key weekly levels: +10 points (gaps aligning with previous week's high, low, or close within 0.5% tolerance)
These enhancements help prioritize the most significant CME gaps for trading decisions.
Custom Gap Zones
Traders can manually mark custom gap zones by specifying top and bottom levels. These zones are tracked like automatically detected gaps, allowing traders to:
- Mark historical gaps that weren't detected
- Create support/resistance zones based on other analysis
- Track specific price levels of interest
Multi-Timeframe Support
The script can detect gaps on higher timeframes simultaneously. For example, when viewing a 1-hour chart, it can also detect and display gaps from the weekly timeframe. This provides multi-timeframe context for gap analysis.
Alert System
Comprehensive alert system with multiple trigger types:
- Gap Creation: Alert when new gaps are detected
- Gap Closure: Alert when gaps are fully filled
- Partial Fill: Alert when gaps reach specific fill percentages (e.g., 25%, 50%, 75%, 90%)
- Approaching Closure: Alert when gaps reach high fill levels (e.g., 90%, 95%) before closing
- Gap Re-opening: Alert when previously filled gaps reopen
Alerts can be filtered to trigger only on Mondays (useful for CME weekly gaps) or any day.
Filtering Options
Gaps can be filtered by:
- Fill Status: Show all, unfilled only, partially filled only, or fully filled only
- Fill Percentage Range: Show gaps within specific fill percentage ranges
- Gap Age: Show only gaps within specific age ranges (bars)
- Gap Expiration: Automatically remove gaps older than specified number of bars (for Weekly CME gaps, uses separate CME expiration threshold)
Performance & Safety
The script includes several safety features:
- Safe array operations to prevent index out-of-bounds errors
- Memory leak prevention through proper visual object cleanup
- Ticker validation caching to prevent race conditions
- Week boundary detection for accurate CME gap identification
- Fill confirmation system to reduce false signals
- Monday opening volume analysis for CME gap strength assessment
- CME gap expiration tracking with configurable thresholds
- Priority scoring enhancement for Monday gaps, high Monday volume, and key weekly levels
Usage Recommendations
For CME Weekly Gaps:
1. Set "Gap Detection Type" to "Weekly CME"
2. View a CME futures chart (e.g., BTC1!) or enable auto-detect spot ticker
3. Set tolerance to filter gap size (default 0.333%)
4. Enable statistics to track fill rates
5. Configure alerts for gap creation/closure
For Consecutive Bar Gaps:
1. Set "Gap Detection Type" to "Consecutive Bars"
2. Choose "High/Low" for more gaps or "Close/Open" for fewer gaps
3. Adjust tolerance based on instrument volatility
4. Enable fill confirmation (2-3 bars) for more reliable signals
5. Use filtering to focus on specific gap types
For Gap Trading Strategies:
1. Enable backtesting to validate strategy performance
2. Review statistics to understand gap fill patterns
3. Use confluence zones to identify strong support/resistance
4. Configure alerts for gap events matching your strategy
5. Use custom zones to mark important levels
Technical Details:
• Pine Script v6 | Overlay indicator
• Safe array operations with index validation
• Memory leak prevention through proper object cleanup
• Ticker validation caching for reliable ticker resolution
• Works on all timeframes and instruments
• Comprehensive edge case handling
• Week boundary detection using ta.change(weekofyear)
• Fill confirmation system with configurable bars
For detailed documentation and usage instructions, see the script comments.
Classic Chartism-Market Structure- Support.ResistanceClassic Chartism – Market Structure + Support & Resistance
This indicator is designed for traditional chart-based technical analysis, relying exclusively on price action and market structure, without the use of oscillators or lagging indicators.
The script automatically detects significant swing highs and swing lows using confirmed pivots and classifies price structure according to classic market structure notation:
HH (Higher High)
HL (Higher Low)
LH (Lower High)
LL (Lower Low)
Based on these swings, the indicator plots horizontal Support & Resistance (SR) levels, representing historically significant areas of supply and demand. These levels remain active until invalidated by price, providing a clear and objective market context.
The indicator does not repaint once a swing is confirmed, making it suitable for real-time analysis and discretionary trading decisions. It performs well across cryptocurrencies, futures, indices, and equities, and is particularly useful for trend identification, pullback entries, and structure-based risk management.
Seasonal Strategies V1Seasonal Strategies V1 is a rule-based futures seasonality framework built around predefined calendar windows per asset.
The strategy automatically detects the current symbol and activates long or short trading phases strictly based on historically observed seasonal tendencies. All entries and exits are fully time-based — no indicators, no predictions, no discretionary input.
Key Features
Asset-specific seasonal windows (MMDD-based)
Automatic long and short activation
Fully time-based entries and exits
One position at a time (no pyramiding)
Clean chart visualization using subtle background shading
No indicators, no filters, no curve fitting
Philosophy:
This strategy is designed as a structural trading tool, not a forecasting model.
It focuses on when a market historically shows seasonal tendencies — not why or how far price might move.
Seasonal Strategies V1 intentionally keeps the chart clean and minimal, making it suitable as a baseline framework for research, portfolio-style seasonal approaches, or further extensions in later versions.
Intended Use:
Futures and commodity markets
Seasonality research and testing
Systematic, calendar-driven strategies
Educational and analytical purposes
Disclaimer
This script is provided for educational and research purposes only.
Past seasonal tendencies do not guarantee future performance.
Risk management, position sizing, and portfolio decisions are the responsibility of the user.
Trading Discipline Mirror How deciplined you are?
Trading Discipline Journal – Smart Feedback helps traders stay disciplined and emotionally controlled. Select your winning or losing reasons, and the indicator automatically calculates scores, evaluates your behavior, and gives clear feedback on whether you’re trading in a safe mindset or a risky one.
Price % Distance from 52 Weeks High, and EMAs"Stop guessing how far extended the price is—measure it instantly."
As a swing trader, knowing the exact distance between the current price and your key moving averages is critical. It tells you if a stock is overextended (too far) or offering a low-risk pullback entry (near 0%).
This lightweight utility script calculates the real-time percentage distance of the closing price from three critical levels:
10 EMA (Short-term momentum)
20 EMA (Swing trend baseline)
52-Week High (Major structural resistance)
It displays this data in a single, clean Smart Label attached to the latest candle, keeping your chart clutter-free.
Key Features
📊 Instant Calculation: See exactly how far (%) the price is from the 10 EMA, 20 EMA, and 52-Week High without using a measuring tool.
🧠 Intelligent Trend Coloring: The text color changes dynamically based on the immediate trend:
🟢 Green Text: Price is ABOVE both 10 & 20 EMAs (Bullish / Buy-the-dip zone).
🔴 Red Text: Price is BELOW both 10 & 20 EMAs (Bearish / Caution).
⚪ White Text: Price is mixed/choppy (between the EMAs).
👁️ High Contrast Design: Uses a semi-transparent dark background that ensures the data is clearly visible on both Light and Dark mode charts.
How to Use for Swing Trading
Pullback Entries: In a strong uptrend (Green Text), watch for the 10 EMA or 20 EMA % value to drop near 0.0% to 0.5%. This indicates a pullback to the average—often a high-probability entry point.
Overextension Warning: If the % distance becomes unusually large (e.g., Price is +5% above the 10 EMA), the move may be overextended, signaling to tighten stops or take profit.
52-Week Breakouts: Monitor the 52W % distance. As it approaches 0.0%, the stock is challenging its yearly high, alerting you to potential breakout plays.
Settings
EMA Lengths: Fully customizable (Default: 10 & 20).
Lookback: Adjust the high lookback period (Default: 260 bars for 52 Weeks).
Position: Toggle the label to appear Above or Below the candle.
Shadows, by Paragon Signals"Shadows" is a momentum indicator with a twist: Instead of reading raw price at face value, it focuses on moves that look more intentional, then measures momentum through a MACD-style lens. It includes filters to avoid getting baited by chop or dead market conditions, a directional state so it doesn’t flip on noise, and a quality score as a quick “is this clean or messy?” check.
Quick use:
a) Check the quality score first: high = cleaner context, low = noise.
b) Follow the directional bias: bullish → favor longs, bearish → favor shorts.
L / S= suggested entry when everything lines up. **XL / XS** = exit when momentum fades or bias flips.
* You can also use the **colored lines** as signals on their own ( blue-longs, red-shorts) —not just the entry/exit markers—since they help you read momentum and direction in real time.
Great for 15m TF (crypto perp)
About me: Quant trader with years in the game, building a new project and using Pine Script as a sandbox/proyect. I’m also a data scientist and Python developer, eat, sleep, and breathe markets is mandatory lol ( jk ). Outside trading, my second passion is football (watching it and playing it).
a = "peace out"
print(a)
Bar Countdown ClockBar Countdown Clock
Description:
Displays the remaining time for the current bar on the chart. The countdown label follows the previous EMA5 price to stay stable during high-volatility markets. Font size and label position are fully customizable. Works well on BTC, Gold, Forex, and other trading instruments.
How to Use:
Add the indicator to your chart.
Adjust Clock Color, Font Size, and X Offset to suit your preference.
The label will automatically track the previous EMA5 price.
The countdown updates in real-time until the current bar closes.
Tips:
Increase X Offset if the label overlaps the current bar.
For high-volatility instruments, the label remains stable by following EMA5.
EMA Length can be adjusted to change the anchor point for the label.






















