อินดิเคเตอร์ Pine Script®
อินดิเคเตอร์และกลยุทธ์
swing trader algo📈 Swing Trader Algo – High-Probability Trend Signals
This indicator is a strict swing-trading algorithm designed to capture high-probability market moves while filtering out noise and false signals.
It uses a dual moving average crossover system combined with trend direction, candle confirmation, and momentum filtering to ensure trades align with the dominant market structure.
🔑 Key Features
User-defined fast & slow moving averages
Buy & Sell labels at key crossover points
Signals only trigger when price closes above/below both MAs
Additional filter requiring the slow MA to be rising (BUY) or falling (SELL)
Optional time-based (UTC) session filter
High-probability signal logic to reduce whipsaws
Designed for swing trading, intraday, and higher timeframes
Works well on Forex, Indices, Crypto, and Commodities
⚠️ Disclaimer
This script is for educational and analytical purposes only and does not constitute financial advice. Always apply proper risk management and confirm signals with your own analysis.
อินดิเคเตอร์ Pine Script®
s-PV Gap Screener# TradingView Publication Description
## Title
s-PV Gap Screener - Price & Volume Breakouts + Gap Detection: only works with www.tradingview.com
## Short Description
Multi-signal screener combining trend-filtered price/volume breakouts with dual-threshold gap detection. 19 output columns for comprehensive technical filtering.
## Full Description
---
### 📊 Overview
**s-PV Gap Screener** is a comprehensive technical screener designed for TradingView's Pine Screener that combines two powerful signal types:
1. **Price & Volume Breakouts** - Detects when price and volume simultaneously break out, filtered by trend (200 SMA)
2. **Gap Detection** - Identifies significant overnight price gaps with dual customizable thresholds
**Inspiration:** This screener is inspired by the excellent (), expanding on that concept to add gap detection, short setups, and multi-signal confirmation.
---
### ✨ Key Features
**Price & Volume Breakout Detection:**
- ✅ Trend-filtered breakouts (SMA confirmation - avoid counter-trend signals)
- ✅ Both long AND short breakout detection
- ✅ Customizable lookback periods (10-500 bars)
- ✅ Strength calculation (% above/below breakout level)
- ✅ Volume confirmation (must exceed highest volume in period)
**Gap Detection:**
- ✅ Dual threshold system (default 5% and 10%)
- ✅ Independent tracking for moderate and major gaps
- ✅ Direction filtering (gap up, gap down, or both)
- ✅ Historical gap scanning (up to 500 bars)
**Composite Signals:**
- ✅ Combined Score (0-80 weighted system)
- ✅ "Any Signal" flag for quick filtering
- ✅ 19 total output columns
---
### 🎯 How It Works
#### Price & Volume Breakout Logic
**Long Breakout Triggers When:**
1. Close > Highest High in lookback period
2. Volume > Highest Volume in lookback period
3. Close > SMA (trend filter - ensures uptrend)
**Short Breakout Triggers When:**
1. Close < Lowest Low in lookback period
2. Volume > Highest Volume in lookback period
3. Close < SMA (trend filter - ensures downtrend)
The trend filter is crucial - it prevents false breakouts by ensuring the move aligns with the dominant trend direction. This is inspired by TradeDots' approach but adds the short side capability.
#### Gap Detection Logic
Calculates overnight gap: `(Open - Previous Close) / Previous Close * 100`
Tracks the most recent gap for each threshold independently, allowing you to monitor both moderate gaps (5%) and major gaps (10%) separately.
---
### 📈 Screener Output Columns (19 Total)
**Price & Volume Breakout (7 columns):**
- PV Breakout Flag (0/1)
- PV Days Ago
- PV Breakout Date (YYYYMMDD format) - tw doesnt allow for better formating
- PV Strength %
- PV Type (1=long, -1=short, 0=none)
- Volume Ratio (current/average)
- Price vs SMA % (distance from trend line)
**Gap Threshold 1 (5 columns):**
- Gap1 Flag, Days Ago, Date, Size %, Direction
**Gap Threshold 2 (5 columns):**
- Gap2 Flag, Days Ago, Date, Size %, Direction
**Composite (2 columns):**
- Any Signal (quick filter)
- Combined Score (weighted 0-80)
---
### ⚙️ Input Parameters
**Fully Customizable:**
- Price/Volume breakout periods (default 60 bars)
- Trend filter SMA length (default 200)
- Gap thresholds (default 5% and 10%)
- Historical lookback (default 100 bars)
- Direction filters (long only, short only, or both)
---
### 💡 Example Usage Scenarios
**1. Fresh Momentum Breakouts:**
```
PV Breakout Flag = 1
PV Days Ago <= 5
Volume Ratio >= 1.5
```
**2. Major Gaps Awaiting Confirmation:**
```
Gap2 Flag = 1
Gap2 Days Ago <= 20
PV Breakout Flag = 0
Price vs SMA % > 0
```
**3. High Conviction Multi-Signal:**
```
PV Breakout Flag = 1
Gap1 Flag = 1
Combined Score >= 60
Volume Ratio >= 2.0
```
**4. Long Setups in Strong Trends:**
```
PV Type = 1
Price vs SMA % >= 5
PV Strength % >= 3
```
---
### 🎓 How to Use
**Step 1:** Add indicator to a **DAILY chart**
**Step 2:** Configure settings (or use defaults)
**Step 3:** Open Pine Screener: www.tradingview.com
**Step 4:** Add "s-PV Gap Screener" to your screener columns
**Step 5:** Apply filters and sort by Combined Score
**Detailed documentation:** See published script comments or README
---
### 📅 Date Format
Dates display as **YYYYMMDD** (e.g., 20260212 = February 12, 2026)
- Sortable chronologically
- ISO 8601 standard
- Easy to filter by date ranges
---
### ⚠️ Important Notes
**DAILY TIMEFRAME ONLY:** This screener is designed for daily bars. Other timeframes may produce unexpected results.
**500-Bar Limit:** Pine Screener loads last 500 bars (~2 years on daily). This is a TradingView platform limitation.
**Combined Score Weights:**
- PV Breakout: +30 points
- Gap Threshold 1: +20 points
- Gap Threshold 2: +30 points
- Maximum: 80 points
---
### 🔄 Differences from TradeDots Strategy
This screener **expands** on the TradeDots concept:
✅ **Added:** Gap detection (dual thresholds)
✅ **Added:** Short breakout detection
✅ **Added:** Combined scoring system
✅ **Added:** Multiple output columns for detailed filtering
✅ **Modified:** Designed specifically for Pine Screener (not a strategy)
✅ **Kept:** Core PV breakout logic with trend filter
**Credit:** Original PV breakout concept from ()
---
### 🎯 Best For
- Swing traders looking for momentum setups
- Traders who combine multiple technical signals
- Screening large watchlists for breakout opportunities
- Finding gap plays with volume confirmation
- Multi-timeframe position traders
---
### 📊 Tips for Best Results
1. **Start Broad:** Filter by `Any Signal = 1`, sort by Combined Score
2. **Volume Confirmation:** Add `Volume Ratio >= 1.5` for stronger signals
3. **Trend Alignment:** Filter by `Price vs SMA % > 0` for longs (or `< 0` for shorts)
4. **Fresh Signals:** Use `PV Days Ago <= 10` for recent breakouts
5. **Save Presets:** Create filter combinations for different strategies
---
### 🔧 Customization
All parameters are configurable via inputs:
- Adjust periods to match your trading timeframe
- Modify gap thresholds for your volatility preference
- Enable/disable specific signal types
- Change trend filter SMA length (50, 100, 200, etc.)
---
### 📚 Additional Resources
**Full Documentation:** See README.md in published script or at:
github.com /indicators/pine-screeners/PVscreener/
**Pine Screener Guide:** www.tradingview.com
**Original Inspiration:** ()
---
### ⚖️ Disclaimer
This indicator is for informational and educational purposes only. It does not constitute financial advice. Always do your own research and use proper risk management. Past performance does not guarantee future results.
---
### 🙏 Credits
- **Inspired by:** TradeDots' Price and Volume Breakout Buy Strategy
- **Original concept:** Price + Volume confirmation with trend filter
- **Enhancements:** Gap detection, short setups, multi-signal scoring
---
**Version:** 2.0
**Type:** Screener Indicator
**Timeframe:** Daily (1D)
**Outputs:** 19 columns
**License:** Mozilla Public License 2.0
---
### 📝 Release Notes
**v2.0 (February 2026)**
- Optimized for Pine Screener usage
- 19 output columns for comprehensive filtering
- Dual gap threshold system
- Combined scoring mechanism
- Full input customization
**v1.0**
- Initial release with PV breakout detection
- Gap detection added
- Trend filtering implemented
---
### 🏷️ Tags
`screener` `breakout` `volume` `gap` `momentum` `trend` `technical-analysis` `multi-signal` `price-action` `volatility`
---
อินดิเคเตอร์ Pine Script®
Multi-Timeframe Strength Scanner [JOAT]Multi-Timeframe Strength Scanner
Introduction
The Multi-Timeframe Strength Scanner is an open-source indicator that combines higher timeframe trend analysis with current timeframe momentum indicators to create a comprehensive market strength assessment system. This mashup integrates ADX (Average Directional Index), Donchian Channels, VWAP (Volume Weighted Average Price), RSI divergence detection, and multi-timeframe EMA analysis into a unified scanner that identifies when trend strength aligns across multiple timeframes.
The indicator addresses a critical trading challenge: signals that look strong on one timeframe often fail because higher timeframes are moving in the opposite direction. By analyzing 15-minute, 1-hour, and 4-hour timeframes simultaneously while monitoring current timeframe momentum, this tool helps traders avoid counter-trend trades and identify high-probability setups where multiple timeframes align.
Chart showing multi-timeframe alignment dashboard and strength indicators on 15M timeframe
Why This Mashup Exists
This indicator combines five analytical frameworks that address different aspects of trend strength:
ADX Analysis: Measures trend strength regardless of direction using directional movement
Donchian Channels: Identifies breakouts and trend continuation using price extremes
VWAP: Shows institutional average price and volume-weighted fair value
RSI Divergence: Detects momentum exhaustion at current timeframe swing points
Multi-Timeframe EMAs: Confirms trend direction across 15M, 1H, and 4H timeframes
Each component serves a specific purpose: ADX quantifies trend strength, Donchian Channels identify breakout momentum, VWAP reveals institutional positioning, RSI divergences warn of reversals, and multi-timeframe EMAs ensure directional alignment. Together, they create a strength scanner that filters out weak, counter-trend setups and highlights only those with multi-timeframe confirmation.
The mashup is justified because these components use fundamentally different data (directional movement, price extremes, volume-weighted averages, momentum oscillators, moving averages) that respond to different market conditions. When they align, it indicates genuine trend strength rather than temporary momentum.
Core Components Explained
1. ADX Trend Strength System
ADX (Average Directional Index) measures trend strength on a scale of 0-100:
= ta.dmi(adxLength, adxLength)
// Trend strength classification
strongTrend = adx > adxThreshold // Default: 20
veryStrongTrend = adx > 40
extremeTrend = adx > 60
// Direction determination
bullishTrend = plus > minus
bearishTrend = minus > plus
ADX interpretation:
ADX < 20: Weak trend or ranging market - avoid trend-following strategies
ADX 20-40: Moderate trend strength - standard trend-following viable
ADX 40-60: Strong trend - high-probability trend continuation
ADX > 60: Extreme trend - potential exhaustion or very strong momentum
The indicator plots ADX as a line with color coding:
Green: Strong bullish trend (ADX > 20, +DI > -DI)
Red: Strong bearish trend (ADX > 20, -DI > +DI)
Gray: Weak trend or ranging (ADX < 20)
2. Donchian Channel Breakout System
Donchian Channels track the highest high and lowest low over a specified period:
donchianLength = 20 // Configurable
upperChannel = ta.highest(high, donchianLength)
lowerChannel = ta.lowest(low, donchianLength)
midChannel = (upperChannel + lowerChannel) / 2
Breakout signals:
Bullish Breakout: Close above upper channel = new 20-bar high
Bearish Breakout: Close below lower channel = new 20-bar low
Channel Position: Price near upper channel = bullish strength, near lower = bearish strength
The indicator uses Donchian breakouts to confirm trend strength. When price breaks out of the channel with strong ADX, it signals high-momentum trend continuation.
3. VWAP Analysis
VWAP (Volume Weighted Average Price) calculates the average price weighted by volume:
vwap = ta.vwap(hlc3)
// Position analysis
aboveVWAP = close > vwap // Bullish positioning
belowVWAP = close < vwap // Bearish positioning
// Distance from VWAP
vwapDistance = ((close - vwap) / vwap) * 100
VWAP significance:
Institutional traders use VWAP as benchmark for execution quality
Price above VWAP = buyers in control, institutions paying premium
Price below VWAP = sellers in control, institutions getting discount
Large distance from VWAP = potential mean reversion opportunity
VWAP acts as dynamic support/resistance level
The indicator plots VWAP with dynamic coloring based on price position and uses it for trend confirmation.
4. RSI Divergence Detection
The indicator detects divergences using pivot-based analysis:
rsi = ta.rsi(close, 14)
// Identify swing points
pivotHigh = ta.pivothigh(rsi, 5, 5)
pivotLow = ta.pivotlow(rsi, 5, 5)
// Compare current pivot with previous pivot
bullishDivergence = price makes lower low AND rsi makes higher low
bearishDivergence = price makes higher high AND rsi makes lower high
Divergence types:
Regular Bullish: Price LL, RSI HL - momentum improving, potential reversal up
Regular Bearish: Price HH, RSI LH - momentum deteriorating, potential reversal down
Hidden Bullish: Price HL, RSI LL - trend continuation signal in uptrend
Hidden Bearish: Price LH, RSI HH - trend continuation signal in downtrend
Divergences are marked with "DIV" labels and used to warn of potential trend exhaustion or continuation.
5. Multi-Timeframe EMA Analysis
The indicator analyzes trend direction across three higher timeframes:
// Request higher timeframe data
htf15mEMA = request.security(syminfo.tickerid, "15", ta.ema(close, 21))
htf1hEMA = request.security(syminfo.tickerid, "60", ta.ema(close, 21))
htf4hEMA = request.security(syminfo.tickerid, "240", ta.ema(close, 21))
// Determine trend direction
htf15mBullish = close > htf15mEMA
htf1hBullish = close > htf1hEMA
htf4hBullish = close > htf4hEMA
// Count aligned timeframes
bullishCount = (htf15mBullish ? 1 : 0) + (htf1hBullish ? 1 : 0) + (htf4hBullish ? 1 : 0)
bearishCount = (!htf15mBullish ? 1 : 0) + (!htf1hBullish ? 1 : 0) + (!htf4hBullish ? 1 : 0)
Alignment classification:
STRONG BULL: All 3 timeframes bullish (3/3 alignment)
BULL: 2 out of 3 timeframes bullish
MIXED: Timeframes conflicting (1-1-1 or 2-1 split)
BEAR: 2 out of 3 timeframes bearish
STRONG BEAR: All 3 timeframes bearish (3/3 alignment)
Example showing multi-timeframe alignment dashboard with all three timeframes bullish
Strength Scoring System
The indicator calculates a comprehensive strength score (0-100) by evaluating:
Strength Score Components:
- ADX Strength: Up to 25 points (ADX > 40 = 25, ADX > 20 = 15, ADX < 20 = 0)
- ADX Direction: Up to 15 points (+DI > -DI = 15 for bull, -DI > +DI = 15 for bear)
- Donchian Position: Up to 15 points (breakout = 15, near channel = 10, mid-channel = 5)
- VWAP Position: Up to 15 points (above VWAP = 15 for bull, below = 15 for bear)
- MTF Alignment: Up to 20 points (3/3 = 20, 2/3 = 13, 1/3 = 7)
- RSI Level: Up to 10 points (healthy range = 10, extreme = 5, divergence = -5)
Score interpretation:
80-100: Extremely strong trend - high-probability continuation
60-79: Strong trend - favorable for trend-following
40-59: Moderate trend - selective trend trades
20-39: Weak trend - caution, potential reversal
0-19: Very weak or counter-trend - avoid trend-following
The dashboard displays the strength score with color coding and individual component breakdown.
Visual Elements
ADX Line: Main trend strength indicator with dynamic coloring
+DI/-DI Lines: Directional movement indicators
ADX Threshold: Horizontal line at 20 (configurable)
Donchian Channels: Upper, middle, and lower channel lines
VWAP Line: Volume-weighted average price with dynamic coloring
Divergence Labels: "DIV" markers at RSI divergence points
Strength Bars: Background coloring based on strength score
Dashboard: Comprehensive table showing:
- Current strength score
- ADX value and direction
- Donchian position
- VWAP position
- MTF alignment (15M, 1H, 4H status)
- RSI level
- Overall trend classification
Chart showing strength dashboard with component breakdown and visual indicators
How Components Work Together
The mashup creates a layered strength analysis:
Layer 1 - Trend Strength: ADX quantifies how strong the trend is
Layer 2 - Breakout Momentum: Donchian Channels identify momentum surges
Layer 3 - Institutional Positioning: VWAP shows where smart money is positioned
Layer 4 - Momentum Health: RSI divergences warn of exhaustion
Layer 5 - Multi-Timeframe Confirmation: HTF EMAs ensure directional alignment
Layer 6 - Synthesis: Strength score combines all factors into actionable metric
Example scenario: ADX is 45 (Layer 1), price breaks above Donchian upper channel (Layer 2), trading above VWAP (Layer 3), no RSI divergence (Layer 4), and all three higher timeframes are bullish (Layer 5). The strength score reaches 90 (Layer 6), signaling extremely strong bullish trend with high continuation probability.
Input Parameters
ADX Settings:
ADX Length: Period for ADX calculation (default: 14)
ADX Threshold: Minimum ADX for strong trend (default: 20)
Show +DI/-DI: Toggle directional indicators (default: enabled)
Donchian Settings:
Donchian Length: Period for channel calculation (default: 20)
Show Channels: Toggle channel display (default: enabled)
Breakout Sensitivity: Threshold for breakout signals (default: close beyond channel)
VWAP Settings:
Show VWAP: Toggle VWAP line (default: enabled)
VWAP Reset: Session, Week, Month, or Never (default: Daily)
Distance Alert: Alert when price moves X% from VWAP (default: 2%)
RSI Settings:
RSI Length: Period for RSI calculation (default: 14)
Show Divergences: Toggle divergence markers (default: enabled)
Pivot Lookback: Bars for pivot detection (default: 5)
Multi-Timeframe Settings:
HTF 1: First higher timeframe (default: 15 minutes)
HTF 2: Second higher timeframe (default: 1 hour)
HTF 3: Third higher timeframe (default: 4 hours)
EMA Length: Period for HTF EMAs (default: 21)
Min Alignment: Minimum timeframes aligned for signal (default: 2/3)
Display Options:
Show Dashboard: Toggle strength score table (default: enabled)
Show Strength Bars: Toggle background coloring (default: enabled)
Dashboard Position: Top-right, top-left, bottom-right, bottom-left
Color Theme: Choose between multiple color schemes
How to Use This Indicator
Step 1: Check Multi-Timeframe Alignment
Review the dashboard MTF section. Look for 2/3 or 3/3 alignment in your intended trade direction. Avoid trades when timeframes are mixed or opposing.
Step 2: Verify ADX Strength
Ensure ADX is above 20 (preferably above 30) for trend-following trades. ADX below 20 suggests ranging market where trend strategies underperform.
Step 3: Confirm Donchian Position
Check if price is near or breaking through Donchian channels. Breakouts with strong ADX signal high-momentum moves.
Step 4: Assess VWAP Position
For long trades, prefer price above VWAP. For short trades, prefer price below VWAP. Large distances from VWAP may indicate overextension.
Step 5: Check for Divergences
Look for RSI divergence warnings. If divergence appears with extreme strength score, consider taking profits or tightening stops.
Step 6: Review Strength Score
Use the overall strength score as final filter. Scores above 70 indicate strong trend conditions favorable for trend-following. Scores below 40 suggest caution.
Best Practices
Use on 5-minute to 1-hour timeframes for optimal multi-timeframe analysis
Wait for 2/3 or 3/3 MTF alignment before entering trend trades
Strong ADX (> 30) with MTF alignment produces highest-probability setups
Donchian breakouts with ADX > 25 often lead to sustained moves
VWAP acts as dynamic support/resistance - use for entry refinement
RSI divergences in strong trends often lead to pullbacks, not reversals
Strength score above 80 suggests strong trend continuation potential
Avoid trading when strength score is below 40 unless counter-trend trading
Combine with price action and key levels for precise entries
Indicator Limitations
ADX is lagging indicator - trend strength confirmed after move has started
Donchian breakouts can produce false signals in choppy markets
VWAP resets daily, may not reflect longer-term institutional positioning
Multi-timeframe analysis requires sufficient data history
Strength score is mathematical calculation, not prediction of future movement
Strong trends can reverse suddenly despite high strength scores
Divergences can persist for extended periods in strong trends
Higher timeframe data may repaint on lower timeframes
Requires understanding of trend analysis concepts for effective use
Technical Implementation
Built with Pine Script v6 using:
DMI/ADX calculation with directional indicators
Donchian Channel calculation with breakout detection
VWAP calculation with session reset options
Pivot-based RSI divergence detection
request.security() for multi-timeframe EMA analysis
Comprehensive strength scoring algorithm
Dynamic dashboard with component breakdown
Background coloring based on strength levels
The code is fully open-source and can be modified to adjust timeframes, thresholds, and scoring weights.
Originality Statement
This indicator is original in its multi-timeframe strength integration approach. While individual components (ADX, Donchian Channels, VWAP, RSI divergence, EMAs) are established tools, this mashup is justified because:
It combines trend strength measurement with multi-timeframe directional confirmation
The strength scoring system quantifies trend quality across multiple dimensions
Multi-timeframe analysis prevents counter-trend trades on lower timeframes
Integration of volume-weighted analysis (VWAP) with momentum indicators
Divergence detection provides early warning within trend strength context
Comprehensive dashboard presents complex multi-timeframe data clearly
Each component contributes unique information: ADX measures trend strength, Donchian identifies breakout momentum, VWAP shows institutional positioning, RSI divergences warn of exhaustion, and MTF EMAs ensure alignment. The mashup's value lies in filtering out weak, counter-trend setups and highlighting only those with genuine multi-timeframe strength confirmation.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss and is not suitable for all investors.
Trend strength indicators are lagging tools that confirm trends after they've begun. Strong trends can reverse suddenly, and high strength scores do not guarantee trend continuation. Multi-timeframe analysis does not eliminate the risk of losses.
The strength score is a mathematical calculation based on current market data, not a prediction of future price movement. Past trend strength does not guarantee future performance. Market conditions change, and trends that appear strong can reverse without warning.
Always use proper risk management, including stop losses and position sizing appropriate for your account size and risk tolerance. Never risk more than you can afford to lose. Consider consulting with a qualified financial advisor before making investment decisions.
The author is not responsible for any losses incurred from using this indicator. Users assume full responsibility for all trading decisions made using this tool.
-Made with passion by officialjackofalltrades
อินดิเคเตอร์ Pine Script®
4EMA+RSI+BuySell+Diverg+NWE+BB Megart4 EMA
RSI 70/30 and 80/20 Signals
Nadaraya-Watson Signals
Buyer/Seller Change Signal
Ballinger Bands Concentrate show
อินดิเคเตอร์ Pine Script®
Bitcoin (BTC) Electrical Cost [R2D2]Bitcoin Electrical Cost Ribbon
Description
"Bitcoin bottoms don't happen when people feel good. They happen when selling becomes impossible."
This script replicates the famous "Bitcoin Production Cost" and "Energy Value" models popularized by Charles Edwards (Capriole Investments) and frequently cited by analysts like Black Swan. It provides a structural valuation of Bitcoin based on the thermodynamics of Proof-of-Work: Energy.
This indicator visualizes the Miner Profitability Ribbon, helping you identify generational bottoms where Bitcoin's price touches its raw electrical production cost.
How It Works
Bitcoin is an industrial network. To produce one coin requires a tangible amount of electricity (Joules). This script calculates that cost using Mining Difficulty as a proxy for the network's total energy expenditure.
The Red Floor (Electrical Cost):
This is the estimated raw electricity bill to mine 1 BTC.
The Logic : When price drops below this line, the average miner is operating at a cash-flow loss. They are forced to shut down rigs or sell reserves to pay bills. This creates "Miner Capitulation."
The Signal: Historically, Bitcoin price only touches this red line during the deepest phase of a Bear Market (e.g., 2018 bottom, 2022 bottom). It acts as a hard "fundamental floor" because selling below this price destroys the miners themselves.
The Ribbon (Profitability Zone):
The area between the Red Floor and the Grey Ceiling represents the miner's operational margin (CapEx + OpEx).
When price is above the ribbon, miners are profitable and expanding.
When price is inside the ribbon, margins are compressing.
Settings & Calibration
Difficulty Source: The script attempts to pull QUANDL:BCHAIN/DIFF automatically. If you are on a free plan without access to this data, the script features a smart "Fallback Model" that mathematically estimates the difficulty curve so the indicator always works.
Electrical Multiplier: Default is set to 465. This is calibrated for the 2026 era (Difficulty ~125T ≈ $58k Cost). You can adjust this slightly as global energy prices or hardware efficiency changes.
Smoothing: Includes a built-in Moving Average (SMA 21) to remove the "staircase" effect of difficulty adjustments, giving you the clean, wave-like aesthetic seen in professional macro charts.
How to Trade This Indicator
The "All-In" Signal: Watch for the price to aggressively drop into the Red Ribbon. A daily or weekly close on or slightly below the Red Electrical Cost line has historically marked the absolute bottom of the cycle.
Trend Confirmation: During a Bull Market, this ribbon should slope upwards. If the ribbon flattens or curls down, it indicates hashrate is leaving the network (miner stress).
Disclaimer
This tool is for educational purposes and analyzes on-chain network fundamentals. It is not financial advice. Mining costs are estimates based on global averages; individual miner costs vary wildly based on electricity rates and hardware efficiency.
อินดิเคเตอร์ Pine Script®
อินดิเคเตอร์ Pine Script®
AlphaSignal Suite PRO# AlphaSignal Suite PRO
## Overview
AlphaSignal Suite PRO is a comprehensive, multi-factor confluence indicator designed to identify high-probability reversal zones by combining six distinct analytical approaches into a unified scoring system. It features an automatic optimization engine that detects your chart timeframe and asset type, then adjusts all parameters for optimal signal quality — no manual tuning required.
## Key Features
- **Auto-Optimization Engine** - Automatically detects your timeframe (Scalp / Intraday / Swing / Position) and asset type (Crypto / Forex / Stocks / Index) to apply optimized parameter profiles
- **Conservative Signal Design** - Requires strong multi-factor confluence (minimum 3 of 6 factors) to reduce noise and false signals
- **Super Signals** - High-confluence setups (4-5+ score) are highlighted as "SUPER BUY/SELL" for potential reversal zones at market highs and lows
- **Non-repainting** - All higher timeframe data uses confirmed bar values with proper lookahead handling
- **Full Manual Override** - Auto-optimization can be disabled; every parameter remains fully adjustable
## How It Works
The indicator evaluates six independent signal sources and scores each setup from 0 to 6:
1. **Trend Analysis** - Dual EMA system with higher timeframe EMA confirmation for directional bias. EMAs auto-scale per timeframe (e.g., 21/100 for scalping, 50/200 for swing trading)
2. **Momentum (RSI)** - RSI crossovers at conservative overbought/oversold levels. Levels auto-adjust per timeframe and asset (e.g., 80/20 for scalp, 75/25 for intraday, wider for crypto)
3. **Bollinger Band Bounces** - Price must pierce the band AND close clearly back inside — not just touch the edge
4. **Volume Spikes** - Significant volume events only (1.7-2.0x average), confirming institutional participation
5. **Smart Money Absorption** - Detects strong rejection candles (wick > body, wick > 0.3x ATR) near range extremes with low volume — a footprint of institutional accumulation
6. **Liquidity Grabs** - Identifies false breakouts beyond swing highs/lows where price sweeps stops and reclaims — a classic reversal trigger
## Signal Types
**Regular Signal (BUY/SELL)** — Triggers when 3+ factors align. Shown as green/red triangles on the chart.
**Super Signal (SUPER BUY/SELL)** — Triggers when 4-5+ factors align. Shown as yellow/pink diamonds. These are high-confidence reversal zone candidates where trend, momentum, volume, and smart money all confirm simultaneously.
## Auto-Optimization Profiles
The engine applies different parameter sets depending on context:
**By Timeframe:**
- Scalp (1-5min): Faster EMAs, tighter RSI, higher confluence required (4+)
- Intraday (15-60min): Balanced settings, moderate confluence (3+)
- Swing (4H-Daily): Standard settings, moderate confluence (3+)
- Position (Weekly+): Slower EMAs, relaxed RSI, moderate confluence (3+)
**By Asset Type:**
- Crypto: Wider Bollinger Bands, more extreme RSI levels, higher volume thresholds (compensates for high volatility)
- Forex: Tighter ranges, lower volume thresholds
- Stocks: Standard settings with emphasis on volume confirmation
- Index/Futures: Slightly faster response parameters
You can disable auto-optimization and set all parameters manually, or use a hybrid (auto-timeframe with manual asset selection, or vice versa).
## Dashboard
The real-time dashboard (bottom right) displays:
- Active profile (e.g., "Swing | Crypto") and mode (Full Auto / Manual)
- LTF and HTF trend direction
- Smart money activity status
- Current signal strength with Super Signal indicator
- Active key parameters (EMA and RSI values in use)
## Alerts
Four alert conditions are available:
- PRO BUY / PRO SELL — for regular signals
- SUPER BUY / SUPER SELL — for high-confluence reversal signals
## How to Use
1. **Add to chart** — The indicator auto-detects your timeframe and asset type immediately
2. **Watch for Super Signals** — Yellow/pink diamonds mark the highest-probability reversal zones
3. **Use regular signals for trend entries** — Green/red triangles show standard confluence setups
4. **Fine-tune if needed** — Disable auto-optimization and adjust any parameter manually
5. **Set alerts** — Enable SUPER BUY/SELL alerts for notifications on the best setups
## Important Disclaimer
This indicator is provided for educational and informational purposes only. Past performance does not guarantee future results. No indicator can predict market movements with certainty. Always implement proper risk management including position sizing, stop-loss orders, and risk-reward assessment before every trade. Use this tool as one component of a comprehensive trading strategy, not as a standalone decision-making system. The author assumes no responsibility for trading losses. Trade at your own risk.
อินดิเคเตอร์ Pine Script®
Ultra Single Session +Alerts [1CG]Ultra Single Session +Alerts
Session Range, Trade Windows, and Alerts
Overview
Ultra Single Session +Alerts marks a single trading session on your chart, tracks that session’s high and low, and helps you watch for breaks when price moves away from the session range.
It’s made for traders who want accurate session levels across timeframes, optional trade windows, and alerts that don’t fire outside the times they care about.
Session Display
During the session, the indicator can draw a box to show the session range. It also draws the Session High and Session Low levels. After the session ends, those levels can stay on the chart so you can reference them later.
Sessions
Choose a preset session (London / New York / Asia / cross sessions) or set your own start and end times. Time zone handling is included so the session stays aligned to the clock you expect.
Customization
Most visual elements can be adjusted so it fits your chart:
Colors for box/lines/background
Line style (solid/dotted/dashed) and thickness
Labels (show/hide) and text settings
Box fill options
History options (if enabled)
Line Extensions
You can control how the High/Low lines behave:
Where the lines begin (from price behavior vs from the session start, depending on your settings)
How far they extend after the session
Optional “frontrun”/projection behavior (if enabled)
Optional history display for prior sessions (if enabled)
Trade Windows
Trade windows are optional time blocks you define. When enabled, the script can mark the window boundaries (and optionally highlight the background) so it’s easy to see when your “allowed trading time” is active.
Alerts
Alerts trigger from breaks of the Session High or Session Low. You can choose one of these modes:
On Break : alerts on the first touch/break of the level.
Close Out : alerts only when a candle closes beyond the level.
Close In (Sweep) : alerts when price breaks the level but closes back inside the session range.
Trade Window Gating: If trade window gating is enabled, alerts only fire when the break happens inside your trade window(s).
Higher Timeframe Accuracy
To keep the session high/low accurate on higher timeframes, the indicator uses 1-minute data for session tracking. This helps prevent missed highs/lows that can happen when a session starts or ends inside a larger candle.
Daily Sessions
You can also use this for daily session templates (for example midnight-to-midnight, or market open-to-close) to track daily ranges and daily breaks using the same workflow.
Help / Feedback
If you need help setting this up, notice something that looks wrong, or have an idea for improvements, feel free to message me.
Questions about settings or getting it to match your session times
Bug reports (please include symbol, timeframe, and your session/trade window settings)
Interest in a version that supports more sessions
อินดิเคเตอร์ Pine Script®
StO Price Action - Gold Timings | LiquidityShort Summary
- Identifies statistically 5-minute candles (Source: Oanda, M5)
- Classifies them into four intensity levels
- Highlights timing and liquidity concentrations
Full Description
Method
- Analyzes one year of 5-minute candle data
- Compares each candle to its previous candle
- Selects candles with unusually large differences
- Uses either candle range or volume as data source
- Groups selected candles into four levels
- All levels represent above-average activity
Overview
- Designed to detect abnormal intraday expansion
- Highlights moments of aggressive participation
- Works as a timing and liquidity mapping tool
- Can be based on volatility (range) or participation (volume)
- Helps identify recurring high-impact periods
- Level Structure
- 0: Highest expansion or volume spikes
- 1: Very strong expansion
- 2: Strong expansion
- 3: Elevated but moderate expansion
- Each level can be individually enabled or hidden
- Each level has customizable color coding
Usage
- Choose between Range or Volume as primary metric
- Enable only the intensity levels relevant to your strategy
- Use levels to identify high-liquidity windows
- Combine with structure, liquidity sweeps, or order blocks
- Observe clustering behavior across sessions
Future Bars
- Projects statistical timing to next day
- Can hide the current developing period
- Allows small hour shifts to adjust session alignment
Notes
- Does not predict direction, only intensity
- Best used as timing confirmation, not entry signal
- Range mode emphasizes volatility
- Volume mode emphasizes participation
- Particularly useful for session opens and news-driven markets
อินดิเคเตอร์ Pine Script®
Donchian Breakout AI Adaptive Trend
DESCRIPTION:
A self-adapting trend-following indicator that uses K-Means machine learning to analyze 27 Donchian Channel parameter combinations in real-time, identifying which breakout settings perform best in the current market regime.
━━━━━━━━━━━━━━━━━━━
🔍 HOW IT WORKS
The core logic is based on the Donchian Channel breakout — the original trend-following system used by the legendary Turtle Traders. Price breaking above the highest high signals a long, breaking below the lowest low signals a short.
The AI layer runs 27 parameter combinations simultaneously in the background:
• Entry lookback: 10, 20, 30 bars
• Exit lookback: 5, 10, 15 bars
• ATR filter: 1.0x, 1.5x, 2.0x
Each combination is tracked for real-time performance. K-Means clustering (an unsupervised machine learning algorithm) groups these into Best, Average, and Worst performing clusters — and the dashboard tells you what's working best right now.
━━━━━━━━━━━━━━━━━━━
★ HOW TO READ SIGNALS
Signals use a visual agreement system between the base strategy and the AI:
★ Bright + Large label = AI-confirmed signal (confidence ≥ threshold)
○ Dim + Small label = Signal fired but AI confidence is low
The number on each label is the AI confidence score (0-10). Higher = stronger agreement from the AI. You decide: trade all signals, or only the bright AI-confirmed ones.
Entry: Price breaks above the Donchian high (long) or below the Donchian low (short)
Exit: Price breaks the exit channel in the opposite direction, OR the ATR trailing stop is hit (orange step-line on chart)
Trend Filter: EMA(50) prevents counter-trend entries — longs only when price is above the EMA, shorts only when below. The EMA is plotted on chart (green = bullish, red = bearish).
━━━━━━━━━━━━━━━━━━━
📊 HOW TO READ THE DASHBOARD
Signal — Current position state:
★ LONG / ★ SHORT = AI-confirmed trade active
○ LONG / ○ SHORT = Trade active but AI confidence is low (⚠ CAUTION)
— WAITING = No trade, scanning for next breakout
Confidence — Only shown during active trades. A 5-factor composite score:
STRONG (8-10) / HIGH (6-7) / MODERATE (4-5) / LOW (2-3) / WEAK (0-1)
Visual bar: ■■■■■■■□□□ shows the score at a glance
Shows "—" when waiting (no signal to score)
Regime — Current volatility environment based on 20-bar annualized volatility:
LOW VOL = Quiet, fewer breakouts expected
NORMAL = Healthy trending conditions
HIGH VOL = Elevated volatility, wider moves
⚠ EXTREME = Crash/mania conditions
AI Next Entry — The entry lookback (in bars) that the best-performing cluster recommends for the next trade. Example: "20-bar breakout" means the AI thinks 20-bar Donchian highs/lows are optimal right now.
AI Next Exit — The exit lookback the best cluster recommends. Shorter = tighter exits (locks profit faster). Longer = gives trades more room to run.
AI Next Filter — The ATR filter multiplier the best cluster recommends. Higher = only trades strong breakouts. Lower = catches more breakouts including weaker ones.
Best WR — Win rate of the best-performing cluster's simulated trades. Trend-following typically runs 35-50% win rate with large winners compensating for small losses.
Clusters — Distribution of the 27 parameter combos across Best ● Average ● Worst groups. When most combos cluster into "Best," conditions are broadly favorable.
Trend(50) — EMA trend filter direction:
▲ BULLISH / longs only = Price above EMA, only long breakouts allowed
▼ BEARISH / shorts only = Price below EMA, only short breakdowns allowed
━━━━━━━━━━━━━━━━━━━
⚙️ KEY FEATURES
• Non-repainting — All signals use previous-bar confirmed data. Trailing stop updates on bar close only. No signal will appear mid-bar then vanish.
• ATR trailing stop — Locks in profits during extended trends, plotted as orange step-line on chart
• Trend filter — EMA(50) blocks counter-trend entries, preventing long signals during crashes
• ATR breakout filter — Removes weak/noisy breakouts that don't move enough
• Bright/dim visual system — Instantly see which signals the AI agrees with
• 7 alert conditions — Including AI-confirmed entries for selective trading
• Rich tooltips — Hover any signal label for full breakdown (breakout level, confidence, ATR, AI optimal params, cluster win rate)
━━━━━━━━━━━━━━━━━━━
📐 RECOMMENDED SETTINGS
Crypto (BTC, ETH) — 4H or Daily, default settings
Forex — 4H, ATR filter 1.0x for tighter moves
Commodities (Gold, Oil) — Daily, ATR trail 2.5x
Indices (SPY, NAS100) — Daily, trend MA 100
AI Confidence Threshold: Default 5. Raise to 6-7 for fewer but higher-conviction signals. Lower to 3-4 to see more signals.
━━━━━━━━━━━━━━━━━━━
🎓 THE AI EXPLAINED
The "AI" is K-Means clustering — a real unsupervised machine learning algorithm. Here's exactly what it does:
1. Simulates 27 Donchian strategies with different parameters every bar
2. Tracks each one's performance using an EMA-smoothed return metric
3. K-Means groups them into 3 clusters based on performance similarity
4. The best cluster's average parameters become the "AI Next" recommendation
5. Confidence is a 5-factor composite: cluster spread, win rate, breakout strength, trend alignment, and volatility expansion
This means the indicator constantly adapts. In choppy markets, longer lookbacks with stricter filters dominate the best cluster. In trending markets, shorter aggressive breakouts take over. You see this shift in real-time on the dashboard.
━━━━━━━━━━━━━━━━━━━
⚠️ DISCLAIMER
This indicator is a tool for analysis, not financial advice. Past performance does not guarantee future results. Always use proper risk management and position sizing.
━━━━━━━━━━━━━━━━━━━
Happy trading.
อินดิเคเตอร์ Pine Script®
Stochastic Momentum Index - SMI | TR🎯 Overview
Stochastic Momentum Index - SMI | TR is a refined momentum oscillator that measures the position of the closing price relative to the midpoint of the recent high-low range. Developed by Tiagorocha1989, this enhanced version of William Blau's Stochastic Momentum Index offers dual-mode operation with moving average customization and comprehensive visual features, helping traders identify momentum shifts, overbought and oversold conditions, and potential reversal points with greater precision than traditional stochastic oscillators.
🔧 How It Works
The Stochastic Momentum Index (SMI) is an evolution of the traditional stochastic oscillator. While standard stochastic measures where price closes within the recent high-low range, the SMI measures where price closes relative to the midpoint of that range, providing a more balanced view of momentum.
Core Calculation Logic:
The indicator calculates the SMI using the standard stochastic formula:
Stochastic = (Current Close - Lowest Low) / (Highest High - Lowest Low) × 100
Where the highest high and lowest low are determined over the specified Length SMI period
The resulting oscillator oscillates between 0 and 100, with:
Readings above 50 indicating price is closing in the upper half of the recent range (bullish momentum)
Readings below 50 indicating price is closing in the lower half of the recent range (bearish momentum)
Readings above 80 suggesting overbought conditions
Readings below 20 suggesting oversold conditions
The indicator compares SMI to a reference line that can be either:
The traditional 50 level (centerline)
A user-defined moving average of the SMI itself (SMI MA mode)
✨ Key Features
🔹 Dual Operating Modes
50 Level Mode: Classic SMI implementation where signals occur when the SMI crosses above or below the 50 centerline, indicating momentum shifts
SMI MA Mode: Enhanced version where signals occur when SMI crosses its own moving average, providing smoother, filtered entries
🔹 Flexible Moving Average Selection
Choose from six MA types for the SMI MA mode:
EMA (Exponential Moving Average) for responsive signals
SMA (Simple Moving Average) for smoother readings
RMA (Rolling Moving Average) for weighted recent data
WMA (Weighted Moving Average) for customizable weighting
VWMA (Volume-Weighted Moving Average) incorporating volume
HMA (Hull Moving Average) for reduced lag
🔹 Customizable SMI Parameters
Length SMI: Lookback period for SMI calculation (default 101)
Source SMI: Price source for calculations (default Close)
🔹 Extended Lookback Period
The default length of 101 makes this version particularly suitable for longer-term trend identification and filtering out short-term market noise.
🔹 Customizable Color Themes
Eight distinct color schemes to match your charting preferences:
Classic – Green for bullish, Red for bearish
Modern – White for bullish, Purple for bearish
Robust – Amber for bullish, Maroon for bearish
Accented – Violet for bullish, Pink for bearish
Monochrome – Light gray for bullish, Dark gray for bearish
Moderate – Green for bullish, Red for bearish
Aqua – Blue for bullish, Orange for bearish
Cosmic – Pink for bullish, Purple for bearish
🔹 Comprehensive Visual Feedback
Colored SMI Line: Changes color based on position relative to the reference line
Signal Line: Yellow line showing 50 or MA reference
Gradient Fill Zones: Clear visualization of overbought (above 80) and oversold (below 20) conditions
Dynamic Zone Fills: Semi-transparent fills showing when SMI is above or below the reference line
Color-Coded Candles: Bars reflect current SMI bias (above or below reference)
Signal Markers: Triangle up/down symbols at crossover points
Live Value Display: Current SMI value shown in a floating label
Trend Table: Bullish/Bearish status displayed on the chart
🔹 Ready-to-Use Alerts
Built-in alert conditions trigger LONG signals on bullish crossovers and SHORT signals on bearish crossunders across both operating modes.
⚙️ Settings Summary
Color Choice: Select from eight visual themes (Default: Classic)
Length SMI: Lookback period for SMI calculation (Default: 101)
Source SMI: Price source for calculations (Default: Close)
Entry/Exit Signal: Choose between 50 level or SMI MA mode (Default: 50)
Length MA: Moving average period for SMI MA mode (Default: 365)
SMI MA Type: Moving average method for signal line (Default: EMA)
📈 Practical Applications
🔹 Overbought/Oversold Detection
Traditional SMI usage identifies extreme conditions:
Readings above 80 suggest overbought conditions and potential reversal down
Readings below 20 suggest oversold conditions and potential reversal up
The indicator provides gradient fills in these zones for visual clarity
The long default period (101) makes these signals more significant and less frequent
🔹 Centerline Crossovers
In 50 Level mode, crossovers provide momentum signals:
Crossover above 50 → Bullish momentum strengthening
Crossunder below 50 → Bearish momentum strengthening
These signals often confirm trend direction changes
🔹 Signal Line Crossovers
In SMI MA mode, crossovers between SMI and its moving average provide filtered signals that reduce whipsaws in ranging markets while maintaining sensitivity in trends.
🔹 Divergence Trading
SMI is excellent for spotting divergences:
Bullish Divergence: Price makes lower low, SMI makes higher low → Potential upside reversal
Bearish Divergence: Price makes higher high, SMI makes lower high → Potential downside reversal
Divergences are most significant when occurring at extreme levels (above 80 or below 20)
🔹 Trend Confirmation
The position of SMI relative to 50 confirms trend direction:
SMI consistently above 50 confirms uptrend
SMI consistently below 50 confirms downtrend
The extended 101-period length ensures these signals reflect meaningful trends
🔹 Momentum Reversal Signals
Watch for SMI turning up from oversold levels or turning down from overbought levels:
Turn up from below 20 → Potential bullish reversal
Turn down from above 80 → Potential bearish reversal
🔹 Multiple Timeframe Analysis
Compare SMI readings across different timeframes:
Higher timeframe SMI confirms primary trend direction
Lower timeframe SMI identifies entry timing and short-term momentum
🎯 Ideal For
✅ Long-Term Traders seeking to identify major trend shifts with reduced noise
✅ Swing Traders wanting to capture medium to long-term momentum shifts
✅ Divergence Traders looking for reliable reversal signals
✅ Position Traders needing confirmation of trend strength and direction
✅ System Developers needing robust, smoothed momentum signals
✅ Trend Followers wanting to avoid false signals in choppy markets
📌 Key Takeaways
Extended Lookback Period: The default length of 101 makes this indicator particularly effective for filtering out short-term noise and identifying significant trend movements
Midpoint Focus: By measuring price relative to the midpoint of the range (rather than just the range extremes), SMI provides a more balanced view of momentum than traditional stochastic
Dual-Mode Flexibility: Choose between classic 50-level crossovers for traditional signals or MA-smoothed signals for filtered entries
Comprehensive Visualization: Color themes, gradient fills for overbought/oversold zones, candles, and labels provide immediate market awareness
Divergence Capability: Excellent for spotting both regular and hidden divergences that signal trend reversals or continuations
Alert-Ready: Built-in alerts for both LONG and SHORT signals across both operating modes
⚠️ Important Notes
The long default length (101) makes this SMI variant much smoother than traditional stochastic settings (typically 14). This reduces false signals but also makes the indicator slower to react to short-term price changes. The 365-day MA default in SMI MA mode is designed for longer-term trend context on daily charts. Readings above 80 and below 20 are significant but may persist during strong trends; consider combining with trend filters. Divergences are most reliable when they occur at extreme readings. Always combine with proper risk management and additional confirmation for best results.
Disclaimer: This indicator is provided for educational and informational purposes only. Past performance is not indicative of future results. Always conduct thorough testing and align with your risk management strategy before live deployment.
อินดิเคเตอร์ Pine Script®
META Scalp 5m (RSI+ADX/DMI+TSI+Vol+Squeeze+SMC-lite) [v1.1]Script Description
META Scalp 5m (RSI+ADX/DMI+TSI+Vol+Squeeze+SMC-lite) is a futures scalping strategy designed primarily for the 5-minute timeframe. Its goal is to filter higher-probability entries through a multi-indicator confluence engine that calculates a Score (from -100 to +100) and converts it into an estimated short-term probability of bullish or bearish continuation.
This script is not a magic predictor. It is a consensus-based decision engine: when multiple conditions align (direction + strength + volatility + context), it triggers entries with automatic risk management (SL/TP) based on ATR.
What it shows on the chart
Plots Fast EMA and Slow EMA for trend direction.
Entry markers:
Triangle “L” = Long signal
Triangle “S” = Short signal
SMC-lite events:
SW↑ = High sweep (possible stop hunt above)
SW↓ = Low sweep (possible stop hunt below)
Information panel showing:
Current Score
P(Long) / P(Short) in %
ADX
Volume confirmation (VolOk)
Squeeze status (ON/OFF)
Indicators and Modules Included
1) Trend Filter (EMA)
Fast EMA (default 21) and Slow EMA (default 55).
Bullish bias when:
Fast EMA > Slow EMA and rising.
Bearish bias when:
Fast EMA < Slow EMA and falling.
Purpose: avoid trading against strong trend momentum.
2) RSI
RSI (default 14) with configurable midpoint (default 50).
Bias:
RSI > 50 → bullish bias
RSI < 50 → bearish bias
RSI weight increases as it moves further away from 50.
3) ADX/DMI (Strength + Direction)
Uses +DI, -DI and ADX via ta.dmi().
Works as:
Strength filter: market considered tradable only if ADX ≥ threshold (default 18).
Direction: +DI > -DI → bullish; -DI > +DI → bearish.
When ADX is low, the script treats the market as choppy and avoids trades.
4) TSI (True Strength Index)
Momentum confirmation:
TSI above signal → bullish
TSI below signal → bearish
5) Volume Filter
Compares current volume vs Volume SMA (default 20).
VolOk when:
Volume > SMA(volume) × multiplier (default 1.10)
Filters low-participation signals.
6) Squeeze (BB vs KC approximation) + Momentum
Detects volatility compression:
Bollinger Bands inside Keltner Channels = Squeeze ON
Expansion signal when:
Squeeze OFF and momentum aligns:
Momentum rising → bullish bias
Momentum falling → bearish bias
Goal: capture post-compression expansions.
7) SMC-lite (Basic Smart Money Concepts)
This module implements simplified SMC logic:
A) Equal Highs / Equal Lows + Sweep
Detects equal highs/lows using pivots and ATR tolerance.
Sweep logic:
Wick above EQH and close back below → SW↑ (bearish/contrarian)
Wick below EQL and close back above → SW↓ (bullish/contrarian)
B) BOS-lite (Break of Structure)
Continuation signal when price closes beyond the last swing high/low.
Higher Timeframe Confirmation (15m)
Optional but recommended.
Calculates EMAs on a higher timeframe (default 15m).
If Score goes against HTF trend → score is penalized.
This avoids many bad 5m trades.
Score Engine & Probability
Core engine produces a Score between -100 and +100.
Positive score → Long bias
Negative score → Short bias
Converted into estimated probabilities:
P(Long) increases with Score
P(Short) = 100% − P(Long)
Important: probability is a mathematical transformation of the score, not a guaranteed statistical prediction.
Entry Rules
Long Entry
Triggered when:
Score ≥ Entry threshold (default 60)
Market not in chop (ADX filter)
Short Entry
Triggered when:
Score ≤ −Entry threshold
Market not in chop
Trade Management (SL/TP)
Risk management uses ATR-based dynamic levels:
Stop Loss = ATR × SL multiplier (default 1.2)
Take Profit = ATR × TP multiplier (default 1.5)
Optional:
ATR trailing stop
Early Exit (Score deterioration)
Positions can close early when confluence weakens:
Long closes if score falls below exit threshold.
Short closes if score rises above negative exit threshold.
Recommended Trading Approach
Best used as a quality filter, not blind signals.
Recommended Settings (5m scalping)
Timeframe: 5m
HTF confirmation: 15m ON
ADX minimum: 18–22
Entry score: 60–75
SL: 1.0–1.3 ATR
TP: 1.2–1.8 ATR
Trailing stop: useful in trending markets.
Workflow
Wait for Score to exceed threshold.
Avoid trades when ADX is low.
Prefer trades aligned with HTF trend.
Let SL/TP manage the trade.
Alerts
Built-in alerts:
META LONG
META SHORT
SMC Sweep High
SMC Sweep Low
Limitations
Pine Script cannot access private indicators (LuxAlgo, SmartBuzz, etc.).
TradingView VPVR/VRVP cannot be accessed directly via Pine.
Designed for backtesting and screening. Adjust settings per asset and exchange.
Best Practices
Test separately on BTC, ETH, and altcoins.
Include realistic fees and slippage.
Avoid high-impact news periods.
กลยุทธ์ Pine Script®
Options Swing Trading Signals - ProOptions Swing Trading Signals - Pro. helps with swing trading options
อินดิเคเตอร์ Pine Script®
Messanger Cross Strategy PRO6AM–10AM 50% Cross Strategy PRO to identify the range of entry and analysis
กลยุทธ์ Pine Script®
Demand Supply and FVG Analyzer by ZeeshanThis indicator combines three core concepts of price behavior to help traders identify high‑probability zones and market imbalances:
1. Demand & Supply Zones
The script automatically detects potential demand and supply areas based on structural pivots and price reactions. These zones help highlight where buyers or sellers previously showed strength, allowing traders to anticipate future reactions.
2. Fair Value Gaps (FVG)
The indicator marks bullish and bearish FVGs created by displacement candles. These gaps often act as magnets for price and can signal continuation or retracement opportunities.
3. Volume‑Based Weakness Signals
The script includes optional signals such as:
Low Demand
Low Supply
Weak Breakouts
These appear when price movement is not supported by meaningful volume, helping traders filter out false moves.
How to Use
Look for alignment between demand/supply zones and FVGs.
Use volume‑based weakness signals to confirm or reject breakout attempts.
Combine with your own market structure analysis for best results.
Notes
This tool is designed for educational and analytical purposes.
It does not repaint historical signals.
All settings are customizable to fit different trading styles.
อินดิเคเตอร์ Pine Script®
Probability Zone - Forex KemangKey Features:
✅ Multi-Zone Detection:
Fibonacci levels (bullish & bearish)
Supply/Demand zones (RBD & DBR patterns)
Support/Resistance (pivot points)
First Candle Box (H1 range, first 3 hours)
✅ Probability Box with Percentage:
BUY LINE (green) with the text "BUY X%" when the convergence zone supports buying
SELL LINE (red) with the text "SELL X%" when the convergence zone supports selling
Percentage 0-100% based on the number of zones that meet
✅ How it Works:
The indicator scans all zones (Fibonacci, S/D, S/R)
When multiple zones meet in the same area (the threshold can be adjusted)
Calculates BUY/SELL probability based on zone type
Creates boxes with percentage labels
✅ Customizable Settings:
Minimum Probability: Only displays zones with a probability ≥ X%
Zone Convergence Threshold: How close the zones should meet (0.1-2.0%)
Buy, Sell, and High Probability Zone Colors
✅ Info Table (top right):
Current Direction (Buy/Sell)
Current Price Probability
Number of Detected Zones
อินดิเคเตอร์ Pine Script®
LOWESS Adaptive Envelope [BackQuant]LOWESS Adaptive Envelope
Overview
LOWESS Adaptive Envelope is a nonparametric trend-fit and volatility envelope tool built around LOWESS (Locally Weighted Scatterplot Smoothing). Instead of smoothing price with a fixed-form moving average, this indicator performs a rolling set of local weighted linear regressions across a chosen historical window and stitches those local fits into a single smooth curve that adapts to changing market structure.
On top of the fitted curve, the script builds an adaptive envelope whose width is driven by the local magnitude of the model’s residuals (how far price deviates from the fit). That means the envelope automatically expands when the market is noisy or trending aggressively, and contracts when price is stable or mean-reverting cleanly.
The output is a complete “structure map”:
A LOWESS fitted centerline (trend estimate).
Upper and lower adaptive bands derived from smoothed residual spread.
A filled region that changes color based on where price sits relative to the fit.
Optional extrapolation of the fit and envelope into the future using last slope, with widening uncertainty.
An info label showing fit quality (R²), position inside the envelope, and direction.
Where LOWESS comes from (and why it is different from moving averages)
LOWESS (also written LOESS) is a classic statistical smoothing technique used in exploratory data analysis and robust curve fitting. It became popular because it can approximate complex shapes without assuming a single global model. Instead of forcing the entire window to follow one equation (like a single linear regression or a single moving average kernel), LOWESS fits many small local regressions , each one tailored to its neighborhood.
Key distinction:
A moving average is a fixed smoother, it applies the same weighting rule everywhere, regardless of whether the market is trending, chopping, or accelerating.
LOWESS is a locally re-fitted model, it re-estimates slope and intercept at each point based on nearby data.
In price terms:
LOWESS is better at “hugging structure” when the market curves or transitions.
It can follow gradual regime shifts without the same lag profile as long-window MAs.
It does not assume the trend is constant across the whole lookback, it assumes trend can vary locally.
What the indicator is modeling
Think of the lookback window as a dataset of points:
x = bar index (0..length-1 inside the window)
y = price
For every point i inside that window, the indicator estimates the best local line:
y ≈ a + b * x
But it does this using only nearby points, and it weights them by distance from i. So the fitted value at i is a locally weighted regression prediction.
The final fitted curve is the collection of those predictions across i = 0..length-1.
Core mechanics: local weighted linear regression
1) Neighborhood size (bandwidth)
The “locality” is controlled by a bandwidth parameter. In this script:
h = max(bandwidth * length / 2, 2)
Interpretation:
h acts like a radius measured in bars inside the fitting window.
Lower bandwidth → smaller h → more local fit (more responsive, can track curvature, more sensitive to noise).
Higher bandwidth → larger h → more global fit (smoother, more stable, more lag in transitions).
So bandwidth controls the bias-variance tradeoff:
Small bandwidth: low bias, high variance.
Large bandwidth: higher bias, lower variance.
2) Tricube kernel weighting
LOWESS requires a weight function that decays smoothly with distance. This script uses the classic tricube kernel :
For each candidate point j around target i:
u = |i - j| / h
If u < 1:
- w = (1 - u³)³
If u ≥ 1:
- w = 0
Why tricube:
Weights go to zero smoothly at the boundary (no sharp cutoff artifacts).
Nearby points dominate the fit, distant points contribute little or nothing.
It is a standard LOWESS choice because it produces stable smooth curves.
3) Weighted least squares fit
For each i, the script accumulates weighted sums over j in the neighborhood:
sumW, sumWX, sumWY, sumWXX, sumWXY
These correspond to the normal equations for weighted linear regression. From those, it computes:
denom = sumW * sumWXX - sumWX²
a and b derived from sums (intercept and slope)
fitted = a + b * i
If denom is too small (numerical instability, insufficient variation), it falls back to the raw price at that i.
This entire process is repeated for every i in the window, which is why it is done only on the last bar (performance).
Why it fits inside the window rather than a single line
A single regression across 200 bars assumes one slope b explains the whole move. Markets rarely do that. LOWESS allows the slope to drift through time, which is exactly what “trend structure” actually does in real price.
Residuals: turning model error into volatility structure
Once the LOWESS fitted curve is computed, the script measures the residual at each point:
res = price - fitted
Residuals are the model’s error. In trading terms, residual magnitude is a proxy for:
Local noise level.
Deviations from trend structure (overextension/underextension).
Regime instability (trend is less “explanatory”).
The script takes absolute residuals:
absRes = |res |
This is important because envelope width should reflect spread size regardless of direction.
R²: fit quality and regime information
The indicator also computes R² over the window:
ssRes = Σ(res²)
ssTot = Σ((price - meanPrice)²)
R² = 1 - ssRes/ssTot
Interpretation:
Higher R² means the LOWESS fit explains more of the variation inside the window.
Lower R² means price is behaving in a way the smooth trend model cannot explain well (chop, shocks, irregular volatility).
In markets, R² can be read as “how trend-like vs how noisy” the recent environment is, but remember it depends on your chosen length and bandwidth.
Adaptive envelope construction (what makes it “adaptive”)
A normal envelope uses a constant width (like ±k*ATR or ±k*stdev). This script does something different: it estimates a local envelope width based on smoothed residual magnitude.
1) Smooth residual magnitude locally
It computes a residual averaging window:
rWin = max(3, int(h * 0.8))
So the residual smoothing window is linked to the LOWESS locality. If the fit is local, the envelope adapts locally. If the fit is global, the envelope adapts more slowly.
Then for each i:
envW = mean(absRes over ) * envMult
Interpretation:
The envelope width is proportional to how much price typically deviates from the fit around that region.
envMult is your “how many spreads” multiplier.
This creates an envelope that expands and contracts along the curve, not a single constant band.
2) Upper and lower envelopes
For each i:
upper = fitted + envW
lower = fitted - envW
This is a model-driven channel. It is not ATR-based directly, it is “error-based.” That makes it very effective at responding to the actual behavior of the market relative to the fitted structure.
How to interpret the envelope
The centerline is the best local structural estimate. The envelope is the expected deviation range around that structure.
Typical readings:
Price near centerline: balanced relative to structure.
Price riding upper band: strong bullish pressure, trend continuation or overextension depending on context.
Price riding lower band: strong bearish pressure, continuation or overextension.
Repeated band rejections: mean-reversion regime around the structural fit.
Envelope widening: instability rising, volatility expanding, structure less reliable.
Envelope tightening: compression, cleaner trend or coiling behavior.
Because the band width is based on residuals, widening often coincides with “trend breaks” and regime transitions, not just higher ATR.
Color logic and visual encoding
The envelope fill color is based on price relative to the most recent fitted value:
If close > fitted , bullish color.
Else bearish color.
So color is a regime/bias cue, not a volatility cue. The bands themselves are drawn with translucent versions of the same regime color, while the fit line is a subtle white.
The fill polygon is constructed by:
Walking forward through upper points.
Then walking backward through lower points.
So the shape is closed and can be filled cleanly using polyline fills.
Extrapolation: forward projection with widening uncertainty
This script can project the fitted line into future bars. This is not forecasting in a statistical sense, it is a deterministic extension based on the current slope.
How it extrapolates
It takes:
slope = fitted - fitted
lastFit = fitted
Then for i = 1..extrapBars:
futureFit = lastFit + slope * i
This is a linear continuation of the most recent fit direction. It is meant as a visual guide for “if the current local trend continues.”
Why the forward envelope widens
The script also grows the envelope slightly with each projected bar:
envGrow = lastEnv * 0.01
futureEnv = lastEnv + envGrow * i
This is a simple uncertainty widening mechanism. As you move further into the future, you should assume less confidence. The envelope expansion encodes that visually without claiming statistical rigor.
Info label: what it reports and how to read it
When enabled, the label shows:
1) Direction arrow
It computes a slope over the last few fitted points:
recentSlope = fitted - fitted (or closest valid index)
▲ if slope >= 0
▼ if slope < 0
This gives a slightly more stable direction read than one-bar slope.
2) R²
Displayed as R²: 0.xxx, representing how well the LOWESS curve explains window variation.
3) Envelope Position (Env Pos)
It measures where the current close sits inside the latest envelope:
0% = at lower band
50% = at centerline
100% = at upper band
This is extremely useful as a normalized “over/under extension” metric because it is scaled by the adaptive band width, not raw price units.
How to use it properly
Trend structure and regime filtering
Use the fit line as structural trend direction.
Use the fill color as quick bias context.
Use R² as a “trend quality” read: high R² tends to mean cleaner structure, low R² tends to mean chop or instability.
Mean reversion vs continuation
This tool can support both styles, but interpretation differs:
Mean reversion framing
If market repeatedly returns to the fit line, the fit is acting like value.
Upper band touches can be “overbought relative to structure.”
Lower band touches can be “oversold relative to structure.”
Envelope position becomes your normalized stretch gauge.
Trend continuation framing
In strong trends, price can ride a band rather than revert to centerline.
Band riding plus rising fit slope suggests persistence.
A sudden failure to hold the band plus falling R² can flag transition risk.
Breakdown/transition identification
Because the envelope width is residual-driven:
If price starts producing large residuals, the envelope expands.
That expansion is often a signature of regime change, not just volatility.
Combine expansion with slope flattening to identify trend exhaustion.
Parameter tuning (what each input really does)
Length
Defines how much historical data is used for the full fit. Larger length:
More stable curve.
More computational load.
Tends to represent macro structure.
Bandwidth
Controls locality:
Low bandwidth (0.10–0.25): more reactive, tracks curvature and micro-structure, more sensitive to noise.
Higher bandwidth (0.30–0.50+): smoother, more stable, more lag in fast turns.
Envelope Width (envMult)
Scales how wide the adaptive band is relative to the local residual spread:
Lower values create a tighter channel, more band interactions.
Higher values create a wider channel, fewer touches, better for regime filtering.
Extrapolation Bars
Purely visual. More bars gives a longer projected structure line and uncertainty region.
Limitations and correct expectations
LOWESS is powerful, but it is not a magic predictor.
LOWESS is descriptive, it fits what happened, then projects linearly if extrapolation is enabled.
In sudden shocks or gaps, the fit will update only after the new data is inside the window.
Very small bandwidth can overfit local noise, producing misleading curvature.
Very large bandwidth can underfit, behaving like a slow regression and missing turning points.
R² is window-dependent, a low value does not mean “bad indicator,” it often means “market is not smooth right now.”
Summary
LOWESS Adaptive Envelope applies locally weighted linear regression (LOWESS) with a tricube kernel to build a smooth, structure-following fitted price curve that adapts to regime changes without relying on a fixed moving-average form. It then converts the model’s local residual spread into a dynamic envelope that expands and contracts with real deviation behavior, provides fit quality via R², normalizes price position inside the band, and optionally extrapolates the latest structural slope forward with widening uncertainty. The result is a robust trend-structure and deviation framework that is equally useful for regime filtering, mean-reversion context, and trend persistence assessment.
อินดิเคเตอร์ Pine Script®
อินดิเคเตอร์ Pine Script®
Trend Channel with Buy/Sell SignalsFree Telegram Trading Community t.me
📈 Trend Channel with Buy/Sell Signals
Short Title: TrendChannel Signals
How It Works
This indicator combines linear regression channel analysis with trend-confirmed pullback signals to help you trade with the trend, not against it.
The core philosophy is simple: Only take buy signals in uptrends and sell signals in downtrends. This prevents you from fighting the dominant market direction and increases the probability of successful trades.
🔑 Key Concept: Trading Pullbacks in Trend Direction
The indicator identifies the current trend direction by analyzing the slope of the regression channel:
Uptrend = Channel slopes upward (left side higher than right side)
Downtrend = Channel slopes downward (left side lower than right side)
The Smart Entry Logic:
BUY SIGNALS (Uptrend Only): When price breaks below the lower channel line and then moves back UP into the channel. This captures pullbacks in an uptrend.
SELL SIGNALS (Downtrend Only): When price breaks above the upper channel line and then moves back DOWN into the channel. This captures pullbacks in a downtrend.
📊 What It Displays
Linear Regression Channel - The core trend/regression line with upper and lower boundaries
Trend Direction Label - Clearly shows "UPTREND" or "DOWNTREND" at the start of each channel
Pearson's R Value - Shows the correlation strength (optional display)
Buy/Signal Alerts - Visual triangles at entry points with optional pop-up alerts
⚙️ Key Features
Trend-Filtered Signals - Ensures you only trade in the direction of the prevailing trend
Pullback Detection - Identifies when price retraces to the channel after a breakout
Customizable Deviation Bands - Use standard deviation or min/max pricing
Adjustable Length - Control the sensitivity of the regression calculation
Alert Conditions - Get notified when potential setups occur
🎯 Trading Strategy
For Long Positions (Uptrend):
Wait for "UPTREND" label to appear
Look for price to close below the lower channel line
Enter when price moves back above the lower line
Place stop loss below the recent swing low
For Short Positions (Downtrend):
Wait for "DOWNTREND" label to appear
Look for price to close above the upper channel line
Enter when price moves back below the upper line
Place stop loss above the recent swing high
📝 Best Practices
Use higher timeframes (1H, 4H, Daily) for trend confirmation
Combine with volume analysis for stronger signals
Consider Pearson's R value (>0.7 indicates strong trend)
Adjust channel length based on your trading style (shorter for scalping, longer for swing trading)
🔍 Keywords
Linear Regression Channel, Trend Following, Pullback Strategy, Mean Reversion, Channel Trading, Trend Confirmation, Buy/Sell Alerts, Technical Analysis, Price Action, Support and Resistance, TradingView Indicator, Algorithmic Trading, Swing Trading, Day Trading, Trend Analysis, Regression Bands, Statistical Arbitrage, Momentum Trading, Counter-trend Pullbacks, Smart Money Concepts
⚠️ Disclaimer
This indicator is for educational and informational purposes only. Past performance does not guarantee future results. Always use proper risk management and test strategies thoroughly before trading with real money.
Settings Overview
Parameter Description
Length Number of bars for regression calculation (50-5000)
Deviation Type Choose between Standard Deviation or Min/Max pricing
Deviation Multiplier Adjust channel width (1.0-4.0 recommended)
Extend Lines Choose to extend channel lines left/right/both
Pearson's R Display Show/hide correlation strength on chart
อินดิเคเตอร์ Pine Script®
CHECKLISTabove indicator is to find the best trades .f there is low ticks in the box its considered as low probbability
อินดิเคเตอร์ Pine Script®
Ye Min Naing EMA + Wave TrendAll in One indicator Base on EMA 9
Chart Overlay (price panel)
- EMA 9 (blue) - primary signal line
- EMA 21 (orange) - trend reference
- EMA 50 (gray) - major trend
- VWAP (purple)
- BUY/SELL labels on the chart
Oscillator (separate pane)
- Wave Trend Main Line (green) - ema(ci, 21) where ci = (hlc3 - ema(hlc3, 10)) / (0.015 * d)
- Signal Line (red) - SMA(main, 4) (verified from data)
- Histogram (columns) - main minus signal
- Dots at local min/max of main line
- Diamonds at histogram zero-crosses in OB/OS zones
- Reference lines at 0, +60, -60
Signal Logic
- BUY: Close crosses above EMA 9 + alternating state (must follow a SELL)
- SELL: Close crosses below EMA 9 + alternating state (must follow a BUY)
- Configurable confirmation bars (default: 1)
- Uses force_overlay=true so everything works in a single indicator
อินดิเคเตอร์ Pine Script®
Commodity Channel Index Pullback (CCI/P) v1Commodity Channel Index Pullback (CCI/P) v1
CCI/P v1 is a pullback-style oscillator built around two Commodity Channel Index calculations:
CCI #1 (Primary): identifies momentum extremes using an adjustable Absolute Level (± level).
CCI #2 (Secondary) or MA of CCI #2: acts as a simple regime filter based on whether it’s above or below 0.
What you’ll see
CCI #1 plotted as the primary line.
Fixed reference levels at ±100 and ±200, with subtle gray background zones.
Dynamic “plot zones” when CCI #1 exceeds ±Absolute Level:
Overbought plot (red)
Oversold plot (green)
Optional CCI #2 / MA2 area (plotted behind everything), colored:
Above 0: #089981
Below 0: #b2b5be
Optional candle coloring based on CCI #2 / MA2 regime (toggle in settings).
Triangle logic
Triangles flag “pullback + regime alignment” conditions:
Green triangle: CCI #1 < -Absolute Level AND CCI #2/MA2 > 0
Red triangle: CCI #1 > +Absolute Level AND CCI #2/MA2 < 0
Alerts
Alert conditions are included for:
Green / Red triangle setups (fires on the first bar the condition becomes true)
CCI #1 crossing above/below ±Absolute Level (and returning inside)
CCI #2/MA2 crossing above/below 0 (based on Plot Mode)
How I use it
This is a pullback framework, so I treat CCI #2/MA2 as the “environment” and CCI #1 as the “stretch”:
Pick your regime filter
Use MA of CCI #2 if you want a steadier filter (fewer flips).
Use CCI #2 if you want it more responsive.
Let CCI #1 reach an extreme
I’m generally looking for CCI #1 to push beyond the Absolute Level threshold, then watch for the pullback condition to align with the regime.
Use the triangle as a “checklist complete” marker
The triangle is not a guarantee—just a structured moment where stretch + regime align.
I still validate with structure/levels/volatility context (e.g., key highs/lows, prior range boundaries, session context).
Risk is external
Stops/targets aren’t built in—position sizing and exits depend on your instrument and volatility.
If you automate alerts, consider triggering alerts on bar close for more stable signals.
Notes
This script does not use higher-timeframe security() calls. Values may update during the currently-forming bar until it closes (standard TradingView behavior).
Disclaimer
This indicator is for educational/informational purposes only and is not financial advice. Always test on your market and timeframe and manage risk appropriately.
Changelog / v1 Notes
v1 (initial public release): Dual-CCI pullback framework with optional CCI #2 or MA(CCI #2) regime area, dynamic OB/OS plot zones, triangle conditions, candle-color toggle, and a full alert set (triangles + CCI #1 threshold crosses + CCI #2/MA2 zero crosses).
อินดิเคเตอร์ Pine Script®






















