[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) 联系我。
Pine实用程序
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.
Macro Stress Monitor (USDJPY + JGB + Yield Curve)
# **Note‑Style Description**
This indicator provides a consolidated framework for monitoring two of the most systemically important channels of global USD liquidity transmission: **offshore USD funding conditions in Japan** and **front‑end U.S. rates stress linked to repo and collateral dynamics**. While TradingView does not supply direct access to cross‑currency basis swaps or repo benchmarks, the script employs market‑validated proxies that closely track the same underlying pressures observed in dealer balance‑sheet constraints, FX‑hedged flows, and Treasury funding markets.
### **1. USD/JPY Funding Pressure (Basis‑Swap Proxy)**
The USD/JPY cross‑currency basis is a primary indicator of offshore USD funding premia for Japanese banks, insurers, and real‑money accounts. Basis widening typically reflects elevated USD demand, reduced hedge ratios, and impaired FX swap market liquidity.
To approximate this behavior in real time, the indicator combines:
- **USDJPY spot**, which tends to accelerate higher during USD funding stress, FX swap dislocations, or shifts in BOJ/Fed policy differentials.
- **JP10Y (Japan 10‑year yield)**, which captures JGB‑market stress, duration‑hedging flows, and the impact of FX‑hedged UST carry dynamics on domestic rates.
The joint behavior of these two series provides a high‑signal proxy for USD/JPY basis conditions, particularly around quarter‑end, fiscal year‑end, and BOJ policy events.
### **2. U.S. Front‑End Curve Stress (Repo/Collateral Proxy)**
Stress in the U.S. repo market often manifests first in the front end of the Treasury curve, where funding volatility, collateral scarcity, and dealer balance‑sheet compression drive rapid curve distortions.
The indicator tracks:
- **US02Y – US10Y (2s10s spread)** as a public‑market proxy for repo tightness, GC specialness, and leveraged Treasury basis‑trade unwind risk.
A deeper inversion or accelerated flattening of the 2s10s curve frequently coincides with rising funding premia, increased margin requirements, and deleveraging across rates‑sensitive strategies.
### **3. Stress Diagnostics**
The script highlights three conditions that historically align with elevated cross‑asset fragility:
- **USDJPY > 20‑day SMA** — proxy for USD funding stress / basis widening
- **JP10Y < 20‑day SMA** — proxy for JGB‑market stress or hedging‑related duration flows
- **2s10s < –0.50** — proxy for front‑end funding pressure and repo‑related curve distortions
These are not directional trading signals. They are **liquidity‑risk diagnostics** intended to identify periods when global funding markets become more vulnerable to synchronized deleveraging.
### **4. Intended Use Case**
This tool is designed for macro practitioners, cross‑asset strategists, and risk managers who monitor:
- USD funding premia and cross‑currency basis dynamics
- FX‑hedged UST flows and Japanese institutional positioning
- Treasury basis‑trade leverage and repo‑driven volatility
- BOJ/Fed policy interactions and quarter‑end balance‑sheet effects
- Systemic liquidity conditions across FX, rates, and credit
The indicator provides a real‑time dashboard for identifying early‑stage liquidity stress that may precede broader cross‑asset volatility.
EMA MACD Swing Set upUsed EMA and MACD, Targeted to help you simply identify the trending stocks. Can be used for Buy and Sell side trades
Backtest Pro - The TradingView Backtesting EngineBacktest your indicators — no strategy code required. Backtest Pro is the next-generation backtesting engine for smarter testing. Simply link your signals, set your stops, and start testing.
With its upgraded UI/UX and fundamentally improved stop system, Backtest Pro replaces the legacy PSE (Practical Strategy Engine) and sets a new standard for TradingView backtesting. It delivers more accurate intrabar trailing stops, flexible stop types (Points, ATR Multiplier, %), and a smoother workflow for greater precision and control.
Once loaded on your chart, Backtest Pro appears as BT Pro as the script title and in the Strategy Tester, alerts, and chart labels.
Beyond the core stop and pyramiding logic, Backtest Pro also introduces:
A clearer Data Window for reviewing trade details.
Improved signal labels in the Strategy Tester’s List of Trades for easier log analysis.
Updated chart labels that align better with TradingView’s native style and make signals easy to interpret. Together, these improvements make Backtest Pro the most practical and user-friendly way to backtest indicator-based trading signals in TradingView.
Copyright © 2025 CoinOperator
________________________________________________________________________________
🚀 Why Traders Choose Backtest Pro
Answer in minutes what used to take days of manual testing.
Backtest Pro is a drop-in, ready-to-use backtesting engine that links to your indicator with just a few simple connection lines. It provides more accurate intrabar trailing stops, multiple stop types (Points, ATR Multiplier, %), and a smoother workflow for greater precision and control.
Whether you’re running a quick test or fine-tuning complex strategies, Backtest Pro helps you reach clearer insights faster.
________________________________________________________________________________
👤 Who Backtest Pro Is For
Backtest Pro is designed for traders who already have a trading methodology or entry/exit logic and want professional-grade validation and risk analysis.
Backtest Pro is not a signal service and does not provide discretionary trade recommendations. All entries and exits — including alerts used for automation — are generated solely from user-defined logic.
You bring the logic — Backtest Pro provides the structure, metrics, and discipline.
Backtest Pro helps swing traders, day traders, and strategy developers streamline the backtesting process without sacrificing depth or accuracy. It offers flexible stop management, enhanced Data Window metrics, refined Strategy Tester labeling, and clean on-chart visuals to support consistent evaluation.
Backtest Pro supports trading and backtesting on futures (continuous contracts), forex, crypto, stocks, ETFs, and commodity/index CFDs (tradable if offered by your broker).
________________________________________________________________________________
⚡ Quick Start
Add Backtest Pro to your chart. It appears as BT Pro as the script title and in the Strategy Tester, alerts, and chart labels.
Add a few connector lines to your indicator, then link your custom entry and exit signals.
Adjust position sizing, stops, and pyramiding.
Run the TradingView Strategy Tester for instant results.
________________________________________________________________________________
🔄 From PSE to Backtest Pro
Backtest Pro builds on the foundation of the PSE (Practical Strategy Engine), evolving it into a more refined tool. While PSE introduced flexible stop handling, Backtest Pro enhances the experience with:
More accurate intrabar trailing stops
Expanded stop type options (Points, ATR Multiplier, %)
Upgraded Data Window for easier review
Clearer trade signals in the Strategy Tester
Cleaner, more consistent chart labels
Wash Sale Prevention is Now Optional. If enabled, it only applies to assets of types stock and fund.
🛠 INPUTS TAB SETTING
📅 Trading Window
Enable Trading Window to define the date/time when trading is allowed. Disable to trade the entire market data.
Partition the time when trading is allowed to see if your indicator settings work well across the different ranges. Your resulting metrics should be acceptable across all four (4) ranges: entire range, 1st half, IQR, and 2nd half.
Show Trading Window Lines – Enable to draw vertical lines at the start and end of the trading window for clear visual definition of when trading is allowed.
💰 Position Sizing (Money Management)
Separating the equity risk into initial position and pyramid position allows for greater ability to maximize profits within your acceptable drawdown.
Note : Position sizing is determined on the anticipated fill price which is affected by the maximum of slippage and selected price gap (discussed in the Execution Rules section). Max Equity per Position (%) : This setting applies to each position within a trade group . Limits the position size and will not exceed this amount. Set as desired. Default is 20% for non-leverage trading. For leveraged trading, adjust accordingly. Example: for 3× leverage, enter 300 (3 × 100 = 300).
Max Equity Drawdown Warning (%) : Triggers an alert if the strategy’s equity drawdown exceeds this threshold. Select the method to use for this warning. If BT Pro, then it is based on peak equity at bar-close. If TradingView, then it is based on the built-in variable strategy.max_drawdown_percent. Helps you manage strategy-level risk tolerance.
Scaled Pyramiding : Adjusts position size incrementally for each pyramid entry—either decreasing or increasing exposure relative to the prior entry.
Start Position: The entry number at which scaling begins. For example, 3 means scaling starts on the 2nd pyramid (the 3rd entry overall).
Chg(%): The percentage change applied to each subsequent pyramid entry.
Max(%): The maximum cumulative reduction allowed when scaling downward. Ignored for upward scaling because increases are already capped by Max Equity per Position (%).
⚖️ Execution Rules
Trade Direction : Select either Both , Long Only, or Short Only.
Alert Failed to Trade – Enable to alert you when a trade did not happen due to low equity or low order size. Applicable only for the first position of a trade group.
Cooldown Period : Controls how long the engine waits after an exit before allowing a new trade group. Backtest Pro also applies a small built-in safeguard to prevent unrealistic same-bar flips: ● 1 bar minimum for same-direction entries
● 2 bars minimum for direction changes
Prevent Wash Sales : Enable if you want the Backtest Pro to enforce a minimum cooldown period of 30 days for trade groups that result in a loss. Only applies to assets of types stock and fund.
Pyramid Conditions with Price Gaps : Dwn Gap and Up Gap refer to price gaps. A price gap is the difference between the closing price of the previous candle and the opening price of the current candle, and their value is shown in the Data Window. Selection options include: disabled (the default), median, avg, p80 (for 80th percentile), and p90 (for 90th percentile). The values reflect ~500 most recent bars from the cursor position. Disabled sets the Dwn Gap and Up Gap to zero in the below logic. Pyramids require a tailing stop loss, TSL. The price gaps are used in conditions for pyramids:
To ensure the previous position is protected when opening a pyramid position. A new pyramid position will not open until its trailing stop loss protects the prior position.
To prevent a pyramid position from becoming a loss when too close to a take profit level, TP (if enabled), due to commission cost.
The logic for #1 and #2 is as follows:
For a Long Pyramid: TSL: Stop Price - max(DwnGap, slippage) > LastEntryPrice
TP (if enabled): Long take profit > close + max(UpGap, slippage) AND gain > commission cost
For a Short Pyramid:
TSL: Stop Price + max(UpGap, slippage) < LastEntryPrice
TP (if enabled): Short take profit < close - max(DwnGap, slippage) AND gain > commission cost
Show All Gap Stats in Data Window
Enable to show all price gap statistics in the Data Window to review market conditions.
Disable for the Backtest Pro to run most efficiently.
Note: Statistics selected in Dwn Gap and Up Gap settings are always shown, regardless of this option.
🛑 Exit Strategy (Risk Management)
Backtest Pro supports multiple stop loss styles, giving traders the tools to backtest strategies in TradingView with precision:
The Exit Strategy applies a common protective stop across the entire trade group.
Pyramids require a trailing stop loss. A new pyramid position will not open until its trailing stop loss protects the prior position.
Plot Stop Level : You can plot the stop level either as of bar close (the default) or as of bar open. This only affects the visual plot. The underlying logic does not change. The trades will be the same regardless of the setting.
ATR Length : The ATR Length is used with the ATR multiplier and is common to stop loss, SL, trailing stop loss, TSL, take profit, TP, and the time-based exit option. It is the number of bars (periods) used in ATR calculation.
Price-Based Exits Stop Loss and Trailing Stop Loss options are Points, ATR Multiplier, and %.
The Trailing Stop Loss is activated from entry of the initial position of a trade group.
Take Profit options are Points, ATR Multiplier, %, and R-Multiple. How Trailing Stops Work in the Backtest Pro All trailing stop inputs (Points, ATR Multiplier, or %) are converted at the first entry into a fixed currency offset.
That offset is reactive intrabar and applied as the trailing distance from the most favorable price (highest for longs, lowest for shorts) since the first entry in the trade group.
Even if “%” is selected as the input method, the engine uses the fixed currency offset.
The trailing stop offset (points) is displayed in the Data Window for reference, allowing you to enter that offset directly at your broker if needed.
⚠️ Caution: Always enter a points-based trailing stop at your broker—never a percentage-based trailing stop. Volatility-Based Exit While in a trade, ATR values are accumulated each bar. The position exits once the total exceeds ATR Multiplier × ATR at entry if the Reward/Risk is below the set threshold.
Dividends are not included in reward (i.e., profit).
👉 These flexible stop types solve one of the biggest limitations of the legacy PSE and make Backtest Pro a true TradingView backtesting engine.
📑 Trade Signal Labels in Strategy Tester
Backtest Pro uses standardized trade labels in the Strategy Tester → List of Trades. These labels make it easy to understand the reason behind each entry or exit at a glance. Entry : Standard entry signal when conditions are met.
Stop : Stop-loss exit triggered at your defined stop level.
Pyr-Entry : Pyramid entry, adds to an existing position.
Trail-Stop : Trailing stop exit based on offset logic. Note : If the stop level has been adjusted to equal the trailing stop level, the Strategy Tester may display Stop instead of Trail-Stop. The exit displayed is the one Pine Script evaluates first, but the actual exit behavior remains correct.
Exit : Standard exit signal.
Delay-Exit : One-bar delayed exit, prevents immediate exit when position entry and exit signal occur on the same bar.
TP : Take Profit exit, closes position at your profit target.
RR-Exit : Reward/Risk exit — position closes when ATR accumulation exceeds the set threshold and R/R is below target.
📊 Performance Metrics & Reporting
Include Dividends in Profit
Adjusts ROI, CAGR, Reward/Risk, Avg Invest/Trade-Grp, and Equity.
Assumes dividends are taken as cash (not reinvested). They are applied to Equity on the ex-date instead of the payment date.
Only applies if the security issues dividends and the chart is 1D or lower timeframe; otherwise ignored.
Include Dividends in Profit Factor
Applies only when Include Dividends in Profit is enabled.
Adds dividend income to both gross profits and gross losses when calculating Profit Factor, so PF reflects total return (trading + dividends).
Affects Avg Trade-Grp Loss, Equity Loss from ECL, and Equity Loss from ECL (%).
Show Dividends
Displays the payout in currency/share, as well as the total amount based on the number of shares of the position(s) currently held by the trade group. For long positions you earned the dividends. For short positions you owe the dividends.
Show Metrics Table
The on-chart Metrics Table displays a compact set of key statistics for quick reference and mobile use. Full and expanded metrics are available in the Data Window on desktop or browser. Section groupings may differ between the table and Data Window to optimize readability and presentation in each context.
📊 Data Window
Note : Accessible via a button on the right-hand toolbar of the chart interface. Unlike the Metrics Table, Data Window values update dynamically as you move your cursor across bars. All metrics are based on trade groups.
Trade Information
Enter Price
Stop Price
Favorable Extreme : only shows if trailing stop loss is enabled on Inputs tab. The most favorable price (highest for longs, lowest for shorts) since the first entry in the trade group.
TSL Offset Points : only shows if trailing stop loss is enabled on Inputs tab.
Take Profit : only shows if take profit is enabled on Inputs tab.
Leverage information applies to trade groups.
Fail Pos / Margin (%) : Shows zero if the failed position size was <1, or the margin % that failed to meet the requirement in the Properties tab. A flag appears above the bar where a failed trade occurred. Only applies to the first position of a trade group. Hover over the flag to view the value in the Data Window.
Notional Value : total trade group position size x latest entry price x point value. The equity must be > notional value x margin requirement for a trade to occur.
Current Margin (%) : must be greater than margin requirement set on the Properties tab in order for a trade to occur.
Margin Call Price : when enabled on the Style tab is displayed on both the chart and the Data Window as shown below.
Performance Net Profit (%) : Will include dividends if 'Include Dividends in Profit' is enabled. Only shows in Data Window if 'Include Dividends in Profit' is enabled.
ROI (%) and CAGR (%) : Based on Avg Invest/Trade-Grp. Adjusted for dividends if enabled.
Reward/Risk (profit/risked, expectancy per amount risked): Adjusted for dividends if enabled. Color is green if above breakeven, red if below, and yellow if within ±0.1 tolerance.
Profit Factor (PF) : By default, dividends are not counted in win/loss classification.
Win % : Uses same coloring scheme as Reward/Risk except uses a ±2% tolerance for yellow. Breakeven point is the balance between Reward/Risk and Win %, showing whether the system can be profitable. For example, for a low Win % a high Reward/Risk is needed for the system to be potentially profitable. Equity & Growth
Equity : Your current equity.
Dividend Sum : The amount of total dividends accumulated since entering the market. Only shows in Data Window if 'Include Dividends in Profit' is enabled. Risk & Drawdown
Maximum Drawdown (MDD)
Measures the largest peak-to-trough decline in account equity over the entire backtest.
A new peak is recorded whenever equity reaches a new high; the system then tracks the lowest equity seen until a new peak forms.
This method uses bar-close equity including both realized and unrealized P&L. Therfore, it may not match TradingView’s displayed drawdown values which use a different method.
Maximum Drawdown %
Expresses MDD as a percentage of the equity peak from which the decline occurred.
This normalizes drawdown across different account sizes and assets, making strategy-to-strategy risk comparisons more meaningful.
Maximum Consecutive Losses applies to trade groups.
Equivalent Consecutive Losses (ECL) : Based on Win % and Nbr of Trade-Grp’s.
Simulates a realistic losing streak with intermittent small wins.
Lowered by increasing Win %.
Equity Loss from ECL : Equity drawdown estimated from ECL.
Equity Loss from ECL (%) : Same, expressed as a percentage.
Avg Trade-Grp Loss Trade Structure
Backtesting Years : The trading window in years.
Nbr of Trade-Grp’s : Count of trade groups.
Nbr of Positions : The count of positions shown on the chart.
The TV list of trades in the Strategy Tester may indicate more than what is actually shown on the chart.
Avg Invest/Trade-Grp : Avg money invested per trade group. Adjusted for dividends if enabled.
Avg Trade-Grp Days : The average number of days for trade groups.
Time in Market (%) : The percentage of time in a trade based on the trading window.
Cnt 1st EE Same-Bar is the count of first positions in a trade group that enter and exit on the same bar. Labels appear above for easy reference. Helps assess optimal stop-loss settings.
Cnt Pyr EE Same-Bar is the count of pyramid positions in a trade group that enter and exit on the same bar. Labels appear above for easy reference. Helps assess optimal stop-loss settings. Up Gaps / Dwn Gap (Ticks) ( Show All Gap Stats in Data Window enabled )
Median gap
Avg gap
80 percentile
90 percentile
Price Gap (Ticks) ( Show All Gap Stats in Data Window disabled )
Dwn Gap : Shows selected option if not disabled.
Up Gap : Shows selected option if not disabled.
Data Quality
Tick Resolution measures how many minimum price increments (ticks) fit into the current asset’s price. It is calculated as: Tick Resolution = Price / Minimum Tick Size. This value indicates the precision available for order placement and stop calculations.
Green – High resolution (>= 1000). The strategy’s stop and profit calculations will operate with normal accuracy.
Yellow – Moderate resolution (100-999). Stop levels are still functional but may exhibit minor rounding effects.
Red – Low resolution (< 100). This can distort trailing stops, stop losses, or take profits due to coarse rounding by TradingView’s broker emulator.
⚠️ Caution : When Tick Resolution is in the red zone, results from backtests may differ significantly from live trading because price precision is too low for reliable simulation.
💡 Tip : If low tick resolution is present at the beginning of the chart’s market data (often with very old price history), use the Trading Window to restrict backtesting to later periods where the asset price has risen and tick resolution is higher.
👁 Visualization
Highlight Traded Background
Trade groups are shown in background color of green for long positions and red for short positions. Set as desired.
Show Losing Trade Groups
Losing trade groups are indicated at the exit with label text in the color blue. Used to easily find consecutive losses affecting your strategy’s performance. The dividend payment, if any, is not considered in the calculation of a win or loss.
Show Position Values
Enable to show the currency value of each position in gold color.
Show Max Drawdown (Peak & Trough) Enable to show the peak and trough labels on the price chart. Based on equity at bar close. Use to easily identify the bar associated with the peak and trough of equity.
Select label size for your preference.
Alert on Expiring GTC Orders
Backtest Pro includes an optional alert that warns you when a Good-Til-Canceled (GTC) order is approaching expiration. This feature is designed as a safety net, helping you avoid unprotected trades caused by broker-imposed GTC expirations. This alert is sent a few days before a 60-day time period you’re if still in an open position.
By default, the alert is enabled, offering protection for traders who may not actively monitor order expiry rules.
Professional users who already track expirations can disable the feature in the settings to streamline alerts.
🔌 Signal Connection
Click the dropdown and select the entry and exit signal to establish a connection to your indicator.
Separate Entry and Exit Signal Connections.
Backtest Pro requires separate entry and exit signals. Indicators that already produce distinct events integrate cleanly and make strategies easier to read, debug, and maintain.
If your indicator currently uses a combined signal (e.g., buy = 1, sell = –1, flat = 0), that structure can create overlap or conflicts during backtesting.
Don’t worry — later in this manual, you’ll learn exactly how to adapt your indicator so it outputs clear entry and exit signals compatible with Backtest Pro.
🔌 Configure Your Indicator for Entry and Exit Signals
This section explains how to structure your indicator’s entry and exit signals so they can connect seamlessly with the Backtest Pro engine.
Define your own conditions for when to enter or exit positions using any technical logic you prefer. You can configure exits independently of entries or make them dependent on them—for example, exiting only when the opposite entry condition occurs.
Below are a few examples of how you might define Long and Short Entry Signals before connecting them to Backtest Pro.
________________________________________________________________________________
Examples of Long Entry Signals
ind_sig_long = oscillator > UpperLimit
ind_sig_long = ta.crossover(ta.sma(close, 14), ta.sma(close, 28))
ind_sig_long = MACD_hist > 0 Examples of Short Entry Signals
ind_sig_short = oscillator < LowerLimit
ind_sig_short = ta.crossunder(ta.sma(close, 14), ta.sma(close, 28))
ind_sig_short = MACD_hist < 0 ________________________________________________________________________________
Combining and Refining Your Signals
If your indicator uses multiple internal conditions, you can combine them using logical operators or threshold rules before connecting to the Backtest Pro engine.
1. Combine multiple conditions
Use logical and / or to merge your conditions into one signal:
Entry_Long = ind_sig_long1 and ind_sig_long2 // both must be true
Entry_Short = ind_sig_short1 or ind_sig_short2 // either may be true ________________________________________________________________________________
2. Require a minimum number of confirming conditions
You can also define a threshold for how many entry conditions must be true before triggering a signal. This can help ensure stronger confirmation.
minNbr_Entries = input.int(defval=1, title='Min Number of Entry Conditions')
// Convert boolean signals to numeric form
longCount = (ind_sig_long1 ? 1 : 0) + (ind_sig_long2 ? 1 : 0)
shortCount = (ind_sig_short1 ? 1 : 0) + (ind_sig_short2 ? 1 : 0)
// Require at least minNbr_Entries to confirm signal
Entry_Long = longCount >= minNbr_Entries
Entry_Short = shortCount >= minNbr_Entries
Do likewise for your Exit conditions to ensure consistency in trade confirmation.
________________________________________________________________________________
Defining Exits
Independent of Entries
Exit_Long = ta.crossunder(ta.rsi(close, 14), 70)
Exit_Short = ta.crossover(ta.rsi(close, 14), 30) Dependent on Entries
Exit_Long = Entry_Short // exit longs when short entry triggers
Exit_Short = Entry_Long // exit shorts when long entry triggers ________________________________________________________________________________
Final Signals to Connect to Backtest Pro
entry_signal = Entry_Long ? 1 : Entry_Short ? -1 : 0
exit_signal = Exit_Long ? 1 : Exit_Short ? -1 : 0
plot(entry_signal, title="entry_signal", color = color.blue, display=display.data_window)
plot(exit_signal, title="exit_signal", color = color.red, display=display.data_window) ________________________________________________________________________________
Notes
You can easily expand this structure to handle three or more conditions by adding them to the count expression.
If your indicator already provides a single entry_signal, you can connect it directly to Backtest Pro without modification.
Always ensure your final Entry_Long, Entry_Short, Exit_Long, and Exit_Short variables are boolean (true / false).
🔒 Connecting Closed-Source Indicators
If your indicator is closed-source (meaning you cannot view or modify its internal code), you’ll need to work with the plotted values it provides.
Create a connection indicator that reads those plotted values and converts them into clear entry and exit signals using the logic described above.
This connection indicator acts as a bridge between the closed-source indicator and Backtest Pro, allowing you to translate its behavior into standardized signal logic that the engine can process.
⚙️ PROPERTIES TAB SETTING
Initial Capital : Set as desired.
Base Currency : Leave as Default. The Backtest Pro is designed to use the instrument’s native currency, so changing this is not necessary.
Order Size : Essentially disabled. Position sizing is handled in the Inputs tab and is based on a percentage of equity.
Pyramiding : Set as desired.
Commission : Enter as a percentage of position value. The Backtest Pro is designed to work only with commission expressed this way.
Verify Price for Limit Orders : Set as desired.
Slippage : Set as desired. See the Dwn/Up Gap values in Data Window to get an idea of possible values to use.
Margin (Leverage Trading):
The Backtest Pro supports both leveraged and non-leveraged trading (default is no leverage).
Note : The following two settings apply at the trade group level . For example, to trade with 5× leverage, enter 20 (1 ÷ 5 × 100 = 20).
Margin for Long Positions : Set as desired. Default is 100%.
Margin for Short Positions : Set as desired. Default is 100%.
Recalculate After Order Is Filled (default is enabled)
Enabling this allows the Backtest Pro to function correctly and to recalculate immediately after an order is filled , which makes it possible to:
Enter and exit on the same bar (because the strategy sees the fill instantly).
Trigger alerts immediately after the fill , instead of waiting for the next bar close.
You may see the following Caution! message in the TradingView Strategy Tester:
This warning occurs because the strategy parameter calc_on_order_fills = true . You can safely close the caution message and know the Backtest Pro will produce realistic backtest results.
Recalculate On every tick : Disable.
Fill Orders
Using Bar Magnifier : Recommended if your TradingView plan supports it. Improves intrabar accuracy, but the strategy can still run without it.
On Bar Close : Must remain disabled. Enabling this prevents the Backtest Pro from working as intended.
⚠️ Caution : Enabling On Bar Close forces all orders to be evaluated only at bar close. This disables intrabar logic, prevents same-bar entries and exits, and breaks trailing stop / pyramid behavior. For the Backtest Pro to work as intended, On Bar Close must remain disabled .
Using Standard OHLC : Recommended if running the strategy on Heikin Ashi charts. Otherwise, set as desired. The default is enabled.
📢 Using The Alert Dialog Box Message Field
When setting alerts, include alert() function calls with order fills to allow notifications for drawdown exceeded, Failed to Trade (if enabled), and to be warned of expiring GTC orders (if enabled).
Example Message for Order Fill Alerts
(This is just an example. Consult TV manual for possible placeholders to use.)
Position: Current = {{strategy.market_position}}, Previous = {{strategy.prev_market_position}}
{{strategy.order.action}} {{strategy.order.contracts}} shares at price = {{strategy.order.price}} on {{exchange}}:{{ticker}} (TF: {{interval}})
Equity_Multiplier = {{strategy.order.contracts}} x {{strategy.order.price}} ÷ {{plot("Equity")}}
{{strategy.order.alert_message}}
Note :
Use a known account equity multiplied by Equity_Multiplier to determine the total currency amount required for position sizing—especially when managing multiple accounts with different equity levels.
What {{strategy.order.alert_message}} Includes
This placeholder automatically inserts the additional information generated for each order fill alert (blank for exits):
Stop Price (on first entries is based on bar close prior to order fill bar)
TSL Offset (Pts) distance from Favorable Extreme (for pyramid entries)
TP (on first entries is based on bar close prior to order fill bar)
Price Gap (Pts) based on your gap selection and slippage entered
Example Message for Bot Trading Alerts
(You must consult your specific bot for configuring the alert message. This is just an example.)
"action": "{{strategy.order.action}}",
“price”: {{strategy.order.price}}
"amount": {{strategy.order.contracts}},
"botId": "1234"
Time-Based Level & Watermark [PTN.Trades]Hello NTA Bros. Let's test my script! Hello Hello TDV said my description is too brief. I have to write something more!
## 3 Ways to Cook Crispy, Fluffy, and Delicious Omelettes Without the Grease
Calling all **Egg Lovers**! Today, we’re diving into the "Omelette"—a dish that seems simple but is packed with secret techniques. Everyone has their own signature style, and today, Maggi is sharing 3 different ways to fry an omelette. Whether you’re craving that **extra crispy and fluffy** version you find at restaurants, a **healthy, low-oil** version that isn't greasy, or a **thick and soft** omelette for a full, satisfying bite—we’ve got you covered!
---
### 1. How to Fry a Crispy Omelette
**Ingredients:**
1. 1 tsp Maggi Cooking Sauce
2. Cooking oil (about half a pan deep)
**Instructions:**
1. Pour oil into the pan and heat until hot. Crack the eggs, season, and beat well.
2. Once the oil is boiling, pour the egg mixture through a **strainer** into the pan to create a fluffy texture. When the egg turns golden brown, flip it over. Fry until cooked through and serve.
**Pro-Tips for Crispiness:**
* Don't over-beat the eggs until they are too bubbly, or they will flow through the strainer too slowly.
* Wait for the oil to get hot, then reduce to medium heat for about 10 seconds before testing a small amount of egg through the strainer. If it fluffs up beautifully, pour the rest through the strainer across the pan.
* If using an **electric stove**, use the highest heat. Once the oil is hot, test with a little egg. If it fluffs up, pour the rest in without reducing the heat.
* Pouring through a strainer creates small "strands" of egg that fluff up instantly when hitting the hot oil.
---
### 2. The Healthy Version: Low-Oil Omelette
**Ingredients:**
1. 2 Eggs
2. 1 tsp Maggi Cooking Sauce
3. A small amount of oil
**Instructions:**
1. Crack the eggs, season, and beat well. Heat the pan first, then add a little vegetable oil.
2. Pour the egg into the pan. Once golden brown, flip to the other side and serve.
**Pro-Tips for Low-Oil:**
* **Heating the pan before adding oil** prevents the egg from sticking, which is crucial since we are using very little oil.
* When you pour the egg in, use the edge of your spatula to stir the center quickly. This helps the egg cook faster, makes it easier to flip, and results in a thicker, softer texture.
---
### 3. How to Make a Thick and Soft Omelette
**Ingredients:**
1. 4 Eggs
2. 2 tsp Maggi Cooking Sauce
3. Cooking oil
**Instructions:**
1. Crack the eggs, season, and beat well. Pour about 3 tbsp of oil into a **pot**. You don't need to wait for the oil to be extremely hot.
2. Pour the egg in and use a fork to stir the center quickly (similar to making scrambled eggs). This helps the egg set fast without spreading too much. Use medium-low heat (or medium heat for electric stoves).
3. Once the egg starts to set, tilt the pot slightly and use a spatula to flip the egg. Add a tiny bit more oil, increase the heat, and wait for a beautiful color. Flip again and use high heat briefly to "push out" any excess oil. Remove, drain the oil, and serve.
**Pro-Tips for a Thick & Soft Texture:**
* **Frying in a pot** forces the egg to stay thick and shapely. Choose a small pot to make the omelette look taller and fluffier.
* Stirring quickly with a fork helps the egg cook and bind together faster, making it much easier to flip.
* Using medium-low heat ensures the egg doesn't burn before the thick center is fully cooked.
---
So, what do you think? With these 3 different methods, you can choose the style that fits your mood—whether it’s crispy, thick, or healthy. You can easily make these at home and ensure every bite is perfectly seasoned and delicious with **Maggi Cooking Sauce**.
---
**Would you like me to adjust the tone to be more formal, or perhaps help you write a catchy title for social media?**






















