Cerca negli script per "daily"
BTC Swinger v1Daily interval swing trading algorithm based on momentum techniques using ATR Stops. Made by Kory Hoang from Stably.
Shout out to the Advanced Crypto Asset Trading crew! ;)
MY_CME eod OI vs CFTC eow OIDaily e-o-d Open Interest as published by CME.
As CFTC COT Open Interest relates to last Tuesday, here you can have an idea how things evolved day-by-day since then.
As CME total OI is not accessibl as data, here I sum OI of the next 9 outstanding contracts, which gives a fair idea of the trend in OI
MTF EMA Combo with Background ColorDaily/Weekly EMA combo for longer term trend direction, with combo background color for varying trend direction.
Daily Average True Range OverlayPlots the upper and lower average true range away from the previous days close on all time frames.
Daily Deviations (Lazy Edition)
Plots the standard deviation resistance/support lines.
Uses Previous days close and the VIX as the volatility factor.
credit to u/UberBotMan and u/Living_Granger for the idea and formulas
Daily Deviations (Self Input Version)
Plots the standard deviation resistance/support levels.
Input the previous settlement price and the implied volatility.
credit to u/UberBotMan and u/Living_Granger for the idea and formulas
(preview example is using settlement of 2420 and IV of 11)
Daily Returns & STDWhat happened last time when xx increased by xx%? - Start collecting some stats!
You can choose the ticker and the timeframe you're interested in
RSI Oversold/UndersoldThe study script will place GREEN BUY arrows BELOW oversold conditions and RED SHORT arrows ABOVE overbought conditions. You can configure the period
Most RSI(14) indicators use a 14-period, I prefer a 5-period. The period, overbought and oversold periods are settings that can easily be changed by adding this study to your chart and clicking the "gear" icon next to the study inside your chart.
Daily SMAThis pine script on intraday chart is exactly the same SMA as built-in MovingAverage on a 1Day chart (with the same lengths)
Power Zone Trader (PZT)The PZT Indicator (Power Zone Trader ) is a multi-timeframe confluence system designed to identify and visualize natural support and resistance levels with exceptional clarity. By automatically mapping key structural highs and lows from higher timeframes, PZT allows traders to see where price is most likely to react, reverse, or accelerate, forming the foundation for high-probability trade setups. PZT highlights key reaction zones that influence order flow and trader behavior across all markets — including Forex, Crypto, Indices, and Commodities.
📍 Indicator Key
Each color represents a significant price level derived from its respective timeframe, helping traders instantly gauge market context and potential liquidity pools:
Color Level Represented Significance
🔴 Red Yearly High Strong resistance — potential selling pressure and major liquidity sweep zones.
🟢 Green Yearly Low Strong support — potential buying interest and accumulation points.
🟠 Orange Monthly High Intermediate resistance — swing rejection or continuation decision zone.
🔵 Blue Monthly Low Intermediate support — potential retracement or base-building area.
🟣 Purple Weekly High Short-term resistance — common rejection level or stop hunt zone.
🟤 Teal Weekly Low Short-term support — potential rebound or liquidity grab.
⚫ Gray Daily High Intraday resistance — active scalper and day trader interest.
⚪ White Daily Low Intraday support — short-term bounce or continuation pivot.
Full Currency Strength Table Dashboard (8 Currencies)
# Full Currency Strength Table Dashboard (8 Currencies) 📊
This indicator provides a **simplified, visual representation of the current relative strengths of 8 major global currencies** (EUR, USD, GBP, JPY, AUD, NZD, CAD, CHF). It's designed as a minimalist dashboard that appears discreetly on your chart, giving traders a quick and clear picture of forex pair movements.
The indicator calculates the relative strength of each currency based on its movement against the other 7 currencies in the panel, providing insight into which currencies are currently the strongest and which are the weakest.
## Key Features 🌟
* **Simplified Visualization:** Instead of showing currency strength as a line on the chart, which can often be distracting, the indicator uses a **data table (dashboard)** positioned on the chart. This ensures **maximum chart visibility** and cleanliness.
* **8 Major Currencies:** All major currencies are included ($A$ - EUR, $B$ - USD, $C$ - GBP, $D$ - JPY, $E$ - AUD, $F$ - NZD, $G$ - CAD, $H$ - CHF), allowing strength calculation based on **28 base currency pairs**.
* **Strength Calculation:** Strength is calculated based on the average percentage change $\left(\frac{\text{Close} - \text{Open}}{\text{Open}} \times 100\right)$ of the currency relative to all 7 other currencies.
* **Timeframe Setting:** Users can select a **higher timeframe (TF)** (e.g., Daily - 'D') for the strength calculation. This allows analysis of longer-term currency strength momentum, independent of the chart's current timeframe.
* **Customizable Design:** You can adjust the table's position, text size, the colour of each currency, and the resolution (length) of the strength meter.
## How to Use the Indicator (Interpretation) 💡
1. **Select a Timeframe (TF):** It's recommended to use a higher TF (e.g., Daily - 'D' or 4h - '240') to get more stable currency strength signals.
2. **The Dashboard Table:** The table displays:
* The currency name (bottom, with its corresponding colour).
* The numerical strength value (top, expressed in points or average change).
* The **Strength Meter (bar)** visually represents the currency's relative strength compared to the other currencies on the panel (calculated based on the Min/Max values across all 8 currencies).
3. **Making Decisions:**
* **Buy:** Look for a currency pair where the **Base Currency** is significantly **strong** (high positive value, long meter) and the **Quote Currency** is significantly **weak** (high negative value, short meter).
* **Sell:** Look for a currency pair where the **Base Currency** is significantly **weak** and the **Quote Currency** is significantly **strong**.
* **Avoid Trading:** Avoid pairs where both currencies have roughly the same strength or are close to zero.
## Note on Calculation and Code 🛠️
* **Base Pairs:** The script calculates 28 base currency pairs (e.g., EURUSD, EURGBP... CADCHF) using the `request.security` function to retrieve data from the selected timeframe (`freq`).
* **Data Correction:** A correction was implemented in the code by adding ` ` after `request.security` to always use the **CLOSED bar values** from the higher TF. This **eliminates NaN (Not a Number) data** that would appear when using the current bar.
* **Accumulation:** Accumulation (`sumA, sumB...`) only occurs when the selected higher TF changes (`timeframe.change(freq)`), effectively tracking the currency's relative strength during the formation of **one closed bar** on that higher TF.
### License
This work is licensed under the **Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)** license.
The original concept and code are based on the work of the **LuxAlgo** team and finalized to fix syntax errors and handle NaN data for stable use with 8 currencies.
---
**Questions or suggestions?** I'd love to hear your feedback in the comments! Happy trading! 📈
SFC Bollinger Band and Bandit概述 (Overview)
SFC 布林通道與海盜策略 (SFC Bollinger Band and Bandit Strategy) 是一個基於 Pine Script™ v6 的技術分析指標,結合布林通道 (Bollinger Bands)、移動平均線 (Moving Averages) 以及布林海盜 (Bollinger Bandit) 交易策略,旨在為交易者提供多時間框架的趨勢分析與進出場訊號。該腳本支援風險管理功能,並提供視覺化圖表與交易訊號提示,適用於多種金融市場。
This script, written in Pine Script™ v6, combines Bollinger Bands, Moving Averages, and the Bollinger Bandit strategy to provide traders with multi-timeframe trend analysis and entry/exit signals. It includes risk management features and visualizes data through charts and trading signals, suitable for various financial markets.
功能特點 (Key Features)
布林通道 (Bollinger Bands)
提供可調整的標準差參數 (σ1, σ2),支援多層布林通道顯示。
進場訊號基於價格穿越布林通道上下軌,並結合連續K線確認機制。
Provides adjustable standard deviation parameters (σ1, σ2) for multi-layer Bollinger Bands display.
Entry signals are based on price crossing the upper/lower bands, combined with a consecutive bar confirmation mechanism.
移動平均線 (Moving Averages)
支援簡單移動平均線 (SMA) 或指數移動平均線 (EMA),可自訂快、中、慢線週期。
Supports Simple Moving Average (SMA) or Exponential Moving Average (EMA) with customizable fast, medium, and slow line periods.
布林海盜策略 (Bollinger Bandit Strategy)
基於變動率 (ROC) 與布林通道動態止損,提供做多與做空訊號。
包含動態止損均線與平倉天數設定,增強交易靈活性。
Utilizes Rate of Change (ROC) and Bollinger Bands with dynamic stop-loss for long and short signals.
Includes dynamic stop-loss moving average and liquidation days for enhanced trading flexibility.
多時間框架分析 (Multi-Timeframe Analysis)
支援六個時間框架 (5分、15分、1小時、4小時、日線、週線) 的趨勢分析。
通過表格顯示各時間框架的連續上漲/下跌趨勢,輔助交易決策。
Supports trend analysis across six timeframes (5m, 15m, 1h, 4h, daily, weekly).
Displays consecutive up/down trends in a table to aid decision-making.
風險管理 (Risk Management)
提供基於 ATR 或布林通道的停利/停損設定。
自動計算交易手數,根據報價貨幣匯率調整風險敞口。
Offers take-profit/stop-loss settings based on ATR or Bollinger Bands.
Automatically calculates trading lots, adjusting risk exposure based on quote currency exchange rates.
視覺化與提示 (Visualization and Alerts)
繪製布林通道、移動平均線、海盜策略動態止損線及交易訊號。
提供多時間框架趨勢表格、交易手數標籤及浮水印。
支援交易訊號快訊,方便即時監控。
Plots Bollinger Bands, Moving Averages, Bandit strategy stop-loss lines, and trading signals.
Includes multi-timeframe trend tables, trading lot labels, and watermark.
Supports alert conditions for real-time trade monitoring.
使用說明 (Usage Instructions)
設置參數 (Parameter Setup)
布林通道 (Bollinger Bands): 可調整週期 (預設21)、標準差 (σ1=1, σ2=2) 及停利/停損依據 (ATR 或 BAND)。
移動平均線 (Moving Averages): 可選擇顯示快線 (10)、中線 (20)、慢線 (60),並切換 SMA/EMA。
布林海盜 (Bollinger Bandit): 調整通道週期 (50)、平倉均線週期 (50) 及 ROC 週期 (30)。
時間框架 (Timeframes): 自訂六個時間框架,預設為 5分、15分、1小時、4小時、日線、週線。
Adjust Bollinger Band period (default 21), standard deviations (σ1=1, σ2=2), and take-profit/stop-loss basis (ATR or BAND).
Configure Moving Averages (fast=10, medium=20, slow=60) and toggle SMA/EMA.
Set Bollinger Bandit parameters: channel period (50), liquidation MA period (50), ROC period (30).
Customize six timeframes (default: 5m, 15m, 1h, 4h, daily, weekly).
交易訊號 (Trading Signals)
買入訊號 (Buy): 價格穿越下軌且滿足連續K線條件。
賣出訊號 (Sell): 價格穿越上軌且滿足連續K線條件。
海盜策略訊號: 基於 ROC 與布林通道穿越,結合動態止損。
Buy signal: Price crosses below lower band with consecutive bar confirmation.
Sell signal: Price crosses above upper band with consecutive bar confirmation.
Bandit strategy signals: Based on ROC and band crossings with dynamic stop-loss.
視覺化 (Visualization)
布林通道以不同顏色顯示上下軌與中軌。
移動平均線以快、中、慢線區分顏色。
趨勢表格顯示各時間框架的趨勢狀態 (🔴上漲, 🟢下跌, ⚪中性)。
海盜策略顯示動態止損線與交易狀態。
Bollinger Bands display upper, lower, and middle bands in distinct colors.
Moving Averages use different colors for fast, medium, and slow lines.
Trend table shows timeframe trends (🔴 up, 🟢 down, ⚪ neutral).
Bandit strategy displays dynamic stop-loss and trading status.
Experimental Supertrend [CHE]Experimental Supertrend — Combines EMA crossovers for trend regime detection with an adaptive ATR-based hull that selects the narrowest band to contain recent highs and lows, minimizing false breaks in varying volatility.
Summary
This indicator overlays a dynamic supertrend boundary around a midline derived from dual EMAs, using EMA crossovers to switch between bullish and bearish regimes. The hull adapts by evaluating multiple ATR periods and selecting the tightest one that fully encloses price action over a specified window, which helps in creating more stable trend lines that hug price without excessive gaps or breaches. Fills between the midline and hull provide visual cues for trend strength, darkening temporarily after regime changes to highlight transitions. Alerts trigger on crossovers, and markers label entry points, making it suitable for trend-following setups where standard supertrends might whipsaw. Overall, it offers robustness through auto-adjustment, reducing sensitivity to noise while maintaining responsiveness to genuine shifts.
Motivation: Why this design?
Standard supertrend indicators often flip prematurely in choppy markets due to fixed multipliers that do not account for localized volatility patterns, leading to frequent false signals and eroded confidence in trends. This design addresses that by incorporating an EMA-based regime filter for directional bias and an auto-adaptive hull that dynamically tunes the band width based on recent price containment needs. By prioritizing the narrowest effective enclosure, it avoids over-wide bands in calm periods that cause lag or under-wide ones in volatility spikes that invite breaks, providing a more consistent trailing reference without manual tweaking.
What’s different vs. standard approaches?
- Reference baseline: Diverges from the classic ATR-multiplier supertrend, which uses a single fixed period and constant factor applied to close or high/low deviations.
- Architecture differences:
- Auto-selection from candidate ATR lengths to find the optimal period for current conditions.
- Dynamic multiplier clamped between floor and cap values, adjusted by padding to ensure reliable containment.
- Regime-gated rendering, where hull position flips based on EMA relative positioning.
- Post-transition visual fading to emphasize change points without altering core logic.
- Practical effect: Charts show tighter, more reactive bands that rarely breach during trends, reducing visual clutter from flips; the adaptive nature means less intervention across assets, as the hull self-adjusts to volatility clusters rather than applying a one-size-fits-all scale.
How it works (technical)
The indicator first computes two EMAs from close prices using lengths derived from a preset pair or manual inputs, establishing a midline as their average. This midline serves as the central reference for the hull. True range values are then smoothed into multiple ATR candidates using exponential weighting over the specified lengths. For each candidate, deviations of recent highs and lows from the midline are ratioed against the ATR to determine a required multiplier that would enclose all extremes in the containment window—the highest ratio plus padding sets the base, clamped to user-defined bounds. Among valid candidates (those with sufficient history), the one yielding the narrowest overall band width is selected. The hull boundaries are then offset from the midline by this multiplier times the chosen ATR, and further smoothed with a fixed EMA to reduce jitter. Regime direction from EMA comparison gates which boundary acts as support or resistance, with initialization seeding arrays on the first bar to handle state persistence. No higher timeframe data is used, so all logic runs on the chart's native bars without lookahead.
Parameter Guide
EMA Pair — Selects preset lengths for fast and slow EMAs, influencing regime sensitivity and midline stability. Default: "21/55". Trade-offs/Tips: Faster pairs like "9/21" increase cross frequency for scalping but raise false signals; slower like "50/200" smooths for swings, potentially missing early turns. Use Manual for fine control.
Manual Fast — Sets fast EMA length when Manual mode is active; shorter values make regime switches quicker. Default: 21. Trade-offs/Tips: Lower than 10 risks over-reactivity; pair with slow at least double for clear separation.
Manual Slow — Sets slow EMA length when Manual mode is active; longer values anchor the midline more firmly. Default: 55. Trade-offs/Tips: Above 100 adds lag in trends; balance with fast to avoid perpetual neutrality.
ATR Lengths (comma-separated) — Defines candidate periods for ATR smoothing; more options allow finer auto-selection. Default: "7,10,14,21,28,35". Trade-offs/Tips: Fewer candidates speed computation but may miss optimal fits; keep under 10 for efficiency.
Containment Window — Number of recent bars the hull must fully enclose highs/lows of; larger windows favor stability. Default: 50. Trade-offs/Tips: Shorter (under 20) adapts faster to breaks but increases breach risk; longer smooths but delays response.
Min Multiplier Floor — Lowest allowed multiplier for hull width; prevents overly tight bands in low volatility. Default: 0.5. Trade-offs/Tips: Raise to 0.75 for conservative enclosures; too low allows pinches that flip easily.
Max Multiplier Cap — Highest allowed multiplier; caps expansion in spikes to avoid wide, lagging bands. Default: 1.0. Trade-offs/Tips: Lower to 0.75 tightens overall; higher permits more room but risks detachment from price.
Padding (+) — Adds buffer to the auto-multiplier for safer containment without exact touches. Default: 0.05. Trade-offs/Tips: Increase to 0.10 in gappy markets; minimal values hug closer but may still breach on outliers.
Fill Between (Mid ↔ Supertrend) — Toggles shaded area between midline and active hull for trend visualization. Default: true. Trade-offs/Tips: Disable for cleaner charts; pairs well with transparency tweaks.
Base Fill Transparency (0..100) — Sets default opacity of fills; higher values make them subtler. Default: 80. Trade-offs/Tips: Under 50 overwhelms price action; adjust with darken boost for emphasis.
Darken on Trend Change — Enables temporary opacity increase after regime shifts to spotlight transitions. Default: true. Trade-offs/Tips: Off for steady visuals; on aids spotting reversals in real-time.
Darken Fade Bars — Duration in bars for the darken effect to ramp back to base; longer prolongs highlight. Default: 8. Trade-offs/Tips: Shorter (4-6) for fast-paced charts; longer holds attention on changes.
Darken Boost at Change (Δ transp) — Intensity of opacity reduction at crossover; higher values make shifts more prominent. Default: 50. Trade-offs/Tips: Cap at 70 to avoid blackout; tune down if fades obscure details.
Show Supertrend Line — Displays the active hull boundary as a line. Default: true. Trade-offs/Tips: Hide for fill-only views; linewidth fixed at 3 for visibility.
Show EMA Cross Markers — Places circles and labels at crossover points for entry cues. Default: true. Trade-offs/Tips: Disable in clutter; labels show "Buy"/"Sell" at absolute positions.
Alert: EMA Cross Up (Long) — Triggers notification on bullish crossover. Default: true. Trade-offs/Tips: Pair with filters; once-per-bar frequency.
Alert: EMA Cross Down (Short) — Triggers notification on bearish crossover. Default: true. Trade-offs/Tips: Use for exits; ensure broker integration.
Show Debug — Reveals internal diagnostics like selected ATR details (if implemented). Default: false. Trade-offs/Tips: Enable for troubleshooting selections; minimal overhead.
Reading & Interpretation
Bullish regime shows a green line below price as support, with upward fill from midline; bearish uses red line above as resistance, downward fill. Crossovers flip the active boundary, marked by tiny green/red circles and "Buy"/"Sell" labels at the hull level. Fills start at base transparency but darken sharply at changes, fading over the specified bars to signal fresh momentum. If the hull rarely breaches during trends, containment is effective; frequent touches without flips indicate tight adaptation. Debug mode (when enabled) overlays text or plots for selected length and multiplier, helping verify auto-choices.
Practical Workflows & Combinations
- Trend following: Enter long on green "Buy" label above prior low structure; confirm with higher high. Trail stops along the green hull line, tightening as fills stabilize post-fade.
- Exits/Stops: Conservative exit on opposite crossover or hull breach; aggressive hold until fade completes if volume supports. Use darken boost as a volatility cue—high delta suggests waiting for confirmation.
- Multi-asset/Multi-TF: Defaults suit forex/stocks on 15m-4h; for crypto, widen containment to 75 for gaps. Layer on volume oscillator for cross filters; avoid on low-liquidity assets where ATR candidates skew.
Behavior, Constraints & Performance
Closed-bar logic ensures signals confirm at bar end, with live bars updating hull adaptively but no repaints since no future data or security calls are used. Arrays persist ATR states across bars, initialized once with candidates parsed from string. Small fixed loops (over 6 lengths max, inner up to 50) run per bar, capped by max_bars_back=500 for history needs. Resources stay low with 500 labels/lines limits, but dense charts may hit on markers. Known limits include initial lag until containment history builds (50+ bars), potential wide bands on gaps, and suboptimal selections if candidates omit ideal lengths.
Sensible Defaults & Quick Tuning
Start with "21/55" pair, 50-window, 0.5-1.0 multipliers, and 80% transparency for balanced responsiveness on daily charts. For too many flips, raise min floor to 0.75 or add lengths like "42"; for sluggishness, shorten window to 30 or pick faster pair. In high-vol environments, boost padding to 0.10; for smoother visuals, extend fade bars to 12.
What this indicator is—and isn’t
This is a visualization and signal layer for trend regime and adaptive boundaries, aiding entry/exit timing in directional markets. It is not a standalone system—pair with price structure, risk sizing, and broader context. Not predictive of turns, just reactive to containment and crosses.
Disclaimer
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Do not use this indicator on Heikin-Ashi, Renko, Kagi, Point-and-Figure, or Range charts, as these chart types can produce unrealistic results for signal markers and alerts.
Happy trading
Chervolino
EMA Trend RecognitionEMA Trend Recognition — “Double-Vision Trend Glasses” 👓⚡
In short:
Your chart gets two voices — the Major trend (EMA50 vs EMA200) for the big picture, and the Minor trend (EMA9 vs EMA20) for the short-term mood.
When both sing the same tune, you get a STRONG signal.
When they argue, it’s a WEAK one. Simple. Clean. Effective.
🧭 What this indicator does
Major Trend (Long-Term):
EMA50 above EMA200 → Bullish.
EMA50 below EMA200 → Bearish.
This tells you where the market really wants to go.
Minor Trend (Short-Term):
EMA9 above EMA20 → Bullish.
EMA9 below EMA20 → Bearish.
This shows you what the market feels like right now.
Trend Combinations (The Magic):
🟢 STRONG BUY: Major ↑ + Minor ↑ → full alignment, go with the flow.
🔴 STRONG SELL: Major ↓ + Minor ↓ → both down, no mercy.
🟡 WEAK BUY: Major ↑, Minor ↓ → pullback zone? early dip? maybe.
🟠 WEAK SELL: Major ↓, Minor ↑ → short-term bounce inside a downtrend.
🎨 Background Colors & Info Panel
Bright Green: STRONG BUY
Bright Red: STRONG SELL
Faded Green/Red: WEAK signals (trend disagreement)
Bottom Info Table:
Major Trend: “BULLISH ↑” or “BEARISH ↓”
Minor Trend: same logic, faster tempo
Signal: shows STRONG/WEAK/NEUTRAL status
Price: latest close price (because yes, we all check that)
🔔 Alerts (so you don’t stare all day)
MAJOR TREND CHANGE: “Now Bullish!” or “Now Bearish!”
MINOR TREND CHANGE: quicker reversals
STRONG BUY/SELL: when both trends line up perfectly
(Alerts trigger only on bar close — no disco flicker alerts.)
🧠 Visuals — Simple but Smart
EMA 200 & 50: thick lines = your market highway
EMA 20 & 9: thin lines = your turn signals
Muted colors, so your eyes survive long trading sessions
🚀 Why it’s useful
Trend Trading: Filter out noise, ride the momentum.
Pullback Entries: WEAK signals often mark “turning back in” moments.
System Building: Use “STRONG” as a market bias filter, “MINOR” flips as entry triggers.
⚙️ Pro Tips
Timeframes: EMAs are fixed, but meaning scales with TF.
On 1H or 4H, they often reflect daily/weekly momentum.
Context: Combine with structure (HH/HL/LH/LL), zones (OB/FVG), or volume.
Risk Management: Signal ≠ free money. Always define SL/TP and RR.
⚠️ Disclaimer
No financial advice, no crystal ball.
This indicator helps you see — but you still decide when to act.
Backtest and paper-trade before going live.
Short Pitch (for the top “Summary” line on TradingView):
“Two EMA pairs, one clear trend compass — Major shows direction, Minor sets the rhythm. When both agree, it’s STRONG. When they argue, it’s WEAK. Clean, fast, and easy to read.” ✅
Feel free to commend and if u have inspirations to add something, let me know, cheers :D
Outside Candle Session Breakout [CHE]Outside Candle Session Breakout
Session - anchored HTF levels for clear market-structure and precise breakout context
Summary
This indicator is a relevant market-structure tool. It anchors the session to the first higher-timeframe bar, then activates only when the second bar forms an outside condition. Price frequently reacts around these anchors, which provides precise breakout context and a clear overview on both lower and higher timeframes. Robustness comes from close-based validation, an adaptive volatility and tick buffer, first-touch enforcement, optional retest, one-signal-per-session, cooldown, and an optional trend filter.
Pine version: v6. Overlay: true.
Motivation: Why this design?
Short-term breakout tools often trigger during noise, duplicate within the same session, or drift when volatility shifts. The core idea is to gate signals behind a meaningful structure event: a first-bar anchor and a subsequent outside bar on the session timeframe. This narrows attention to structurally important breaks while adaptive buffering and debouncing reduce false or mid-run triggers.
What’s different vs. standard approaches?
Baseline: Simple high-low breaks or fixed buffers without session context.
Architecture: Session-anchored first-bar high/low; outside-bar gate; close-based confirmation with an adaptive ATR and tick buffer; first-touch enforcement; optional retest window; one-signal-per-session and cooldown; optional EMA trend and slope filter; higher-timeframe aggregation with lookahead disabled; themeable visuals and a range fill between levels.
Practical effect: Cleaner timing at structurally relevant levels, fewer redundant or late triggers, and better multi-timeframe situational awareness.
How it works (technical)
The chart timeframe is mapped to an analysis timeframe and a session timeframe.
The first session bar defines the anchor high and low. The setup becomes active only after the next bar forms an outside range relative to that first bar.
While active, the script tracks these anchors and checks for a breakout beyond a buffered threshold, using closing prices or wicks by preference.
The buffer scales with volatility and is limited by a minimum tick floor. First-touch enforcement avoids mid-run confirmations.
Optional retest requires a pullback to the raw anchor followed by a new close beyond the buffered level within a user window.
Optional trend gating uses an EMA on the analysis timeframe, including an optional slope requirement and price-location check.
Higher-timeframe data is requested with lookahead disabled. Values can update during a forming higher-timeframe bar; waiting and confirmation mitigate timing shifts.
Parameter Guide
Enable Long / Enable Short — Direction toggles. Default: true / true. Reduces unwanted side.
Wait Candles — Minimum bars after outside confirmation before entries. Default: five. More waiting increases stability.
Close-based Breakout — Confirm on candle close beyond buffer. Default: true. For wick sensitivity, disable.
ATR Buffer — Enables adaptive volatility buffer. Default: true.
ATR Multiplier — Buffer scaling. Default: zero point two. Increase to reduce noise.
Ticks Buffer — Minimum buffer in ticks. Default: two. Protects in quiet markets.
Cooldown Bars — Blocks new signals after a trigger. Default: three.
One Signal per Session — Prevents duplicates within a session. Default: true.
Require Retest — Pullback to raw anchor before confirming. Default: false.
Retest Window — Bars allowed for retest completion. Default: five.
HTF Trend Filter — EMA-based gating. Default: false.
EMA Length — EMA period. Default: two hundred.
Slope — Require EMA slope direction. Default: true.
Price Above/Below EMA — Require price location relative to EMA. Default: true.
Show Levels / Highlight Session / Show Signals — Visual controls. Default: true.
Color Theme — “Blue-Green” (default), “Monochrome”, “Earth Tones”, “Classic”, “Dark”.
Time Period Box — Visibility, size, position, and colors for the info box. (Optional)
Reading & Interpretation
The two level lines represent the session’s first-bar high and low. The filled band illustrates the active session range.
“OUT” marks that the outside condition is confirmed and the setup is live.
“LONG” or “SHORT” appears only when the breakout clears buffer, debounce, and optional gates.
Background tint indicates sessions where the setup is valid.
Alerts fire on confirmed long or short breakout events.
Practical Workflows & Combinations
Trend-following: Keep close-based validation, ATR buffer near the default, one-signal-per-session enabled; add EMA trend and slope for directional bias.
Retest confirmation: Enable retest with a short window to prioritize cleaner continuation after a pullback.
Lower-timeframe scalping: Reduce waiting and cooldown slightly; keep a small tick buffer to filter micro-whips.
Swing and position context: Increase ATR multiplier and waiting; maintain once-per-session to limit duplicates.
Timeframe Tiers and Trader Profiles
The script adapts its internal mapping based on the chart timeframe:
Under fifteen minutes → Analysis: one minute; Session: sixty minutes. Useful for scalpers and high-frequency intraday reads.
Between fifteen and under sixty minutes → Analysis: fifteen minutes; Session: one day. Suits day traders who need intraday alignment to the daily session.
Between sixty minutes and under one day → Analysis: sixty minutes; Session: one week. Serves intraday-to-swing transitions and end-of-day planning.
Between one day and under one week → Analysis: two hundred forty minutes; Session: two weeks. Fits swing traders who monitor multi-day structure.
Between one week and under thirty days → Analysis: one day; Session: three months. Supports position traders seeking quarterly context.
Thirty days and above → Analysis: one day; Session: twelve months. Provides a broad annual anchor for macro context.
These tiers are designed to keep anchors meaningful across regimes while preserving responsiveness appropriate to the trader profile.
Behavior, Constraints & Performance
Signals can be validated on closed bars through close-based logic; enabling this reduces intrabar flicker.
Higher-timeframe values may evolve during a forming bar; waiting parameters and the outside-bar gate reduce, but do not remove, this effect.
Resource footprint is light; the script uses standard indicators and a single higher-timeframe request per stream.
Known limits: rare setups during very quiet periods, sensitivity to gaps, and reduced reliability on illiquid symbols.
Sensible Defaults & Quick Tuning
Start with close-based validation on, ATR buffer on with a multiplier near zero point two, tick buffer two, cooldown three, once-per-session on.
Too many flips: increase the ATR multiplier and cooldown; consider enabling the EMA filter and slope.
Too sluggish: reduce the ATR multiplier and waiting; disable retest.
Choppy conditions: keep close-based validation, increase tick buffer, shorten the retest window.
What this indicator is—and isn’t
This is a visualization and signal layer for session-anchored breakouts with stability gates. It is not a complete trading system, risk framework, or predictive engine. Combine it with structured analysis, position sizing, and disciplined risk controls.
Disclaimer
The content provided, including all code and materials, is strictly for educational and informational purposes only. It is not intended as, and should not be interpreted as, financial advice, a recommendation to buy or sell any financial instrument, or an offer of any financial product or service. All strategies, tools, and examples discussed are provided for illustrative purposes to demonstrate coding techniques and the functionality of Pine Script within a trading context.
Any results from strategies or tools provided are hypothetical, and past performance is not indicative of future results. Trading and investing involve high risk, including the potential loss of principal, and may not be suitable for all individuals. Before making any trading decisions, please consult with a qualified financial professional to understand the risks involved.
By using this script, you acknowledge and agree that any trading decisions are made solely at your discretion and risk.
Do not use this indicator on Heikin-Ashi, Renko, Kagi, Point-and-Figure, or Range charts, as these chart types can produce unrealistic results for signal markers and alerts.
Best regards and happy trading
Chervolino