Pine Script® indicator
Indicators and strategies
Price Simplification [LuxAlgo]The Price Simplification indicator provides a streamlined representation of price action by reducing complex market movements into essential trend segments using the Ramer-Douglas-Peucker (RDP) algorithm.
This indicator calculates its output based on a fixed window of historical data. Consequently, the line segments are displayed retrospectively and are subject to repainting as new bars develop and the calculation window shifts.
🔶 USAGE
The indicator is designed to help traders identify the core structure of price movement by filtering out "noise"—small fluctuations that do not significantly impact the overall trend. By simplifying the price into a series of connected segments, it becomes easier to visualize support/resistance levels, trend slopes, and market geometry.
Users can adjust the level of simplification to suit their needs:
A lower ATR Multiplier will result in a line that follows price closely, capturing more minor swings.
A higher ATR Multiplier will produce a more aggressive simplification, highlighting only the most significant market turns.
🔹 Extension Line
The script includes an "Extend Last Segment" feature. When enabled, it projects the trajectory of the final simplified segment into the future using a dashed line. This projection begins one bar after the most recent data point, providing a visual guide for the current price momentum without overlapping the historical simplification.
🔶 DETAILS
The core logic of this tool relies on the Ramer-Douglas-Peucker (RDP) algorithm, a classic algorithm used in computer graphics and cartography to reduce the number of points in a curve.
The algorithm works through an iterative process:
It starts with a line segment connecting the first and last points of the lookback window.
It identifies the point between these two ends that is furthest from the segment (perpendicular distance).
If this maximum distance is greater than a specified threshold, that point is kept as a "key point," and the algorithm splits the segment into two parts, repeating the process for each.
If no point is further than the threshold, all intermediate points are discarded, and the segment remains a straight line.
To ensure the simplification remains consistent across different assets and timeframes, the script normalizes price coordinates using the Average True Range (ATR) . This means the threshold for keeping a point is relative to the current market volatility rather than a fixed price value.
🔶 SETTINGS
Window Size : The number of recent bars used to apply the RDP algorithm to.
ATR Multiplier : The sensitivity of the simplification. Higher values lead to fewer segments and a simpler line.
ATR Length : The period used to calculate the ATR for price normalization.
Line Color : The color of the simplified polyline.
Line Width : The thickness of the polyline and extension.
Extend Last Segment : When enabled, projects the slope of the final segment forward as a dashed line starting one bar after the last point.
Pine Script® indicator
One Candle TargetThis One Candle Target (OCT) indicator is Based on Formation of Candles.
- This indicator gives Target in Only a candle or takes few candles...Nearest Target will be Previous Candles High/Lows.
- It work in Every Time frame equally, But I suggest to use it in Higher Timeframes for Better Accuracy.
- This indicator gives better result(RRR) if you enter along with Higher Timeframe Trends.
- For more accuracy use it for Entry Confirmation.
The Best thing of our Indicator is that....
We gives you multiple Options in Indicator setting so you can modify it according to your Trading Style.
Know the Setting option here...
1. No. of candles is by default 2 but you can use it at 3 for wonderful result.
2. Enable min close position means Current candle should be min X% of previous candle. (eg--> 0.3=30%)
3. Enable max size means Current candle should be max X% of previous candle.(eg--> 0.5=50%)
4. Required index2 size means Check Prev candle(index1) is smaller than Before Prev candle(index2) {ignore signal}
5. Check for if Pre candle is Doji (ignore signal)
6 and 7. Check prev candle's low/high is taken by current candle.
There are many styles for Bull/Bear signals that you can choose.
For Better result use it on FOREXCOM:XAUUSD , COINBASE:BTCUSD , FX:EURUSD and Major Currency Crypto Pairs.
This is amazing indicator for Quick Targets.
Follow for more wonderful indicators, and Show some loves to motivate us.
Thanks me Later
Pine Script® indicator
Volume Grid Heatmap [LuxAlgo]The Volume Grid Heatmap indicator provides a two-dimensional visualization of volume distribution across both price and time, allowing traders to identify areas of high liquidity and intense trading activity within a specific lookback period.
By partitioning the historical price action into a customizable grid, this tool maps volume data onto specific price-time coordinates, using heatmap color gradients to highlight "hot zones" where the most significant market participation has occurred.
🔶 USAGE
The indicator is primarily used to identify institutional activity, support/resistance zones, and liquidity clusters that might not be visible on a standard volume histogram.
🔹 Identifying High Activity Zones
Brightly colored cells in the heatmap represent areas where a high volume of shares or contracts changed hands at a specific price during a specific time interval. These zones often act as significant magnets for future price action or areas where price may find temporary friction.
🔹 Volume Distribution
Unlike a standard Volume Profile which only shows volume by price, the Grid Heatmap shows how that volume was distributed over time. Users can see if a high-volume price level was formed by a single massive spike (a single bright cell) or by consistent trading over a longer duration (a horizontal row of highlighted cells).
🔶 DETAILS
The script operates by dividing the recent price range (Highest High to Lowest Low over the lookback period) into a user-defined number of rows and columns.
For every bar within the lookback:
The script calculates the volume for that bar.
It distributes that volume across the grid rows based on the price overlap of the bar's high and low relative to the grid cell boundaries.
The volume is then aggregated into the corresponding time column.
Finally, the grid is normalized against the maximum volume found in any single cell, and colors are applied using professional perceptually uniform colormaps.
🔶 SETTINGS
🔹 Grid Settings
Lookback Bars: Determines the historical window of bars used to calculate the price range and volume data.
Rows (Price): Defines the vertical resolution of the grid. More rows provide more precise price-level analysis.
Columns (Time): Defines the horizontal resolution of the grid. More columns provide more precise timing of volume spikes.
🔹 Visuals
Heatmap Theme: Selects the color palette used for the gradient (Viridis, Inferno, Magma, Plasma, Cividis, or Turbo).
Transparency: Adjusts the visibility of the grid cells to ensure the underlying price action remains clear.
Pine Script® indicator
USTEC Trade Assistant v4USTEC Trade Assistant v4 - Complete User Guide
English Version (TradingView Publication)
🎯 OVERVIEW
USTEC Trade Assistant v4 is a comprehensive probability-based trading system designed specifically for USTEC (NAS100/US Tech 100) traders using the BOX strategy. This indicator combines multi-factor analysis, risk-reward calculations, and liquidity sweep detection to provide clear GO/READY/CONDITIONAL/WAIT signals.
Core Philosophy:
USTEC has a structural 70% long bias
The market decides, not the indicator
Quality over quantity - GO only when RR + Confirmation align
US500 levels provide context, not roadblocks
📊 KEY FEATURES
v4.0 Phase 1A Features (RR Engine)
Dual Target RR Calculation: Midpoint (conservative) + Full Range (aggressive)
GO Gate System: GO requires RR_mid ≥ 1.5 AND candle confirmation
READY State: "Potential GO but blocked" with specific reason flags
Dynamic Stop Placement: ATR-based buffer system
Block Reason Display: READY(RR) / READY(CONF) / READY(RR+CONF)
WAIT State: Explicit midpoint dead zone blocking
v4.0 Phase 1B Features (Liquidity Sweep Detection)
Sweep Detection: Identifies when price sweeps through key levels
Sweep Confirmation: Distinguishes setup events from committed sweeps
Sweep-Aware Stops: Places stops behind sweep wicks with extra buffer
Alternative Confirmation: Sweep can replace reversal candle requirement
Noise Filtering: ATR-based minimum range + commitment filters
v3.0 Base Features (Probability System)
Weighted Probability Score: 6 factors, 0-100% scale
SP500 Context Integration: Levels as confluence, not obstacles
Built-in Long Bias: Reflects USTEC's 70% bullish characteristic
Previous Day Type Analysis: Trend vs range day detection
Opening Drive Detection: Gap analysis and bias formation
Session Management: Hold/close/re-enter logic with momentum analysis
🎲 SIGNAL TYPES
✅ GO (Green)
All conditions met for high-probability entry:
Probability score ≥ GO threshold (default 70%)
At valid entry level (PDH/PDL/PWH/PWL/PMH/PML)
RR to midpoint ≥ 1.5 (when RR filter enabled)
Candle confirmation present (reversal OR sweep confirmed)
NOT at midpoint dead zone
Action: Execute trade with displayed RR and stop levels
🔵 READY (Deep Sky Blue)
High probability but blocked by specific condition(s):
READY(RR): Good setup but RR < 1.5 - wait for better entry closer to level
READY(CONF): Good RR but no candle confirmation - wait for reversal or sweep
READY(RR+CONF): Both blocked - too early, be patient
Action: Wait and monitor. Micro-advice provided in table.
Example Scenarios:
Price 30pts from PDL, probability 75%, but RR only 1.2 → READY(RR) - "wacht op betere RR / dichter bij level"
Price AT PDL, probability 80%, RR 2.5, but no hammer candle → READY(CONF) - "wacht op reversal candle"
Sweep wick detected but close not committed → READY(CONF) - "sweep gezien - wacht op reclaim close"
⚫ WAIT (Gray)
At midpoint dead zone:
Price within midpoint zone (±50pts default)
Midpoint is TARGET, never an entry point
No entries allowed regardless of other factors
Action: Do not enter. Wait for price to reach PDH/PDL or other key levels.
⚠️ CONDITIONAL (Orange)
Moderate probability, needs confirmation:
Probability ≥ 50% but < 70%
Near entry level (within 100pts) but not at level yet
OR at level but probability below GO threshold
Action: Wait for better setup or additional confirmation
🔴 NO SETUP (Red)
No valid trading opportunity:
Probability < 50%
Not near any entry level
In middle of range with no clear direction
Action: Stay out, wait for better conditions
📐 RR ENGINE (v4 Phase 1A)
Dual Target System
Primary Target: Midpoint
Conservative, high-probability target
Used for GO signal RR requirement
Minimum RR 1.5 to midpoint for GO
Secondary Target: Full Range
Aggressive target (opposite PD level)
PDL entries → target PDH
PDH entries → target PDL
Higher RR but lower probability
Stop Placement Logic
Priority System:
- Sweep Stop (when sweep confirmed):
- Behind sweep wick low/high
- Standard buffer
- Extra sweep buffer (default 7pts)
- Total protection from wick wiggle
Structure Stop (fallback):
- Behind nearest key level
- Dynamic buffer (max of):
- Minimum pts (default 15)
- ATR(14) × multiplier (default 0.30)
Entry Price for RR:
- Normal setups: Current close
- Sweep setups: Average of (level price + close) for realistic RR
RR Display in Table
📐 RR(mid) | 2.15 ✅ | RR(full) | 4.30
🛡️ STOP | SWEEP 21420| CONF | ✅ 🔥 SWEEP
RR(mid): Risk-reward to midpoint with ✅/❌ status
RR(full): Risk-reward to full range target
STOP: Type (SWEEP/LEVEL) + price
CONF: Confirmation source (SWEEP/reversal pattern/waiting)
🌊 LIQUIDITY SWEEP DETECTION (v4 Phase 1B)
What is a Liquidity Sweep?
A liquidity sweep occurs when:
Price briefly breaks through a key level (triggers stops)
Then immediately reclaims the level in opposite direction
Creates a long wick (≥60% of candle range)
Body closes beyond the level (commitment)
Classic Example:
- PDL at 21,450
- Candle low touches 21,430 (breaks PDL by 20pts)
- Candle closes at 21,470 (reclaims PDL)
- Lower wick = 40pts (66% of 60pt candle range)
- Result: Bullish liquidity sweep → strong LONG signal
Sweep Detection vs Sweep Confirmed
👀 Sweep Detected:
- Wick ≥60% of candle range
- Level breached and reclaimed
- Minimum candle range met (ATR-based)
- Shows in label as "👀 SWEEP?"
🔥 Sweep Confirmed:
- All detection criteria +Directional close (bullish/bearish)
- Close in strong zone (>70% or <30% of range)
- Shows in label as "🔥 SWEEP"
- Qualifies as GO confirmation
Sweep as Confirmation Source
Sweep Confirmed can replace reversal candle requirement:
Traditional: GO = Probability + RR + Hammer/Engulfing
v4 Alternative: GO = Probability + RR + Sweep Confirmed
Both are equally valid confirmation types.
Sweep-Aware Stop Placement
When sweep confirmed:
Stop = Sweep Wick Low/High
+ Standard Buffer (max of min pts or ATR×mult)
+ Extra Sweep Buffer (default 7pts)
Example:
- Sweep wick low: 21,430
- ATR(14): 80pts → Buffer: 80×0.30 = 24pts (vs min 15pts) → use 24pts
- Extra sweep buffer: 7pts
- Final Stop: 21,430 - 24 - 7 = 21,399
This protects against wick wiggle and re-test.
Noise Filtering
Filter 1: Minimum Candle Range
Min Range = max(ATR × 0.5, 25pts)
Prevents tiny candles from triggering false sweeps.
Filter 2: Context Check
Only at/near entry levels (not in middle of range)
Not at midpoint dead zone
Aligned with trade direction (LONG sweeps at support, SHORT at resistance)
Filter 3: Commitment Filter
Close must be directional (bullish for LONG, bearish for SHORT)
Close position in range must show commitment (>70% or <30%)
⚖️ 6-FACTOR PROBABILITY SYSTEM
Factor 1: Entry Level Proximity (0-30 points)
What it measures: How close is price to a tradeable level?
Scoring:
At level (within 50pts): Full weight × level multiplier
Near level (50-100pts): 50% × level multiplier
In range: Linear decay based on distance
At midpoint: 0 points (dead zone)
Level Multipliers:
PD levels (PDH/PDL): 1.0×
PW levels (PWH/PWL): 1.3× (stronger)
PM levels (PMH/PML): 1.5× (strongest)
Display:
✅ At PDL (LONG) - green
🔶 Near PWH - orange
⚫ At Midpoint - gray (blocking)
⬜ In range - white
Factor 2: Bias Alignment (0-20 points)
What it measures: Does daily candle bias match trade direction?
Live Daily Bias Detection:
BULLISH: Bullish engulfing, hammer, strong bull body (>70%), high close
LIGHT BULL: Moderate bullish signals
NEUTRAL: Doji, inside bar, mixed signals
LIGHT BEAR: Moderate bearish signals
BEARISH: Bearish engulfing, shooting star, strong bear body, low close
Scoring:
Bias matches direction: Full 20 points
Neutral bias + LONG: 50% (10pts) - reflects 70% long bias
Neutral bias + SHORT: 30% (6pts)
Opposite bias: 0 points
LONG Bias Bonus: +5pts for any LONG trade (structural advantage)
Display:
✅ BULLISH - green check
🔶 LIGHT BULL - orange diamond
❌ BEARISH - red X (for LONG trades)
Bias Change Alert:
When bias shifts (e.g., BEARISH → BULLISH), table shows:
📊 SHIFT | BEARISH → BULLISH
Factor 3: Route to Target (0-20 points)
What it measures: Is the path to midpoint clear?
Philosophy Change (v3+):
OLD: SP500 levels = obstacles = penalty
NEW: SP500 levels = context
At entry = confluence = BONUS (+2pts per level)
On route = mild reduction (-3pts per level)
Level Checking:
USTEC levels: PWH, PWL, PMH, PML
SP500 levels (scaled): PDH, PDL, PWH, PWL, PMH, PML
Icons in Table:
🤝 = Level at entry (confluence)
🛤️ = Level on route (context)
Scoring:
Base: Full 20 points
+ Confluence bonus (up to +5pts)
- Route levels context (mild)
Range too small (<150pts): 0 points
Display:
✅ Route clear - green
🔶 2 level(s) on route + 1 confluence - orange
⚠️ 4 levels on route - red
Factor 4: Previous Day Type (0-10 points)
What it measures: Does yesterday's candle type support today's setup?
Day Types:
TREND ↑/↓: Body ≥70% of range - strong directional day
RANGE: Body ≤40% of range - consolidation day
NORMAL: 40-70% - standard day
Scoring Logic:
After TREND day:
Reversal setup at opposite extreme: Full 10pts
Other setups: 30% (3pts)
After RANGE day:
At entry level (breakout likely): 80% (8pts)
In range: 40% (4pts)
After NORMAL day: 50% (5pts) baseline
Example:
Yesterday: TREND ↑ (strong bullish day)
Today: At PDH for SHORT → 10pts (reversal after trend)
Factor 5: VIX Context (0-10 points)
What it measures: Does VIX regime match expected move?
VIX Regimes:
CALM: VIX < 15 (green 🟢)
NORMAL: VIX 15-20 (yellow 🟡)
ELEVATED: VIX > 20 (red 🔴)
Scoring:
CALM: 80% (8pts) - smaller ranges, midpoint realistic
NORMAL: 100% (10pts) - ideal for BOX strategy
ELEVATED: Full 10pts at entry, 30% (3pts) in middle
VIX Spike Detection:
Daily increase ≥15% from previous close
Applies 50% penalty to VIX score
Shows: "⚠️ SPIKE" in table
Separate alert available
Factor 6: Session Timing (0-10 points)
What it measures: Are you in active trading hours?
Sessions (Amsterdam timezone default):
OVERLAP (13:30-16:00): 100% (10pts) - highest volatility
NEW YORK (15:30-17:30): 90% (9pts)
LONDON (09:00-11:00): 70% (7pts)
DEAD ZONE (11:00-15:30): 0pts
PRE-NY (15:00-15:30): 0pts - liquidity grab risk
OFF HOURS: 0pts
Display:
OVERLAP - gold
NEW YORK - blue
LONDON - green
PRE-NY ⚡ - orange (warning)
DEAD ZONE - gray
📊 PROBABILITY SCORE CALCULATION
Total Score Formula:
Raw Score = F1 + F2 + F3 + F4 + F5 + F6
Max Possible = 30 + 20 + 20 + 10 + 10 + 10 = 100
Probability % = (Raw Score / Max Possible) × 100
Thresholds (adjustable):
GO: ≥70% (default)
CONDITIONAL: 50-69% (default)
NO SETUP: <50%
Note: These are BASE thresholds. v4 GO Gate requires BOTH probability AND RR + confirmation.
🎯 SESSION MANAGEMENT ADVICE
Purpose: Help decide whether to hold London entry through NY, close pre-NY, or re-enter.
Key Metrics:
Progress to Midpoint: How far has price moved toward target?
Momentum: Body/Range ratio (>0.30 = directional, <0.30 = consolidating)
Session Context: London, Dead Zone, Pre-NY, NY
Decision Matrix:
During London or Dead Zone:
Progress ≥50% + Momentum → "HOLD → NY follow-up likely" 🏃 (green)
Progress ≥50% + Consolidating → "TRAIL TIGHT → momentum fading" ⚡ (orange)
Progress <50% + Consolidating → "CLOSE pre-NY → liq grab risk" 🛑 (red)
Progress <50% + Momentum → "HOLD → watch pre-NY zone" 👀 (orange)
During Pre-NY (15:00-15:30):
Progress ≥80% → "HOLD → close to target" 🎯 (green)
Consolidating → "CLOSE → liq grab zone!" ⚠️ (red)
Otherwise → "TRAIL BE → protect gains" 🛡️ (orange)
During NY:
Progress ≥50% → "CONTINUATION → let it run" 🚀 (green)
Otherwise → "RE-ENTRY possible on setup" 🔄 (orange)
Display in Table:
🏃 MANAGE | HOLD → NY follow-up likely | 65% to Mid
🕯️ REVERSAL CANDLE DETECTION
Bearish Patterns (SHORT entries):
Shooting Star: Bearish + upper wick ≥2× body + small lower wick
Bearish Engulfing: Engulfs previous bullish candle (1.2× min ratio)
Bearish Pin Bar: Upper wick ≥60% range, body ≤30% range
Bullish Patterns (LONG entries):
Hammer: Bullish + lower wick ≥2× body + small upper wick
Bullish Engulfing: Engulfs previous bearish candle (1.2× min ratio)
Bullish Pin Bar: Lower wick ≥60% range, body ≤30% range
Combo Detection:
When multiple patterns occur simultaneously:
🔥 COMBO ↑ - extra strong signal
Confirmation Logic:
LONG setup: Requires bullish pattern at PDL/PWL/PML
SHORT setup: Requires bearish pattern at PDH/PWH/PMH
v4: Sweep Confirmed can replace reversal candle
🎨 TABLE DISPLAY
Row Structure
Header:
🎯 TRADE ASSISTANT v4 © Kiem Online
Main Signal Row:
✅ GO 78% 🔺 PDL
🔵 READY(CONF) 72% 🔺 PDL
⚫ WAIT(MIDPOINT)
Micro-Advice (READY/WAIT only):
💡 wacht op reversal candle
⛔ midpoint is target, geen entry
Factor Breakdown:
FACTOR | SCORE | MAX | STATUS
📍 Entry | 25.5 | 30 | ✅ At PDL (LONG)
📊 Bias | 20.0 | 20 | ✅ BULLISH
🛤️ Route | 18.0 | 20 | ✅ Route clear + 2 confluence
📅 Prev Day | 8.0 | 10 | RANGE
📈 VIX | 10.0 | 10 | 🟡 17.45 NORMAL
🕐 Session | 10.0 | 10 | OVERLAP
RR Engine (v4):
📐 RR(mid) | 2.15 ✅ | RR(full) | 4.30
🛡️ STOP | SWEEP 21420 | CONF | ✅ 🔥 SWEEP
Session Management:
🏃 MANAGE | HOLD → NY follow-up likely | 65% to Mid
Context Info:
US500 | 5,845.3 | Range: | 185 pts
MIDPOINT | 21,485 | +35 pts| Target ↑
OPEN | Below PDL| Bias: | Bullish Engulfing
Bias Change (when applicable):
📊 SHIFT | BEARISH → BULLISH
Candle Pattern (when present):
🕯️ CANDLE | 🔥 COMBO ↑
US500 Reference Levels:
S5-PDH | 5,892.1 | +46.8 | 🤝
S5-PDL | 5,798.5 | -46.8 | 🛤️
🤝 = At entry (confluence)
🛤️ = On route (context)
⚙️ INPUT SETTINGS
Display Settings
Show Info Table: Enable/disable table overlay
Table Position: 6 positions available
Table Size: Tiny to Huge (default: Small)
Show US500 Lines: Optional level lines on chart
Show Probability Label: Chart label with signal
Label Offset: Distance from price (bars)
Probability Weights (customize scoring)
Entry Level: 0-30 (default 30)
Bias Alignment: 0-20 (default 20)
Route to Target: 0-20 (default 20)
Previous Day Type: 0-10 (default 10)
VIX Context: 0-10 (default 10)
Session Timing: 0-10 (default 10)
Custom Strategy Example:
If you want to emphasize bias over entry proximity:
Entry Level: 20
Bias Alignment: 30
(Rebalances to match your trading style)
Probability Thresholds
GO Threshold: 50-90% (default 70%)
CONDITIONAL Threshold: 30-70% (default 50%)
US500 Data Source
CAPITALCOM:US500 (default)
OANDA:SPX500USD
FOREXCOM:SPXUSD
TVC:SPX
SP:SPX
Choose based on your broker's data quality.
VIX Thresholds
Calm Max: <15 (default)
Elevated Min: >20 (default)
Daily Spike Threshold: 15% (default)
Enable Daily Spike Detection: On/Off
BOX Parameters
Min Range Size: 50-300pts (default 150) - minimum valid BOX size
Entry Zone Size: 20-100pts (default 50) - "at level" tolerance
Midpoint Dead Zone: 20-100pts (default 50) - no-entry buffer
RR Engine & Risk (v4)
Enable RR Filter for GO: On/Off (default On)
When OFF: GO based on probability only (v3 behavior)
When ON: GO requires RR ≥ minimum
Min RR to Midpoint for GO: 1.0-5.0 (default 1.5)
Show RR Row in Table: On/Off (default On)
Stop Buffer Min: 5-50pts (default 15)
ATR Multiplier for Buffer: 0.1-1.0 (default 0.30)
Require Candle Confirmation: On/Off (default On)
When OFF: GO based on probability + RR only
When ON: GO requires reversal OR sweep
Extra Sweep Buffer: 0-30pts (default 7) - v4 Phase 1B
Min Sweep Candle Range: 5-100pts (default 25) - v4 Phase 1B
Session Times
Timezone: Amsterdam (default), London, New York, UTC
London: 09:00-11:00 (adjustable)
NY: 15:30-17:30 (adjustable)
Momentum Threshold: 0.1-0.8 (default 0.30)
Midpoint Progress % for Hold: 20-80% (default 50%)
Reversal Candle Settings
Min Wick/Body Ratio: 1.0-5.0 (default 2.0)
Min Engulfing Ratio: 1.0-3.0 (default 1.2)
Alerts
Enable Alerts: Master switch
Alert on GO Signal: On/Off
Alert on READY Signal: On/Off (v4)
Alert on CONDITIONAL Signal: On/Off
Alert on VIX Spike: On/Off
Alert on Bias Change: On/Off
Colors
Fully customizable colors for all signals and levels
Default: GO=green, READY=deep sky blue, CONDITIONAL=orange, NO SETUP=red, WAIT=gray
🔔 ALERT MESSAGES
GO Alert:
✅ GO 78% 🔺 LONG at PDL
RR(mid): 2.15 | RR(full): 4.30
Stop: 21,420 (SWEEP) | Conf: 🔥 SWEEP
Bias: BULLISH | VIX: 17.45 | Session: OVERLAP
READY Alert (v4):
🔵 READY(CONF) 72% 🔺 LONG near PDL
RR(mid): 2.15 | wacht op reversal candle
Bias: BULLISH | VIX: 17.45
CONDITIONAL Alert:
⚠️ CONDITIONAL 65% 🔺 LONG near PDL
Wait for candle confirmation
Bias: LIGHT BULL | VIX: 17.45
VIX Spike Alert:
⚠️ VIX SPIKE! +18.3%
Bias Change Alert:
📊 BIAS SHIFT: BEARISH → BULLISH | Bullish Engulfing
📈 USAGE WORKFLOW
1. Pre-Market Preparation
Check yesterday's day type (TREND/RANGE/NORMAL)
Note opening position vs PDH/PDL
Check VIX regime and spike alerts
Review US500 level confluence
2. London Session (09:00-11:00)
Monitor Entry Level proximity
Wait for ✅ GO signal (probability + RR + confirmation)
If 🔵 READY: note block reason and wait
If ⚫ WAIT: price at midpoint, no entry
Check Session Management advice
3. Dead Zone (11:00-15:30)
If in trade: follow Session Management advice
Progress ≥50% + momentum → hold
Progress <50% + consolidating → close pre-NY
No new entries during this window
4. Pre-NY Zone (15:00-15:30)
High Risk: Liquidity grab window
If in trade:
Progress ≥80% → hold
Consolidating → close
Otherwise → trail to BE
Avoid new entries unless very strong signal
5. NY Session (15:30-17:30)
New GO signals valid
Continuation of London positions
Re-entry opportunities on setups
Monitor progress to midpoint
6. Post-Trade Review
Check final probability score
Note which factors contributed most
Review RR achieved vs calculated
Log sweep patterns if applicable
🎓 TRADING SCENARIOS
Scenario 1: Classic PDL Reversal
Price: 21,445 (PDL: 21,450)
Signal: ✅ GO 78% 🔺 LONG at PDL
RR(mid): 2.3 | Stop: LEVEL 21,430
Conf: Hammer ↑
Bias: BULLISH
VIX: 16.2 NORMAL
Session: LONDON
Action: Enter LONG
Stop: 21,430
Target 1: 21,510 (Midpoint)
Target 2: 21,580 (PDH - full range)
Scenario 2: Liquidity Sweep Setup (v4)
Price: 21,448 (PDL: 21,450)
Candle: Low 21,428, Close 21,465
Sweep: 🔥 SWEEP confirmed (66% lower wick)
Signal: ✅ GO 75% 🔺 LONG at PDL
RR(mid): 2.1 | Stop: SWEEP 21,415
Conf: 🔥 SWEEP
Bias: LIGHT BULL
VIX: 18.5 NORMAL
Session: OVERLAP
Action: Enter LONG
Stop: 21,415 (sweep stop with extra buffer)
Target 1: 21,510 (Midpoint)
Note: Sweep provides alternative confirmation
Scenario 3: READY - Waiting for Confirmation
Price: 21,451 (PDL: 21,450)
Signal: 🔵 READY(CONF) 72% 🔺 LONG at PDL
RR(mid): 2.4 ✅
Conf: ❌ waiting
Advice: wacht op reversal candle
Bias: BULLISH
VIX: 15.8 CALM
Session: LONDON
Action: Wait
Monitor: Watch for hammer, engulfing, or sweep
Do NOT: Enter without confirmation
If next candle forms hammer → GO signal
Scenario 4: READY - Poor RR
Price: 21,475 (PDL: 21,450)
Signal: 🔵 READY(RR) 74% 🔺 LONG at PDL
RR(mid): 1.2 ❌ (need 1.5)
Conf: ✅ Hammer ↑
Advice: wacht op betere RR / dichter bij level
Bias: BULLISH
VIX: 17.2 NORMAL
Session: LONDON
Action: Wait
Monitor: Price needs to move closer to PDL (21,450)
Sweet spot: 21,455-21,460 range
Then: RR improves to >1.5 → GO signal
Scenario 5: WAIT - Midpoint Dead Zone
Price: 21,510 (Midpoint: 21,515)
Signal: ⚫ WAIT(MIDPOINT)
Advice: midpoint is target, geen entry
PDH: 21,580 (+70pts)
PDL: 21,450 (-60pts)
Action: Do NOT enter
Rationale: Midpoint is profit-taking zone, not entry
Wait for: Price to reach PDH (short) or PDL (long)
Scenario 6: Session Management - Hold Through
Entry: LONG at PDL 21,450 during London
Current: 15:15 (Pre-NY window)
Price: 21,495
Progress: 62% to midpoint
Momentum: Body/Range 0.45 (strong)
Session Advice: 🏃 HOLD → NY follow-up likely
Action: Hold position
Stop: Trailing at 21,465 (original 21,430)
Target: Still 21,510 (midpoint)
Plan: Let NY session drive to target
Scenario 7: Session Management - Close Pre-NY
Entry: LONG at PDL 21,450 during London
Current: 15:10 (Pre-NY window)
Price: 21,465
Progress: 25% to midpoint
Momentum: Body/Range 0.15 (consolidating)
Session Advice: 🛑 CLOSE pre-NY → liq grab risk
Action: Close position
Profit: +15pts (1R)
Rationale: Low progress + consolidating + pre-NY risk
Result: Book profit, avoid liquidity grab
⚠️ IMPORTANT NOTES
What This Indicator Does:
Calculates probability based on 6 weighted factors
Provides clear GO/READY/WAIT/CONDITIONAL signals
Calculates dual RR targets (midpoint + full range)
Detects liquidity sweeps and uses them for confirmation
Identifies reversal candles at key levels
Tracks US500 levels for confluence context
Monitors VIX regime and spikes
Provides session-based trading windows
Offers hold/close/re-enter advice
What This Indicator Does NOT Do:
Does not execute trades automatically
Does not guarantee profits - probability ≠ certainty
Does not replace risk management - you set position size
Does not predict exact price paths - markets are probabilistic
Does not work in all market conditions - designed for USTEC BOX strategy
Risk Warnings:
Past performance does not guarantee future results
Trade at your own risk - this is an analysis tool, not financial advice
Always use proper position sizing - recommended 0.36% risk per trade
Markets can gap through stops - especially during news events
Probability scores are estimates - based on historical patterns
No indicator is 100% accurate - losses are part of trading
Best Practices:
Wait for GO signals - READY/CONDITIONAL need more development
Respect WAIT zones - midpoint is never an entry
Use stop losses always - displayed stop levels are recommendations
Follow session management - timing matters in USTEC
Monitor VIX spikes - elevated volatility changes dynamics
Check US500 confluence - levels at entry strengthen setups
Respect sweep confirmations - they're alternative reversal signals
Don't force trades - quality over quantity
Recommended Trading Rules:
Risk per trade: 0.36% of capital
Min RR to midpoint: 1.5 (enforced by default)
Max trades per day: 6 (your discipline)
Required confirmation: Reversal candle OR sweep confirmed
Avoid: Midpoint entries, dead zone trading, VIX spike entries
Focus: London/NY sessions, overlap priority
🔧 TROUBLESHOOTING
Q: Why am I getting READY instead of GO?
A: Check the block reason:
READY(RR): Move closer to entry level for better RR
READY(CONF): Wait for hammer/engulfing/sweep confirmation
READY(RR+CONF): Too early - be patient
Q: Why does it say WAIT when I'm at PDL?
A: You're likely within the midpoint dead zone (±50pts of midpoint). This is intentional - midpoint is a target, not an entry.
Q: Sweep detected but not confirmed - why?
A: Sweep needs directional commitment:
Close must be bullish (LONG) or bearish (SHORT)
Close position in range must be >70% or <30%
This filters out noise from wick touches
Q: RR looks wrong - why?
A: Check if you're at/near an entry level. RR is only calculated when:
At entry level (within 50pts) OR
Near entry level (within 100pts) AND
Not at midpoint
Q: US500 levels not showing?
A: Enable "Show US500 Lines" in Display settings. Also check your data source - some brokers have better S5 data than others.
Q: Alerts not firing?
A:Check "Enable Alerts" master switch
Check specific alert toggles (GO, READY, CONDITIONAL, etc.)
Create alert condition in TradingView: Right-click chart → Add Alert → Select condition
Alerts fire once per bar (repaints)
Q: Table too big/small?
A: Adjust "Table Size" in Display settings (Tiny → Huge)
Q: Wrong timezone showing?
A: Change "Timezone" in Sessions settings. Default is Amsterdam - adjust for your location.
📊 DATA WINDOW PLOTS
Available in TradingView Data Window (hover over chart):
Probability %
All 6 factor scores
Progress to Midpoint %
RR to Midpoint (v4)
RR to Full Range (v4)
Stop Price (v4)
Risk in Points (v4)
ATR(14) (v4)
Stop Buffer (v4)
Sweep Detected (v4)
Sweep Confirmed (v4)
Wick Ratios (v4)
US500 price
VIX value
Use these for:
Historical analysis
Backtesting setups
Strategy optimization
Custom alerts
📝 VERSION HISTORY
v4.0 - Phase 1B (Current)
Added liquidity sweep detection
Sweep-aware stop placement
Sweep as alternative confirmation
Enhanced noise filtering (ATR-based + commitment)
Sweep info in table, labels, alerts
v4.0 - Phase 1A
Introduced RR Engine with dual targets
GO Gate system (RR + Confirmation required)
READY state with block reason flags
WAIT state for midpoint dead zone
Dynamic stop buffer (ATR-based)
Micro-advice for READY/WAIT scenarios
v3.0
Weighted probability system (6 factors)
US500 levels as context (not obstacles)
70% long bias integration
Previous day type analysis
Opening drive detection
Session management advice
Live daily bias calculation
📞 SUPPORT & FEEDBACK
Author: © Kiem Online
Indicator: USTEC Trade Assistant v4
For questions, suggestions, or bug reports:
Comment on TradingView publication
Message via TradingView profile
Prohibited:
Unauthorized distribution
Resale or commercial use without permission
Code modification for redistribution
License: Mozilla Public License 2.0
🎯 FINAL THOUGHTS
This indicator is a probability assessment tool, not a magic bullet. It combines:
Technical analysis (levels, candles, sweeps)
Market context (VIX, US500, sessions)
Risk management (RR calculations, dynamic stops)
Trading psychology (READY states, session advice)
Success requires:
Discipline to wait for quality setups
Patience to let winners run
Courage to cut losers quickly
Consistency in following signals
Remember:
The market determines, not the indicator
Quality over quantity always wins
Risk management is non-negotiable
Losses are part of the game
Trade smart. Trade safe. Trade with the flow. 🎯
Pine Script® indicator
PE Ratio WT LevelsThis indicator calculates and plots the Price-to-Earnings Ratio (P/E) using the latest available TTM (Trailing Twelve Months) Earnings Per Share data.
It allows traders and investors to easily monitor valuation changes over time and compare the current P/E to customizable horizontal levels.
Pine Script® indicator
RaVen Mobile V2.2.1RaVen Mobile V2.2.1 - 专为 Polymarket 5分钟市场打造
中文说明
概述
RaVen Mobile V2.2.1 是一款专为 Polymarket 比特币 5 分钟 UP/DOWN 市场 深度优化的 Pine Script 指标。它基于成熟的 RaVen V2.1 桌面版架构,并针对移动端的使用习惯和屏幕空间进行了特别优化。该脚本的核心目标是在高胜率和高信号覆盖率之间取得最佳平衡,为用户的交易决策提供强大的数据支持。
| 功能 | 描述 |
| --- | --- |
| **HTF 架构** | 当图表周期设为 **5秒** 时,脚本会自动从 **15秒** 周期获取核心指标数据,实现 **“15秒精度计算 + 5秒刷新显示”** 的最佳体验。此时面板标题栏会显示 **⚡** 标记。
**锁仓后反转预警** | 当信号锁仓后,如果市场出现强烈的反转迹象(如趋势和动量指标全面倒戈),面板将发出 **“⚠️ 考虑倒仓!”** 的橙色警告,为您提供二次决策机会。
|| **实时质量分** | 锁仓后,面板不仅会显示锁仓时的分数,还会在旁边实时更新当前市场的质量分,方便您对比判断当前信号的健康度。
|| **开盘价容错** | 当您启用“强制输入开盘价”但忘记输入时,脚本不再完全阻止信号,而是会自动使用 TradingView 的系统开盘价进行回测,确保数据连续性,同时在面板上给予明确的警告提示。
推荐用法
1.
交易对: BTC/USD (或 Polymarket 使用的任何比特币交易对)
2.
K线周期:
•
5秒 (推荐): 可获得最快的面板刷新率和接近实时的倒计时,同时通过 HTF 架构保持 15 秒周期的计算精度。
•
15秒: 经典模式,脚本的各项参数基于此周期校准,信号稳定可靠。
3.
操作流程:
•
在新一局开始后,尽快在脚本设置中输入 Polymarket 的实际开盘价。
•
在“信号窗口”时间内,密切关注面板状态。
•
出现“💎 锁仓”信号后,根据信号方向在 Polymarket 进行操作,然后等待当局结束。
English Description
Overview
RaVen Mobile V2.2.1 is a Pine Script indicator deeply optimized for the Polymarket 5-minute Bitcoin UP/DOWN market. It is based on the mature architecture of the RaVen V2.1 desktop version, specially adapted for mobile use regarding layout and user experience. The core objective of this script is to strike the optimal balance between a high win rate and extensive signal coverage, providing robust data support for your trading decisions.
Core Features
Feature
Description
HTF Architecture
When the chart timeframe is set to 5 seconds, the script automatically fetches core indicator data from the 15-second timeframe. This achieves the best of both worlds: "15s Precision Calculation + 5s Refresh Rate". A ⚡ icon in the panel title indicates this mode is active.
Post-Lock Reversal Alert
After a signal is locked, if the market shows strong signs of a reversal (e.g., trend and momentum indicators flip decisively), the panel will issue an orange warning: “⚠️ Consider Reversing!”, offering you a crucial second chance to decide.
Real-time Quality Score
When a position is locked, the panel not only displays the score at the moment of the lock but also shows the real-time quality score alongside it. This allows you to compare and assess the current health of your signal.
Open Price Fallback
If you enable "Force Custom Open Price" but forget to input the price, the script no longer blocks signals. It will automatically fall back to the TradingView system open price for backtesting while providing a clear warning on the panel.
Recommended Usage
1.
Symbol: BTC/USD (or any Bitcoin pair used by Polymarket).
2.
Timeframe:
•
5-Second (Recommended): Provides the fastest panel refresh rate and a near real-time countdown, while maintaining the calculation accuracy of the 15-second timeframe via the HTF architecture.
•
15-Second: The classic mode. The script's parameters are calibrated based on this timeframe, ensuring stable and reliable signals.
3.
Workflow:
•
As soon as a new round begins, enter the actual open price from Polymarket into the script settings.
•
Pay close attention to the panel status during the "Signal Window".
•
Once a "💎 Lock-in" signal appears, place your trade on Polymarket according to the signal's direction and wait for the round to settle.
Key Parameter Configuration
Parameter
Recommended Setting
Description
Enable Custom Open Price
Enabled
Highly recommended to use the actual open price from Polymarket for the most accurate signal evaluation and backtesting.
Force Custom Open Price
Enabled
When enabled, the panel will show a prominent warning if you forget to enter the open price. However, V2.2.1 will no longer block signals because of this.
Polymarket Open Price
Manual Input
After a new round starts, fill in the open price displayed on the Polymarket page here.
Signal Window
1s-3min
This is the optimal window for the 5-minute market, searching for signals from 1 second after the start until 2 minutes before the end.
Timezone Offset
Set according to your location
CRITICALLY IMPORTANT! Set this to the timezone displayed in the bottom-right corner of your TradingView chart. For example, enter -5 for UTC-5, 8 for UTC+8.
⚠️ 重要提示 / IMPORTANT NOTE
为了完整使用此脚本的全部功能(特别是 5秒 或 15秒 K线周期),您需要拥有 TradingView 的付费会员资格(Premium 或更高版本)。免费版不支持秒级K线,会导致脚本无法正常运行。
To utilize the full capabilities of this script, especially the 5-second or 15-second timeframes, you need a paid TradingView subscription (Premium or higher). The free plan does not support second-based intraday timeframes, which will prevent the script from running correctly.
📜 免责声明 / DISCLAIMER
本脚本仅供学习、研究和教育目的使用,不构成任何财务或投资建议。所有基于此脚本产生的交易决策,其风险完全由使用者自行承担。市场有风险,投资需谨慎。
This script is provided for learning, research, and educational purposes only. It does not constitute any financial or investment advice. You bear all risks associated with any trading decisions made based on this script. The market is risky; invest with caution.
Pine Script® indicator
Alpha Trend Master (No Repaint)Overview
The Alpha Trend Master is a high-precision technical analysis tool designed for trend followers. This indicator is built on the core logic of volatility-based trailing stops, refined to provide clean, non-repainting signals. By combining Average True Range (ATR) sensitivity with a powerful long-term trend filter, it helps traders capture significant market moves while staying away from "noise."
Optimized Strategy: The 30-Minute Power Frame
While this indicator can adapt to various assets, it is specifically optimized for the 30-minute (30m) timeframe. This timeframe offers a perfect balance between intraday responsiveness and trend reliability, reducing the impact of micro-volatility.
The EMA 1000 Trend Filter (Institutional Confirmation)
To ensure you are always trading with the "Smart Money," we have integrated a 1000-period Exponential Moving Average (EMA) as the ultimate trend filter.
Bullish Confirmation (BUY): Look for Buy signals only when the price is trading ABOVE the Yellow EMA 1000. This indicates a strong long-term bullish regime.
Bearish Confirmation (SELL): Look for Sell signals only when the price is trading BELOW the Yellow EMA 1000. This confirms a dominant bearish structure.
Key Features
No Repaint: Signals are calculated and fixed once the bar is confirmed. What you see on the history is exactly how it performed in real-time.
Adaptive Sensitivity: Defaulted to a Key Value of 50 and ATR of 5 for a smoother, macro-focused signal delivery.
Visual Clarity: Includes dynamic bar coloring and signal line extensions for better entry visualization.
A Realistic Approach to Trading
In the world of finance, no indicator is a "holy grail" or 100% accurate. Markets are driven by complex human emotions and fundamental events. Our goal with Alpha Trend Master was to provide the highest possible precision by filtering out false signals through the 1000 EMA.
However, trading always involves risk. We strongly recommend:
1.Using proper Risk Management (Stop Losses are a must).
2.Combining these signals with your own price action analysis (Support/Resistance).
3.Testing the settings on a demo account before going live.
Pine Script® indicator
NAPTNAPT – NY Session Kill Zones
Displays New York time-based trading sessions and kill zones with DST adjustment.
Full 1-year session visualization
America/New_York timezone accurate
Clean pastel session backgrounds
Non-repainting
Designed for pre
Pine Script® indicator
Swing Strategy Feature Set U [theEccentricTrader]█ OVERVIEW
This swing strategy is part of a broader research and exploration framework designed to encourage users to experiment with a variety of technical concepts and evaluate the comparative effectiveness of different strategy configurations. For example, users can first configure a core strategy as a benchmark, then iteratively test a range of feature configurations as additional entry conditions and compare their performance against one another and against the core strategy.
Feature Set U includes concepts beginning with the letter "U" and forms part of a larger swing strategy suite that covers a wide range of technical concepts. The objective of the suite is not curve-fitting, but rather structured experimentation, exploration and statistical validation (or invalidation) of technical concepts.
Concepts exclusive to the feature set are as follows:
Ulcer Index
Ultimate Oscillator
█ OPERATIONAL
Initial Capital
The initial capital is defined as a monetary value denominated in a given base currency.
The default initial capital is set to 100,000.
The default base currency is set to the selected symbol's default base currency.
Users can adjust the initial capital and select an alternative base currency via strategy Settings/Properties.
Risk as Percentage of Equity
The equity is defined as the sum of initial capital, net profit and open profit.
The risk is defined as a percentage of equity per-trade. As a result, net profit outcomes are subject to compounding effects over time.
The default risk is set to 1% of equity.
Users can adjust the strategy's per-trade risk via strategy Settings/Inputs/STRATEGY.
For further information on how the risk is applied in practice, refer to the position sizing section below.
Unit of Value
The unit of value is defined as a decimal precision factor that converts user-defined point or pip distances into actual price units used by the selected symbol.
Different symbols express price movement using different conventions. For example, some symbols are quoted directly in whole price points, while others use pips or fractional point increments. The unit of value provides a normalisation layer that allows all distance-based logic in the strategy to operate consistently across symbols.
Examples:
A unit of value of 1 corresponds to a price increment of 1.0.
A unit of value of 10 corresponds to a price increment of 0.1.
A unit of value of 100 corresponds to a price increment of 0.01.
A unit of value of 1000 corresponds to a price increment of 0.001.
A unit of value of 10000 corresponds to a price increment of 0.0001.
Users should consult their broker’s published symbol specifications to confirm how price movement is defined for the symbols they intend to backtest. Incorrect configuration of the unit of value may result in misaligned stop distances, targets and/or risk calculations.
The default unit of value is set to 1.
Users can adjust the unit of value via strategy Settings/Inputs/STRATEGY.
Stop Buffer
The stop buffer is defined as the number of points or pips beyond a stop loss level required for the level to be considered clearly breached.
The default stop buffer is set to 0 points/pips.
Users can adjust the stop buffer via strategy Settings/Inputs/STRATEGY.
Risk Range
The risk range is defined as the difference between the entry price and the stop loss price (inclusive of the stop buffer) for any given trade.
Position Sizing
Position sizing determines the quantity of contracts, shares or units opened for each trade based on the user-defined risk and the selected symbol’s pricing structure.
"syminfo.pointvalue" is a built-in Pine Script variable that defines the number of underlying units contained within a single contract for any given symbol, and is critical for accurate position size calculations.
The position size is calculated as follows:
The risk range is multiplied by the syminfo.pointvalue to convert the price movement into its monetary equivalent.
The user-defined risk amount (expressed as a percentage of equity) is divided by this monetary risk per unit to determine the position size.
This ensures that each trade risks a consistent proportion of account equity regardless of point or pip based quoting conventions, symbol price scale or contract specifications.
While the strategy targets a fixed percentage of equity risk per-trade, the exact risk applied cannot always be matched precisely due to symbol-specific constraints such as contract sizing and margin requirements. In these cases, the strategy opens the largest permissible position that does not violate operational constraints, resulting in a realised risk that is as close as possible to the user-defined risk without exceeding it.
For further information on the syminfo.pointvalue variable, please refer to:
www.tradingview.com
Margin
The margin is defined as the minimum percentage of a position’s notional value that must be covered by the strategy’s available equity in order for TradingView's strategy tester to simulate opening and maintaining that position. For example, a margin setting of 25% means the simulated account must hold equity equal to at least 25% of the position’s notional value in order to enter or maintain that trade, the remaining 75% is considered provided by the simulated broker.
A lower margin percentage allows the account to open larger positions relative to its equity, because the required equity portion is smaller. Conversely, a higher margin percentage demands more of the account's equity be committed to any given position.
When the account’s equity falls below the required margin, the strategy tester emulates a margin call event, in which the broker emulator forcibly closes or reduces positions so that remaining positions no longer exceed available equity relative to the margin requirement. This behaviour is documented as part of TradingView’s margin/leverage feature for strategies.
Margin settings in a strategy are used solely for simulation purposes and do not automatically match any broker’s real-world margin requirements (which can vary by broker, asset class and symbol). Users should consult their broker’s published specifications for further details.
The default margin is set to 25% for both long and short positions.
Users can adjust the margin for long and short positions independently via strategy Settings/Properties/MARGIN.
For further information on the strategy tester's margin functionality, please refer to:
www.tradingview.com
www.tradingview.com
Pyramiding
The pyramiding count is defined as the maximum number of open positions permitted at any one time. TradingView's strategy tester does not facilitate hedging, as such, long entries will close any open short positions and short entries will close any open long positions.
The default pyramiding count is set to 100.
Users can adjust the pyramiding count via strategy Settings/Properties.
For further information on TradingView's strategy tester and broker emulator, please refer to:
www.tradingview.com
Spread
The spread is defined as the difference between a given symbol's bid (buy) price and ask (sell) price.
Typical spreads vary by broker and symbol. Some brokers offer fixed spreads on certain symbols, while others offer variable spreads that fluctuate with market conditions. Users should consult their broker's published specifications for further details.
Commission
The commission is defined as a transaction cost applied by a broker and may be expressed as a percentage of position size, a per-contract fee or a fixed fee per-transaction.
Commission structures vary by broker and symbol. Some brokers charge no explicit commission and instead generate revenue through the spread or other indirect sources, while others will typically apply one of the three aforementioned commission types, depending on the product offered. Users should consult their broker's published specifications for further details.
The default commission is set to 0.005% of position size.
Users can select and adjust the commission type via strategy Settings/Properties/COST SIMULATION.
█ CORE STRATEGY
Green and Red Candles
A green candle is defined as a candle that closes at or above its open price and a red candle is defined as a candle that closes below its open price.
Swing Highs and Swing Lows
A swing high is defined as a green candle, or a series of consecutive green candles, followed by a single red candle that completes the swing and forms the peak.
A swing low is defined as a red candle, or a series of consecutive red candles, followed by a single green candle that completes the swing and forms the trough.
Peak and Trough Prices
The peak price of a complete swing high is either the high of the red candle that completes the swing high or the high of the preceding green candle, depending on which is higher.
The trough price of a complete swing low is either the low of the green candle that completes the swing low or the low of the preceding red candle, depending on which is lower.
Fixed Reward-to-Risk
Fixed reward-to-risk is defined as a user-defined reward multiple for a given unit of risk.
Variable Reward-to-Risk
Variable reward-to-risk is defined as a path-dependent reward multiple for a given unit of risk.
Swing High Swing Low (SHSL) Strategy
The SHSL strategy uses swing lows for core long entry conditions and swing highs for core short entry conditions. The strategy is designed for standard OHLC candlestick charts only and will not behave as intended on other chart types.
All entries are processed at candle close and use the candle close price for the entry price.
Long stop losses are anchored to the most recent trough and short stop losses are anchored to the most recent peak.
Users can choose between long-only and short-only configurations, or alternatively simulate trades in both directions (long-short). However, when the "Both" option is selected, long entries will close any open short positions and short entries will close any open long positions (as mentioned in the pyramiding sub-section above). This can and will result in variable reward-to-risk outcomes.
The default direction is set to "Long" for a long-only configuration.
The default exit type is set to "Target" for a fixed reward-to-risk configuration.
Long targets are determined by adding a user-defined multiple of the risk range to the entry price and short targets are determined by subtracting a user-defined multiple of the risk range from the entry price.
Even when using a fixed reward-to-risk configuration, realised reward-to-risk outcomes may vary due to market gaps, particularly when positions are held across session boundaries or market closures. Gaps can cause stop losses or exits to be executed at prices materially different from those implied by the strategy’s static distance calculations. Users who wish to minimise gap-related variability may consider applying the close at end of session filter (see core filters section below), accepting that this introduces its own form of reward-to-risk variability.
The default reward-to-risk is set to 1.
Users can adjust strategy parameters via strategy Settings/Inputs/STRATEGY. Selecting a non-target exit type removes profit targets and renders the reward-to-risk input inactive.
Trailing Stop Loss
A trailing stop loss is defined as an exit type that dynamically moves a stop loss level in a favourable direction when a predefined condition is met. For example, a predefined point move or the formation of a higher trough or lower peak.
Risk Range Trailing Stop Loss
The risk range trailing stop loss is defined as a trailing stop mechanism that activates once price has moved favourably by one full risk range. Upon activation, the stop loss is moved to breakeven and subsequently trails favourable price movement by the risk range into profit.
Users can apply this exit type by selecting "Trail" via strategy Settings/Inputs/STRATEGY.
Trend Trailing Stop Loss
The trend trailing stop loss is defined as a trailing stop mechanism that dynamically moves a stop loss level to newly formed higher troughs (for longs) or lower peaks (for shorts).
Users can apply this exit type by selecting "Trend Trail" via strategy Settings/Inputs/STRATEGY.
Candle Trailing Stop Loss
The candle trailing stop loss is defined as a trailing stop mechanism that dynamically moves a stop loss level to newly formed higher candle lows (for longs) or lower candle highs (for shorts).
Users can apply this exit type by selecting "Candle Trail" via strategy Settings/Inputs/STRATEGY.
Opposing Candle Colour Close
The opposing candle colour close exit type is defined as an exit condition that closes any long positions when a new red candle forms and closes any short positions when a new green candle forms.
Users can apply this exit type by selecting "Opposing Candle" via strategy Settings/Inputs/STRATEGY.
█ CORE FILTERS
Minimum Risk Range Filter
The minimum risk range filter is defined as an entry filter that invalidates trade signals with a risk range below a user-defined threshold.
The default minimum risk range is set to 4 points/pips.
Users can adjust the minimum risk range via strategy Settings/Inputs/RISK RANGE FILTER.
It is recommended that users set the minimum risk range at least 1–2 points/pips above the selected symbol’s spread to invalidate trades that would be completely impractical under realistic trading conditions.
Time Zone
The time zone is defined using either an IANA region identifier (e.g. Europe/London, America/New_York) or a fixed UTC/GMT offset (e.g. UTC+1, GMT-05:30). Fixed offsets do not account for daylight saving time.
The default time zone is set to Europe/London.
Users can change the time zone via strategy Settings/Inputs/TIME ZONE.
For further information on time zone configuration, please refer to:
data.iana.org
en.wikipedia.org
Session Filter
The session filter is defined as an entry filter that invalidates trade signals that fall outside a user-defined intraday trading session, with session start and end times bound to the strategy time zone.
TradingView candle timestamps represent the candle open time, not the candle close time. As a result, session boundaries are evaluated based on when a candle opens, even though entries and exits are processed at candle close.
To avoid trades being entered or held beyond the intended session end, users should configure the session end time at least one full timeframe period earlier than the desired practical session close. For example, on a 5-minute chart with a desired session end at 22:00, the session should typically be configured to end at 21:55. This ensures that no new trades are taken at the final session close and that any session-dependent exit logic is applied before the session ends in practice.
When using custom or non-standard timeframes where the desired session end does not align cleanly with candle boundaries, it is recommended that users set the session end two full timeframe periods earlier than the desired session end. This provides an additional safety buffer, ensuring the strategy avoids taking trades near the session boundary.
By default, the session filter is set to false and the default session is set to "2300-2155".
Users can apply the session filter and adjust session boundaries via strategy Settings/Inputs/SESSION FILTER.
Close At End of Session Filter
The close at end of session filter is defined as an exit filter that closes all open positions when the active trading session ends, provided that the session filter is appropriately configured and applied.
When enabled, the strategy monitors the session filter state and detects the transition from an active session to an inactive session. All open trades are closed on the first candle that falls outside the defined session window. This ensures that no positions are carried beyond the user-defined trading session.
The close at end of session filter operates independently of entry conditions and other exit types. When enabled, it will force the closure of all open positions at session end regardless of the selected exit configuration.
Enabling the close at end of session filter can result in variable reward-to-risk outcomes. Because positions are forcibly closed at session end regardless of stop loss or target placement, exits may occur at prices that differ from those implied by the fixed reward-to-risk configuration. This behaviour is intentional and reflects a design trade-off between enforcing strict session boundaries and allowing trades to reach their predefined directional objectives, regardless of how severely distorted the realised reward-to-risk outcomes could be in the event of price gaps.
By default, the close at end of session filter is set to false.
Users can apply the close at end of session filter via strategy Settings/Inputs/CLOSE AT END OF SESSION FILTER.
Users should also ensure that the session filter is applied and that session boundaries are configured appropriately with respect to candle timestamp behaviour, as described in the session filter section above.
Sample Period Filter
The sample period filter is defined as an entry filter that invalidates trade signals that fall outside a user-defined date-time range, with start and end date-times bound to the strategy time zone.
TradingView candle timestamps represent the candle open time, not the candle close time. As a result, sample period boundaries are evaluated based on when a candle opens, even though entries and exits are processed at candle close.
To avoid trades being entered beyond the intended sample period end, users should configure the sample period end date-time at least one full timeframe period earlier than the desired practical sample period end date-time. For example, on a 5-minute chart with a desired end date-time of 01/01/2026 22:00, the end date-time should typically be configured to 01/01/2026 21:55.
The default sample period start and end date-times are set to 01/01/1900 00:00 and 01/01/3000 00:00, respectively.
Users can adjust the sample period via strategy Settings/Inputs/SAMPLE PERIOD FILTER.
█ GENERIC FILTERS
Generic Filter Behaviour
Unless otherwise stated:
"None" inputs return true.
Filters return true only when their selected condition is satisfied.
Minimum and Maximum Boundary Filters
Minimum and maximum boundary filters are defined as entry filters used to constrain time-series values to predefined minimum and/or maximum thresholds, invalidating trade signals that do not satisfy a user-defined threshold criteria. The filters consist of two independent threshold components, minimum (above-equal) and maximum (below-equal), which may be applied individually or together.
When both components are applied simultaneously the filters act as a value range constraint, invalidating trade signals that fall outside of the specified bounds.
"Above-Equal" returns true when the evaluated value is greater than or equal to the user-defined minimum boundary.
"Below-Equal" returns true when the evaluated value is less than or equal to the user-defined maximum boundary.
Minimum Percentage Change Positive-Flat/Negative Filter
The minimum percentage change filter is an entry filter that measures the relative change of a time-series value over a configurable historical window and applies a directional threshold condition, invalidating trade signals that do not meet the directional threshold criteria.
The filter compares the current value to its value n bars ago and computes the percentage difference. A signal returns true only if this percentage change satisfies both:
The selected directional requirement.
The user-defined minimum percentage change magnitude.
"Positive-Flat" direction logic:
Accepts values that have increased or remained unchanged, provided the percentage change is greater than or equal to the minimum threshold.
"Negative" direction logic:
Accepts values that have decreased, provided the magnitude of the decrease meets or exceeds the minimum threshold.
When the minimum threshold is set to 0%, the filter behaves as a pure directional check:
"Positive-Flat" accepts ≥ 0% changes.
"Negative" accepts < 0% changes only.
Basic and Multi-Part Trend Filters
Basic and multi-part trend filters are defined as entry filters that evaluate changes in time-series values from one period to the next and invalidate trade signals that do not satisfy a user-defined trend condition.
Basic trends operate independently of prior trend state, whereas multi-part trends are defined by the presence or absence of preceding trend sequences. The multi-part trend states are distinguished numerically and the conditions are bound to a user-defined trend count.
"Basic Uptrend" returns true when a time-series value is greater than the preceding value. For example, a basic volume uptrend filter returns true if the most recent candle's volume is greater than the preceding candle's volume.
"Basic Downtrend" returns true when a time-series value is less than the preceding value. For example, a basic volume downtrend filter returns true if the most recent candle's volume is less than the preceding candle's volume.
"Uptrend" returns true while a multi-part uptrend state is valid. The uptrend state begins when a new basic uptrend forms following a basic downtrend and remains valid until a new basic downtrend forms. The user-defined trend count will determine which multi-part trend condition is selected. For example, if the user-defined trend count is set to 3, then only 3-part uptrend conditions will return true.
"Downtrend" returns true while a multi-part downtrend state is valid. The downtrend state begins when a new basic downtrend forms following a basic uptrend and remains valid until a new basic uptrend forms. The user-defined trend count will determine which multi-part trend condition is selected. For example, if the user-defined trend count is set to 3, then only 3-part downtrend conditions will return true.
█ FEATURE SET U SPECIFIC FILTERS
All feature set specific indicators use the same calculations as the built-in TradingView indicators unless otherwise stated in the relevant filter sub-section. While users do not need to apply the indicators for the strategy to function, they can of course apply the relevant indicators as visual aids if they so desire.
For further information on how to apply built-in TradingView indicators, please refer to:
www.tradingview.com
Ulcer Index (UI) Filters
The UI indicator defaults are as follows:
Source is set to "Close".
Length is set to 14.
Users can adjust the UI inputs via strategy Settings/Inputs/ULCER INDEX (UI).
The UI minimum percent change positive-flat/negative filter (see generic filters section above) defaults are as follows:
Mode is set to "None".
Minimum percent change is set to 0.
Lookback is set to 3.
The UI trend filter (see generic filters section above) defaults are as follows:
Mode is set to "None".
Trend count is set to 3.
Users can apply the UI filters and adjust filter parameters via strategy Settings/Inputs/UI FILTERS.
Ultimate Oscillator (UO) Filters
The UO indicator defaults are as follows:
Fast length is set to 7.
Medium length is set to 14.
Slow length is set to 28.
Users can adjust the Ultimate Oscillator inputs via strategy Settings/Inputs/ULTIMATE OSCILLATOR (UO).
The UO minimum and maximum boundary filter (see generic filters section above) defaults are as follows:
Apply UO above-equal is set to false.
UO above-equal threshold is set to 0.
Apply UO below-equal is set to false.
UO below-equal threshold is set to 100.
The UO minimum percent change positive-flat/negative filter (see generic filters section above) defaults are as follows:
Mode is set to "None".
Minimum percent change is set to 0.
Lookback is set to 3.
The UO trend filter (see generic filters section above) defaults are as follows:
Mode is set to "None".
Trend count is set to 3.
Users can apply the UO filters and adjust filter parameters via strategy Settings/Inputs/UO FILTERS.
█ ALERTS
Users can set alerts for any given strategy configuration via the alerts dialogue box.
Users must first ensure that the correct condition (the strategy title) is selected from the first drop-down list in the alert dialogue box's condition field.
Default alert messages have been configured for both entries and exits so that users can more effectively distinguish between long and short entries and exits while using long-short configurations.
To get alerts for both entries and exits the user should change the value in the condition field's second drop-down list from "Order fills only and alert() function calls" to "Order fills only". When using "Order fills only" with long-short configurations, it is recommended that users define their alert via the alert name field and use only the default {{strategy.order.alert_message}} call in the alert message field.
Alert conditions generated by "Order fills only" are evaluated after entry conditions have been satisfied and operational constraints (risk, position size and margin requirements) have been applied. As such, trade signals that would result in position sizes exceeding the simulated account's margin constraints will not generate alerts.
To get alerts for entries only the user should change the value in the condition field's second drop-down list from "Order fills only and alert() function calls" to "alert() function calls only".
The default alert messages generated by "Order fills only" are as follows:
"long entry".
"long exit".
"short entry".
"short exit".
The default alert messages generated by "alert() function calls only" are as follows:
"long entry".
"short entry".
Alert conditions generated by "alert() function calls only" are operational-constraint-agnostic and will generate alerts whenever entry conditions are satisfied, regardless of the simulated account's margin constraints.
For further information on setting and managing alerts, please refer to:
www.tradingview.com
www.tradingview.com
www.tradingview.com
█ LIMITATIONS AND CONSIDERATIONS
Backtesting
Backtest results should always be interpreted cautiously. Strategy performance can vary significantly across time periods and sample sets. While strong historical performance does not guarantee future results, poor historical performance reliably indicates a weak strategy when sample sizes are statistically meaningful.
Statistical Significance and Path-Dependent Outcomes (Overfitting)
In statistical practice, sample sizes of 100 observations are sometimes cited as a rough lower bound for certain forms of basic significance testing. In the context of trading strategy evaluation, such sample sizes are rarely sufficient to produce results that are meaningfully reliable or replicable. Based on practical experience, sample sizes closer to 1,000 observations or more are generally required before performance characteristics begin to stabilise. As a general rule, larger sample sizes increase the reliability and replicability of observed results.
Path dependence refers to situations in which outcomes are determined not only by initial conditions, but by the specific and unique sequence of price movements over a given time period.
Even with large sample sizes, favourable net profit outcomes should be interpreted with caution when they are primarily driven by either variable reward-to-risk configurations or fixed reward-to-risk configurations that employ unrealistically high reward multiples. In both cases, performance is often strongly influenced by path-dependent effects, making such outcomes less reliable and less replicable.
Fixed reward-to-risk configurations are generally less susceptible to path dependence when the reward multiple is kept within reasonable bounds. However, empirical studies and practitioner research suggest that reward multiples above approximately 3:1 increasingly exhibit the same path-dependent characteristics observed in variable reward-to-risk strategies.
Bar Magnifier
Due to the limitations of OHLC data, intra-bar price movement cannot be precisely determined.
When both stop loss and target levels are reached within the same candle, assumptions are made by the strategy tester.
Pine Script's bar magnifier partially mitigates this limitation by evaluating lower-timeframe data. However, this feature is available only to TradingView Premium users and remains inherently limited.
For further information on the bar magnifier functionality, please refer to:
www.tradingview.com
www.tradingview.com
TradingView Premium users can enable bar magnifier via strategy Settings/Properties/FILL ORDERS.
Processing Orders at Candle Close
Backtests cannot accurately account for slippage between signal generation and trade execution.
A practical mitigation is to use fixed-distance stop losses and targets rather than absolute price levels, a feature supported by many brokers and APIs.
Empirical Probabilities
Empirical probabilities are derived directly from observed outcomes rather than from theoretical models or assumed distributions. In the context of trading, they are calculated by measuring the relative frequency of events (such as wins and losses) across a large sample of historical trades.
Unlike conditional or model-based probabilities, empirical probabilities make no assumptions. Their validity relies primarily on sample size and the consistency of the rules used to generate observations, making them particularly relevant for trading systems evaluated under the law of large numbers.
Empirical probabilities are most useful for comparative analysis, such as assessing how different configurations, filters or exit mechanisms alter the statistical behaviour of a strategy under identical conditions. They are not intended to represent true predictive probabilities or to imply stable future performance.
To study empirical probabilities for comparative purposes, it is recommended that users set commission and both long and short margin values to 0% in order to maximise sample size. However, users should not interpret any resulting profits as realistic. Setting commission and margin (in particular) to 0% produces highly distorted outcomes that are not representative of realistic live trading conditions.
█ DISCLAIMER
This Pine Script strategy is provided for educational purposes only and does not constitute financial advice in any form.
Pine Script® strategy
NAPTNAPT – NY Session Kill Zones
Displays New York time-based trading sessions and kill zones with DST adjustment.
Full 1-year session visualization
America/New_York timezone accurate
Clean pastel session backgrounds
Non-repainting
Designed for preNAPT – NY Session Kill Zones
Displays New York time-based trading sessions and kill zones with DST adjustment.
Full 1-year session visualization
America/New_York timezone accurate
Clean pastel session backgrounds
Non-repainting
Designed for pre
Pine Script® indicator
Trinity Signal [Cythos]Trinity Signal is a regime-adaptive indicator that combines three independent signal types into a single overlay. It automatically detects whether the market is trending or sideways, then activates the appropriate signal for each condition.
Unlike single-method indicators, Trinity Signal does not force one approach on all market conditions. Trend-following signals fire only during confirmed trends, while mean reversion signals activate only during sideways regimes.
🔶 THREE SIGNAL TYPES
1 — Volume Breakout (VB)
Fires during trending regimes when price breaks above/below the Donchian Channel with a volume spike (default 2.5x the 20-bar average). Additional filters: ADX must be above threshold and rising, ATR must be expanding relative to its 50-bar average, and DI+/DI- must confirm direction. An optional EMA trend filter (EMA 20 > EMA 50) is available for long entries.
2 — RSI Divergence (DIV)
Detects classic bullish and bearish RSI divergences using pivot points. A bullish divergence occurs when price makes a lower low but RSI makes a higher low. The minimum price difference and minimum RSI difference are configurable to filter out weak divergences. Regime filter prevents bullish divergences in bear regimes and bearish divergences in bull regimes.
3 — Mean Reversion (MR)
Activates only in sideways regimes. Uses Z-Score (standard deviations from the 20-bar mean) instead of RSI for entry detection. The Z-Score threshold adapts to current volatility: lower threshold (default 1.5) during low-volume periods, higher threshold (default 2.5) during high-volume periods. Entries beyond Z = 3.0 are blocked as cascade risk protection. An ATR percentile filter (default 65th percentile) prevents entries during abnormally volatile sideways conditions.
🔶 REGIME DETECTION
The regime engine uses a 3-vote ensemble:
• ADX vote — ADX above threshold with hysteresis (entry at 22, exit at 16 to prevent regime flicker)
• Bollinger Band Width vote — BB Width percentile rank above threshold
• ATR vote — ATR percentile rank above threshold
All three must agree for a "trending" classification. If trending, the regime is further classified as BULL (price > EMA 50) or BEAR (price < EMA 50). Otherwise, the regime is SIDEWAYS.
This unanimous-vote approach prevents false regime switches that would generate incorrect signals.
🔶 TP / SL SYSTEM
Each signal type has independent ATR-based take-profit and stop-loss multipliers:
• VB: TP = 5.0 ATR, SL = 4.0 ATR (trend-following: wide TP, moderate SL)
• DIV: TP = 3.5 ATR, SL = 2.5 ATR (balanced R:R)
• MR: TP = 3.0 ATR, SL = 7.0 ATR with 2% cap (mean reversion: small TP, wide SL, high win rate)
The indicator tracks a virtual position internally and shows TP exits as green dots and SL exits as pink dots on the chart. A minimum TP percentage filter prevents entries when ATR is too small relative to price.
🔶 ADDITIONAL FILTERS
• OI Confirmation (VB only) — When enabled, Volume Breakout signals require Open Interest to be above its 20-bar SMA. If OI is declining during a breakout, it may indicate a liquidation-driven move rather than genuine new positions.
• RSI Extreme Filter (VB only) — Blocks VB longs when RSI > 75 and VB shorts when RSI < 25 to avoid chasing exhausted moves.
• Cooldown — Separate cooldown periods for VB/DIV (default 8 bars) and MR (default 25 bars) to prevent signal clustering.
• No same-bar entry+exit — The indicator will not enter a new position on the same bar an exit occurred.
• Non-repainting — All signals evaluate only on confirmed (closed) bars using barstate.isconfirmed. Signals will never appear and then disappear.
🔶 HOW TO USE
• Add to any chart (optimized for crypto perpetual futures, 5-minute timeframe)
• "L" labels = long (buy) entry, "S" labels = short (sell) entry
• Green dot = take profit exit, Pink dot = stop loss exit
• White dot at entry = entry price marker
• All parameters are adjustable in the indicator settings
• JSON-formatted alerts are available for webhook integration
🔶 LIMITATIONS
• Designed primarily for crypto perpetual futures — default parameters are tuned on BTCUSDT 5m. Other pairs may require adjustment
• The 5-minute timeframe produces the most signals; higher timeframes will generate fewer signals
• Mean Reversion signals have a low R:R ratio by design (compensated by high win rate)
• Past performance in backtesting does not guarantee future results
• OI data may not be available for all symbols — the filter automatically skips when OI data is missing
• This is a tool to assist your analysis, not a standalone trading system. Always use proper risk management.
Pine Script® indicator
RWB Rocket PatternRWB Rocket Pattern
OVERVIEW
This indicator visualizes the Red White Blue (RWB) momentum system using 13 lines on your chart: 6 short-term EMAs (red), 6 long-term EMAs (blue), and a dotted close line.
When all 12 EMAs stack perfectly from shortest on top to longest on bottom with a visible gap between the red and blue groups, the stock is in a "Rocket" pattern — a strong sustained uptrend. The close line (13th line) shows whether price is leading the averages higher.
EMA PERIODS
Red (short-term): 3, 5, 8, 10, 12, 15
Blue (long-term): 30, 35, 40, 45, 50, 60
SIGNALS
ROCKET (green label) — Strong Rocket. All 12 EMAs perfectly stacked with white space and close leading above all red EMAs. Strongest bullish signal.
RWB (green triangle) — Perfect RWB stacking formed but close not yet leading all reds.
Bnce (teal diamond) — Price dipped into the red EMAs and bounced back above them while the RWB structure held. Potential re-entry point.
X (red cross) — Close dropped below the lowest red EMA. Early warning of breakdown.
Lost (orange triangle) — Perfect RWB stacking has broken down.
SUB (red label) — Submarine. All 12 EMAs inversely stacked. Bearish.
RIBBON FILLS
Green fill between red and blue ribbons = healthy white space gap (bullish).
Orange fill = gap has collapsed (caution).
DASHBOARD
The corner table shows a real-time Rocket Strength Score (0-100) and pattern status including EMA stacking, white space width, close position, how many EMAs are rising, and how long the pattern has held.
HOW TO USE
1. Apply to a Weekly chart for the classic RWB setup. Daily also works.
2. Look for scores above 90 with "STRONG ROCKET" status for high-conviction momentum stocks.
3. Use Bnce signals to time re-entries on pullbacks within an active Rocket.
4. Watch for X crosses and Lost signals as exit warnings.
5. Avoid longs when SUB (Submarine) is active.
ALERTS
Six built-in alerts are included. Right-click the indicator, select "Add Alert", and choose from: Strong Rocket, RWB Formed, Rocket Lost, Bounce Into Reds, Close Below Reds, or Submarine Formed.
SETTINGS
All EMA periods, colors, ribbon fills, signals, background tinting, and dashboard position are configurable in the indicator settings.
DISCLAIMER
For educational purposes only. Not financial advice. Always perform your own research before making trading decisions.
Pine Script® indicator
BTC Intraday Advanced Spot PRO V6BTC indicator in 5-minute spot intraday timeframe, automated strategy version, with SL, TP, BE crossing, alerts.
Pine Script® strategy
ICT Kill ZoneThe indicator automatically draws the major ICT trading sessions and plots the finalized Asian session High/Low levels together with their wick-based breaks.
Built specifically for traders using liquidity sweep, inducement and session-based entry models.
Automatically marks the following trading sessions (ICT Timezone: GMT+7):
🔹Asia
🔹London Open
🔹New York AM
🔹New York PM
Boxes:
🔹appear instantly at session start
🔹dynamically expand during the session
🔹visible only on intraday timeframes (1m - 4H)
🔹labels auto-hide on higher timeframes for a clean chart
Asia Range Liquidity (Key Feature)
After the Asian session closes:
🔹The final High and Low levels are drawn
🔹Lines extend forward until price breaks them with a wick
🔹Not close-based breaks — true liquidity sweep detection
Ideal for:
🔹London sweep models
🔹NY reversal setups
🔹SMT + liquidity context
Volatility Filter
Optionally monitors the size of the Asian range.
If the range is too large (default: 30 pips):
🔹⚠️ warning icon appears inside the box
🔹Alert can be triggered
Helps filter out poor conditions (news / trend days).
Alert System
The indicator can send alerts for:
🔹Asia session close
🔹High volatility Asia session
Useful for automated pre-London preparation.
Settings
Fully customizable:
🔹Enable/disable sessions
🔹Box colors
🔹Labels
🔹High/Low lines
🔹Volatility pip threshold
Pine Script® indicator
LIVE STATUS CSO TREND INDICATOR BY OEZKAN
# LIVE STATUS CSO TREND INDICATOR BY OEZKAN
## 📊 INDICATOR DESCRIPTION
**LIVE STATUS CSO TREND INDICATOR** is an advanced multi-timeframe trading analysis tool designed for professional traders seeking real-time market signals with high precision. This indicator combines multiple technical analysis methods including trend detection, momentum analysis, volume confirmation, and supply/demand zone tracking.
### 🎯 KEY FEATURES
✅ **Multi-Timeframe Analysis** - 8 simultaneous timeframes (1m, 5m, 15m, 30m, 60m, 240m, Daily, Weekly)
✅ **Real-Time Signals** - LONG/SHORT entry signals with probability calculations
✅ **Take Profit Tracking** - 3-level TP system with hit probability percentages
✅ **Supply & Demand Zones** - Dynamic zone detection and retest tracking
✅ **Volume Analysis** - RVOL (Relative Volume) confirmation
✅ **Risk Management** - Automatic Stop Loss calculation with position sizing
✅ **Advanced Dashboard** - 11-column live status display with all key metrics
✅ **No Repaint Technology** - Stable signals on closed candles only
✅ **Zero Lookahead Bias** - Optimized for live and backtest trading
### 📈 INDICATOR COMPONENTS
**Neon Trend Engine**: Advanced trend identification with visual bands and real-time direction changes
**CCI Extremes Detection**: Identifies extreme market conditions for high-probability setups
**Power/Momentum Analysis**: Measures trend strength (0-100%) with color-coded alerts
**Multi-Timeframe Synergy**: Confirms signals across all selected timeframes
**Golden Point Tracking**: Tracks key support/resistance levels
**Live Dashboard**: Real-time display of:
- System Status (V172+)
- Pattern Recognition (Setup Type)
- Power % (Trend Strength)
- CCI Value (Momentum)
- Signal Strength (Overall Confidence)
- Trend Direction (LONG/SHORT)
- Win Rate Statistics
- Golden Point Level
- Supply Zone Status
- Demand Zone Status
- Volume Strength (RVOL)
### 🔐 ACCESS & SHARING
**⚠️ IMPORTANT - PRIVATE INDICATOR**
This indicator is **INVITE-ONLY** and designed for professional traders. Access is granted by direct invitation from @Oezkan1983.
**HOW TO GET ACCESS:**
1. Follow @Oezkan1983 on TradingView
2. Send a private message requesting access to "LIVE STATUS CSO TREND INDICATOR"
3. Receive add-to-chart invite link and setup instructions within 24 hours
### 💡 TRADING METHODOLOGY
**Entry Conditions**:
- Trend reversal with CCI confirmation and Multi-Timeframe alignment
- Optional: Pattern recognition with Power strength verification
**Position Management**:
- TP1 (High Probability): 75% - Quick profit target
- TP2 (Medium Probability): 50% - Standard risk/reward
- TP3 (Extended): 35% - Maximum profit potential
- Stop Loss: Automatic calculation based on recent structure
**Signal Strength Interpretation**:
- 75%+: STRONG (High confidence, execute immediately)
- 50-74%: MODERATE (Confirm with price action before entry)
- <50%: WEAK (Wait for better setup or skip)
### ⚙️ SETTINGS & CUSTOMIZATION
All parameters are fully adjustable:
- CCI Period & Triggers
- Power Threshold Settings
- TP% Levels (Customizable distances)
- SL % Level
- Timeframe Selection (8 independent choices)
- Volume Confirmation Toggle
- Signal Display Options
### 📊 BACKTESTING & LIVE TRADING
✅ **Production Ready**: Zero repaint, no lookahead bias
✅ **Proven Results**: Consistent win rates above 50% across multiple timeframes
✅ **Risk Management**: Built-in position sizing and money management
✅ **Stability**: Signals finalize on candle close, then remain stable
### 📞 SUPPORT & UPDATES
- Regular updates with performance improvements
- Direct support via TradingView messaging
- Community discussion in private group
- Monthly strategy webinars for subscribers
---
**Disclaimer**: This indicator is provided for educational and research purposes. Past performance does not guarantee future results. Always use proper risk management and position sizing. Trade at your own risk.
---
*Developed by: Oezkan1983*
*Version: V172+ LIVE STATUS*
*Last Updated: 2026*
Pine Script® indicator
Swing Strategy Feature Set T [theEccentricTrader]█ OVERVIEW
This swing strategy is part of a broader research and exploration framework designed to encourage users to experiment with a variety of technical concepts and evaluate the comparative effectiveness of different strategy configurations. For example, users can first configure a core strategy as a benchmark, then iteratively test a range of feature configurations as additional entry conditions and compare their performance against one another and against the core strategy.
Feature Set T includes concepts beginning with the letter "T" and forms part of a larger swing strategy suite that covers a wide range of technical concepts. The objective of the suite is not curve-fitting, but rather structured experimentation, exploration and statistical validation (or invalidation) of technical concepts.
Concepts exclusive to the feature set are as follows:
Tilson Moving Average
Trend
Trendline
Triple Exponential Moving Average (TRIX)
True Strength Index
█ OPERATIONAL
Initial Capital
The initial capital is defined as a monetary value denominated in a given base currency.
The default initial capital is set to 100,000.
The default base currency is set to the selected symbol's default base currency.
Users can adjust the initial capital and select an alternative base currency via strategy Settings/Properties.
Risk as Percentage of Equity
The equity is defined as the sum of initial capital, net profit and open profit.
The risk is defined as a percentage of equity per-trade. As a result, net profit outcomes are subject to compounding effects over time.
The default risk is set to 1% of equity.
Users can adjust the strategy's per-trade risk via strategy Settings/Inputs/STRATEGY.
For further information on how the risk is applied in practice, refer to the position sizing section below.
Unit of Value
The unit of value is defined as a decimal precision factor that converts user-defined point or pip distances into actual price units used by the selected symbol.
Different symbols express price movement using different conventions. For example, some symbols are quoted directly in whole price points, while others use pips or fractional point increments. The unit of value provides a normalisation layer that allows all distance-based logic in the strategy to operate consistently across symbols.
Examples:
A unit of value of 1 corresponds to a price increment of 1.0.
A unit of value of 10 corresponds to a price increment of 0.1.
A unit of value of 100 corresponds to a price increment of 0.01.
A unit of value of 1000 corresponds to a price increment of 0.001.
A unit of value of 10000 corresponds to a price increment of 0.0001.
Users should consult their broker’s published symbol specifications to confirm how price movement is defined for the symbols they intend to backtest. Incorrect configuration of the unit of value may result in misaligned stop distances, targets and/or risk calculations.
The default unit of value is set to 1.
Users can adjust the unit of value via strategy Settings/Inputs/STRATEGY.
Stop Buffer
The stop buffer is defined as the number of points or pips beyond a stop loss level required for the level to be considered clearly breached.
The default stop buffer is set to 0 points/pips.
Users can adjust the stop buffer via strategy Settings/Inputs/STRATEGY.
Risk Range
The risk range is defined as the difference between the entry price and the stop loss price (inclusive of the stop buffer) for any given trade.
Position Sizing
Position sizing determines the quantity of contracts, shares or units opened for each trade based on the user-defined risk and the selected symbol’s pricing structure.
"syminfo.pointvalue" is a built-in Pine Script variable that defines the number of underlying units contained within a single contract for any given symbol, and is critical for accurate position size calculations.
The position size is calculated as follows:
The risk range is multiplied by the syminfo.pointvalue to convert the price movement into its monetary equivalent.
The user-defined risk amount (expressed as a percentage of equity) is divided by this monetary risk per unit to determine the position size.
This ensures that each trade risks a consistent proportion of account equity regardless of point or pip based quoting conventions, symbol price scale or contract specifications.
While the strategy targets a fixed percentage of equity risk per-trade, the exact risk applied cannot always be matched precisely due to symbol-specific constraints such as contract sizing and margin requirements. In these cases, the strategy opens the largest permissible position that does not violate operational constraints, resulting in a realised risk that is as close as possible to the user-defined risk without exceeding it.
For further information on the syminfo.pointvalue variable, please refer to:
www.tradingview.com
Margin
The margin is defined as the minimum percentage of a position’s notional value that must be covered by the strategy’s available equity in order for TradingView's strategy tester to simulate opening and maintaining that position. For example, a margin setting of 25% means the simulated account must hold equity equal to at least 25% of the position’s notional value in order to enter or maintain that trade, the remaining 75% is considered provided by the simulated broker.
A lower margin percentage allows the account to open larger positions relative to its equity, because the required equity portion is smaller. Conversely, a higher margin percentage demands more of the account's equity be committed to any given position.
When the account’s equity falls below the required margin, the strategy tester emulates a margin call event, in which the broker emulator forcibly closes or reduces positions so that remaining positions no longer exceed available equity relative to the margin requirement. This behaviour is documented as part of TradingView’s margin/leverage feature for strategies.
Margin settings in a strategy are used solely for simulation purposes and do not automatically match any broker’s real-world margin requirements (which can vary by broker, asset class and symbol). Users should consult their broker’s published specifications for further details.
The default margin is set to 25% for both long and short positions.
Users can adjust the margin for long and short positions independently via strategy Settings/Properties/MARGIN.
For further information on the strategy tester's margin functionality, please refer to:
www.tradingview.com
www.tradingview.com
Pyramiding
The pyramiding count is defined as the maximum number of open positions permitted at any one time. TradingView's strategy tester does not facilitate hedging, as such, long entries will close any open short positions and short entries will close any open long positions.
The default pyramiding count is set to 100.
Users can adjust the pyramiding count via strategy Settings/Properties.
For further information on TradingView's strategy tester and broker emulator, please refer to:
www.tradingview.com
Spread
The spread is defined as the difference between a given symbol's bid (buy) price and ask (sell) price.
Typical spreads vary by broker and symbol. Some brokers offer fixed spreads on certain symbols, while others offer variable spreads that fluctuate with market conditions. Users should consult their broker's published specifications for further details.
Commission
The commission is defined as a transaction cost applied by a broker and may be expressed as a percentage of position size, a per-contract fee or a fixed fee per-transaction.
Commission structures vary by broker and symbol. Some brokers charge no explicit commission and instead generate revenue through the spread or other indirect sources, while others will typically apply one of the three aforementioned commission types, depending on the product offered. Users should consult their broker's published specifications for further details.
The default commission is set to 0.005% of position size.
Users can select and adjust the commission type via strategy Settings/Properties/COST SIMULATION.
█ CORE STRATEGY
Green and Red Candles
A green candle is defined as a candle that closes at or above its open price and a red candle is defined as a candle that closes below its open price.
Swing Highs and Swing Lows
A swing high is defined as a green candle, or a series of consecutive green candles, followed by a single red candle that completes the swing and forms the peak.
A swing low is defined as a red candle, or a series of consecutive red candles, followed by a single green candle that completes the swing and forms the trough.
Peak and Trough Prices
The peak price of a complete swing high is either the high of the red candle that completes the swing high or the high of the preceding green candle, depending on which is higher.
The trough price of a complete swing low is either the low of the green candle that completes the swing low or the low of the preceding red candle, depending on which is lower.
Fixed Reward-to-Risk
Fixed reward-to-risk is defined as a user-defined reward multiple for a given unit of risk.
Variable Reward-to-Risk
Variable reward-to-risk is defined as a path-dependent reward multiple for a given unit of risk.
Swing High Swing Low (SHSL) Strategy
The SHSL strategy uses swing lows for core long entry conditions and swing highs for core short entry conditions. The strategy is designed for standard OHLC candlestick charts only and will not behave as intended on other chart types.
All entries are processed at candle close and use the candle close price for the entry price.
Long stop losses are anchored to the most recent trough and short stop losses are anchored to the most recent peak.
Users can choose between long-only and short-only configurations, or alternatively simulate trades in both directions (long-short). However, when the "Both" option is selected, long entries will close any open short positions and short entries will close any open long positions (as mentioned in the pyramiding sub-section above). This can and will result in variable reward-to-risk outcomes.
The default direction is set to "Long" for a long-only configuration.
The default exit type is set to "Target" for a fixed reward-to-risk configuration.
Long targets are determined by adding a user-defined multiple of the risk range to the entry price and short targets are determined by subtracting a user-defined multiple of the risk range from the entry price.
Even when using a fixed reward-to-risk configuration, realised reward-to-risk outcomes may vary due to market gaps, particularly when positions are held across session boundaries or market closures. Gaps can cause stop losses or exits to be executed at prices materially different from those implied by the strategy’s static distance calculations. Users who wish to minimise gap-related variability may consider applying the close at end of session filter (see core filters section below), accepting that this introduces its own form of reward-to-risk variability.
The default reward-to-risk is set to 1.
Users can adjust strategy parameters via strategy Settings/Inputs/STRATEGY. Selecting a non-target exit type removes profit targets and renders the reward-to-risk input inactive.
Trailing Stop Loss
A trailing stop loss is defined as an exit type that dynamically moves a stop loss level in a favourable direction when a predefined condition is met. For example, a predefined point move or the formation of a higher trough or lower peak.
Risk Range Trailing Stop Loss
The risk range trailing stop loss is defined as a trailing stop mechanism that activates once price has moved favourably by one full risk range. Upon activation, the stop loss is moved to breakeven and subsequently trails favourable price movement by the risk range into profit.
Users can apply this exit type by selecting "Trail" via strategy Settings/Inputs/STRATEGY.
Trend Trailing Stop Loss
The trend trailing stop loss is defined as a trailing stop mechanism that dynamically moves a stop loss level to newly formed higher troughs (for longs) or lower peaks (for shorts).
Users can apply this exit type by selecting "Trend Trail" via strategy Settings/Inputs/STRATEGY.
Candle Trailing Stop Loss
The candle trailing stop loss is defined as a trailing stop mechanism that dynamically moves a stop loss level to newly formed higher candle lows (for longs) or lower candle highs (for shorts).
Users can apply this exit type by selecting "Candle Trail" via strategy Settings/Inputs/STRATEGY.
Opposing Candle Colour Close
The opposing candle colour close exit type is defined as an exit condition that closes any long positions when a new red candle forms and closes any short positions when a new green candle forms.
Users can apply this exit type by selecting "Opposing Candle" via strategy Settings/Inputs/STRATEGY.
█ CORE FILTERS
Minimum Risk Range Filter
The minimum risk range filter is defined as an entry filter that invalidates trade signals with a risk range below a user-defined threshold.
The default minimum risk range is set to 4 points/pips.
Users can adjust the minimum risk range via strategy Settings/Inputs/RISK RANGE FILTER.
It is recommended that users set the minimum risk range at least 1–2 points/pips above the selected symbol’s spread to invalidate trades that would be completely impractical under realistic trading conditions.
Time Zone
The time zone is defined using either an IANA region identifier (e.g. Europe/London, America/New_York) or a fixed UTC/GMT offset (e.g. UTC+1, GMT-05:30). Fixed offsets do not account for daylight saving time.
The default time zone is set to Europe/London.
Users can change the time zone via strategy Settings/Inputs/TIME ZONE.
For further information on time zone configuration, please refer to:
data.iana.org
en.wikipedia.org
Session Filter
The session filter is defined as an entry filter that invalidates trade signals that fall outside a user-defined intraday trading session, with session start and end times bound to the strategy time zone.
TradingView candle timestamps represent the candle open time, not the candle close time. As a result, session boundaries are evaluated based on when a candle opens, even though entries and exits are processed at candle close.
To avoid trades being entered or held beyond the intended session end, users should configure the session end time at least one full timeframe period earlier than the desired practical session close. For example, on a 5-minute chart with a desired session end at 22:00, the session should typically be configured to end at 21:55. This ensures that no new trades are taken at the final session close and that any session-dependent exit logic is applied before the session ends in practice.
When using custom or non-standard timeframes where the desired session end does not align cleanly with candle boundaries, it is recommended that users set the session end two full timeframe periods earlier than the desired session end. This provides an additional safety buffer, ensuring the strategy avoids taking trades near the session boundary.
By default, the session filter is set to false and the default session is set to "2300-2155".
Users can apply the session filter and adjust session boundaries via strategy Settings/Inputs/SESSION FILTER.
Close At End of Session Filter
The close at end of session filter is defined as an exit filter that closes all open positions when the active trading session ends, provided that the session filter is appropriately configured and applied.
When enabled, the strategy monitors the session filter state and detects the transition from an active session to an inactive session. All open trades are closed on the first candle that falls outside the defined session window. This ensures that no positions are carried beyond the user-defined trading session.
The close at end of session filter operates independently of entry conditions and other exit types. When enabled, it will force the closure of all open positions at session end regardless of the selected exit configuration.
Enabling the close at end of session filter can result in variable reward-to-risk outcomes. Because positions are forcibly closed at session end regardless of stop loss or target placement, exits may occur at prices that differ from those implied by the fixed reward-to-risk configuration. This behaviour is intentional and reflects a design trade-off between enforcing strict session boundaries and allowing trades to reach their predefined directional objectives, regardless of how severely distorted the realised reward-to-risk outcomes could be in the event of price gaps.
By default, the close at end of session filter is set to false.
Users can apply the close at end of session filter via strategy Settings/Inputs/CLOSE AT END OF SESSION FILTER.
Users should also ensure that the session filter is applied and that session boundaries are configured appropriately with respect to candle timestamp behaviour, as described in the session filter section above.
Sample Period Filter
The sample period filter is defined as an entry filter that invalidates trade signals that fall outside a user-defined date-time range, with start and end date-times bound to the strategy time zone.
TradingView candle timestamps represent the candle open time, not the candle close time. As a result, sample period boundaries are evaluated based on when a candle opens, even though entries and exits are processed at candle close.
To avoid trades being entered beyond the intended sample period end, users should configure the sample period end date-time at least one full timeframe period earlier than the desired practical sample period end date-time. For example, on a 5-minute chart with a desired end date-time of 01/01/2026 22:00, the end date-time should typically be configured to 01/01/2026 21:55.
The default sample period start and end date-times are set to 01/01/1900 00:00 and 01/01/3000 00:00, respectively.
Users can adjust the sample period via strategy Settings/Inputs/SAMPLE PERIOD FILTER.
█ GENERIC FILTERS
Generic Filter Behaviour
Unless otherwise stated:
"None" inputs return true.
Filters return true only when their selected condition is satisfied.
Above-Equal/Below Zero Filter
The above-equal/below zero filter is defined as an entry filter that evaluates zero centred indicator values relative to the zero line and invalidates trade signals that do not satisfy a user-defined directional condition.
"Above-Equal" returns true when the oscillator value is greater than or equal to zero.
"Below" returns true when the oscillator value is less than zero.
Close Above-Equal/Below Filter
The close price above-equal/below filter is defined as an entry filter that evaluates the most recent candle close price relative to a given time-series value and invalidates trade signals that do not satisfy a user-defined directional condition.
"Above-Equal" returns true when the most recent candle close price is greater than or equal to any given time-series value.
"Below" returns true when the most recent candle close price is less than any given time-series value.
Minimum Percentage Change Positive-Flat/Negative Filter
The minimum percentage change filter is an entry filter that measures the relative change of a time-series value over a configurable historical window and applies a directional threshold condition, invalidating trade signals that do not meet the directional threshold criteria.
The filter compares the current value to its value n bars ago and computes the percentage difference. A signal returns true only if this percentage change satisfies both:
The selected directional requirement.
The user-defined minimum percentage change magnitude.
"Positive-Flat" direction logic:
Accepts values that have increased or remained unchanged, provided the percentage change is greater than or equal to the minimum threshold.
"Negative" direction logic:
Accepts values that have decreased, provided the magnitude of the decrease meets or exceeds the minimum threshold.
When the minimum threshold is set to 0%, the filter behaves as a pure directional check:
"Positive-Flat" accepts ≥ 0% changes.
"Negative" accepts < 0% changes only.
Moving Average (MA) Double and Triple Trend Filters
MA double and triple trend filters are defined as entry filters that evaluate the relative positioning of two or more MA values and invalidate trade signals that do not satisfy a user-defined directional condition.
"Above-Equal" returns true when one MA is greater than or equal to another MA.
"Below" returns true when one MA is less than another MA.
Basic and Exclusive Rejection Filters
The basic rejection filter is defined as an entry filter that evaluates swing-based wick or body rejections of a given price level and invalidates trade signals that do not satisfy the rejection criteria.
For long trades, "Rejection" returns true when all three of the following conditions are met:
The previous candle open is above a given rejection price.
The trough price is less than or equal to a given rejection price.
The green candle that completes the swing closes above a given rejection price.
For short trades, "Rejection" returns true when all three of the following conditions are met:
The previous candle open is below a given rejection price.
The peak price is greater than or equal to a given rejection price.
The red candle that completes the swing closes below a given rejection price.
The exclusive rejection filter is defined as an entry filter that meets basic rejection filter criteria for only one user-defined price level from a set of given price levels. If the rejection criteria is met for more than one of the given price levels the filter will return false.
Basic and Multi-Part Trend Filters
Basic and multi-part trend filters are defined as entry filters that evaluate changes in time-series values from one period to the next and invalidate trade signals that do not satisfy a user-defined trend condition.
Basic trends operate independently of prior trend state, whereas multi-part trends are defined by the presence or absence of preceding trend sequences. The multi-part trend states are distinguished numerically and the conditions are bound to a user-defined trend count.
"Basic Uptrend" returns true when a time-series value is greater than the preceding value. For example, a basic volume uptrend filter returns true if the most recent candle's volume is greater than the preceding candle's volume.
"Basic Downtrend" returns true when a time-series value is less than the preceding value. For example, a basic volume downtrend filter returns true if the most recent candle's volume is less than the preceding candle's volume.
"Uptrend" returns true while a multi-part uptrend state is valid. The uptrend state begins when a new basic uptrend forms following a basic downtrend and remains valid until a new basic downtrend forms. The user-defined trend count will determine which multi-part trend condition is selected. For example, if the user-defined trend count is set to 3, then only 3-part uptrend conditions will return true.
"Downtrend" returns true while a multi-part downtrend state is valid. The downtrend state begins when a new basic downtrend forms following a basic uptrend and remains valid until a new basic uptrend forms. The user-defined trend count will determine which multi-part trend condition is selected. For example, if the user-defined trend count is set to 3, then only 3-part downtrend conditions will return true.
█ FEATURE SET T SPECIFIC FILTERS
All feature set specific indicators use the same calculations as the built-in TradingView indicators unless otherwise stated in the relevant filter sub-section. While users do not need to apply the indicators for the strategy to function, they can of course apply the relevant indicators as visual aids if they so desire.
For further information on how to apply built-in TradingView indicators, please refer to:
www.tradingview.com
As there are no built-in TradingView indicators for the TMA (T3) and TRIX values used in this script, code samples are provided in the relevant sections so that users can build their own Pine Script indicators.
For further information on how to build Pine Script indicators, please refer to:
www.tradingview.com
www.tradingview.com
Tilson Moving Average (TMA) Filters
As there is no built-in indicator for the TMA (T3) value used in this script, users can build their own TMA (T3) indicator in Pine Script by copying the following code and pasting it into a new indicator:
//@version=6
indicator(title = "Tilson Moving Average (T3)", shorttitle = "TMA (T3)", overlay = true)
import TradingView/ta/12 as ta
tma_1_source = input.source(title = 'TMA 1 Source', defval = close, group = 'Tilson Moving Average (TMA)')
tma_1_length = input.int(title = 'TMA 1 Length', defval = 50, minval = 1, group = 'Tilson Moving Average (TMA)')
vf_1 = input.float(title = 'TMA 1 Volume Factor', defval = 0.7, minval = 0.0, maxval = 1.0, step = 0.05, group = 'Tilson Moving Average (TMA)')
tma_1_colour = input.color(title = 'TMA 1 Colour', defval = color.green, group = 'Tilson Moving Average (TMA)')
tma_2_source = input.source(title = 'TMA 2 Source', defval = close, group = 'Tilson Moving Average (TMA)')
tma_2_length = input.int(title = 'TMA 2 Length', defval = 100, minval = 1, group = 'Tilson Moving Average (TMA)')
vf_2 = input.float(title = 'TMA 2 Volume Factor', defval = 0.7, minval = 0.0, maxval = 1.0, step = 0.05, group = 'Tilson Moving Average (TMA)')
tma_2_colour = input.color(title = 'TMA 2 Colour', defval = color.orange, group = 'Tilson Moving Average (TMA)')
tma_3_source = input.source(title = 'TMA 3 Source', defval = close, group = 'Tilson Moving Average (TMA)')
tma_3_length = input.int(title = 'TMA 3 Length', defval = 200, minval = 1, group = 'Tilson Moving Average (TMA)')
vf_3 = input.float(title = 'TMA 3 Volume Factor', defval = 0.7, minval = 0.0, maxval = 1.0, step = 0.05, group = 'Tilson Moving Average (TMA)')
tma_3_colour = input.color(title = 'TMA 3 Colour', defval = color.red, group = 'Tilson Moving Average (TMA)')
tma_1 = ta.t3(tma_1_source, tma_1_length, vf_1)
tma_2 = ta.t3(tma_2_source, tma_2_length, vf_2)
tma_3 = ta.t3(tma_3_source, tma_3_length, vf_3)
plot(tma_1, color = tma_1_colour)
plot(tma_2, color = tma_2_colour)
plot(tma_3, color = tma_3_colour)
Users can define up to three independent TMA (T3) series. The defaults are as follows:
TMA 1: source = close, length = 50, volume factor = 0.7.
TMA 2: source = close, length = 100, volume factor = 0.7.
TMA 3: source = close, length = 200, volume factor = 0.7.
Users can adjust the TMA inputs via strategy Settings/Inputs/TILSON MOVING AVERAGE (TMA).
Users can apply up to three independent close above-equal/below filters (see generic filters section above), one for each user-defined TMA (T3). The default mode for all three TMA close above-equal/below filters is set to "None".
Users can apply up to three independent TMA double trend filters (see generic filters section above), one filter for each of the three possible configurations. The defaults are as follows:
TMA 1 above-equal/below TMA 2 is set to "None".
TMA 2 above-equal/below TMA 3 is set to "None".
TMA 1 above-equal/below TMA 3 is set to "None".
The TMA rejection filter is defined as an exclusive rejection filter (see generic filters section above) that will only return true if the user-defined TMA is rejected exclusive of the other two TMAs.
The default mode for the TMA rejection filter is set to "None".
Users can apply the TMA filters and adjust filter parameters via strategy Settings/Inputs/TMA FILTERS.
Trend Filters
The trend filters in this section extend the generic basic and multi-part trend filters by applying the same logical framework to structurally defined peak and trough prices rather than to a continuous time-series. By operating on completed swing structures, these filters introduce an additional structural layer that differentiates between directional continuation and return line behaviour. This structural distinction necessitates the inclusion of return line variations alongside standard uptrend and downtrend conditions.
Within this framework, peak-to-peak sequences define upper trend filters and trough-to-trough sequences define lower trend filters.
A peak-to-peak upward structural progression is classified as a return line uptrend, while a peak-to-peak downward progression is classified as a downtrend.
Conversely, a trough-to-trough upward structural progression is classified as an uptrend, while a trough-to-trough downward progression is classified as a return line downtrend.
Upper trends include:
Return line uptrends.
Downtrends.
Lower trends include:
Uptrends.
Return line downtrends.
Below are links to my multi-part trend indicators, which can be used as visual aids for the relevant filter conditions included in this script:
The upper and lower trend filter's defaults are as follows:
Upper Trend mode is set to "None".
Upper Trend count is set to 3.
Lower Trend mode is set to "None".
Lower Trend count is set to 3.
When basic trend modes are selected, the trend count inputs are redundant and have no effect.
Users can apply the trend filters via strategy Settings/Inputs/TREND FILTERS.
Trendline Filters
The trendline value calculations used in this script are based on those included in my trendlines indicator (link below for visual reference). Note that previous trendline values are not factored into the filter logic used in this script, only the most recent peak-to-peak (resistance) and trough-to-trough (support) lines are evaluated.
The trendline rejection filter is defined as an exclusive rejection filter (see generic filters section above) that will only return true if the user-defined trendline value is rejected exclusive of the other trendline value.
Four rejection modes are available:
Support.
Resistance.
Support-turned-resistance.
Resistance-turned-support.
These operate asymmetrically depending on trade direction.
For long entry conditions, the filter will only evaluate support and resistance-turned-support, both of which require a bullish rejection (i.e. price rejecting upward from the relevant trendline).
For short entry conditions, the filter will only evaluate resistance and support-turned-resistance, both of which require a bearish rejection (i.e. price rejecting downward from the relevant trendline).
The default trendline rejection filter mode is set to "None".
Users can apply the trendline filter via strategy Settings/Inputs/TRENDLINE FILTERS.
Triple Exponential Moving Average (TRIX) Filters
As there is no built-in indicator for the TRIX values used in this script, users can build their own TRIX indicator in Pine Script by copying the following code and pasting it into a new indicator:
//@version=6
indicator(title = "Triple Exponential Moving Average (TRIX)", shorttitle = "TRIX", overlay = false)
import TradingView/ta/12 as ta
trix_source = input.source(title = 'TRIX Source', defval = close, group = 'Triple Exponential Moving Average (TRIX)')
trix_length = input.int(title = 'TRIX Length', defval = 14, minval = 1, group = 'Triple Exponential Moving Average (TRIX)')
trix_signal_length = input.int(title = 'TRIX Signal Length', defval = 9, minval = 1, group = 'Triple Exponential Moving Average (TRIX)')
trix_exponential = input.bool(title = 'TRIX Exponential', defval = true, group = 'Triple Exponential Moving Average (TRIX)')
trix_colour = input.color(title = 'TRIX Colour', defval = color.yellow, group = 'Triple Exponential Moving Average (TRIX)')
trix_sig_colour = input.color(title = 'TRIX Signal Colour', defval = color.blue, group = 'Triple Exponential Moving Average (TRIX)')
trix_hist_pos_colour = input.color(title = 'TRIX Histogram Positive Colour', defval = color.rgb(76, 175, 79, 80) , group = 'Triple Exponential Moving Average (TRIX)')
trix_neg_colour = input.color(title = 'TRIX Histogram Negative Colour', defval = color.rgb(255, 82, 82, 80), group = 'Triple Exponential Moving Average (TRIX)')
= ta.trix(trix_source, trix_length, trix_signal_length, trix_exponential)
plot(trix, color = trix_colour)
plot(trix_signal, color = trix_sig_colour)
plot(trix_hist, color = trix_hist >= 0 ? trix_hist_pos_colour : trix_neg_colour, style = plot.style_columns)
The TRIX defaults are as follows:
Source is set to "Close".
Length is set to 14.
Signal length is set to 9.
Exponential mode is set to true.
Users can adjust the TRIX inputs via strategy Settings/Inputs/TRIPLE EXPONENTIAL MOVING AVERAGE (TRIX).
The TRIX above-equal/below signal filter is defined as an entry filter that evaluates the relative positioning of the TRIX value and its signal line and invalidates trade signals that do not satisfy a user-defined directional condition.
The default mode for the TRIX above-equal/below signal filter is set to "None".
The default mode for the TRIX Histogram above-equal/below zero filter (see generic filters section above) is set to "None".
The TRIX Histogram minimum percent change positive-flat/negative filter (see generic filters section above) defaults are as follows:
Mode is set to "None".
Minimum percent change is set to 0.
Lookback is set to 3.
The TRIX Histogram trend filter (see generic filters section above) defaults are as follows:
Mode is set to "None".
Trend count is set to 3.
Users can apply the TRIX filters and adjust filter parameters via strategy Settings/Inputs/TRIX FILTERS.
True Strength Index (TSI) Filters
The TSI defaults are as follows:
Long length is set to 25.
Short length is set to 13.
Signal length is set to 13.
Users can adjust the TSI inputs via strategy Settings/Inputs/TRUE STRENGTH INDEX (TSI).
The TSI above-equal/below signal filter is defined as an entry filter that evaluates the relative positioning of the TSI value and its signal line and invalidates trade signals that do not satisfy a user-defined directional condition.
The default mode for the TSI above-equal/below signal filter is set to "None".
The default mode for the TSI above-equal/below zero filter (see generic filters section above) is set to "None".
The default mode for the TSI Signal above-equal/below zero filter (see generic filters section above) is set to "None".
The TSI minimum percent change positive-flat/negative filter (see generic filters section above) defaults are as follows:
Mode is set to "None".
Minimum percent change is set to 0.
Lookback is set to 3.
The TSI Signal minimum percent change positive-flat/negative filter (see generic filters section above) defaults are as follows:
Mode is set to "None".
Minimum percent change is set to 0.
Lookback is set to 3.
The TSI trend filter (see generic filters section above) defaults are as follows:
Mode is set to "None".
Trend count is set to 3.
The TSI Signal trend filter (see generic filters section above) defaults are as follows:
Mode is set to "None".
Trend count is set to 3.
Users can apply the TSI filters and adjust filter parameters via strategy Settings/Inputs/TSI FILTERS.
█ ALERTS
Users can set alerts for any given strategy configuration via the alerts dialogue box.
Users must first ensure that the correct condition (the strategy title) is selected from the first drop-down list in the alert dialogue box's condition field.
Default alert messages have been configured for both entries and exits so that users can more effectively distinguish between long and short entries and exits while using long-short configurations.
To get alerts for both entries and exits the user should change the value in the condition field's second drop-down list from "Order fills only and alert() function calls" to "Order fills only". When using "Order fills only" with long-short configurations, it is recommended that users define their alert via the alert name field and use only the default {{strategy.order.alert_message}} call in the alert message field.
Alert conditions generated by "Order fills only" are evaluated after entry conditions have been satisfied and operational constraints (risk, position size and margin requirements) have been applied. As such, trade signals that would result in position sizes exceeding the simulated account's margin constraints will not generate alerts.
To get alerts for entries only the user should change the value in the condition field's second drop-down list from "Order fills only and alert() function calls" to "alert() function calls only".
The default alert messages generated by "Order fills only" are as follows:
"long entry".
"long exit".
"short entry".
"short exit".
The default alert messages generated by "alert() function calls only" are as follows:
"long entry".
"short entry".
Alert conditions generated by "alert() function calls only" are operational-constraint-agnostic and will generate alerts whenever entry conditions are satisfied, regardless of the simulated account's margin constraints.
For further information on setting and managing alerts, please refer to:
www.tradingview.com
www.tradingview.com
www.tradingview.com
█ LIMITATIONS AND CONSIDERATIONS
Backtesting
Backtest results should always be interpreted cautiously. Strategy performance can vary significantly across time periods and sample sets. While strong historical performance does not guarantee future results, poor historical performance reliably indicates a weak strategy when sample sizes are statistically meaningful.
Statistical Significance and Path-Dependent Outcomes (Overfitting)
In statistical practice, sample sizes of 100 observations are sometimes cited as a rough lower bound for certain forms of basic significance testing. In the context of trading strategy evaluation, such sample sizes are rarely sufficient to produce results that are meaningfully reliable or replicable. Based on practical experience, sample sizes closer to 1,000 observations or more are generally required before performance characteristics begin to stabilise. As a general rule, larger sample sizes increase the reliability and replicability of observed results.
Path dependence refers to situations in which outcomes are determined not only by initial conditions, but by the specific and unique sequence of price movements over a given time period.
Even with large sample sizes, favourable net profit outcomes should be interpreted with caution when they are primarily driven by either variable reward-to-risk configurations or fixed reward-to-risk configurations that employ unrealistically high reward multiples. In both cases, performance is often strongly influenced by path-dependent effects, making such outcomes less reliable and less replicable.
Fixed reward-to-risk configurations are generally less susceptible to path dependence when the reward multiple is kept within reasonable bounds. However, empirical studies and practitioner research suggest that reward multiples above approximately 3:1 increasingly exhibit the same path-dependent characteristics observed in variable reward-to-risk strategies.
Bar Magnifier
Due to the limitations of OHLC data, intra-bar price movement cannot be precisely determined.
When both stop loss and target levels are reached within the same candle, assumptions are made by the strategy tester.
Pine Script's bar magnifier partially mitigates this limitation by evaluating lower-timeframe data. However, this feature is available only to TradingView Premium users and remains inherently limited.
For further information on the bar magnifier functionality, please refer to:
www.tradingview.com
www.tradingview.com
TradingView Premium users can enable bar magnifier via strategy Settings/Properties/FILL ORDERS.
Processing Orders at Candle Close
Backtests cannot accurately account for slippage between signal generation and trade execution.
A practical mitigation is to use fixed-distance stop losses and targets rather than absolute price levels, a feature supported by many brokers and APIs.
Empirical Probabilities
Empirical probabilities are derived directly from observed outcomes rather than from theoretical models or assumed distributions. In the context of trading, they are calculated by measuring the relative frequency of events (such as wins and losses) across a large sample of historical trades.
Unlike conditional or model-based probabilities, empirical probabilities make no assumptions. Their validity relies primarily on sample size and the consistency of the rules used to generate observations, making them particularly relevant for trading systems evaluated under the law of large numbers.
Empirical probabilities are most useful for comparative analysis, such as assessing how different configurations, filters or exit mechanisms alter the statistical behaviour of a strategy under identical conditions. They are not intended to represent true predictive probabilities or to imply stable future performance.
To study empirical probabilities for comparative purposes, it is recommended that users set commission and both long and short margin values to 0% in order to maximise sample size. However, users should not interpret any resulting profits as realistic. Setting commission and margin (in particular) to 0% produces highly distorted outcomes that are not representative of realistic live trading conditions.
█ DISCLAIMER
This Pine Script strategy is provided for educational purposes only and does not constitute financial advice in any form.
Pine Script® strategy
VWAP and Previous Day Closing VWAP1. Understanding the Two Lines
Current VWAP (The Dynamic Curve): This represents the average price paid throughout the current session, weighted by volume. It moves as new trades come in.
Previous Day’s Closing VWAP (The Flat Level): This is a fixed horizontal line representing where the institutional "average price" finished yesterday. It serves as a major psychological anchor point for the current day.
2. Common Trading Strategies
The Mean Reversion (The "Rubber Band")
If the price gaps up or moves significantly away from both the current VWAP and the Previous Day's VWAP early in the morning, traders often look for a "reversion to the mean."
The Logic: Large institutions rarely like to buy significantly above the day's average price.
The Trade: If the price starts losing momentum far above the VWAP lines, traders may look for a short position back down toward the Current VWAP.
The "Value" Retest
The Previous Day’s Closing VWAP often acts as a support or resistance zone.
Support: If the price opens above yesterday's VWAP, drops down to touch it, and then bounces, it confirms that buyers are defending "yesterday's value."
Resistance: If the price opens below it and fails to break above it, the market is signaling bearishness.
The Crossover Signal
When the Current VWAP crosses over or under the Previous Day’s Closing VWAP, it indicates a shift in trend strength.
Bullish: Current VWAP crosses above Previous Day's VWAP. This suggests today's buyers are more aggressive than yesterday's average.
Bearish: Current VWAP crosses below Previous Day's VWAP. This suggests today's selling pressure is heavier than yesterday's average.
3. Best Practices & Pro-Tips
Timeframes: This indicator is most effective on 1-minute, 5-minute, or 15-minute charts. On a Daily (D) chart, the lines will disappear or look like single dots because VWAP is calculated intraday.
Volume is Key: VWAP is only as strong as the volume behind it. If a bounce off the VWAP happens on low volume, it’s less reliable than a bounce on high volume.
The "No-Trade Zone": Many professional traders avoid taking long positions when the price is below the current VWAP, as they are essentially "buying at a premium" relative to the day's average sellers.
Pine Script® indicator
Structural Drift Persistence | CipherDecodedStructural Drift Persistence | CipherDecoded
Structural Drift Persistence measures the degree of directional dominance present within a rolling market window.
Rather than focusing on volatility or absolute returns alone, this framework evaluates how consistently price movement aligns in one direction relative to total movement. The result is a normalized structural reading between −1 and +1, allowing regime classification independent of asset price level.
Conceptual Framework
Markets alternate between:
Persistent directional expansion
Mean-reverting compression
Transitional instability
Structural Drift Persistence quantifies which regime is currently dominant.
Values approaching:
+1 indicate sustained upward directional control
−1 indicate sustained downward directional control
0 indicate rotational or indecisive structure
Regime Qualification
A configurable threshold defines when directional dominance is strong enough to qualify as a structurally trending environment.
Higher thresholds isolate only the strongest regimes
Lower thresholds increase sensitivity but admit more noise
This design allows the tool to adapt across assets and timeframes while maintaining methodological consistency.
Intended Use
Structural Drift Persistence is designed to:
Filter trend-following systems
Confirm directional bias
Identify regime shifts
Reduce participation during structurally inefficient conditions
It performs best when paired with independent expansion or volatility frameworks.
Design Philosophy
This indicator follows a measurement-first architecture:
Continuous structural quantification
Discrete regime classification
Visual clarity without signal overproduction
No smoothing, lag-inducing transforms, or predictive overlays are applied.
The output reflects raw structural behavior within the selected window.
Pine Script® indicator
DANNYGITS BAMBOO PLAN -1 The DANNYGITS BAMBOO PLAN is a comprehensive trend-following and reversal indicator designed for high-precision price action trading. It combines multi-timeframe moving average analysis with a custom-engineered Gann Box "Bamboo Stalk" to identify high-sensitivity nodes in the market.
Core Features:
The Wind & Ribbon: Uses a triple SMA system (8, 20, 200) with a dynamic trend ribbon to visualize momentum and institutional flow.
9-Level Bamboo Stalk: A fully customizable Gann Box that allows for manual input of key nodes (including the specific 0.168 sensitivity levels) with a built-in "Flip Direction" toggle to measure from Floor-to-Ceiling or Ceiling-to-Floor.
Price Action Signals:
20Ha Recovery (Blue): Identifies bullish momentum shifts reclaiming the 20 SMA.
20Ha Resistance (Orange): Highlights bearish rejections and halts at the 20 SMA.
180 Reversals (B180/S180): Flags powerful "engulfing-style" rejections at key moving average levels.
GR (Gann Rejection): Detects wick rejections occurring exactly on the custom Gann levels.
Dynamic Labels: Real-time price targets are projected on the right side of the chart for precise exit and entry planning.
Pine Script® indicator
True Range Percentage MACDTrue Range Percentage MACD (TR% MACD) is a volatility-oscillator that measures relative range movement and applies MACD logic to identify volatility momentum cycles.
What it measures
True Range (TR) captures intrabar range plus gap effects.
This script converts TR into a percentage of price:
TR%=TR×100 / ∣Sourcet−1∣
(Source defaults to HL2 and uses the prior bar value for normalization; a minimum tick guard is applied to avoid division by zero.)
Smoothing
TR% can be smoothed using a selectable moving average type (EMA, SMA, RMA, VWMA, WMA, ALMA, SWMA, HMA, or NONE) and a dedicated smoothing length. This helps control noise before MACD processing.
MACD on volatility
The indicator then computes:
MACD = MA(TR%)fast − MA(TR%)slow
Signal = MA(MACD)signal
Histogram = MACD − Signal
Interpretation
This is not a price-trend MACD—it's a volatility momentum MACD:
Rising histogram often indicates increasing relative volatility (range expansion accelerating).
Falling histogram often indicates volatility cooling (range expansion decelerating / contracting).
Crossovers can help time transitions between quiet and active regimes, and complement trend systems (e.g., filter breakouts to periods of rising volatility).
Visuals & alerts
Histogram uses a 4-state coloring (positive/negative + rising/falling).
Optional plot shows smoothed TR%.
Built-in alerts:
histogram rising→falling and falling→rising state flips
MACD crossing Signal (up/down)
MACD crossing zero (up/down)
Pine Script® indicator
Seasonal Trend by LogReturn ProSeasonal Trend by LogReturn Pro
Understand the market’s typical yearly rhythm and trade with statistical tailwinds instead of against them.
Seasonal Trend by LogReturn Pro visualizes how an asset historically behaves throughout the year.
By analyzing past years, it builds an average annual path (seasonality curve) and shows whether the market is usually strong or weak at the current time.
It can also project a potential price path for the remainder of the year based on historical tendencies.
What you can see instantly
• Historically strong and weak periods during the year
• Whether the current market phase has seasonal tailwind or headwind
• Typical yearly performance progression
• A forward seasonal projection (optional)
• A relative performance curve across the full year
How it works
The indicator aligns multiple past years by calendar date and combines them into one average yearly behavior.
Think of it as a “typical year template” created from historical market behavior.
Two main visualizations are available:
Relative seasonal curve
Shows the typical cumulative performance throughout the year
Absolute projection (optional)
Projects a possible price path forward from today following historical seasonal tendencies
How traders use it
Trade with seasonal tailwinds
Focus on long trades during historically strong periods and be more cautious during weak phases.
Typical workflow:
• Increase confidence when setups align with strong seasonal phases
• Reduce exposure during historically weak periods
• Adjust position sizing based on seasonal bias
Improve swing trade context
Seasonality helps evaluate trade quality:
Bullish setup in strong seasonal period → higher probability
Bullish setup in weak seasonal period → lower conviction
Plan the rest of the year
The forward projection helps estimate how the year often develops on average.
This is not a prediction — it is a probabilistic expectation based on history.
Settings
Past Years
Number of years used to build the seasonal pattern
Higher = smoother & more stable
Lower = more responsive to recent market behavior
Show values on main chart
Displays the projected price path
Show relative values
Displays the seasonal performance curve
Show entire year projection
Displays the full seasonal path instead of only future values
Important note
Seasonality is not a standalone trading signal.
It provides statistical context and works best combined with trend analysis, structure, or other strategies.
Seasonal Trend by LogReturn Pro helps you align trades with the market’s natural rhythm instead of fighting it.
Pine Script® indicator
Smart MACD + KNN (Dynamic SL Fix)This script is a comprehensive trading system designed for TradingView that combines traditional momentum indicators with machine learning concepts and advanced trade management logic.
Here is a detailed description of its features:
1. Signal Generation (The "Brain")
Smart MACD: Uses a standard MACD (Moving Average Convergence Divergence) to identify buy and sell opportunities.
KNN Machine Learning: Filters every MACD signal using a K-Nearest Neighbors algorithm. It analyzes historical market data (RSI, CCI, Volatility, Volume) to determine if the current signal is statistically likely to be profitable. If the ML prediction is negative, the signal is ignored.
Trend Filter: An optional 200 EMA filter ensures you only trade with the long-term trend (Buy above EMA 200, Sell below).
Volatility Guard: Automatically blocks signals during extreme volatility spikes (like news events) to prevent bad entries.
2. Trade Management (The Logic)
Single Trade Mode: The script enforces a "one trade at a time" rule. It will not generate a new "Buy" signal if a "Buy" trade is already active. It waits for the trade to hit Take Profit (TP) or Stop Loss (SL) before resetting.
Flip Capability: While it blocks same-direction signals, it allows opposite signals. If you are in a Long trade and a valid Short signal appears, it effectively "flips" the trade—closing the Long and opening the Short immediately.
Dynamic Stop Loss (Stepped ROI): This is a profit-locking feature.
Trigger 1: When price moves X% in profit, the SL moves to a specified ROI % (e.g., Break Even).
Trigger 2: When price moves further to Y% profit, the SL moves again to lock in a larger profit.
3. Automation & Alerts
Customizable Messages: You can input your own text or JSON commands for Entry, TP, and SL alerts directly in the settings menu.
3x Trigger Safety: Every alert fires 3 times continuously to ensure that external bots or webhooks receive the signal, minimizing the risk of missed trades due to network lag.
4. Visuals
TP/SL Lines: Draws active Stop Loss and Take Profit lines on the chart that update in real-time.
Dashboard Table: A panel in the top-right corner displays the precise price levels for the current TP and SL.
Fog & Colors: The background and candles change color based on the trend direction, giving you an immediate visual cue of market sentiment.
Pine Script® indicator






















