PnL Bubble [%] | Fractalyst1. What's the indicator purpose?
The PnL Bubble indicator transforms your strategy's trade PnL percentages into an interactive bubble chart with professional-grade statistics and performance analytics. It helps traders quickly assess system profitability, understand win/loss distribution patterns, identify outliers, and make data-driven strategy improvements.
How does it work?
Think of this indicator as a visual report card for your trading performance. Here's what it does:
What You See
Colorful Bubbles: Each bubble represents one of your trades
Blue/Cyan bubbles = Winning trades (you made money)
Red bubbles = Losing trades (you lost money)
Bigger bubbles = Bigger wins or losses
Smaller bubbles = Smaller wins or losses
How It Organizes Your Trades:
Like a Photo Album: Instead of showing all your trades at once (which would be messy), it shows them in "pages" of 500 trades each:
Page 1: Your first 500 trades
Page 2: Trades 501-1000
Page 3: Trades 1001-1500, etc.
What the Numbers Tell You:
Average Win: How much money you typically make on winning trades
Average Loss: How much money you typically lose on losing trades
Expected Value (EV): Whether your trading system makes money over time
Positive EV = Your system is profitable long-term
Negative EV = Your system loses money long-term
Payoff Ratio (R): How your average win compares to your average loss
R > 1 = Your wins are bigger than your losses
R < 1 = Your losses are bigger than your wins
Why This Matters:
At a Glance: You can instantly see if you're a profitable trader or not
Pattern Recognition: Spot if you have more big wins than big losses
Performance Tracking: Watch how your trading improves over time
Realistic Expectations: Understand what "average" performance looks like for your system
The Cool Visual Effects:
Animation: The bubbles glow and shimmer to make the chart more engaging
Highlighting: Your biggest wins and losses get extra attention with special effects
Tooltips: hover any bubble to see details about that specific trade.
What are the underlying calculations?
The indicator processes trade PnL data using a dual-matrix architecture for optimal performance:
Dual-Matrix System:
• Display Matrix (display_matrix): Bounded to 500 trades for rendering performance
• Statistics Matrix (stats_matrix): Unbounded storage for complete statistical accuracy
Trade Classification & Aggregation:
// Separate wins, losses, and break-even trades
if val > 0.0
pos_sum += val // Sum winning trades
pos_count += 1 // Count winning trades
else if val < 0.0
neg_sum += val // Sum losing trades
neg_count += 1 // Count losing trades
else
zero_count += 1 // Count break-even trades
Statistical Averages:
avg_win = pos_count > 0 ? pos_sum / pos_count : na
avg_loss = neg_count > 0 ? math.abs(neg_sum) / neg_count : na
Win/Loss Rates:
total_obs = pos_count + neg_count + zero_count
win_rate = pos_count / total_obs
loss_rate = neg_count / total_obs
Expected Value (EV):
ev_value = (avg_win × win_rate) - (avg_loss × loss_rate)
Payoff Ratio (R):
R = avg_win ÷ |avg_loss|
Contribution Analysis:
ev_pos_contrib = avg_win × win_rate // Positive EV contribution
ev_neg_contrib = avg_loss × loss_rate // Negative EV contribution
How to integrate with any trading strategy?
Equity Change Tracking Method:
//@version=6
strategy("Your Strategy with Equity Change Export", overlay=true)
float prev_trade_equity = na
float equity_change_pct = na
if barstate.isconfirmed and na(prev_trade_equity)
prev_trade_equity := strategy.equity
trade_just_closed = strategy.closedtrades != strategy.closedtrades
if trade_just_closed and not na(prev_trade_equity)
current_equity = strategy.equity
equity_change_pct := ((current_equity - prev_trade_equity) / prev_trade_equity) * 100
prev_trade_equity := current_equity
else
equity_change_pct := na
plot(equity_change_pct, "Equity Change %", display=display.data_window)
Integration Steps:
1. Add equity tracking code to your strategy
2. Load both strategy and PnL Bubble indicator on the same chart
3. In bubble indicator settings, select your strategy's equity tracking output as data source
4. Configure visualization preferences (colors, effects, page navigation)
How does the pagination system work?
The indicator uses an intelligent pagination system to handle large trade datasets efficiently:
Page Organization:
• Page 1: Trades 1-500 (most recent)
• Page 2: Trades 501-1000
• Page 3: Trades 1001-1500
• Page N: Trades to
Example: With 1,500 trades total (3 pages available):
• User selects Page 1: Shows trades 1-500
• User selects Page 4: Automatically falls back to Page 3 (trades 1001-1500)
5. Understanding the Visual Elements
Bubble Visualization:
• Color Coding: Cyan/blue gradients for wins, red gradients for losses
• Size Mapping: Bubble size proportional to trade magnitude (larger = bigger P&L)
• Priority Rendering: Largest trades displayed first to ensure visibility
• Gradient Effects: Color intensity increases with trade magnitude within each category
Interactive Tooltips:
Each bubble displays quantitative trade information:
tooltip_text = outcome + " | PnL: " + pnl_str +
"\nDate: " + date_str + " " + time_str +
"\nTrade #" + str.tostring(trade_number) + " (Page " + str.tostring(active_page) + ")" +
"\nRank: " + str.tostring(rank) + " of " + str.tostring(n_display_rows) +
"\nPercentile: " + str.tostring(percentile, "#.#") + "%" +
"\nMagnitude: " + str.tostring(magnitude_pct, "#.#") + "%"
Example Tooltip:
Win | PnL: +2.45%
Date: 2024.03.15 14:30
Trade #1,247 (Page 3)
Rank: 5 of 347
Percentile: 98.6%
Magnitude: 85.2%
Reference Lines & Statistics:
• Average Win Line: Horizontal reference showing typical winning trade size
• Average Loss Line: Horizontal reference showing typical losing trade size
• Zero Line: Threshold separating wins from losses
• Statistical Labels: EV, R-Ratio, and contribution analysis displayed on chart
What do the statistical metrics mean?
Expected Value (EV):
Represents the mathematical expectation per trade in percentage terms
EV = (Average Win × Win Rate) - (Average Loss × Loss Rate)
Interpretation:
• EV > 0: Profitable system with positive mathematical expectation
• EV = 0: Break-even system, profitability depends on execution
• EV < 0: Unprofitable system with negative mathematical expectation
Example: EV = +0.34% means you expect +0.34% profit per trade on average
Payoff Ratio (R):
Quantifies the risk-reward relationship of your trading system
R = Average Win ÷ |Average Loss|
Interpretation:
• R > 1.0: Wins are larger than losses on average (favorable risk-reward)
• R = 1.0: Wins and losses are equal in magnitude
• R < 1.0: Losses are larger than wins on average (unfavorable risk-reward)
Example: R = 1.5 means your average win is 50% larger than your average loss
Contribution Analysis (Σ):
Breaks down the components of expected value
Positive Contribution (Σ+) = Average Win × Win Rate
Negative Contribution (Σ-) = Average Loss × Loss Rate
Purpose:
• Shows how much wins contribute to overall expectancy
• Shows how much losses detract from overall expectancy
• Net EV = Σ+ - Σ- (Expected Value per trade)
Example: Σ+: 1.23% means wins contribute +1.23% to expectancy
Example: Σ-: -0.89% means losses drag expectancy by -0.89%
Win/Loss Rates:
Win Rate = Count(Wins) ÷ Total Trades
Loss Rate = Count(Losses) ÷ Total Trades
Shows the probability of winning vs losing trades
Higher win rates don't guarantee profitability if average losses exceed average wins
7. Demo Mode & Synthetic Data Generation
When using built-in sources (close, open, etc.), the indicator generates realistic demo trades for testing:
if isBuiltInSource(source_data)
// Generate random trade outcomes with realistic distribution
u_sign = prand(float(time), float(bar_index))
if u_sign < 0.5
v_push := -1.0 // Loss trade
else
// Skewed distribution favoring smaller wins (realistic)
u_mag = prand(float(time) + 9876.543, float(bar_index) + 321.0)
k = 8.0 // Skewness factor
t = math.pow(u_mag, k)
v_push := 2.5 + t * 8.0 // Win trade
Demo Characteristics:
• Realistic win/loss distribution mimicking actual trading patterns
• Skewed distribution favoring smaller wins over large wins
• Deterministic randomness for consistent demo results
• Includes jitter effects to prevent visual overlap
8. Performance Limitations & Optimizations
Display Constraints:
points_count = 500 // Maximum 500 dots per page for optimal performance
Pine Script v6 Limits:
• Label Count: Maximum 500 labels per indicator
• Line Count: Maximum 100 lines per indicator
• Box Count: Maximum 50 boxes per indicator
• Matrix Size: Efficient memory management with dual-matrix system
Optimization Strategies:
• Pagination System: Handle unlimited trades through 500-trade pages
• Priority Rendering: Largest trades displayed first for maximum visibility
• Dual-Matrix Architecture: Separate display (bounded) from statistics (unbounded)
• Smart Fallback: Automatic page clamping prevents empty displays
Impact & Workarounds:
• Visual Limitation: Only 500 trades visible per page
• Statistical Accuracy: Complete dataset used for all calculations
• Navigation: Use page input to browse through entire trade history
• Performance: Smooth operation even with thousands of trades
9. Statistical Accuracy Guarantees
Data Integrity:
• Complete Dataset: Statistics matrix stores ALL trades without limit
• Proper Aggregation: Separate tracking of wins, losses, and break-even trades
• Mathematical Precision: Pine Script v6's enhanced floating-point calculations
• Dual-Matrix System: Display limitations don't affect statistical accuracy
Calculation Validation:
// Verified formulas match standard trading mathematics
avg_win = pos_sum / pos_count // Standard average calculation
win_rate = pos_count / total_obs // Standard probability calculation
ev_value = (avg_win * win_rate) - (avg_loss * loss_rate) // Standard EV formula
Accuracy Features:
• Mathematical Correctness: Formulas follow established trading statistics
• Data Preservation: Complete dataset maintained for all calculations
• Precision Handling: Proper rounding and boundary condition management
• Real-Time Updates: Statistics recalculated on every new trade
10. Advanced Technical Features
Real-Time Animation Engine:
// Shimmer effects with sine wave modulation
offset = math.sin(shimmer_t + phase) * amp
// Dynamic transparency with organic flicker
new_transp = math.min(flicker_limit, math.max(-flicker_limit, cur_transp + dir * flicker_step))
• Sine Wave Shimmer: Dynamic glowing effects on bubbles
• Organic Flicker: Random transparency variations for natural feel
• Extreme Value Highlighting: Special visual treatment for outliers
• Smooth Animations: Tick-based updates for fluid motion
Magnitude-Based Priority Rendering:
// Sort trades by magnitude for optimal visual hierarchy
sort_indices_by_magnitude(values_mat)
• Largest First: Most important trades always visible
• Intelligent Sorting: Custom bubble sort algorithm for trade prioritization
• Performance Optimized: Efficient sorting for real-time updates
• Visual Hierarchy: Ensures critical trades never get hidden
Professional Tooltip System:
• Quantitative Data: Pure numerical information without interpretative language
• Contextual Ranking: Shows trade position within page dataset
• Percentile Analysis: Performance ranking as percentage
• Magnitude Scaling: Relative size compared to page maximum
• Professional Format: Clean, data-focused presentation
11. Quick Start Guide
Step 1: Add Indicator
• Search for "PnL Bubble | Fractalyst" in TradingView indicators
• Add to your chart (works on any timeframe)
Step 2: Configure Data Source
• Demo Mode: Leave source as "close" to see synthetic trading data
• Strategy Mode: Select your strategy's PnL% output as data source
Step 3: Customize Visualization
• Colors: Set positive (cyan), negative (red), and neutral colors
• Page Navigation: Use "Trade Page" input to browse trade history
• Visual Effects: Built-in shimmer and animation effects are enabled by default
Step 4: Analyze Performance
• Study bubble patterns for win/loss distribution
• Review statistical metrics: EV, R-Ratio, Win Rate
• Use tooltips for detailed trade analysis
• Navigate pages to explore full trade history
Step 5: Optimize Strategy
• Identify outlier trades (largest bubbles)
• Analyze risk-reward profile through R-Ratio
• Monitor Expected Value for system profitability
• Use contribution analysis to understand win/loss impact
12. Why Choose PnL Bubble Indicator?
Unique Advantages:
• Advanced Pagination: Handle unlimited trades with smart fallback system
• Dual-Matrix Architecture: Perfect balance of performance and accuracy
• Professional Statistics: Institution-grade metrics with complete data integrity
• Real-Time Animation: Dynamic visual effects for engaging analysis
• Quantitative Tooltips: Pure numerical data without subjective interpretations
• Priority Rendering: Intelligent magnitude-based display ensures critical trades are always visible
Technical Excellence:
• Built with Pine Script v6 for maximum performance and modern features
• Optimized algorithms for smooth operation with large datasets
• Complete statistical accuracy despite display optimizations
• Professional-grade calculations matching institutional trading analytics
Practical Benefits:
• Instantly identify system profitability through visual patterns
• Spot outlier trades and risk management issues
• Understand true risk-reward profile of your strategies
• Make data-driven decisions for strategy optimization
• Professional presentation suitable for performance reporting
Disclaimer & Risk Considerations:
Important: Historical performance metrics, including positive Expected Value (EV), do not guarantee future trading success. Statistical measures are derived from finite sample data and subject to inherent limitations:
• Sample Bias: Historical data may not represent future market conditions or regime changes
• Ergodicity Assumption: Markets are non-stationary; past statistical relationships may break down
• Survivorship Bias: Strategies showing positive historical EV may fail during different market cycles
• Parameter Instability: Optimal parameters identified in backtesting often degrade in forward testing
• Transaction Cost Evolution: Slippage, spreads, and commission structures change over time
• Behavioral Factors: Live trading introduces psychological elements absent in backtesting
• Black Swan Events: Extreme market events can invalidate statistical assumptions instantaneously
חפש סקריפטים עבור "纳斯达克指数期货cfd"
MACD Classic MT5 Style (2 Lines + Histogram)MACD เหมือน MT5 นะจ๊ะ
MACD Line (Green) = Difference between Fast EMA and Slow EMA
Signal Line (Red) = EMA of the MACD Line
Histogram = Distance between MACD Line and Signal Line (or in MT5 style, just MACD Line itself)
Ultra-Precise Scalper with OB, W/M & Liquidity Sweepsupport and resistance with order block detection and M and W PATTERNS
Competition Signals — GBPUSD M15 (Manual)Here’s a brief and clear rundown on how to privately share your TradingView indicator:
Quick Guide: Share a Private TradingView Indicator
1. You Need a Premium Account
Only users with a Premium TradingView subscription can publish invite-only scripts, which allow private sharing. You can identify invite-only scripts by a lock icon next to the script’s name. 
2. Publish Your Script as Invite-Only
• Open your indicator in the Pine Editor.
• Click “Publish Script”, choose “Private” visibility, then select Invite-Only as the access type. 
• After publishing, a “Manage Access” button will appear on your script page, letting you control which TradingView users can use it. 
3. Grant Access to Others
• Use the “Manage Access” section to add specific TradingView usernames.
• Those added will be able to see the script under their “Invite-Only Scripts” tab in their Indicators panel. 
4. Privacy & Control Maintained
• Invite-Only scripts are closed-source: Users can’t view or copy your code. 
• You retain full control—only those you authorize can use it.
Summary Table
Step Action
1. Premium Required Needed to publish invite-only scripts
2. Publish Invite-Only Via Pine Editor → “Publish Script” → Invite-Only
3. Manage Access Use “Manage Access” to add users
4. Users Access They access via the “Invite-Only Scripts” tab
5. Code Privacy Script is hidden; users can’t see or copy it
Let me know if you’d like help walking through these steps or setting up permissions for multiple users!
Reversal with Buy/Sell Signal from QuantVuemodification script from QuantVue with target TP/SL.
additional filter EMA 9 & wick.
Indicator 102#M3indicator based on Daily and weekly fib Level. Initial Breakout and breakdowns have been denoted as well
Candle Power Pro – Engulfing + RSI Smart Strategy📌 Candle Power Pro – Engulfing + RSI Smart Strategy
Candle Power Pro is a high-performance trading strategy that combines the strength of engulfing candlestick patterns, RSI filters, and candle stability analysis to deliver accurate BUY & SELL signals.
🔥 Why traders love it:
✅ Detects bullish & bearish engulfing setups with RSI confirmation
✅ Built-in Stop Loss & Take Profit (customizable %)
✅ Prevents overtrading with anti-repeat signal filter
✅ Works on any market & timeframe (Forex, Crypto, Stocks, Indices)
✅ Backtest-ready with full PnL, Winrate, and Risk/Reward stats
🚦 How it works:
A BUY signal triggers when a bullish engulfing candle forms with RSI confirmation in a downtrend.
A SELL signal triggers when a bearish engulfing candle forms with RSI confirmation in an uptrend.
Labels show exact entry points on the chart for clarity.
⚡ Perfect for:
Swing traders, scalpers, and algorithmic enthusiasts
Traders who want rule-based entries & exits
Anyone looking to backtest and refine their trading strategy
👉 Just add it to your chart, adjust your Stop Loss & Take Profit, and start testing smarter trades!
3 SMA + RSI + MACD + MTF Ultimate Dashboard🎯 Overview:
High-precision trading indicator combining trend, momentum, and multi-timeframe confirmation for reliable buy/sell signals in Forex, Crypto, and other markets.
🔹 Core Features:
📈 3 SMAs (7/25/99) – Short, Medium & Long-term trend detection
⚡ RSI Filter – Avoid weak signals (Buy >55 / Sell <45)
💎 MACD with Threshold – Reduce false crossovers
⏱️ Multi-Timeframe Trend (H4) – Confirm overall market direction
✅ Dashboard & Signals:
🟢 Clear Buy & Sell arrows on chart
📊 Live dashboard showing filter status & total signals
🔔 Audio & Push Alerts – Mobile/Desktop/Webhook
💎 Benefits:
⚡ Minimizes false signals
📈 Works on M15, H1, H4, Daily
🎯 Combines trend, momentum, and confirmation filters in one dashboard
⚠️ Note: Signals are generated only after candle close for maximum reliability.
3 SMA + RSI + MACD + MTF Ultimate Dashboard🎯 Overview:
High-precision trading indicator combining trend, momentum, and multi-timeframe confirmation for reliable buy/sell signals in Forex, Crypto, and other markets.
🔹 Core Features:
📈 3 SMAs (7/25/99) – Short, Medium & Long-term trend detection
⚡ RSI Filter – Avoid weak signals (Buy >55 / Sell <45)
💎 MACD with Threshold – Reduce false crossovers
⏱️ Multi-Timeframe Trend (H4) – Confirm overall market direction
✅ Dashboard & Signals:
🟢 Clear Buy & Sell arrows on chart
📊 Live dashboard showing filter status & total signals
🔔 Audio & Push Alerts – Mobile/Desktop/Webhook
💎 Benefits:
⚡ Minimizes false signals
📈 Works on M15, H1, H4, Daily
🎯 Combines trend, momentum, and confirmation filters in one dashboard
⚠️ Note: Signals are generated only after candle close for maximum reliability.
NY Sessions Boxes (Live Drawing)//@version=5
indicator("NY Sessions Boxes (Live Drawing)", overlay=true)
ny_tz = "America/New_York"
t = time(timeframe.period, ny_tz)
hour_ny = hour(t)
minute_ny = minute(t)
// سشن ۱: 02:00 – 05:00
session1_active = (hour_ny >= 2 and hour_ny < 5)
session1_start = (hour_ny == 2 and minute_ny == 0)
// سشن ۲: 09:30 – 11:00
session2_active = ((hour_ny == 9 and minute_ny >= 30) or (hour_ny > 9 and hour_ny < 11))
session2_start = (hour_ny == 9 and minute_ny == 30)
var box box1 = na
var float hi1 = na
var float lo1 = na
if session1_start
hi1 := high
lo1 := low
box1 := box.new(left = time, right = time, top = high, bottom = low, bgcolor=color.new(color.blue, 85), border_color=color.blue)
if session1_active and not na(box1)
hi1 := math.max(hi1, high)
lo1 := math.min(lo1, low)
box.set_right(box1, time)
box.set_top(box1, hi1)
box.set_bottom(box1, lo1)
if not session1_active and not na(box1)
box1 := na
hi1 := na
lo1 := na
var box box2 = na
var float hi2 = na
var float lo2 = na
if session2_start
hi2 := high
lo2 := low
box2 := box.new(left = time, right = time, top = high, bottom = low, bgcolor=color.new(color.purple, 85), border_color=color.purple)
if session2_active and not na(box2)
hi2 := math.max(hi2, high)
lo2 := math.min(lo2, low)
box.set_right(box2, time)
box.set_top(box2, hi2)
box.set_bottom(box2, lo2)
if not session2_active and not na(box2)
box2 := na
hi2 := na
lo2 := na
Universal Webhook Connector Demo.This strategy demonstrates how to generate JSON alerts from TradingView for multiple trading platforms.
Users can select platform_name (MT5, TradeLocker, DxTrade, cTrader, etc).
Alerts are constructed in JSON format for webhook execution.
gfg//@version=5
indicator("Lux Gainz Style Algo", overlay=true)
// User Inputs
fastLen = input.int(12, "Fast MA Length", minval=1)
slowLen = input.int(26, "Slow MA Length", minval=1)
rsiLen = input.int(14, "RSI Length", minval=1)
rsiOverbought = input.float(70, "RSI Overbought Level")
rsiOversold = input.float(30, "RSI Oversold Level")
sensitivity = input.float(1.5, "Signal Sensitivity", minval=0.1, step=0.1)
// Moving Averages for Trend
fastMA = ta.ema(close, fastLen)
slowMA = ta.ema(close, slowLen)
// RSI for Momentum
rsi = ta.rsi(close, rsiLen)
// Trend Conditions
bullTrend = fastMA > slowMA
bearTrend = fastMA < slowMA
// Confirmation Signals
longSignal = ta.crossover(fastMA, slowMA) and rsi < rsiOversold * sensitivity
shortSignal = ta.crossunder(fastMA, slowMA) and rsi > rsiOverbought / sensitivity
// Plot Moving Averages
plot(fastMA, color=color.new(color.green, 0), title="Fast EMA")
plot(slowMA, color=color.new(color.red, 0), title="Slow EMA")
// Candle Coloring for Trend Strength
barcolor(bullTrend ? color.new(color.green, 70) : bearTrend ? color.new(color.red, 70) : color.gray)
// Plot Buy/Sell Signals
plotshape(longSignal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, size=size.small)
plotshape(shortSignal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, size=size.small)
// Alerts
alertcondition(longSignal, title="Long Entry", message="Lux Gainz Algo: Long Entry Signal")
alertcondition(shortSignal, title="Short Entry", message="Lux Gainz Algo: Short Entry Signal")
Hammer, Engulfing & Star Candles aksh//@version=5
indicator("Hammer, Engulfing & Star Candles ", overlay=true, max_bars_back=500)
// ===== Inputs =====
showHammer = input.bool(true, "Show Hammer")
showShootingStar = input.bool(true, "Show Shooting Star")
showEngulfing = input.bool(true, "Show Bull/Bear Engulfing")
showMorningStar = input.bool(true, "Show Morning Star (3-candle)")
showEveningStar = input.bool(true, "Show Evening Star (3-candle)")
// Sensitivity / thresholds
wickToBodyMin = input.float(2.5, "Min Wick:Body (Hammer/Star)", minval=0.5, step=0.1)
maxOppWickToBody = input.float(0.7, "Max Opp Wick:Body (Hammer/Star)", minval=0.0, step=0.1)
closeInTopPct = input.float(0.35, "Hammer: close in top % of range", minval=0.0, maxval=1.0, step=0.05)
closeInBotPct = input.float(0.35, "Star: close in bottom % of range", minval=0.0, maxval=1.0, step=0.05)
minBodyFracRange = input.float(0.15, "Min body as % of range (avoid doji)", minval=0.0, maxval=1.0, step=0.01)
engulfRequireBodyPct = input.float(1.00, "Engulfing: body >= prev body x", minval=0.5, maxval=3.0, step=0.05)
engulfAllowWicks = input.bool(false, "Engulfing: allow wick engulf if bodies equal")
starMiddleBodyMaxPct = input.float(0.40, "Morning/Evening Star: middle body <= % of avg body", minval=0.05, maxval=1.0, step=0.05)
starCloseRetracePct = input.float(0.50, "Morning/Evening Star: final close retraces >= % of first body", minval=0.25, maxval=1.0, step=0.05)
// ===== Helpers =====
body(c,o) => math.abs(c - o)
upperWick(h,o,c) => h - math.max(o, c)
lowerWick(l,o,c) => math.min(o, c) - l
rng(h,l) => h - l
isBull(o,c) => c > o
isBear(o,c) => o > c
midpoint(h,l) => (h + l) * 0.5
b = body(close, open)
uw = upperWick(high, open, close)
lw = lowerWick(low, open, close)
rg = rng(high, low)
prev_o = open , prev_c = close , prev_h = high , prev_l = low
prev_b = body(prev_c, prev_o)
// avoid divide-by-zero
safe(val) => nz(val, 0.0000001)
// ===== Single-candle patterns =====
// Hammer: long lower wick, small/limited upper wick, decent body, close toward top of range
hammer = showHammer and rg > 0 and b/rg >= minBodyFracRange and
(lw / safe(b) >= wickToBodyMin) and (uw / safe(b) <= maxOppWickToBody) and
(close >= (low + (1.0 - closeInTopPct) * rg))
// Shooting Star: long upper wick, small/limited lower wick, close toward bottom
shootingStar = showShootingStar and rg > 0 and b/rg >= minBodyFracRange and
(uw / safe(b) >= wickToBodyMin) and (lw / safe(b) <= maxOppWickToBody) and
(close <= (low + closeInBotPct * rg))
// ===== Two-candle patterns: Engulfing =====
// Bullish engulfing: previous bearish, current bullish, current body engulfs previous body
bullEngulf = showEngulfing and isBear(prev_o, prev_c) and isBull(open, close) and
(open <= prev_c and close >= prev_o) and (b >= engulfRequireBodyPct * prev_b or (engulfAllowWicks and high >= prev_h and low <= prev_l))
// Bearish engulfing: previous bullish, current bearish, current body engulfs previous body
bearEngulf = showEngulfing and isBull(prev_o, prev_c) and isBear(open, close) and
(open >= prev_c and close <= prev_o) and (b >= engulfRequireBodyPct * prev_b or (engulfAllowWicks and high >= prev_h and low <= prev_l))
// ===== Three-candle patterns: Morning/Evening Star =====
// Morning Star: strong bearish candle, small middle candle (gap or small body), strong bullish close retracing into first body
o2 = open , c2 = close
b2 = body(c2, o2)
avgBody = ta.sma(body(close, open), 20)
smallMiddle = body(close , open ) <= starMiddleBodyMaxPct * nz(avgBody, prev_b)
firstBear = isBear(o2, c2)
lastBull = isBull(open, close)
retrBull = lastBull and (close >= (c2 + starCloseRetracePct * (o2 - c2)))
morningStar = showMorningStar and firstBear and smallMiddle and retrBull
// Evening Star: mirror
firstBull = isBull(o2, c2)
lastBear = isBear(open, close)
retrBear = lastBear and (close <= (c2 - starCloseRetracePct * (c2 - o2)))
eveningStar = showEveningStar and firstBull and smallMiddle and retrBear
// ===== Plotting =====
plotshape(hammer, title="Hammer", style=shape.labelup, location=location.belowbar, text="🔨\nHammer", size=size.tiny, color=color.new(color.lime, 0), textcolor=color.black)
plotshape(shootingStar, title="Shooting Star", style=shape.labeldown, location=location.abovebar, text="⭐\nStar", size=size.tiny, color=color.new(color.orange, 0), textcolor=color.black)
plotshape(bullEngulf, title="Bull Engulfing", style=shape.labelup, location=location.belowbar, text="🟢\nEngulf", size=size.tiny, color=color.new(color.teal, 0), textcolor=color.black)
plotshape(bearEngulf, title="Bear Engulfing", style=shape.labeldown, location=location.abovebar, text="🔴\nEngulf", size=size.tiny, color=color.new(color.red, 0), textcolor=color.white)
plotshape(morningStar, title="Morning Star", style=shape.labelup, location=location.belowbar, text="🌅\nMorning", size=size.tiny, color=color.new(color.aqua, 0), textcolor=color.black)
plotshape(eveningStar, title="Evening Star", style=shape.labeldown, location=location.abovebar, text="🌆\nEvening", size=size.tiny, color=color.new(color.purple, 0), textcolor=color.white)
// Optional: color bars when patterns occur
barcolor(hammer ? color.new(color.lime, 60) : na)
barcolor(shootingStar ? color.new(color.orange, 60) : na)
barcolor(bullEngulf ? color.new(color.teal, 70) : na)
barcolor(bearEngulf ? color.new(color.red, 70) : na)
barcolor(morningStar ? color.new(color.aqua, 70) : na)
barcolor(eveningStar ? color.new(color.purple, 70) : na)
// ===== Alerts =====
alertcondition(hammer, "Hammer", "Hammer detected")
alertcondition(shootingStar, "Shooting Star", "Shooting Star detected")
alertcondition(bullEngulf, "Bullish Engulfing","Bullish Engulfing detected")
alertcondition(bearEngulf, "Bearish Engulfing","Bearish Engulfing detected")
alertcondition(morningStar, "Morning Star", "Morning Star detected (3-candle)")
alertcondition(eveningStar, "Evening Star", "Evening Star detected (3-candle)")
// ===== Hints (toggle in the Style tab if labels feel too crowded) =====
// You can adjust thresholds to match your market/timeframe.
// Common tweaks: increase wickToBodyMin for stricter hammers/stars; increase minBodyFracRange to avoid doji;
// require stronger retrace in star patterns by raising starCloseRetracePct.
Gamma Blast StrategyGamma Blast Strategy used for quick 2-5 ticks on Buys, but on a sideways market can get up to 15-20 ticks.
TMA +BB Bands Indicator//@version=5
indicator(shorttitle="BB", title="Bollinger Bands", overlay=true, timeframe="", timeframe_gaps=true)
length = input.int(20, minval=1)
maType = input.string("SMA", "Basis MA Type", options = )
src = input(close, title="Source")
mult = input.float(2.0, minval=0.001, maxval=50, title="StdDev")
ma(source, length, _type) =>
switch _type
"SMA" => ta.sma(source, length)
"EMA" => ta.ema(source, length)
"SMMA (RMA)" => ta.rma(source, length)
"WMA" => ta.wma(source, length)
"VWMA" => ta.vwma(source, length)
basis = ma(src, length, maType)
dev = mult * ta.stdev(src, length)
upper = basis + dev
lower = basis - dev
offset = input.int(0, "Offset", minval = -500, maxval = 500, display = display.data_window)
plot(basis, "Basis", color=#2962FF, offset = offset)
p1 = plot(upper, "Upper", color=#F23645, offset = offset)
p2 = plot(lower, "Lower", color=#089981, offset = offset)
fill(p1, p2, title = "Background", color=color.rgb(33, 150, 243, 95))
Liquidity levels + Order BlocksThis script mark liquidity levels, and monthly, weekly and daily candle open. The order blocks indicator is on construction.
FTSE Trade SignalTrade FTSE with SMA crossovers and signals only printed on FTSE open, between 8am and 10am
MultiSessions traderglobal.topEste indicador de sesiones está diseñado para traders intradía que desean visualizar con precisión la actividad y la volatilidad característica de cada mercado. Basado en Pine Script v5 y optimizado para la zona horaria “America/New_York”, divide el día en sub-sesiones configurables y resalta sus rangos de precio en tiempo real. En particular, incorpora tres bloques para New York (NY1, NY2, NY3), dos para Londres (LON1, LON2), dos para Tokio (TKO1, TKO2) y mantiene Sídney como sesión opcional. Cada bloque puede activarse o desactivarse de forma independiente y cuenta con su propio color ajustable, lo que permite construir mapas visuales claros para estrategias basadas en horario, solapamientos y micro-estructuras de mercado.
El panel de inputs incluye la opción “Activate High/Low View”. Cuando está activada, el indicador calcula de manera incremental el mínimo y máximo de cada sub-sesión y sombrea el área entre ambos con fill, proporcionando una referencia inmediata del rango intrasesión (útil para medir compresión/expansión y posibles rompimientos). Cuando está desactivada, emplea un simple bgcolor por bloque, ideal para traders que prefieren un gráfico más limpio y solo desean distinguir visualmente los tramos horarios.
La lógica central utiliza dos funciones auxiliares: is_session(sess), que detecta si la vela actual pertenece a un tramo horario concreto, e is_newbar(sess), que determina el inicio de una nueva barra de referencia según la resolución elegida (D, W o M). Gracias a esta combinación, en cada sub-sesión el indicador reinicia sus contadores de alto y bajo al comenzar el período y los actualiza vela a vela mientras el bloque siga activo. Este enfoque evita mezclas de datos entre sesiones y asegura que el rango que se muestra corresponda estrictamente al segmento horario configurado.
Los horarios por defecto están pensados para Forex y contemplan casos que cruzan medianoche (por ejemplo, Tokio 2 y Sídney). Pine Script admite rangos como 2200-0200; no obstante, si tu bróker o la zona horaria del gráfico generan un sombreado parcial, basta con dividir el tramo en dos: 2200-2359 y 0000-0200. Asimismo, cada input.session incluye el patrón :1234567 para habilitar los siete días; puedes restringir días según tu operativa.
En cuanto al uso práctico, el indicador facilita identificar: (1) la estructura del rango por sub-sesión (útil para estrategias de breakout/mean-reversion), (2) los solapamientos entre Londres y New York, donde suele concentrarse la liquidez, y (3) períodos de menor volatilidad (tramos tardíos de Asia o previos a noticias). El color independiente por bloque te permite codificar visualmente la importancia o tu plan de trading (por ejemplo, tonos más intensos en ventanas de alta probabilidad).
Finalmente, su diseño modular hace sencilla la personalización: puedes ajustar colores, activar/desactivar bloques, cambiar horarios y modificar la resolución de reseteo del rango. Como posible mejora, se pueden añadir alertas de ruptura de máximos/mínimos de sub-sesión o etiquetas con la altura del rango (pips) al cierre. Este indicador no sustituye el juicio del trader ni constituye recomendación financiera, pero ofrece una base visual robusta para integrar el factor tiempo en la toma de decisiones.
This sessions indicator is built for intraday traders who want a precise, time-aware view of market activity and typical volatility patterns across the day. Written in Pine Script v5 and optimized for the “America/New_York” timezone, it divides the trading day into configurable sub-sessions and highlights their price ranges in real time. Specifically, it provides three blocks for New York (NY1, NY2, NY3), two for London (LON1, LON2), two for Tokyo (TKO1, TKO2), and keeps Sydney as an optional session. Each block can be enabled or disabled independently and comes with its own adjustable color, letting you build clear visual maps for time-based strategies, overlaps, and microstructure nuances.
In the inputs panel you’ll find the “Activate High/Low View” option. When enabled, the indicator incrementally computes each sub-session’s low and high and shades the area between them with fill, giving you an immediate reference to the intra-session range (useful for gauging compression/expansion and potential breakouts). When disabled, it switches to a clean bgcolor background by block—ideal if you prefer a minimal chart and simply want to distinguish time windows at a glance.
The core logic relies on two helper functions: is_session(sess), which detects whether the current bar falls within a given time window, and is_newbar(sess), which identifies the start of a new reference bar according to your chosen reset resolution (D, W, or M). With this combination, each sub-session resets its high/low at the beginning of the period and updates them bar by bar while the block remains active. This prevents cross-contamination between sessions and ensures the range you see belongs strictly to the configured segment.
Default hours are suited to Forex and include segments that cross midnight (e.g., Tokyo 2 and Sydney). Pine Script supports ranges like 2200-0200; however, if your broker or chart timezone causes partial shading, simply split the segment into two: 2200-2359 and 0000-0200. Each input.session uses the :1234567 suffix to enable all seven days; you can easily restrict days to match your plan.
Practically speaking, the indicator helps you identify: (1) range structure by sub-session (great for breakout or mean-reversion frameworks), (2) overlaps between London and New York, where liquidity and directional moves often concentrate, and (3) lower-volatility windows (late Asia or pre-news lulls). Independent colors per block let you visually encode priority or your trading plan (for example, richer tones in high-probability windows).
Thanks to its modular design, customization is straightforward: adjust colors, toggle blocks, change hours, and tweak the range-reset resolution to suit your routine. As a natural extension, you can add alerts for sub-session high/low breakouts or labels that display the range height (in pips) at session close. While no indicator replaces trader judgment or constitutes financial advice, this tool offers a robust visual foundation for incorporating the time factor directly into your decision-making, helping you contextualize price action within the rhythm of global trading sessions.
Smart MTF Fair Value Gap StrategyThe Multi-Timeframe Fair Value Gap (FVG) Strategy is designed to identify institutional imbalance zones (Fair Value Gaps) from a higher timeframe and trade them efficiently on the current chart timeframe.
🔹 Core Logic
Detects Bullish FVGs when there’s a gap between a prior higher-timeframe high and the following low.
Detects Bearish FVGs when there’s a gap between a prior higher-timeframe low and the following high.
Zones are plotted as colored boxes (green for bullish, red for bearish).
When price re-enters a zone, the strategy automatically places trades with defined stop-loss and take-profit levels.
🔹 Risk Management
Stop-loss is set at the opposite side of the zone.
Take-profit is calculated using a customizable Risk:Reward ratio (default 2:1).
Adjustable position sizing and execution rules (enter on touch or require strict close inside zone).
🔹 Inputs & Features
Higher Timeframe selection (e.g., H1, H4, Daily).
Customizable box width for better visualization.
Toggle to show/hide zones.
Strict entry filter to avoid premature signals.
Works in both long and short directions.
⚡ This strategy provides a simple yet powerful way to visualize institutional FVG levels and test structured entries around them with proper risk management.
ICT ob by AyushThis indicator marks **order blocks** by detecting the first opposite candle of any pullback run and drawing a line from its **open** to the confirming candle’s close.
It works on **any timeframe (or HTF projection)**, stays clean, and only shows **solid, body-confirmed OBs**.