REJECTION DETECTOR🔥 CTR (Candle Terjepit - Rejection)
This indicator is specifically designed to detect Rejection Candles, which are moments when the price rejects a certain level and has the potential to form a strong reversal or rapid reaction — an important signal for scalpers and price action traders.
💡 Key Concept:
Rejection is a form of market reaction to areas of liquidity, support-resistance, or order block zones. Candles with long tails and small bodies indicate an imbalance between buyers and sellers, providing an early indication that the price may soon reverse.
⚙️ Key Features
🔍 Automatic Rejection Candle Detection (Buy & Sell)
🧠 Body-to-tail ratio filter for more precise signal validation
🎨 Customizable candle colors and appearance
📊 Suitable for all pairs and timeframes
Wskaźniki i strategie
Quantura - Supply & Demand Zone DetectionIntroduction
“Quantura – Supply & Demand Zone Detection” is an advanced indicator designed to automatically detect and visualize institutional supply and demand zones, as well as breaker blocks, directly on the chart. The tool helps traders identify key areas of market imbalance and potential reversal or continuation zones, based on price structure, volume, and ATR dynamics.
Originality & Value
This indicator provides a unique and adaptive method of zone detection that goes beyond simple pivot or candle-based logic. It merges multiple layers of confirmation—volume sensitivity, ATR filters, and swing structure—while dynamically tracking how zones evolve as the market progresses. Unlike traditional supply and demand indicators, this script also detects and plots Breaker Zones when previous imbalances are violated, giving traders an extra layer of market context.
The key values of this tool include:
Automated detection of high-probability supply and demand zones.
Integration of both volume and ATR filters for precision and adaptability.
Dynamic zone merging and updating based on price evolution.
Identification of breaker blocks (invalidated zones) to visualize market structure shifts.
Optional bullish and bearish trade signals when zones are retested.
Clear, visually optimized plotting for efficient chart interpretation.
Functionality & Core Logic
The indicator continuously scans recent price data for swing highs/lows and combines them with optional volume and ATR conditions to validate potential zones.
Demand Zones are formed when price action indicates accumulation or a strong bullish rejection from a low area.
Supply Zones are created when distribution or strong bearish rejection occurs near local highs.
Breaker Blocks appear when existing zones are invalidated by price, helping traders visualize potential market structure shifts.
Bullish and bearish signals appear when price re-enters an active zone or breaks through a breaker block.
Parameters & Customization
Demand Zones / Supply Zones: Enable or disable each individually.
Breaker Zones: Activate breaker block detection for invalidated zones.
Volume Filter: Optional filter to only confirm zones when volume exceeds its long-term average by a user-defined multiplier.
ATR Filter: Optional filter for volatility confirmation, ensuring zones form under strong momentum conditions.
Swing Length: Controls the number of bars used to detect structural pivots.
Sensitivity Controls: Adjustable ATR and volume multipliers to fine-tune detection responsiveness.
Signals: Toggle for on-chart bullish (▲) and bearish (▼) signal plotting when price interacts with zones.
Color Customization: User-defined bullish and bearish colors for both standard and breaker zones.
Core Calculations
Zones are detected using pivot highs and lows with a defined lookback and lookahead period.
Additional filters apply if ATR and volume are enabled, requiring conditions like “ATR > average * multiplier” and “Volume > average * multiplier.”
Detected zones are merged if overlapping, keeping the chart clean and logical.
When price breaks through a zone, the original box is closed, and a new breaker zone is plotted automatically.
Bullish and bearish markers appear when zones are retested from the opposite side.
Visualization & Display
Demand zones are shaded in semi-transparent bullish color (default: blue).
Supply zones are shaded in semi-transparent bearish color (default: red).
Breaker zones appear when previous imbalances are broken, helping to spot structural shifts.
Optional arrows (▲ / ▼) indicate potential buy or sell reactions on zone interaction.
Use Cases
Identify institutional areas of accumulation (demand) or distribution (supply).
Detect potential breakout traps and market structure shifts using breaker zones.
Combine with other tools such as volume profile, EMA, or liquidity indicators for deeper confirmation.
Observe retests and reactions of zones to anticipate possible reversals or continuations.
Apply multi-timeframe analysis to align higher timeframe zones with lower timeframe entries.
Limitations & Recommendations
The indicator does not predict future price movement; it highlights structural imbalances only.
Performance depends on chosen swing length and sensitivity—users should optimize parameters for each market.
Works best in volatile markets where supply and demand imbalances are clearly expressed.
Should be used as part of a broader trading framework, not as a standalone signal generator.
Markets & Timeframes
The “Quantura – Supply & Demand Zone Detection” indicator is suitable for all asset classes including cryptocurrencies, Forex, indices, commodities, and equities. It performs reliably across multiple timeframes, from intraday scalping to higher timeframe swing analysis.
Author & Access
Developed 100% by Quantura. Published as a Open-source script indicator. Access is free.
Important
This description complies with TradingView’s Script Publishing and House Rules. It clearly explains the indicator’s originality, underlying logic, functionality, and intended use without unrealistic claims or performance guarantees.
Quantura - Trendchange ZonesIntroduction
“Quantura – Trendchange Zones” is an advanced technical indicator that identifies and visualizes potential market reversal zones using dynamic RSI-based logic. It highlights areas of overbought and oversold conditions, marking them as visual zones directly on the price chart, and generates corresponding bullish and bearish signals when the RSI exits these extremes. The tool helps traders anticipate possible trend change regions and confirm momentum shifts in a clean, intuitive way.
Originality & Value
Unlike traditional RSI indicators that only show a static oscillator, this tool transforms RSI behavior into on-chart visual zones that represent structural overbought and oversold phases. It converts RSI threshold breaches into price-based regions (boxes) and marks reversal signals at the moment of momentum change.
The indicator’s originality and usefulness come from its:
Direct visualization of RSI overbought and oversold areas as dynamic chart zones.
Automatic detection of potential reversal regions where momentum exhaustion is likely.
Integration of RSI-based signals and visual cues without requiring users to monitor the RSI window.
Adjustable sensitivity for RSI length and upper/lower levels.
Clear color-coded separation of bullish and bearish phases.
Functionality & Core Logic
The indicator continuously monitors RSI values relative to the user-defined thresholds.
When RSI moves above the upper level, an Overbought Zone is created and extends until RSI falls back below that threshold.
When RSI moves below the lower level, an Oversold Zone is generated and extends until RSI returns above that level.
When RSI exits one of these zones, a corresponding Trendchange Signal (▲ bullish or ▼ bearish) appears at the transition point.
Each zone dynamically adjusts its high and low levels during formation, representing the complete range of the exhaustion phase.
Parameters & Customization
RSI Length: Defines the sensitivity of RSI calculation. Shorter lengths make signals more responsive; longer lengths filter noise.
Upper Level / Lower Level: Set thresholds for overbought and oversold conditions (default 70 / 30).
Signals: Toggle on/off for displaying bullish (▲) and bearish (▼) reversal signals.
Zones: Toggle the visualization of shaded RSI-based zones.
Colors: Fully customizable bullish and bearish colors for both signals and zones.
Visualization & Display
Bullish reversal zones (oversold exits) are shaded using the chosen bullish color (default: blue).
Bearish reversal zones (overbought exits) are shaded using the chosen bearish color (default: red).
Each completed zone is outlined and filled with transparent shading for better clarity.
Reversal arrows (▲ for bullish, ▼ for bearish) are displayed at the bar where RSI exits the extreme level.
Clean overlay design ensures compatibility with any chart style or color scheme.
Use Cases
Identify overbought and oversold periods directly on the price chart without switching to the RSI window.
Anticipate potential market reversals or exhaustion points based on RSI momentum shifts.
Combine with trend indicators, moving averages, or volume tools for confirmation.
Apply across multiple timeframes to align short-term reversal signals with higher timeframe momentum.
Use zone width and duration to assess the strength and persistence of overbought/oversold conditions.
Limitations & Recommendations
The indicator is not a standalone trading system but a visual confirmation tool.
False signals may occur in strongly trending markets where RSI remains overextended.
Optimal RSI settings may differ between assets (e.g., crypto vs. equities).
Combining this indicator with additional trend or structure filters can enhance accuracy.
Markets & Timeframes
The “Quantura – Trendchange Zones” indicator works across all markets and timeframes, including cryptocurrencies, Forex, stocks, and commodities. It is suitable for both short-term scalping and long-term swing analysis.
Author & Access
Developed 100% by Quantura. Published as a Open-source script indicator. Access is free.
Important
This description complies with TradingView’s Script Publishing and House Rules. It provides a clear explanation of the indicator’s originality, logic, and function while avoiding unrealistic performance or predictive claims.
Directional Strength and Momentum Index█ OVERVIEW
“Directional Strength and Momentum Index” (DSMI) is a technical analysis indicator inspired by DMI, but due to different source data, it produces distinct results. DSMI combines direction measurement, trend strength, and overheat levels into a single index, enhanced with gradient fills, extreme zones, entry signals, candle coloring, and a summary table.
█ CONCEPT
The classic DMI, despite its relatively simple logic, can seem somewhat chaotic due to separate +DI and -DI lines and the need for manual interpretation of their relationships. The DSMI indicator was created to increase clarity and speed up results, consolidating key information into a single index from 0 to 100 that simultaneously:
- Indicates trend direction (bullish/bearish)
- Measures movement strength
- Identifies overheat levels
- Generates ready entry signals
DMI (ADX + +DI / -DI) measures trend direction and strength, but does so based solely on comparing price movements between candles. ADX shows whether the trend is orderly and growing (e.g., above 20–30), but does not assess how dynamic the movement is.
DSMI, on the other hand, takes into account candle size and actual market aggression, thus showing directional momentum — whether the trend has real “fuel” to sustain or accelerate, not just whether it is orderly.
The main calculation difference involves replacing True Range with candle size (high-low) and using directional EMA instead of Wilder smoothing. This allows DSMI to react faster to momentum changes, eliminating delays typical of classic DMI based on TR.
This gives the trader an immediate picture of the market situation without analyzing multiple lines.
█ FEATURES
DSMI Main Line:
- EMA(Directional Index) based on +DS and -DS
- Scale 0–100, smooth color gradient depending on strength
+DS / -DS:
- Positive and Negative Directional Strength
- Gradient fill between lines — more intense with stronger trend
Extreme Zones:
- Default 20 and 80
- Gradient fill outside zones
Trend Strength Levels:
- Weak (<10) → neutral
- Moderate (up to 35)
- Strong (up to 45)
- Overheated (up to 55)
- Extreme (>55)
All levels editable
Entry Signals:
- Activated on crossing entry level (default 20)
Or on direction change when DSMI already ≥ entry level
- Highlighted background (green/red)
Candle Coloring:
- According to current trend
Trend Strength Table:
- Top-right corner
- Shows current strength (WEAK/STRONG etc.) + DSMI value
Alerts:
- DSMI Bullish Entry
- DSMI Bearish Entry
█ HOW TO USE
Add to Chart: Paste code in Pine Editor or find in indicator library.
Settings:
DSMI Parameters:
- DSMI Period → default 20
- Show DSMI Line → on/off
Extreme Zones:
- Lower Level → default 20
- Upper Level → default 80
Trend Strength Levels:
- Weak, Moderate, Strong, Overheated → adjust to strategy
Trend Colors:
- BULLISH → default green
- BEARISH → default red
- NEUTRAL → gray
Entry Signals:
- Show Highlight → on/off
- DSMI Entry Level → default 20
Signal Interpretation:
- DSMI Line: Main strength indicator.
- Gradient between +DS and -DS: Visualizes side dominance.
- Crossing 18 with direction confirmation → entry signal.
- Extreme Zones: Potential reversal or continuation points after correction.
- Table: Quick overview of current trend condition.
█ APPLICATIONS
The indicator works well in:
- Trend-following: Enter on signal, exit on direction change or overheat. When a new trend appears, consider entering a position, preferably with a rising trend strength indicator.
- Scalping/daytrading: Shorter period (7–10), lower entry level.
- Swing/position: Longer period (20–30), higher entry level, extreme zones as filters.
- Noise filtering: Ignores consolidation below “Weak” – increasing value e.g. to 15 highlights consolidation zones, but no signals appear there.
Style Adjustment:
- Aggressive strategies → shorten period and entry level
- Conservative → extend period, raise entry level (25–30), watch “Overheated”
“Weak” level (<10 default) → neutral; increasing it e.g. to 15 gives fewer but higher-quality signals. The Weak zone value controls the level below which no signals appear, and the gradient turns gray (often aligned with consolidation zones).
Combine with:
- Support/resistance levels
- Fair Value Gaps (FVG)
- Volume (Volume Profile, VWAP)
- Other oscillators (RSI, Stochastic)
█ NOTES
- Works on all markets and timeframes.
- Adjust period and levels to instrument volatility.
- Higher entry level → fewer signals, higher quality.
- Neutral color below “Weak” – avoids trading in consolidation.
- Gradient and table enable quick assessment without line analysis.
Quantura - Liquidity Sweep & Run LevelsIntroduction
“Quantura – Liquidity Sweep & Run Levels” is a structural price-action indicator designed to automatically detect swing-based liquidity zones and visualize potential sweep and run events. It helps traders identify areas where liquidity has likely been taken (sweep) or released (run), improving precision in market structure analysis and timing of entries or exits.
Originality & Value
This tool translates institutional liquidity concepts into an automated visual framework. Instead of simply marking highs and lows, it dynamically monitors swing points, tracks their breaches, and identifies subsequent reactions. The indicator is built to highlight the liquidity dynamics that often precede reversals or continuations.
Its originality lies in:
Automatic identification and tracking of swing highs and lows.
Real-time detection of broken levels and liquidity sweeps.
Distinction between “Run” and “Sweep” modes for different market behaviors.
Persistent historical visualization of liquidity levels using clean line structures.
Configurable signal markers for bullish and bearish sweep confirmations.
Functionality & Core Logic
Detects swing highs and lows using a user-defined Swing Length parameter.
Stores and updates all swing levels dynamically with arrays for efficient memory handling.
Draws horizontal lines from each detected swing point to visualize potential liquidity zones.
Monitors when price breaks a swing level and marks that event as “broken.”
Generates signals when the market either sweeps above/below or runs away from those levels, depending on the chosen mode.
Provides optional visual signal markers (“▲” for bullish sweeps, “▼” for bearish sweeps).
Parameters & Customization
Mode: Choose between “Sweep” (detects liquidity grabs) or “Run” (detects breakout continuations).
Swing Length: Sets the sensitivity for detecting swing highs/lows. A higher value focuses on larger structures, while smaller values detect micro liquidity points.
Bullish Color / Bearish Color: Customize color themes for sweep/run lines and signal markers.
Signals: Enables or disables visual up/down markers for confirmed events.
Visualization & Display
Horizontal lines represent potential liquidity levels (unbroken swing highs/lows).
Once broken, lines automatically stop extending, marking the moment liquidity is taken.
Depending on the selected mode:
“Sweep” mode identifies false breaks or stop-hunt behavior.
“Run” mode highlights breakouts that continue the trend.
Colored arrows indicate the direction and type of liquidity reaction.
Clean, non-intrusive visualization suitable for overlaying on price charts.
Use Cases
Detect liquidity sweeps before major reversals.
Identify breakout continuations after liquidity runs.
Combine with Supply/Demand or FVG indicators for multi-layered confirmation.
Validate liquidity bias in algorithmic or discretionary strategies.
Analyze market manipulation patterns and institutional stop-hunting behavior.
Limitations & Recommendations
This indicator identifies structural behavior but does not guarantee trade direction or profitability.
Works best on liquid markets with clear swing structures (e.g., crypto, forex, indices).
Signal interpretation should be combined with confluence tools such as volume, order flow, or structure-based filters.
Excessively small swing settings may cause over-signaling in volatile markets.
Markets & Timeframes
Optimized for all major asset classes — including crypto, Forex, indices, and equities — and for intraday to higher-timeframe structural analysis (5-minute up to daily charts).
Author & Access
Developed 100% by Quantura. Published as a Open-source script indicator. Access is free.
Compliance Note
This description fully complies with TradingView’s Script Publishing Rules and House Rules . It avoids performance claims, provides transparency on methodology, and clearly describes indicator behavior and limitations.
Sigma Trinity ModelAbstract
Sigma Trinity Model is an educational framework that studies how three layers of market behavior interact within the same trend: (1) structural momentum (Rasta), (2) internal strength (RSI), and (3) continuation/compounding structure (Pyramid). The model deliberately combines bar-close momentum logic with intrabar, wick-aware strength checks to help users see how reversals form, confirm, and extend. It is not a signal service or automation tool; it is a transparent learning instrument for chart study and backtesting.
Why this is not “just a mashup”
Many scripts merge indicators without explaining the purpose. Sigma Trinity is a coordinated, three-engine study designed for a specific learning goal:
Rasta (structure): defines when momentum actually flips using a dual-line EMA vs smoothed EMA. It gives the entry/exit framework on bar close for clean historical study.
RSI (energy): measures internal strength with wick-aware triggers. It uses RSI of LOW (for bottom touches/reclaims) and RSI of HIGH (for top touches/exhaustion) so users can see intrabar strength/weakness that the close can hide.
Pyramid (progression): demonstrates how continuation behaves once momentum and strength align. It shows the logic of adds (compounding) as a didactic layer, also on bar close to keep historical alignment consistent.
These three roles are complementary, not redundant: structure → strength → progression.
Architecture Overview
Execution model
Rasta & Pyramid: bar close only by default (historically stable, easy to audit).
RSI: per tick (realtime) with bar-close backup by default, using RSI of LOW for entries and RSI of HIGH for exits. This makes the module sensitive to intra-bar wicks while still giving a close-based safety net for backtests.
Stops (optional in strategy builds): wick-accurate: trail arms/ratchets on HIGH; stop hit checks with LOW (or Close if selected) with a small undershoot buffer to avoid micro-noise hits.
Visual model
Dual lines (EMA vs smoothed EMA) for Rasta + color fog to see direction and compression/expansion.
Rungs (small vertical lines) drawn between the two Rasta lines to visualize wave spacing and rhythm.
Clean labels for Entry/Exit/Pyramid Add/RSI events. Everything is state-locked to avoid spamming.
Module 1 — Rasta (Structural Momentum Layer)
Goal: Identify structural momentum reversals and maintain a consistent, replayable backbone for study.
Method:
Compute an EMA of a chosen price source (default Close), and a smoothed version (SMA/EMA/RMA/WMA/None selectable).
Flip points occur when the EMA line crosses the smoothed line.
Optional EMA 8/21 trend filter can gate entries (long-bias when EMA8 > EMA21). A small “adaptive on flip” option lets an entry fire when the filter itself flips to ON and the EMA is already above the smoothed line—useful for trend resumption.
Why bar close only?
Bar-close Rasta gives a stable, auditable timeline for the structure of the trend. It teaches users to separate “structure” (close-resolved) from “energy” (intrabar, via RSI).
Visuals:
Fog between the lines (green/red) to show regime.
Rungs between lines to show spread (compression vs expansion).
Optional plotting of EMA8/EMA21 so users can see the gating effect.
Module 2 — RSI (Internal Strength / Energy Layer)
Goal: Reveal the intrabar strength/weakness that often precedes or confirms structural flips.
Method:
Standard RSI with adjustable length and signal smoothing for the panel view.
Logic uses wick-aware sources:
Entry trigger: RSI of LOW (same RSI length) touching or below a lower band (default 15). Think of it as intraband reactivation from the bottom, using the candle’s deepest excursion.
Exit trigger: RSI of HIGH touching or above an upper band (default 85). Think of it as exhaustion at the top, using the candle’s highest excursion.
Realtime + Close Backup: fires intrabar on tick, but if the realtime event was missed, the close backup will note it at bar end.
Cooldown control: optional bars-between-signals to avoid rapid re-triggers on choppy sequences.
Why wick-aware RSI?
A close-only RSI can miss the true micro-extremes that cause reversals. Using LOW/HIGH for triggers captures the behavior that traders actually react to during the bar, while the bar-close backup preserves historical reproducibility.
Module 3 — Pyramid (Continuation / Compounding Layer)
Goal: Teach how continuation behaves once a trend is underway, and how adds can be structured.
Method:
Same dual-line logic as Rasta (EMA vs smoothed EMA), but only fires when already in a position (or after prior entry conditions).
Supports the same EMA 8/21 filter and optional adaptive-on-flip behavior.
Bar close only to maintain historical cohesion.
What it teaches:
Adds tend to cluster when momentum persists.
Students can experiment with add spacing and compare “one-shot entries” vs “laddered adds” during strong regimes.
How the Pieces Work Together
Rasta establishes the structural frame (when the wave flip is real enough to record at close).
RSI validates or challenges that structure by tracking intrabar energy at the extremes (low/high touches).
Pyramid shows what sustained continuation looks like once (1) and (2) align.
This produces a layered view: Structure → Energy → Progression. Users can see when all three line up (strongest phases) and when they diverge (riskier phases or transitions).
How to Use It (Step-by-Step)
Quick Start
Apply script to any symbol/timeframe.
In Strategy/Indicator Properties:
Enable On every tick (recommended).
If available, enable Using bar magnifier and choose a lower resolution (e.g., 1m) to simulate intrabar fills more realistically.
Keep On bar close unchecked if you want to observe realtime logic in live charts (strategies still place orders on close by platform design).
Default behavior: Rasta & Pyramid = bar close; RSI = per tick with close backup.
Reading the Chart
Watch for Rasta Entry/Exit labels: they define clean structural turns on close.
Watch RSI Entry (LOW touch at/below lower band) and RSI Exit (HIGH touch at/above upper band) to gauge internal energy extremes.
Pyramid Add labels reveal continuation phases once a move is already in progress.
Tuning
Rasta smoothing: choose SMA/EMA/RMA/WMA or None. Higher smoothing → later but cleaner flips; lower smoothing → earlier but choppier.
RSI bands: a common educational setting is 15/85 for strong extremes; 20/80 is a bit looser.
Cooldown: increase if you see too many RSI re-fires in chop.
EMA 8/21 filter: toggle ON to study “trend-gated” entries, OFF to study raw momentum flips.
Backtesting Notes (for Strategy Builds)
Stops (optional): trail is armed when price advances by a trigger (default D–F₀), ratchets only upward from HIGH, and hits from LOW (or Close if chosen) with a tiny undershoot buffer to avoid micro-wicks.
Order sequencing per bar (mirrors the script’s code comments):
Trail ratchet via HIGH
Intrabar stop hit via LOW/CLOSE → immediate close
If still in position at bar close: process exits (Rasta/RSI)
If still in position at bar close: process Pyramid Add
If flat at bar close: process entries (Rasta/RSI)
Platform reality: strategies place orders at bar close in historical testing; the intrabar logic improves realism for stops and event marking but final order timestamps are still close-resolved.
Inputs Reference (common)
Modules: enable/disable RSI and Pyramid learning layers.
Rasta: EMA length, smoothing type/length, EMA8/21 filter & adaptive flip, fog opacity, rungs on/off & limit.
RSI: RSI length, signal MA length (panel), Entry band (LOW), Exit band (HIGH), cooldown bars, labels.
Pyramid: EMA length, smoothing, EMA8/21 filter & adaptive adds.
Execution: toggle Bar Close Only for Rasta/Pyramid; toggle Realtime + Close Backup for RSI.
Stops (strategy): Fixed Stop % (first), Fixed Stop % (add), Trail Distance %, Trigger rule (auto D–F₀ or custom), undershoot buffer %, and hit source (LOW/CLOSE).
What to Study With It
Convergence: how often RSI-LOW entry touches precede the next Rasta flip.
Divergence: cases where RSI screams exhaustion (HIGH >= upper band) but Rasta hasn’t flipped yet—often transition zones.
Continuation: how Pyramid adds cluster in strong moves; how spacing changes with smoothing/filter choices.
Regime changes: use EMA8/21 filter toggles to see what happens at macro turns vs chop.
Limitations & Scope
This is a learning tool, not a trade copier. It does not provide financial advice or automated execution.
Intrabar results depend on data granularity; bar magnifier (when available) can help simulate lower-resolution ticks, but true tick-by-tick fills are a platform-level feature and not guaranteed across all symbols.
Suggested Publication Settings (Strategy)
Initial capital: 100
Order size: 100 USD (cash)
Pyramiding: 10
Commission: 0.25%
Slippage: 3 ticks
Recalculate: ✓ On every tick
Fill orders: ✓ Using bar magnifier (choose 1m or similar); leave On bar close unchecked for live viewing.
Educational License
Released under the Michael Culpepper Gratitude License (2025).
Use and modify freely for education and research with attribution. No resale. No promises of profitability. Purpose is understanding, not signals.
MPO4 Lines – Modal Engine█ OVERVIEW
MPO4 Lines – Modal Engine is an advanced multi-line modal oscillator for TradingView, designed to detect momentum shifts, trend strength, and reversal points through candle-based pressure analysis with multiple fast lines and a reference slow line. It features divergence detection on Fast Line A, overbought/oversold return signals, dynamic coloring modes, and layered gradient visualizations for enhanced clarity and decision-making.
█ CONCEPT
The indicator is built upon the Market Pressure Oscillator (MPO) and serves as its expanded evolution, aimed at enabling broader market analysis through multiple lines with varying parameters. It calculates modal pressure using candle body size and direction, weighted against average body size over a lookback period, then normalized and smoothed via EMA. It generates four distinct oscillator lines: a heavily smoothed Slow Line (trend reference), two Fast Lines (A & B) for momentum and support/resistance, and an optional Line 4 for additional confirmation. Divergence is calculated solely on Fast Line A, with visual gradients between lines and bands for intuitive interpretation.
█ WHY USE IT?
- Multi-Layer Momentum: Combines slow trend reference with dual fast lines for precise entry/exit timing.
- Divergence Precision: Bullish/bearish divergences on Fast Line A with labeled confirmation.
- OB/OS Return Signals: Clear buy/sell markers when Fast Line A exits oversold/overbought zones.
- Dynamic Visuals: Gradient fills, line-to-line shading, and band gradients for instant market state recognition.
- Flexible Coloring: Slow Line color by direction or zero-position; fast lines by sign.
- Full Customization: Independent lengths, smoothing, visibility, and transparency — by adjusting the lengths of different lines, you can tailor results for various strategies; for example, enabling Line 4 and tuning its length allows trading based on crossovers between different lines.
█ HOW IT WORKS?
- Candle Pressure Calculation: Body = math.abs(close - open); avgBody = ta.sma(body, len). Direction = +1 (bull), –1 (bear), 0 (neutral). Weight = body / avgBody. Contribution = direction × weight.
- Rolling Sum & Normalization: Sums contributions over lookback, normalizes to ±100 scale (÷ (len × 2) × 100).
Smoothing: Applies primary EMA (smoothLen), with extra EMA on Slow Line for stability.
Line Structure:
- Slow Line = calcCPO(len1=20, smoothLen1=5) → extra EMA (5)
- Fast Line A = calcCPO(len2=6, smoothLen2=7)
- Fast Line B = calcCPO(len3=6, smoothLen3=10)
- Line 4 = calcCPO(len4=14, smoothLen4=1)
Divergence Detection: Uses ta.pivothigh/low on price and Fast Line A (pivotLength left/right). Bullish: lower price low + higher osc low. Bearish: higher price high + lower osc high. Valid within 5–60 bar window.
Signals:
- Buy: Fast Line A crosses above oversold (–30)
- Sell: Fast Line A crosses below overbought (+30)
- Slow Line color flip (direction or zero-cross)
- Divergence labels ("Bull" / "Bear")
- Band Coloring as Momentum Signal:
When Fast Line A ≤ Fast Line B → Overbought band turns red (bearish pressure building)
When Fast Line A > Fast Line B → Oversold band turns green (bullish pressure building) This dynamic coloring serves as visual confirmation of momentum shift following fast line crossovers
Visualization:
- Gradients: Fast B → Zero (multi-layer fade), Fast A ↔ B fill, OB/OS bands
- Dynamic colors: Green/red based on sign or trend
- Zero line + dashed OB/OS thresholds
Alerts: Trigger on OB/OS returns, Slow Line changes, and divergences.
█ SETTINGS AND CUSTOMIZATION
- Line Visibility: Toggle Slow, Fast A, Fast B, Line 4 independently.
Line Lengths:
- Slow Line: Base (20), Primary EMA (5), Extra EMA (5)
- Fast A: Lookback (6), EMA (7)
- Fast B: Lookback (6), EMA (10)
- Line 4: Lookback (14), EMA (1)
- Slow Line Coloring Mode: “Direction” (trend-based) or “Position vs Zero”.
- Bands & Thresholds: Overbought (+30), Oversold (–30), step 0.1.
- Signals: Enable Fast A OB/OS return markers (default: on).
- Divergence: Enable/disable, Pivot Length (default: 2, min 1).
- Colors & Appearance: Full control over bullish/bearish hues for all lines, zero, bands, divergence, and text.
Gradients & Transparency:
- Fast B → Zero: 75 (default)
- Fast A ↔ B fill: 50
- Band gradients: 40
- Toggle each gradient independently
█ USAGE EXAMPLES
The indicator allows users to configure various strategies manually, though no built-in alerts exist for them. Entry signals can include color of fast lines, crossovers between different lines, alignment of colors across lines, or consistency in direction.
- Trend Confirmation: Slow Line above zero + green = bullish bias; below + red = bearish.
- Entry Timing: Buy on Fast A crossing above –30 (circle marker), especially if Slow Line is rising or near zero.
- Reversal Setup: Bullish divergence (“Bull” label) + Fast A in oversold + green gradient band = high-probability long.
- Scalping: Fast A vs Fast B crossover in direction of Slow Line trend.
- Noise Reduction: Increase extraSmoothLen on Slow Line
█ USER NOTES
- Best combined with volume, support/resistance, or trend channels.
- Adjust lookback and smoothing to asset volatility.
- Divergence delay = pivotLength; plan entries accordingly.
Fat Tony's Composite Momentum + ROC (v0.4)Fat Tony's Composite Momentum + ROC Indicator
Overview
Fat Tony's Composite Momentum + ROC is a sophisticated momentum oscillator that combines multiple technical indicators into a single, volume-weighted signal. This indicator helps traders identify overbought/oversold conditions and potential reversal points by synthesizing Williams %R, Stochastic, MACD, and Rate of Change (ROC) into one composite reading.
Key Features
Multi-Indicator Composite: Combines Williams %R, Stochastic %K, MACD Histogram, and ROC for a comprehensive momentum view
Volume Weighting: Optional volume-based amplification to filter out low-conviction moves
Volume Filter: Requires minimum volume threshold (last 2 bars combined) before triggering signals
Adaptive MACD Scaling: Uses tanh normalization to keep MACD contribution proportional regardless of price volatility
Clear Visual Signals: Triangle markers appear only when crossing extreme levels with sufficient volume
Customizable Thresholds: Adjust overbought/oversold levels, volume sensitivity, and component lengths
How It Works
The indicator normalizes each component to a ±50 scale, then averages them together. The composite reading oscillates around zero, with positive values indicating bullish momentum and negative values indicating bearish momentum.
Signal Generation:
🟢 Rebound Watch (Green Triangle): Fires when the composite crosses UP through the oversold level with adequate volume
🔴 Fade Watch (Red Triangle): Fires when the composite crosses DOWN through the overbought level with adequate volume
Customizing Settings
After adding to your chart, click the gear icon next to the indicator name to access settings:
Length: Base period for Williams %R and Stochastic (default: 14)
MACD Fast/Slow/Signal: Standard MACD parameters (default: 12/26/9)
Overbought/Oversold Levels: Threshold values for signals (default: ±100)
Use Volume Weighting: Toggle volume amplification on/off
Volume Sensitivity: Multiplier for volume weighting (default: 1.5)
Include ROC: Toggle Rate of Change component on/off
ROC Length: Lookback period for ROC calculation (default: 10)
Minimum Volume: Required volume (sum of last 2 bars) for signals to trigger (default: 50,000)
Usage Tips
Works best on liquid instruments with consistent volume
Lower timeframes (5m-15m) benefit from higher minimum volume settings
Volume weighting helps filter out noise during consolidation periods
Watch for signal triangles at key support/resistance levels for highest probability setups
The indicator works as a momentum gauge and reversal spotter - not an entry system by itself
Alerts
The indicator includes built-in alert conditions:
Click the "⏰" (alarm clock) icon on your chart
Select "Fat Tony's Composite Momentum + ROC"
Choose "Rebound Watch" or "Fade Watch"
Configure your notification preferences
MACD Remastered [CHE]MACD Remastered — Robust MACD with confirmed pivot-based divergence, optional signal bands, and ready-to-use alerts.
Summary
This indicator augments classic MACD with a robust, confirmed pivot-based divergence engine and an optional signal channel using Bollinger Bands. Divergence signals are only produced after a pivot is confirmed, which reduces noise from transient swings. A line-of-sight clearance check filters cases where the MACD histogram path contradicts the divergence, further cutting false flags. Histogram coloring clarifies momentum changes, while optional triangles project the same signals onto the main chart for quick context.
Motivation: Why this design?
Standard MACD divergence tools tend to fire early in volatile phases and flip during consolidation. The core idea here is to delay decision points until a pivot is confirmed and to validate the path between pivots. This addresses fake flips and improves signal credibility at the cost of some latency. Optional bands around the Signal line add context about compression and expansion without altering MACD’s core behavior.
What’s different vs. standard approaches?
Reference baseline: Classical MACD (fast and slow moving averages, Signal line, histogram) with simple divergence checks.
Architecture differences:
Confirmed pivot logic with left and right bars.
Line-of-sight clearance test across the histogram path between pivots.
Optional Signal-line Bollinger Bands with configurable length and width.
Composite “Any Divergence” alert plus separate regular and hidden alerts.
Optional main-chart triangles using forced overlay for at-a-glance context.
Practical effect: Fewer early or contradictory divergence signals, clearer momentum context via histogram colors and a visible Signal channel during compression and expansion.
How it works (technical)
The MACD line derives from a fast and a slow moving average on a chosen source. The Signal line smooths the MACD line using a selected moving average type and length. The histogram is the difference between MACD and Signal and is colored by direction and acceleration.
Divergence uses confirmed pivots: a pivot forms only after a set number of bars on the right side, so the event is locked in. The engine retrieves the last two relevant pivots and checks price movement versus the MACD histogram movement to classify regular or hidden divergence. A line-of-sight clearance routine traverses the histogram path between the two pivots and rejects the signal if the path invalidates the directional relationship. When enabled, Bollinger Bands are plotted around the Signal line; width scales with standard deviation. Programmatic alerts fire only on confirmed bars. No higher-timeframe requests are used.
Parameter Guide
Oscillator MA Type — Sets fast and slow MA family for MACD. Default: EMA. Tip: EMA is more responsive; SMA is steadier.
Fast Length — Fast MA period. Default: 12. Trade-off: Shorter is quicker but noisier.
Slow Length — Slow MA period. Default: 26. Trade-off: Longer reduces noise but adds lag.
Source — Price input. Default: Close. Tip: Use a stable source for consistency.
Signal MA Type — Moving average family for Signal. Default: EMA.
Signal Length — Smoothing of MACD into Signal. Default: 9. Trade-off: Longer smooths more, reacts slower.
Calculate Divergence — Enables divergence engine. Default: True.
Enable Bollinger Bands on Signal — Adds bands around Signal. Default: False.
BB Length — Sampling window for bands. Default: 20. Active: Only when bands are enabled.
BB StdDev — Band width in standard deviations. Default: 2.0. Bounds: between about zero point zero zero one and fifty.
Pivot Left / Pivot Right — Bars to the left and right that define a confirmed pivot. Default: five and five. Trade-off: Larger values mean stronger but slower pivots.
Min / Max Bars Between Pivots — Valid window between two pivots. Default: five and sixty. Tip: Increase minimum to reduce micro-divergences.
Detect Hidden — Include hidden divergence. Default: True.
Draw Lines — Draw connector lines on the MACD pane. Default: True.
Alerts: Enable / Regular / Hidden / Frequency / Prefix — Control alert emission, categories, cadence, and label. Defaults: Enabled, both categories on, once per bar close, prefix “MACD RM”.
Reading & Interpretation
Histogram: Columns above zero reflect positive momentum; below zero reflect negative momentum. Color shifts indicate momentum increasing or decreasing within each side.
MACD and Signal: Crosses and distance indicate momentum shifts and strength. When bands are enabled, touches and departures hint at compression and expansion around the Signal.
Divergence: Solid green lines and labels indicate regular bullish; solid red indicate regular bearish. Dashed teal and dashed orange denote hidden bullish and hidden bearish. Triangles on the main chart mirror these events for quicker visibility.
Practical Workflows & Combinations
Trend following: Use histogram color transitions with a structure filter such as higher highs and higher lows for long bias, or lower highs and lower lows for short bias. Divergence against the prevailing structure suggests caution or partial exits.
Exits and risk: In a long, regular bearish divergence near resistance can justify scaling out or tightening stops. Hidden divergence in the trend direction can support continuation but should not replace risk controls.
Multi-asset / Multi-timeframe: Works across liquid futures, forex, indices, and large-cap equities. Start with defaults on four-hour and daily; shorten lengths on intraday only when liquidity is strong.
Behavior, Constraints & Performance
Repaint and confirmation: Signals are anchored only after the right-side pivot bars complete; alerts trigger on confirmed bars. This intentionally adds latency to reduce noise.
No higher-timeframe requests: No `security` calls are used; repaint risk is primarily tied to live bars before confirmation.
Resources: Declared `max_bars_back` is five hundred. The divergence path check iterates between pivots, bounded by the maximum bars parameter. Line objects may accumulate; limits are set for lines and labels.
Known limits: Latency at sharp turns, potential misses during fast single-bar reversals, and sensitivity to extremely choppy sessions if minimum gap between pivots is set too low.
Sensible Defaults & Quick Tunin g
Starting point: EMA, twelve and twenty-six with Signal nine; pivots five and five; minimum five, maximum sixty; alerts on close; bands off.
Too many flips: Increase Signal length, raise pivot counts, and increase minimum bars between pivots. Consider disabling hidden divergence.
Too sluggish: Reduce pivot counts, lower Signal length, and enable bands to visualize early compression.
Cluttered chart: Keep lines off and rely on labels and main-chart triangles. Use the alert prefix to route events cleanly.
What this indicator is—and isn’t
This is a visualization and signal layer for MACD with confirmed, path-checked divergence and optional Signal bands. It is not a trading system, not predictive, and not a position management framework. Use it together with structure analysis, liquidity context, and explicit 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
Ronin Pro Ichimoku Analyzer + ATRRonin Pro Ichimoku Analyzer is a refined Ichimoku-based decision tool designed to read trend strength, momentum shifts, and breakout conditions with clarity.
• It adapts the Kumo cloud dynamically — thickness and trend strength change the cloud’s transparency and color.
• Highlights Tenkan/Kijun crosses and Chikou confirmation to help filter noise.
• Includes optional ATR trailing stop for risk control.
• Shows long/short signals directly on the chart.
• Offers an on-chart analysis table summarizing the current market state in real time.
Volume Spike & RSI | Buy/Sell SignalsThis indicator is designed for intraday traders who seek clean, actionable buy and sell signals using a blend of momentum (RSI) and volume analysis. It automatically detects momentum bursts based on the RSI crossing user-defined levels with a simultaneous volume spike—helping filter out weak or late signals. Signals are highlighted by discrete, color-coded arrows and non-overlapping labels for easy chart interpretation without clutter.
How it works
Buy signal: Generated when the RSI crosses above your chosen “Buy Threshold” (default 60) AND the volume on that bar is above its 20-period average. This suggests strong momentum with real volume support.
Sell signal: Generated when the RSI crosses below your chosen “Sell Threshold” (default 40) AND the volume on that bar is above average, signaling momentum loss or bearish pressure.
Visuals:
Buy signals are illustrated by green upward labels/arrows beneath candles.
Sell signals feature red downward labels/arrows above candles.
All signals adjust spacing dynamically, so they never overlap the price bar.
Bars are colored lime when momentum and volume are both high.
Customization
Fully adjustable RSI “Buy” and “Sell” levels.
Customizable sensitivity for the volume spike via the SMA period input.
Label spacing can be tuned in settings so signals always remain visible, regardless of volatility.
Alerts
Built-in alert conditions for both buy and sell events, compatible with TradingView’s native alerting system.
How to use
1. Add the indicator to your intraday chart (works on any timeframe).
2. When a buy or sell label/arrow appears, it marks a technical momentum burst with real volume conviction. Use these as actionable entries or exits—always manage risk with your personal trading plan.
3. Adjust parameters in the script’s settings as needed for your market or style.
Originality & credits
The logic and code were developed specifically for this script, combining classic RSI levels with volume confirmation and careful non-overlapping visual presentation to ensure clarity for intraday trading.
This tool is for educational and informational purposes only. It is not financial advice or a guarantee of performance. Always test on demo before using in live trading.
Traderei SessionsTraderei Sessions shows the previous daily H/L + previous weekly H + L, daily open from the current day, the H/L from Asia/London/NY Session, including the 50% Level for Premium or Discount Price.
VPOC for each Session. VPOC do not work on FX ! only Crypto + Gold !
2 EMAs and 1 SMA, + 1 additional EMA/SMA.
default settings for EMA 20/50, SMA 200
all lines, labels can be toggled
[FS] Pivot Measurements# Pivot Measurements
An advanced TradingView indicator that combines LuxAlgo's pivot point detection algorithm with automatic measurement calculations between consecutive pivots.
## Features
### Pivot Detection
- **Regular Pivots**: Detects standard pivot highs and lows using configurable pivot length
- **Missed Pivots**: Identifies missed reversal levels that occurred between regular pivots
- **Visual Indicators**:
- Regular pivot highs: Red downward triangle (▼)
- Regular pivot lows: Teal upward triangle (▲)
- Missed pivots: Ghost emoji (👻)
- **Zigzag Lines**: Connects pivots with colored lines (solid for regular, dashed for missed)
- **Ghost Levels**: Horizontal lines indicating missed pivot levels
### Measurement System
- **Automatic Measurements**: Calculates price movements between consecutive pivots
- **Visual Display**:
- Transparent colored boxes (blue for upward, red for downward movements)
- Measurement labels showing:
- Price change (absolute and percentage)
- Duration (bars, days, hours, minutes)
- Volume approximation
- **Smart Positioning**: Labels positioned outside boxes (above for upward, below for downward)
- **Color Coding**: Blue for positive movements, red for negative movements
## Parameters
### Pivot Detection
- **Pivot Length** (default: 50): Number of bars on each side to identify a pivot point
- **Regular Pivots**: Toggle and colors for regular pivot highs and lows
- **Missed Pivots**: Toggle and colors for missed pivot detection
### Measurements
- **Number of Measurements** (1-10, default: 10): Maximum number of measurements to display
- **Show Measurement Boxes**: Toggle to show/hide measurement boxes and labels
- **Box Transparency** (0-100, default: 90): Transparency level for measurement boxes
- **Border Transparency** (0-100, default: 50): Transparency level for box borders
- **Label Background Transparency** (0-100, default: 30): Transparency level for label backgrounds
- **Label Size**: Size of measurement labels (tiny, small, normal, large)
## Usage
1. Add the indicator to your chart
2. Configure the **Pivot Length** based on your timeframe:
- Lower values for shorter timeframes (e.g., 10-20 for 1-5 min)
- Higher values for longer timeframes (e.g., 50-100 for daily)
3. Adjust pivot colors and visibility as needed
4. Customize measurement display settings:
- Set the number of measurements to display
- Adjust transparency levels for boxes, borders, and labels
- Choose label size
## Technical Details
- **Pine Script Version**: v6
- **Pivot Detection**: Based on () algorithm for detecting regular and missed pivots
- **Measurement Calculation**:
- Measures between consecutive pivots (from most recent to older)
- Calculates price change, percentage change, duration, and approximate volume
- Automatically sorts pivots chronologically
- **Performance**: Optimized with helper functions to reduce code duplication
## Notes
- The indicator automatically limits the number of stored pivots to optimize performance
- Measurements are only created when there are at least 2 pivots detected
- All measurements are recalculated on each bar update
- The indicator uses `max_bars_back=5000` to ensure sufficient historical data
## License
This indicator uses LuxAlgo's pivot detection algorithm from (). Please refer to the original LuxAlgo license for pivot detection components.
Hindenburg OmenThe Hindenburg Omen highlights periods of internal market stress — when both new 52-week highs and new lows expand while the NYSE remains in an uptrend.
This condition often precedes major corrections or volatility spikes by revealing divergence beneath the surface of an advancing market.
The indicator triggers when four classic breadth rules align: elevated highs and lows, a positive trend, a negative McClellan Oscillator, and a highs-to-lows ratio under 2:1.
Use it on broad indices (NYSE, S&P 500) as an early-warning context tool, NOT a standalone sell signal.
KD-NewAutoTrade for Future Trading - Heikin Ashi candles The KD-NewAutoTrade strategy is a dynamic trend-following indicator designed for scalping and swing trading across crypto, forex, and index futures. It combines the precision of EMA crossovers, RSI momentum, and ADX trend strength to deliver clear Buy/Sell signals with high reliability.
🔹 Core Logic
EMA Fast & Slow Crossover – Identifies short-term and long-term trend shifts.
RSI Confirmation – Filters out false signals by requiring RSI to cross custom Buy/Sell thresholds.
ADX Filter – Ensures trades only trigger when market trend strength exceeds your chosen ADX minimum.
🔹 Key Features
Visual Buy/Sell triangles directly on the chart.
Customizable inputs for EMA, RSI, and ADX lengths.
Works efficiently on all timeframes and all markets (Crypto, Indices, Stocks, Commodities).
Optional background highlights for active trade zones.
Alert conditions for both BUY and SELL setups – ready to use in automated strategies or alert bots.
🔹 Recommended Usage
Use Heikin Ashi candles
Works best on 1M - 5M timeframes.
Combine with volume or higher-timeframe trend confirmation for stronger signals.
Realtime Squeeze Box [CHE] Realtime Squeeze Box — Detects lowvolatility consolidation periods and draws trimmed price range boxes in realtime to highlight potential breakout setups without clutter from outliers.
Summary
This indicator identifies "squeeze" phases where recent price volatility falls below a dynamic baseline threshold, signaling potential energy buildup for directional moves. By requiring a minimum number of consecutive bars in squeeze, it reduces noise from fleeting dips, making signals more reliable than simple threshold crosses. The core innovation is realtime box visualization: during active squeezes, it builds and updates a box capturing the price range while ignoring extreme values via quantile trimming, providing a cleaner view of consolidation bounds. This differs from static volatility bands by focusing on trimmed ranges and suppressing overlapping boxes, which helps traders spot genuine setups amid choppy markets. Overall, it aids in anticipating breakouts by combining volatility filtering with visual containment of price action.
Motivation: Why this design?
Traders often face whipsaws during brief volatility lulls that mimic true consolidations, leading to premature entries, or miss setups because standard volatility measures lag in adapting to changing market regimes. This design addresses that by using a hold requirement on consecutive lowvolatility bars to denoise signals, ensuring only sustained squeezes trigger visuals. The core idea—comparing rolling standard deviation to a smoothed baseline—creates a responsive yet stable filter for lowenergy periods, while the trimmed box approach isolates the core price cluster, making it easier to gauge breakout potential without distortion from spikes.
What’s different vs. standard approaches?
Reference baseline: Traditional squeeze indicators like the Bollinger Band Squeeze or TTM Squeeze rely on fixed multiples of bands or momentum oscillators crossing zero, which can fire on isolated bars or ignore range compression nuances.
Architecture differences:
Realtime box construction that updates barbybar during squeezes, using arrays to track and trim price values.
Quantilebased outlier rejection to define box bounds, focusing on the bulk of prices rather than full range.
Overlap suppression logic that skips redundant boxes if the new range intersects heavily with the prior one.
Hold counter for consecutive bar validation, adding persistence before signaling.
Practical effect: Charts show fewer, more defined orange boxes encapsulating tight price action, with a horizontal line extension marking the midpoint postsqueeze—visibly reducing clutter in sideways markets and highlighting "coiled" ranges that standard plots might blur with full highs/lows. This matters for quicker visual scanning of multitimeframe setups, as boxes selflimit to recent history and avoid piling up.
How it works (technical)
The indicator starts by computing a rolling average and standard deviation over a userdefined length on the chosen source price series. This deviation measure is then smoothed into a baseline using either a simple or exponential average over a longer window, serving as a reference for normal volatility. A squeeze triggers when the current deviation dips below this baseline scaled by a multiplier less than one, but only after a minimum number of consecutive bars confirm it, which resets the counter on breaks.
Upon squeeze start, it clears a buffer and begins collecting source prices barbybar, limited to the first few bars to keep computation light. For visualization, if enabled, it sorts the buffer and finds a quantile threshold, then identifies the minimum value at or below that threshold to set upper and lower box bounds—effectively clamping the range to exclude tails above the quantile. The box draws from the start bar to the current one, updating its right edge and levels dynamically; if the new bounds overlap significantly with the last completed box, it suppresses drawing to avoid redundancy.
Once the hold limit or squeeze ends, the box freezes: its final bounds become the last reference, a midpoint line extends rightward from the end, and a tiny circle label marks the point. Buffers and states reset on new squeezes, with historical boxes and lines capped to prevent overload. All logic runs on every bar but uses confirmed historical data for calculations, with realtime updates only affecting the active box's position—no future peeking occurs. Initialization seeds with null values, building states progressively from the first bars.
Parameter Guide
Source: Selects the price series (e.g., close, hl2) for deviation and box building; influences sensitivity to wicks or bodies. Default: close. Tradeoffs/Tips: Use hl2 for balanced range view in volatile assets; stick to close for pure directional focus—test on your timeframe to avoid oversmoothing trends.
Length (Mean/SD): Sets window for average and deviation calculation; shorter values make detection quicker but noisier. Default: 20. Tradeoffs/Tips: Increase to 30+ for stability in higher timeframes, reducing false starts; below 10 risks overreacting to singlebar noise.
Baseline Length: Defines smoothing window for the deviation baseline; longer periods create a steadier reference, filtering regime shifts. Default: 50. Tradeoffs/Tips: Pair with Length at 1:2 ratio for calm markets; shorten to 30 if baselines lag during fast volatility drops, but watch for added whips.
Squeeze Multiplier (<1.0): Scales the baseline downward to set the squeeze threshold; lower values tighten criteria for rarer, stronger signals. Default: 0.8. Tradeoffs/Tips: Tighten to 0.6 for highvol assets like crypto to cut noise; loosen to 0.9 in forex for more frequent but shallower setups—balances hit rate vs. depth.
Baseline via EMA (instead of SMA): Switches baseline smoothing to exponential for faster adaptation to recent changes vs. equalweighted simple average. Default: false. Tradeoffs/Tips: Enable in trending markets for quicker baseline drops; disable for uniform history weighting in rangebound conditions to avoid overreacting.
SD: Sample (len1) instead of Population (len): Adjusts deviation formula to divide by length minus one for smallsample bias correction, slightly inflating values. Default: false. Tradeoffs/Tips: Use sample in short windows (<20) for more conservative thresholds; population suits long looks where bias is negligible, keeping signals tighter.
Min. Hold Bars in Squeeze: Requires this many consecutive squeeze bars before confirming; higher denoise but may clip early setups. Default: 1. Tradeoffs/Tips: Bump to 35 for intraday to filter ticks; keep at 1 for swings where quick consolidations matter—trades off timeliness for reliability.
Debug: Plot SD & Threshold: Toggles lines showing raw deviation and threshold for visual backtesting of squeeze logic. Default: false. Tradeoffs/Tips: Enable during tuning to eyeball crossovers; disable live to declutter—great for verifying multiplier impact without alerts.
Tint Bars when Squeeze Active: Overlays semitransparent color on bars during open box phases for quick squeeze spotting. Default: false. Tradeoffs/Tips: Pair with low opacity for subtlety; turn off if using boxes alone, as tint can obscure candlesticks in dense charts.
Tint Opacity (0..100): Controls background tint strength during active squeezes; higher values darken for emphasis. Default: 85. Tradeoffs/Tips: Dial to 60 for light touch; max at 100 risks hiding price action—adjust per chart theme for visibility.
Stored Price (during Squeeze): Price series captured in the buffer for box bounds; defaults to source but allows customization. Default: close. Tradeoffs/Tips: Switch to high/low for wider boxes in gappy markets; keep close for midline focus—impacts trim effectiveness on outliers.
Quantile q (0..1): Fraction of sorted prices below which tails are cut; higher q keeps more data but risks including spikes. Default: 0.718. Tradeoffs/Tips: Lower to 0.5 for aggressive trim in noisy assets; raise to 0.8 for fuller ranges—tune via debug to match your consolidation depth.
Box Fill Color: Sets interior shade of squeeze boxes; semitransparent for layering. Default: orange (80% trans.). Tradeoffs/Tips: Soften with more transparency in multiindicator setups; bold for standalone use—ensures boxes pop without overwhelming.
Box Border Color: Defines outline hue and solidity for box edges. Default: orange (0% trans.). Tradeoffs/Tips: Match fill for cohesion or contrast for edges; thin width keeps it clean—helps delineate bounds in zoomed views.
Keep Last N Boxes: Limits historical boxes/lines/labels to this count, deleting oldest for performance. Default: 10. Tradeoffs/Tips: Increase to 50 for weekly reviews; set to 0 for unlimited (risks lag)—balances history vs. speed on long charts.
Draw Box in Realtime (build/update): Enables live extension of boxes during squeezes vs. waiting for end. Default: true. Tradeoffs/Tips: Disable for confirmedonly views to mimic backtests; enable for proactive trading—adds minor repaint on live bars.
Box: Max First N Bars: Caps buffer collection to initial squeeze bars, freezing after for efficiency. Default: 15. Tradeoffs/Tips: Shorten to 510 for fast intraday; extend to 20 in dailies—prevents bloated arrays but may truncate long squeezes.
Reading & Interpretation
Squeeze phases appear as orange boxes encapsulating the trimmed price cluster during lowvolatility holds—narrow boxes signal tight consolidations, while wider ones indicate looser ranges within the threshold. The box's top and bottom represent the quantilecapped high and low of collected prices, with the interior fill shading the containment zone; ignore extremes outside for "true" bounds. Postsqueeze, a solid horizontal line extends right from the box's midpoint, acting as a reference level for potential breakout tests—drifting prices toward or away from it can hint at building momentum. Tiny orange circles at the line's start mark completion points for easy scanning. Debug lines (if on) show deviation hugging or crossing the threshold, confirming hold logic; a persistent hug below suggests prolonged calm, while spikes above reset counters.
Practical Workflows & Combinations
Trend following: Enter long on squeezeend close above the box top (or midpoint line) confirmed by higher high in structure; filter with rising 50period average to avoid countertrend traps. Use boxes as support/resistance proxies—short below bottom in downtrends.
Exits/Stops: Trail stops to the box midpoint during postsqueeze runs for conservative holds; go aggressive by exiting on retest of opposite box side. If debug shows repeated threshold grazes, tighten stops to curb drawdowns in ranging followups.
Multiasset/MultiTF: Defaults work across stocks, forex, and crypto on 15min+ frames; scale Length proportionally (e.g., x2 on hourly). Layer with highertimeframe boxes for confluence—e.g., daily squeeze + 1H box for entry timing. (Unknown/Optional: Specific multiTF scaling recipes beyond proportional adjustment.)
Behavior, Constraints & Performance
Repaint/confirmation: Core calculations use historical closes, confirming on bar close; active boxes repaint their right edge and levels live during squeezes if enabled, but freeze irrevocably on hold limit or end—mitigates via barbybar buffer adds without future leaks. No lookahead indexes.
security()/HTF: None used, so no external timeframe repaints; all native to chart resolution.
Resources: Caps at 300 boxes/lines/labels total; small arrays (up to 20 elements) and short loops in sorting/minfinding keep it light—suitable for 10k+ bar charts without throttling. Persistent variables track state across bars efficiently.
Known limits: May lag on ultrasharp volatility spikes due to baseline smoothing; gaps or thin markets can skew trims if buffer hits cap early; overlaps suppress visuals but might hide chained squeezes—(Unknown/Optional: Edge cases in nonstandard sessions).
Sensible Defaults & Quick Tuning
Start with defaults for most liquid assets on 1Hdaily: Length 20, Multiplier 0.8, Hold 1, Quantile 0.718—yields balanced detection without excess noise. For too many false starts (choppy charts), increase Hold to 3 and Baseline Length to 70 for stricter confirmation, reducing signals by 3050%. If squeezes feel sluggish or miss quick coils, shorten Length to 14 and enable EMA baseline for snappier adaptation, but monitor for added flips. In highvol environments like options, tighten Multiplier to 0.6 and Quantile to 0.6 to focus on core ranges; reverse for calm pairs by loosening to 0.95. Always backtest tweaks on your asset's history.
What this indicator is—and isn’t
This is a volatilityfiltered visualization tool for spotting and bounding consolidation phases, best as a signal layer atop price action and trend filters—not a standalone predictor of direction or strength. It highlights setups but ignores volume, momentum, or news context, so pair with discreteness rules like higher highs/lows. Never use it alone for entries; always layer risk management, such as 12% stops beyond box extremes, and position sizing based on account drawdown tolerance.
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 HeikinAshi, Renko, Kagi, PointandFigure, or Range charts, as these chart types can produce unrealistic results for signal markers and alerts.
Best regards and happy trading
Chervolino
Index Weighted Returns [SS]This is the index weighted return indicator.
It supports a few ETFs, including:
SPY/SPX
QQQ/NDX
ARKK
SMH
UFO
XBI
QTUM
What it does is it takes the top, approximately 40, of the most heavily weighted tickers on the ETF, monitors their returns using the request security function, and then uses their weight to calculate the synthetic returns of the ETF of interest.
For example, in the chart we have SMH.
The indicator is looking at the top weighted tickers of SMH, calculating their returns, adjusting it for their individual weight on SMH and then predicting the expected return of SMH based on the weighing and holding's returns themselves.
How to Use it
The indicator is pretty straight forward, you select which ever index you are on and your desired timeframe (you can do as low as 30-Minutes or as high as monthly or quarterly).
The indicator will then retrieve the top holdings for that ticker, their corresponding weights and calculate the expected daily return based on the weight and return of these tickers.
It will plot this return for you on the chart.
Other Options
There is an optional table for you to view the actual weight, ticker composition and period returns for each of the top x tickers for an index. You can simply toggle "Show Table" in the settings menu, and it will show you the list of all tickers included, their period returns and their weight on the ETF.
Tips for Use
Works well to see when an index may be over the actual top weighted tickers, implying a pullback/sell, or under. For example:
SPY today fell well below its top tickers and is currently rallying back up to the expected close range.
You can see in the primary chart, SMH fell below and returned to its balance, being at the expected close range based on its component tickers.
That is the indicator!
Its simple but powerful!
Hope you enjoy and as always, safe trades!
chart Pattern & Candle sticks Strategy# **XAUUSD Pattern & Candle Strategy - Complete Description**
## **Overview**
This Pine Script indicator is a comprehensive multi-factor trading system specifically designed for **XAUUSD (Gold) scalping and swing trading**. It combines classical technical analysis methods including candlestick patterns, chart patterns, moving averages, and volume analysis to generate high-probability buy/sell signals with automatic stop-loss and take-profit levels.
***
## **Core Components**
### **1. Moving Average System (Triple MA)**
**Purpose:** Identifies trend direction and momentum
- **Fast MA (20-period)** - Short-term price action
- **Medium MA (50-period)** - Intermediate trend
- **Slow MA (200-period)** - Long-term trend direction
**How it works:**
- **Bullish alignment**: MA20 > MA50 > MA200 (all pointing up)
- **Bearish alignment**: MA20 < MA50 < MA200 (all pointing down)
- **Crossover signals**: When Fast MA crosses Medium MA, it triggers buy/sell signals
- **Choice of SMA or EMA**: Adjustable based on preference
**Visual indicators:**
- Blue line = Fast MA
- Orange line = Medium MA
- Light red line = Slow MA
- Green background tint = Bullish trend
- Red background tint = Bearish trend
---
### **2. Candlestick Pattern Recognition (13 Patterns)**
**Purpose:** Identifies reversal and continuation signals based on price action
#### **Bullish Patterns (Signal potential upward moves):**
1. **Hammer** 🔨
- Long lower wick (2x body size)
- Small body at top
- Indicates rejection of lower prices (buyers stepping in)
- Best at support levels
2. **Inverted Hammer**
- Long upper wick
- Small body at bottom
- Shows buying pressure despite initial selling
3. **Bullish Engulfing** 📈
- Green candle completely engulfs previous red candle
- Strong reversal signal
- Body must be 1.2x larger than previous
4. **Morning Star** ⭐
- 3-candle pattern
- Red candle → Small indecision candle → Large green candle
- Powerful reversal at bottoms
5. **Piercing Line** ⚡
- Green candle closes above 50% of previous red candle
- Indicates strong buying interest
6. **Bullish Marubozu**
- Almost no wicks (95% body)
- Very strong bullish momentum
- Body must be 1.3x average size
#### **Bearish Patterns (Signal potential downward moves):**
7. **Shooting Star** 💫
- Long upper wick
- Small body at bottom
- Indicates rejection of higher prices (sellers in control)
- Best at resistance levels
8. **Hanging Man**
- Similar to hammer but appears at top
- Warning of potential reversal down
9. **Bearish Engulfing** 📉
- Red candle completely engulfs previous green candle
- Strong reversal signal
10. **Evening Star** 🌙
- 3-candle pattern (opposite of Morning Star)
- Green → Small → Large red candle
- Powerful top reversal
11. **Dark Cloud Cover** ☁️
- Red candle closes below 50% of previous green candle
- Indicates strong selling pressure
12. **Bearish Marubozu**
- Almost no wicks, pure red body
- Very strong bearish momentum
#### **Neutral Pattern:**
13. **Doji**
- Open and close nearly equal (tiny body)
- Indicates indecision
- Often precedes major moves
**Detection Logic:**
- Compares body size, wick ratios, and position relative to previous candles
- Uses 14-period average body size as reference
- All patterns validated against volume confirmation
***
### **3. Chart Pattern Recognition**
**Purpose:** Identifies major support/resistance and reversal patterns
#### **Patterns Detected:**
**Double Bottom** 📊 (Bullish)
- Two lows at approximately same level
- Indicates strong support
- Breakout above neckline triggers buy signal
- Most reliable at major support zones
**Double Top** 📊 (Bearish)
- Two highs at approximately same level
- Indicates strong resistance
- Breakdown below neckline triggers sell signal
- Most reliable at major resistance zones
**Support & Resistance Levels**
- Automatically plots recent pivot highs (resistance)
- Automatically plots recent pivot lows (support)
- Uses 3-bar strength for validation
- Levels shown as dashed horizontal lines
**Price Action Patterns**
- **Uptrend detection**: Higher highs + higher lows
- **Downtrend detection**: Lower highs + lower lows
- Confirms overall market structure
***
### **4. Volume Analysis**
**Purpose:** Confirms signal strength and filters false signals
**Metrics tracked:**
- **Volume MA (20-period)**: Baseline average volume
- **High volume threshold**: 1.5x the volume average
- **Volume increase**: Current volume > previous 2 bars
**How it's used:**
- All buy/sell signals **require volume confirmation**
- High volume = institutional participation
- Low volume signals are filtered out
- Prevents whipsaw trades during quiet periods
**Visual indicator:**
- Dashboard shows "High" volume in orange when active
- "Normal" shown in gray during low volume
***
### **5. Signal Generation Logic**
**BUY SIGNALS triggered when ANY of these occur:**
1. **Candlestick + Volume**
- Bullish candle pattern detected
- High volume confirmation
- Price above Fast MA
2. **MA Crossover + Volume**
- Fast MA crosses above Medium MA
- High volume confirmation
3. **Double Bottom Breakout**
- Price breaks above support level
- Volume confirmation present
4. **Trend Continuation**
- Uptrend structure intact (higher highs/lows)
- All MAs in bullish alignment
- Price above Fast MA
- Volume confirmation
**SELL SIGNALS triggered when ANY of these occur:**
1. **Candlestick + Volume**
- Bearish candle pattern detected
- High volume confirmation
- Price below Fast MA
2. **MA Crossunder + Volume**
- Fast MA crosses below Medium MA
- High volume confirmation
3. **Double Top Breakdown**
- Price breaks below resistance level
- Volume confirmation present
4. **Trend Continuation**
- Downtrend structure intact (lower highs/lows)
- All MAs in bearish alignment
- Price below Fast MA
- Volume confirmation
***
### **6. Risk Management System**
**Automatic Stop Loss Calculation:**
- Based on ATR (Average True Range) - 14 periods
- **Formula**: Entry price ± (ATR × SL Multiplier)
- **Default multiplier**: 1.5 (adjustable)
- Adapts to market volatility automatically
**Automatic Take Profit Calculation:**
- **Formula**: Entry price ± (ATR × TP Multiplier)
- **Default multiplier**: 2.5 (adjustable)
- **Default Risk:Reward ratio**: 1:1.67
- Higher TP multiplier = more aggressive targets
**Position Management:**
- Tracks ONE position at a time (no pyramiding)
- Automatically closes position when:
- Stop loss is hit
- Take profit is reached
- Opposite MA crossover occurs
- Prevents revenge trading and over-leveraging
**Visual Representation:**
- **Red horizontal line** = Stop Loss level
- **Green horizontal line** = Take Profit level
- Lines remain on chart while position is active
- Automatically disappear when position closes
***
### **7. Visual Elements**
**On-Chart Displays:**
1. **Moving Average Lines**
- Fast MA (Blue, thick)
- Medium MA (Orange, thick)
- Slow MA (Red, thin)
2. **Support/Resistance**
- Green crosses = Support levels
- Red crosses = Resistance levels
3. **Buy/Sell Arrows**
- Large GREEN "BUY" label below bars
- Large RED "SELL" label above bars
4. **Pattern Labels** (Small markers)
- "Hammer", "Bull Engulf", "Morning Star" (green, below bars)
- "Shooting Star", "Bear Engulf", "Evening Star" (red, above bars)
- "Double Bottom" / "Double Top" (blue/orange)
5. **Signal Detail Labels** (Medium size)
- Shows signal reason (e.g., "Bullish Candle", "MA Cross Up")
- Displays Entry, SL, and TP prices
- Color-coded (green for long, red for short)
6. **Background Coloring**
- Light green tint = Bullish MA alignment
- Light red tint = Bearish MA alignment
***
### **8. Information Dashboard**
**Top-right corner table showing:**
| Metric | Description |
|--------|-------------|
| **Position** | Current trade status (LONG/SHORT/None) |
| **MA Trend** | Overall trend direction (Bullish/Bearish/Neutral) |
| **Volume** | Current volume status (High/Normal) |
| **Pattern** | Last detected candlestick pattern |
| **ATR** | Current volatility measurement |
**Purpose:**
- Quick at-a-glance market assessment
- Real-time position tracking
- No need to check multiple indicators
***
### **9. Alert System**
**Complete alert coverage for:**
✅ **Entry Alerts**
- "Buy Signal" - Triggers when buy conditions met
- "Sell Signal" - Triggers when sell conditions met
✅ **Exit Alerts**
- "Long TP Hit" - Take profit reached on long position
- "Long SL Hit" - Stop loss triggered on long position
- "Short TP Hit" - Take profit reached on short position
- "Short SL Hit" - Stop loss triggered on short position
**How to use:**
1. Click "Create Alert" button
2. Select desired alert from dropdown
3. Set notification method (popup, email, SMS, webhook)
4. Never miss a trade opportunity
***
## **Recommended Settings**
### **For Scalping (Quick trades):**
- **Timeframe**: 5-minute
- **Fast MA**: 9
- **Medium MA**: 21
- **Slow MA**: 50
- **SL Multiplier**: 1.0
- **TP Multiplier**: 2.0
- **Volume Threshold**: 1.5x
### **For Swing Trading (Longer holds):**
- **Timeframe**: 1-hour or 4-hour
- **Fast MA**: 20
- **Medium MA**: 50
- **Slow MA**: 200
- **SL Multiplier**: 2.0
- **TP Multiplier**: 3.0
- **Volume Threshold**: 1.3x
### **Best Trading Hours for XAUUSD:**
- **Asian Session**: 00:00 - 08:00 GMT (lower volatility)
- **London Session**: 08:00 - 16:00 GMT (high volatility) ⭐
- **New York Session**: 13:00 - 21:00 GMT (highest volume) ⭐
- **London-NY Overlap**: 13:00 - 16:00 GMT (BEST for scalping) 🔥
***
## **How to Use This Strategy**
### **Step 1: Setup**
1. Open TradingView
2. Load XAUUSD chart
3. Select timeframe (5m, 15m, 1H, or 4H)
4. Add indicator from Pine Editor
5. Adjust settings based on your trading style
### **Step 2: Wait for Signals**
- Watch for GREEN "BUY" or RED "SELL" labels
- Check the signal reason in the detail label
- Verify dashboard shows favorable conditions
- Confirm volume is "High" (not required but preferred)
### **Step 3: Enter Trade**
- Enter at market or limit order near signal price
- Note the displayed Entry, SL, and TP prices
- Set your broker's SL/TP to match indicator levels
### **Step 4: Manage Position**
- Watch for SL/TP lines on chart
- Monitor dashboard for trend changes
- Exit manually if opposite MA crossover occurs
- Let SL/TP do their job (don't move them!)
### **Step 5: Review & Learn**
- Track win rate over 20+ trades
- Adjust multipliers if needed
- Note which patterns work best for you
- Refine entry timing
***
## **Key Advantages**
✅ **Multi-confirmation approach** - Reduces false signals significantly
✅ **Automatic risk management** - No manual calculation needed
✅ **Adapts to volatility** - ATR-based SL/TP adjusts to market conditions
✅ **Volume filtered** - Ensures institutional participation
✅ **Visual clarity** - Easy to understand at a glance
✅ **Complete alert system** - Never miss opportunities
✅ **Pattern education** - Learn patterns as they appear
✅ **Works on all timeframes** - Scalping to swing trading
***
## **Limitations & Considerations**
⚠️ **Not a holy grail** - No strategy wins 100% of trades
⚠️ **Requires practice** - Demo trade first to understand signals
⚠️ **Market conditions matter** - Works best in trending or volatile markets
⚠️ **News events** - Avoid trading during major economic releases
⚠️ **Slippage on 5m** - Fast markets may have execution delays
⚠️ **Pattern subjectivity** - Some patterns may trigger differently than expected
***
## **Risk Management Rules**
1. **Never risk more than 1-2% per trade**
2. **Maximum 3 positions per day** (avoid overtrading)
3. **Don't trade during major news** (NFP, FOMC, etc.)
4. **Use proper position sizing** (0.01 lot per $100 for micro accounts)
5. **Keep trade journal** (track patterns, win rate, mistakes)
6. **Stop trading after 3 consecutive losses** (psychological reset)
7. **Don't move stop loss further away** (accept losses)
8. **Take partial profits** at 1:1 R:R if desired
***
## **Expected Performance**
**Realistic expectations:**
- **Win rate**: 50-65% (depending on market conditions and timeframe)
- **Risk:Reward**: 1:1.67 default (adjustable to 1:2 or 1:3)
- **Signals per day**: 3-8 on 5m, 1-3 on 1H
- **Best months**: High volatility periods (news events, economic uncertainty)
- **Drawdowns**: Expect 3-5 losing trades in a row occasionally
***
## **Customization Options**
All inputs are adjustable in settings panel:
**Moving Averages:**
- Type (SMA or EMA)
- All three period lengths
**Volume:**
- Volume MA length
- High volume multiplier threshold
**Chart Patterns:**
- Pattern strength (bars for pivot detection)
- Show/hide pattern labels
**Risk Management:**
- ATR period
- Stop loss multiplier
- Take profit multiplier
**Display:**
- Toggle pattern labels
- Customize colors (in code)
***
## **Conclusion**
This is a **professional-grade, multi-factor trading system** that combines the best of classical technical analysis with modern risk management. It's designed to give clear, actionable signals while automatically handling the complex calculations of stop loss and take profit levels.
**Best suited for traders who:**
- Understand basic technical analysis
- Can follow rules consistently
- Prefer systematic approach over gut feeling
- Want visual confirmation before entering trades
- Value proper risk management
**Start with demo trading** for at least 20-30 trades to understand how the signals work in different market conditions. Once comfortable and profitable on demo, transition to live trading with minimal risk per trade.
Happy trading! 📈🎯
SSL Hybrid ScalperIt's a ready to trade script V5, that takes the original SSL Hybrid logic and optimizes it for XAUUSD scalping on 1min to 15min charts for buy & sell signals.
SevenDayHighLowTableWithBoxes [CHE]SevenDayHighLowTableWithBoxes — Seven-day day-range boxes with a weekday-aware “ghost” projection and a compact table that tracks recent extremes and per-weekday hit rates.
Summary
This indicator visualizes each trading day as a colored box and annotates the final high and low with compact markers. It maintains a rolling seven-day view and a five-column table showing day name, high, low, range, and a per-weekday projection hit statistic. A dashed “ghost” box projects a typical range for the current weekday using a running average and an adjustable scaling factor. The script is written in Pine v6, runs on the main chart (overlay true), and emphasizes stable object handling and closed-bar finalization at day boundaries.
Motivation: Why this design?
Intraday traders often need fast context for where today’s price sits relative to recent daily extremes, without switching timeframes. A simple daily high/low overlay is informative but lacks structure, sizing context, and continuity. By grouping bars into local days (configurable UTC offset), drawing explicit boxes, and projecting a weekday-typical range, the chart becomes easier to scan. The compact table gives a quick audit trail of the latest seven days while tracking how often the weekday projection would have covered the realized range.
What’s different vs. standard approaches?
Reference baseline: Plain daily high/low lines or session boxes without context.
Architecture differences:
Weekday-tinted boxes and labels for today plus up to six prior days.
Weekday average range drives a dashed projection (“ghost”) sized by a user-defined percentage.
Per-weekday hit statistics recorded as hits over totals and displayed in the table.
ATR-based vertical offsets keep labels readable.
Live updates intraday; state is finalized at the local day switch.
Practical effect: The chart shows where current price sits inside a known daily envelope, plus how “typical” the day’s movement is for this weekday, aiding expectations and planning.
How it works (technical)
The script computes a local daily timestamp using the user’s UTC offset. A day change finalizes the prior day, writes its high, low, start and end indices, and records the bar indices of the terminal high and low.
For each weekday, it maintains a running average of realized ranges with a cap on the lookback count. The ghost projection length is the weekday average scaled by the user’s percentage setting.
Anchor selection for the ghost uses the most recent extreme and the close relative to the intraday midpoint to choose a low-anchored or high-anchored box.
A five-column table (Day, High, Low, Range, Ghost OK) is refreshed on the last bar. The “Ghost OK” column shows per-weekday cumulative hits over totals with a percentage, calculated before including the just-finished day.
Object counts are bounded to seven days by pruning arrays and deleting old boxes and labels. Visual updates for historical objects occur on the last bar to minimize overhead. No `security()` calls are used.
Parameter Guide
UTC (+/−) — Controls local day boundaries — Default: minus five hours — Set to your venue’s local time.
Session (for Time gate) — Session string — Default: full week — (Optional) computed internally; not applied to gating.
Show 7-Day High/Low Table — Toggles the table — Default: true — Disable to reduce UI load.
Show Day Boxes in Chart — Toggles day boxes — Default: true — Disable for a cleaner chart.
Table Position — Nine-point anchor — Default: Middle Right — Move to avoid overlap.
Table Background / Text Color / Min Cell Width — Styling controls — Defaults: gray background, white text, width twelve characters.
Weekday Colors (Sun…Sat) — Row and box tints — Defaults: semi-transparent hues — Adjust for your theme.
Triangle Transparency — Marker opacity — Default: zero — Increase to fade high/low dots.
Day Label Transparency — Day name opacity — Default: zero — Increase to reduce emphasis.
Box Border Width — Box stroke width — Default: one — Increase for stronger edges.
Extend Boxes Right — Extend current box — Default: false — Useful for forward planning.
Show Average Range Ghost Box — Dashed projection — Default: true — Disable if distracting.
Ghost Border Color / Width — Ghost styling — Defaults: gray, width one.
Ghost Length percent of AvgRange — Projection scale — Default: one hundred; bounds zero to five hundred — Lower to be conservative.
Max History Days for Average — Cap per-weekday averaging — Default: two hundred fifty-two; bounds thirty to five hundred.
ATR Length / Day Label ATR Multiplier / Triangle Up ATR Multiplier / Triangle Down ATR Multiplier — Offsets for label placement — Defaults: length one hundred; multipliers zero — Increase on dense instruments to prevent overlap.
Reading & Interpretation
Day boxes: The filled rectangle marks each day’s full high-low span; color encodes the weekday.
Markers: Small dots near the terminal high and low highlight where the final extremes occurred.
Ghost box: A dashed box sized by the weekday average range, anchored based on recent behavior. It is a typical span, not a target.
Table: Row one shows “Today”. Rows below list up to six prior days. “Ghost OK” shows per-weekday cumulative hits over totals with a percentage, which reflects historical coverage quality for that weekday.
Practical Workflows & Combinations
Trend following: Use the current box plus recent boxes to read expansion or compression days; combine with basic structure such as higher-highs and higher-lows or lower-lows and lower-highs for confirmation.
Exits and risk: When price nears the ghost boundary late in the session, consider managing exposure more conservatively.
Multi-asset and multi-timeframe: Works on minute charts. As a starting point, use five to less than sixty minutes. For cross-checks, pair with a higher timeframe bias filter.
Behavior, Constraints & Performance
Repaint/confirmation: The indicator updates intraday; extremes and ghost position can move while the day is open. Values are finalized on the next local day start.
HTF/security: None used; repaint risk is limited to live-bar movement.
Resources: `max_bars_back` five thousand; arrays are pruned to seven days; the table and color sync run on the last bar; the live ghost updates only in real time.
Known limits: Weekday averages can be unrepresentative during regime shifts, events, or gaps. Day boundaries depend on the UTC offset being set correctly. No alerts are included. The script displays warning labels when the timeframe is below five minutes or at sixty minutes and above.
Sensible Defaults & Quick Tuning
Start with the defaults.
Ghost too aggressive: Lower the percent scale.
Labels overlap: Increase ATR multipliers.
Clutter or performance issues: Hide the table or boxes, or disable the ghost.
Day boundary misaligned: Adjust the UTC offset to your market.
What this indicator is—and isn’t
This is a visualization and context layer for daily extremes and a weekday-based typical span. It does not predict direction, does not manage orders, and is not a complete trading system. Use it alongside market structure, risk controls, and position management.
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
super trader Prosuper trader Pro
super trader Pro
super trader Pro
super trader Pro
super trader Pro
BK AK-13⚔️ BK AK-13 — The Mentor’s 13. Revealed on 11. Command the Band. Punish the Extremes. ⚔️
This is my 11th release—and that matters. 11 is a sacred number to me, so for release eleven I’m doing something I never planned to do: I’m putting my mentor’s secret 13 MA into the open.
For years, this 13-based MA framework was part of our private playbook—quietly doing work behind the scenes. Now I’m handing it to you fully armed, because I believe in karma in, karma out: I took years of wisdom from the market. I took years of wisdom from the men who taught me. This is one of the ways I give back—with structure, respect, and intent.
🎖 Full Credit — Respect the Origin
The core architecture of BK AK-13 is not mine. It stands firmly on the work of DZIV.
What comes from DZIV:
The Heikin Ashi MA engine (MA calculated on HA Open/High/Low/Close)
The multi-MA engine on the HA feed (ALMA / HMA / SMA / RMA / VWMA / WMA / ZLEMA / EMA)
The Body / Wick / Band zone classification for price
The dynamic body & wick clouds that give this structure its clean visual form
If this framework changes the way you see trend and price location, remember the name: DZIV.
On top of his backbone, I forged the BK AK-13 enhancement layer: trend-strength regimes, background modes, structured band-reversal arrows, momentum acceleration dots, extreme pivot markers, historical band-touch rails, the info panel, and a complete alert suite.
And as always, the “AK” in the name is not branding—it’s honor. It belongs to my mentor A.K. His secret 13 MA is the spine of this system, and his obsession with clarity, patience, and zero shortcuts sits behind every decision in this tool. Above that, all glory and gratitude to Gd—the real source of any wisdom, edge, or endurance we have in this game.
🧠 Why “BK AK-13”?
BK — my mark, the house I’m building.
AK — my mentor, the standard I’m still chasing.
13 — his secret moving average, the length that quietly shaped how I see trend, location, and pressure.
For years, 13 stayed off the public record—used, not discussed. Now, on indicator number 11, I’m putting that weapon in the open: 11th release. Sacred number. Secret 13 revealed, not for hype—but as karmic give-back. Karma in. Karma out.
🧱 What BK AK-13 Actually Is
BK AK-13 is a Heikin Ashi MA battle band with a brain and a conscience.
It does three big things:
Builds a smoothed HA-MA band using Heikin Ashi OHLC to create a cleaner, truer band around price.
Maps price into zones: Body, Upper Wick, Lower Wick, Above Band, Below Band—so every bar has a role.
Assigns a trend regime by computing a normalized trend-strength %, classifying the environment as Weak / Normal / Strong / Extreme.
You’re never guessing: Is this real trend or just drift? Am I in the spine, the wick, or off the rails? Is this where I press, fade, or stand down? The band, zones, and regimes answer that for you.
🎨 Visual Architecture — Band, Clouds, Regimes
Body & Wick Clouds (DZIV’s craft)
Body cloud between HA-MA Open & Close.
Wick clouds between body and HA-MA High/Low.
Color follows trend: bull, bear, or neutral.
You’re not decoding noisy candles—you’re reading the spine and skin of the move.
Background Regime Modes (BK layer)
Standard – background always on, soft trend-follow color.
Hybrid (Extreme + Breaks) – lights only on extreme trend states or reversal break events.
Hybrid (Strong/Extreme + Breaks) – shows strong & extreme regimes, darker tone on true extremes.
Breaks Only – background flashes only on reversal arrows.
When the background goes quiet, you’re in ordinary flow. When it lights up, something is strategic, not cosmetic.
🎯 Weapons Inside BK AK-13
⭐ Trend Change Stars
Stars appear when the internal band trend crosses zero: bull star when it flips negative → positive, bear star from positive → negative. They’re your pivot flags for swing shifts when aligned with your higher timeframe bias.
🔁 Band Reversal Arrows — Edge Flip Logic
Not every band tap—only structured reversals:
Reversal Down (short idea): first a break of the upper band, then later, for the first time, a break of the lower band.
Reversal Up (long idea): first a break of the lower band, then later, for the first time, a break of the upper band.
You can require a close outside the band and set a minimum break distance (% of band range) so only real punches count. These arrows mark campaign flips, not noise.
💡 Momentum Acceleration Dots
In strong trend regimes only:
Green dot = trend accelerating in its own direction (uptrend steepening, downtrend deepening).
Red dot = trend decelerating, even if direction hasn’t flipped yet.
They protect you from chasing late when the engine is dying and from staying stubborn when momentum is bleeding out.
⚠ Extreme Pivot Markers
Pivot highs/lows are found with a configurable lookback and only marked when trend strength at that pivot bar is above your threshold. You’ll see ⚠ above likely exhaustion tops in strong bulls and ⚠ below likely exhaustion lows in strong bears—perfect for final scale-outs, countertrend scouts, and knowing where campaigns commonly run out of blood.
📏 Historical Band-Touch Rails
Over your lookback window, BK AK-13 tracks the highest upper band touch and lowest lower band touch, drawing them as dashed rails. They’re dynamic SR built from real band extremes—ideal for trend targets, fade zones, and stop/scale-out context.
🧭 Info Panel — On-Chart War Room
The Info Panel compresses everything into a single strip: direction + strength codes (BULL STR, BEAR EXT, NEUT WEAK), four segments that brighten as |trend| climbs from weak → normal → strong → extreme, and a zone + deviation label (BDY/UW/LW/AB/BL × OK/AL/EX).
Hover and you get a full tactical brief: trend, momentum change, acceleration, band levels, distances to upper/lower/nearest band in ticks, outer-band streaks, strategic state, plus “Action” guidance and a “What-if” forward scenario. It doesn’t just tell you where you are—it pushes you toward a structured thought process on each bar.
🕹 How to Use BK AK-13 with Intent
1️⃣ Trend-Rider Mode
In Strong/Extreme bull with price in Body or Lower Wick: buy dips into the band (mid/lower) instead of chasing tops; target the upper band / upper rail while structure holds.
In Strong/Extreme bear with price in Body or Upper Wick: sell rallies into the band; target lower band / lower rail while acceleration stays healthy.
The band defines where you’re allowed to do business.
2️⃣ Extreme Snapback Hunter
Prime conditions: trend tagged Extreme, price pressed into the outer band in trend direction, strategic state lit + Hybrid background active. That’s where pressing fresh risk often flips from reward to punishment. Use it to stop adding, start harvesting, or launch controlled mean-reversion probes back to the midline—if your system and risk rules allow it.
3️⃣ Exhaustion & Turn Zones
Watch for confluence: red momentum dots, extreme pivot ⚠ markers, a reversal arrow, and a nearby historical rail or your own key level (Fibs, VWAP, volume structure, etc.). That’s where campaigns often end, traps are set, and new campaigns begin.
🔔 Alerts — The Chart Calls You
Included alerts: Bullish/Bearish Trend Change, Strategic Extreme at Outer Band, Reversal Up/Down, Extreme Pivot High/Low, and Body Zone Entry during Strong Trend. Use them so you respond to events, not impulses.
🔧 Tuning the Extremes — Help Me Perfect the Advanced Side
The extreme thresholds and advanced features are powerful but sensitive, and there is no single perfect universal setting. I’m still tuning them myself across instruments and timeframes: strong/extreme trend thresholds, extreme background thresholds, momentum acceleration threshold, pivot lookback + pivot trend filter, band-touch lookback, and minimum break distance for reversals.
Different markets and timeframes breathe differently.
If you find killer settings for a specific symbol + timeframe, please share:
Instrument & timeframe
Your tuned values for extremes and advanced modules
A few charts showing why they work
Experiment. Dial it in. Then share your best settings for the extremes and advanced features. Let this become a crowd-forged battle manual: I gave you the engine, you tune it to your battleground, and we all benefit from what’s discovered in live fire. Karma in. Karma out.
🤝 Pay It Forward
If BK AK-13 sharpens your read, don’t just flex screenshots—teach structure. Show newer traders body vs wick vs edge. Talk about when you didn’t take a trade because the band said “danger,” not just the wins. Share your settings, charts, and lessons—especially around the extremes and advanced modules. I’m sharing a mentor’s secret on release 11 for a reason. If it blesses you, don’t let it stop with you.
📜 King Solomon’s Lens
King Solomon said: “The prudent sees danger and hides himself, but the simple go on and suffer for it.”
BK AK-13 is built exactly around that dividing line: the simple chase candles at the outer band in extreme regimes and get punished; the prudent see danger in the structure, hide their size, hedge, or reverse with intent.
This indicator won’t make you prudent. It just removes your excuse for being simple.
⚔️ BK AK-13 — The mentor’s secret 13, revealed on 11. Let the band define the field. Let wisdom define your strike.
May Gd bless your eyes, your patience, your settings, and every decision you make at the edge. 🙏
ScalpGawd Risk Reward//@version=5
indicator("ScalpGawd Risk Reward", overlay=true)
i_fromDate = input.time(timestamp("2024-02-01T00:00:00"), title="Entry Time")
i_entryPrice = input.float(4000, "Entry Price")
i_slPrice = input.float(3900, "Stop Loss Price")
i_distance = input.int(100, "Horizontal Distance (in Time Units)", group="Styling")
i_entryColor = input.color(color.white, "Entry Line", inline="Entry", group="Styling")
i_entryStyle = input.string("solid", title="", options= , inline="Entry", group="Styling")
i_entryWidth = input.int(1, "", inline="Entry", group="Styling")
i_slColor = input.color(color.red, "SL Line", inline="SL", group="Styling")
i_slStyle = input.string("solid", title="", options= , inline="SL", group="Styling")
i_slWidth = input.int(2, "", inline="SL", group="Styling")
i_tpColor = input.color(color.green, "TP Line", inline="TP", group="Styling")
i_tpStyle = input.string("solid", title="", options= , inline="TP", group="Styling")
i_tpWidth = input.int(2, "", inline="TP", group="Styling")
i_labelSize = input.string("tiny", "Label Size", options= , group="Label")
i_labelOffset = input.int(2, "Label Offset", group="Label")
i_useTP1 = input.bool(true, "1", inline="1", group="Show Take Profit")
i_useTP2 = input.bool(true, "2", inline="1", group="Show Take Profit")
i_useTP3 = input.bool(true, "3", inline="1", group="Show Take Profit")
i_useTP4 = input.bool(true, "4", inline="1", group="Show Take Profit")
i_useTP5 = input.bool(true, "5", inline="1", group="Show Take Profit")
i_useTP6 = input.bool(true, "6", inline="1", group="Show Take Profit")
i_useTP7 = input.bool(true, "7", inline="1", group="Show Take Profit")
i_useTP8 = input.bool(true, "8", inline="1", group="Show Take Profit")
i_useTP9 = input.bool(true, "9", inline="1", group="Show Take Profit")
i_useTP10 = input.bool(true, "10", inline="1", group="Show Take Profit")
var int barDistance = na
if bar_index < 2
barDistance := time - time
else
barDistance := math.min(barDistance, time - time )
int distanceInTime = barDistance * i_distance
var line entryLine = na, line.delete(entryLine)
var line stopLossLine = na, line.delete(stopLossLine)
var line tpLine1 = na, line.delete(tpLine1)
var line tpLine2 = na, line.delete(tpLine2)
var line tpLine3 = na, line.delete(tpLine3)
var line tpLine4 = na, line.delete(tpLine4)
var line tpLine5 = na, line.delete(tpLine5)
var line tpLine6 = na, line.delete(tpLine6)
var line tpLine7 = na, line.delete(tpLine7)
var line tpLine8 = na, line.delete(tpLine8)
var line tpLine9 = na, line.delete(tpLine9)
var line tpLine10 = na, line.delete(tpLine10)
var label entryLabel = na, label.delete(entryLabel)
var label slLabel = na, label.delete(slLabel)
var label tpLabel1 = na, label.delete(tpLabel1)
var label tpLabel2 = na, label.delete(tpLabel2)
var label tpLabel3 = na, label.delete(tpLabel3)
var label tpLabel4 = na, label.delete(tpLabel4)
var label tpLabel5 = na, label.delete(tpLabel5)
var label tpLabel6 = na, label.delete(tpLabel6)
var label tpLabel7 = na, label.delete(tpLabel7)
var label tpLabel8 = na, label.delete(tpLabel8)
var label tpLabel9 = na, label.delete(tpLabel9)
var label tpLabel10 = na, label.delete(tpLabel10)
float i_tp1Price = i_entryPrice + (i_entryPrice - i_slPrice)
float i_tp2Price = i_entryPrice + (i_entryPrice - i_slPrice) * 2
float i_tp3Price = i_entryPrice + (i_entryPrice - i_slPrice) * 3
float i_tp4Price = i_entryPrice + (i_entryPrice - i_slPrice) * 4
float i_tp5Price = i_entryPrice + (i_entryPrice - i_slPrice) * 5
float i_tp6Price = i_entryPrice + (i_entryPrice - i_slPrice) * 6
float i_tp7Price = i_entryPrice + (i_entryPrice - i_slPrice) * 7
float i_tp8Price = i_entryPrice + (i_entryPrice - i_slPrice) * 8
float i_tp9Price = i_entryPrice + (i_entryPrice - i_slPrice) * 9
float i_tp10Price = i_entryPrice + (i_entryPrice - i_slPrice) * 10
f_getStyle(_style) =>
ret = line.style_solid
if _style == "dotted"
ret := line.style_dotted
else if _style == "dashed"
ret := line.style_dashed
ret
f_getLabelSize() =>
ret = size.normal
if i_labelSize == "small"
ret := size.small
else if i_labelSize == "tiny"
ret := size.tiny
ret
entryLine := line.new(i_fromDate, i_entryPrice, i_fromDate + distanceInTime, i_entryPrice, xloc=xloc.bar_time, color=i_entryColor, width=i_entryWidth, style=f_getStyle(i_entryStyle))
stopLossLine := line.new(i_fromDate, i_slPrice, i_fromDate + distanceInTime, i_slPrice, xloc=xloc.bar_time, color=i_slColor, width=i_slWidth, style=f_getStyle(i_slStyle))
tpLine1 := i_useTP1 ? line.new(i_fromDate, i_tp1Price, i_fromDate + distanceInTime, i_tp1Price, xloc=xloc.bar_time, color=i_tpColor, width=i_tpWidth, style=f_getStyle(i_tpStyle)) : na
tpLine2 := i_useTP2 ? line.new(i_fromDate, i_tp2Price, i_fromDate + distanceInTime, i_tp2Price, xloc=xloc.bar_time, color=i_tpColor, width=i_tpWidth, style=f_getStyle(i_tpStyle)) : na
tpLine3 := i_useTP3 ? line.new(i_fromDate, i_tp3Price, i_fromDate + distanceInTime, i_tp3Price, xloc=xloc.bar_time, color=i_tpColor, width=i_tpWidth, style=f_getStyle(i_tpStyle)) : na
tpLine4 := i_useTP4 ? line.new(i_fromDate, i_tp4Price, i_fromDate + distanceInTime, i_tp4Price, xloc=xloc.bar_time, color=i_tpColor, width=i_tpWidth, style=f_getStyle(i_tpStyle)) : na
tpLine5 := i_useTP5 ? line.new(i_fromDate, i_tp5Price, i_fromDate + distanceInTime, i_tp5Price, xloc=xloc.bar_time, color=i_tpColor, width=i_tpWidth, style=f_getStyle(i_tpStyle)) : na
tpLine6 := i_useTP6 ? line.new(i_fromDate, i_tp6Price, i_fromDate + distanceInTime, i_tp6Price, xloc=xloc.bar_time, color=i_tpColor, width=i_tpWidth, style=f_getStyle(i_tpStyle)) : na
tpLine7 := i_useTP7 ? line.new(i_fromDate, i_tp7Price, i_fromDate + distanceInTime, i_tp7Price, xloc=xloc.bar_time, color=i_tpColor, width=i_tpWidth, style=f_getStyle(i_tpStyle)) : na
tpLine8 := i_useTP8 ? line.new(i_fromDate, i_tp8Price, i_fromDate + distanceInTime, i_tp8Price, xloc=xloc.bar_time, color=i_tpColor, width=i_tpWidth, style=f_getStyle(i_tpStyle)) : na
tpLine9 := i_useTP9 ? line.new(i_fromDate, i_tp9Price, i_fromDate + distanceInTime, i_tp9Price, xloc=xloc.bar_time, color=i_tpColor, width=i_tpWidth, style=f_getStyle(i_tpStyle)) : na
tpLine10 := i_useTP10 ? line.new(i_fromDate, i_tp10Price, i_fromDate + distanceInTime, i_tp10Price, xloc=xloc.bar_time, color=i_tpColor, width=i_tpWidth, style=f_getStyle(i_tpStyle)) : na
entryLabel := label.new(i_fromDate + barDistance * i_labelOffset, i_entryPrice, text="Entry @ " + str.tostring(i_entryPrice, '#.##'), xloc=xloc.bar_time, yloc=yloc.price, textcolor=i_entryColor, style=label.style_none,textalign = text.align_center, size=f_getLabelSize())
slLabel := label.new(i_fromDate + barDistance * i_labelOffset, i_slPrice, text="Stop Loss " + str.tostring((i_slPrice - i_entryPrice) / syminfo.mintick, "#")+ " Ticks @ " + str.tostring(i_slPrice, '#.##'), xloc=xloc.bar_time, yloc=yloc.price, textcolor=i_slColor, style=label.style_none,textalign = text.align_center, size=f_getLabelSize())
tpLabel1 := i_useTP1 ? label.new(i_fromDate + barDistance * i_labelOffset, i_tp1Price, text="Target 1 " + str.tostring((i_tp1Price - i_entryPrice) / syminfo.mintick, "#")+ " Ticks @ " + str.tostring(i_tp1Price, '#.##'), xloc=xloc.bar_time, yloc=yloc.price, textcolor=i_tpColor, style=label.style_none,textalign = text.align_center, size=f_getLabelSize()) : na
tpLabel2 := i_useTP2 ? label.new(i_fromDate + barDistance * i_labelOffset, i_tp2Price, text="Target 2 " + str.tostring((i_tp2Price - i_entryPrice) / syminfo.mintick, "#")+ " Ticks @ " + str.tostring(i_tp2Price, '#.##'), xloc=xloc.bar_time, yloc=yloc.price, textcolor=i_tpColor, style=label.style_none,textalign = text.align_center, size=f_getLabelSize()) : na
tpLabel3 := i_useTP3 ? label.new(i_fromDate + barDistance * i_labelOffset, i_tp3Price, text="Target 3 " + str.tostring((i_tp3Price - i_entryPrice) / syminfo.mintick, "#")+ " Ticks @ " + str.tostring(i_tp3Price, '#.##'), xloc=xloc.bar_time, yloc=yloc.price, textcolor=i_tpColor, style=label.style_none,textalign = text.align_center, size=f_getLabelSize()) : na
tpLabel4 := i_useTP4 ? label.new(i_fromDate + barDistance * i_labelOffset, i_tp4Price, text="Target 4 " + str.tostring((i_tp4Price - i_entryPrice) / syminfo.mintick, "#")+ " Ticks @ " + str.tostring(i_tp4Price, '#.##'), xloc=xloc.bar_time, yloc=yloc.price, textcolor=i_tpColor, style=label.style_none,textalign = text.align_center, size=f_getLabelSize()) : na
tpLabel5 := i_useTP5 ? label.new(i_fromDate + barDistance * i_labelOffset, i_tp5Price, text="Target 5 " + str.tostring((i_tp5Price - i_entryPrice) / syminfo.mintick, "#")+ " Ticks @ " + str.tostring(i_tp5Price, '#.##'), xloc=xloc.bar_time, yloc=yloc.price, textcolor=i_tpColor, style=label.style_none,textalign = text.align_center, size=f_getLabelSize()) : na
tpLabel6 := i_useTP6 ? label.new(i_fromDate + barDistance * i_labelOffset, i_tp6Price, text="Target 6 " + str.tostring((i_tp6Price - i_entryPrice) / syminfo.mintick, "#")+ " Ticks @ " + str.tostring(i_tp6Price, '#.##'), xloc=xloc.bar_time, yloc=yloc.price, textcolor=i_tpColor, style=label.style_none,textalign = text.align_center, size=f_getLabelSize()) : na
tpLabel7 := i_useTP7 ? label.new(i_fromDate + barDistance * i_labelOffset, i_tp7Price, text="Target 7 " + str.tostring((i_tp7Price - i_entryPrice) / syminfo.mintick, "#")+ " Ticks @ " + str.tostring(i_tp7Price, '#.##'), xloc=xloc.bar_time, yloc=yloc.price, textcolor=i_tpColor, style=label.style_none,textalign = text.align_center, size=f_getLabelSize()) : na
tpLabel8 := i_useTP8 ? label.new(i_fromDate + barDistance * i_labelOffset, i_tp8Price, text="Target 8 " + str.tostring((i_tp8Price - i_entryPrice) / syminfo.mintick, "#")+ " Ticks @ " + str.tostring(i_tp8Price, '#.##'), xloc=xloc.bar_time, yloc=yloc.price, textcolor=i_tpColor, style=label.style_none,textalign = text.align_center, size=f_getLabelSize()) : na
tpLabel9 := i_useTP9 ? label.new(i_fromDate + barDistance * i_labelOffset, i_tp9Price, text="Target 9 " + str.tostring((i_tp9Price - i_entryPrice) / syminfo.mintick, "#")+ " Ticks @ " + str.tostring(i_tp9Price, '#.##'), xloc=xloc.bar_time, yloc=yloc.price, textcolor=i_tpColor, style=label.style_none,textalign = text.align_center, size=f_getLabelSize()) : na
tpLabel10 := i_useTP10 ? label.new(i_fromDate + barDistance * i_labelOffset, i_tp10Price, text="Target 10 " + str.tostring((i_tp10Price - i_entryPrice) / syminfo.mintick, "#")+ " Ticks @ " + str.tostring(i_tp10Price, '#.##'), xloc=xloc.bar_time, yloc=yloc.price, textcolor=i_tpColor, style=label.style_none,textalign = text.align_center, size=f_getLabelSize()) : na
i_showBox = input.bool(true, "Show Background", group="Show Background")
var box greenBox = na, box.delete(greenBox)
var box redBox = na, box.delete(redBox)
f_findHighestTP() =>
ret = i_tp1Price
if i_useTP10
ret := i_tp10Price
else if i_useTP9
ret := i_tp9Price
else if i_useTP8
ret := i_tp8Price
else if i_useTP7
ret := i_tp7Price
else if i_useTP6
ret := i_tp6Price
else if i_useTP5
ret := i_tp5Price
else if i_useTP4
ret := i_tp4Price
else if i_useTP3
ret := i_tp3Price
else if i_useTP2
ret := i_tp2Price
ret
greenBox := i_showBox ? box.new(i_fromDate, i_entryPrice, i_fromDate + distanceInTime, f_findHighestTP(), xloc=xloc.bar_time, bgcolor=color.new(i_tpColor, 70), border_width = 0) : na
redBox := i_showBox ? box.new(i_fromDate, i_entryPrice, i_fromDate + distanceInTime, i_slPrice, xloc=xloc.bar_time, bgcolor=color.new(i_slColor, 70), border_width = 0) : na






















