Luxy Momentum, Trend, Bias and Breakout Indicators V7
TABLE OF CONTENTS
This is Version 7 (V7) - the latest and most optimized release. If you are using any older versions (V6, V5, V4, V3, etc.), it is highly recommended to replace them with V7.
Why This Indicator is Different
Who Should Use This
Core Components Overview
The UT Bot Trading System
Understanding the Market Bias Table
Candlestick Pattern Recognition
Visual Tools and Features
How to Use the Indicator
Performance and Optimization
FAQ
---
### CREDITS & ATTRIBUTION
This indicator implements proven trading concepts using entirely original code developed specifically for this project.
### CONCEPTUAL FOUNDATIONS
โข UT Bot ATR Trailing System
- Original concept by @QuantNomad: (search "UT-Bot-Strategy"
- Our version is a complete reimplementation with significant enhancements:
- Volume-weighted momentum adjustment
- Composite stop loss from multiple S/R layers
- Multi-filter confirmation system (swing, %, 2-bar, ZLSMA)
- Full integration with multi-timeframe bias table
- Visual audit trail with freeze-on-touch
- NOTE: No code was copied - this is a complete reimplementation with enhancements.
โข Standard Technical Indicators (Public Domain Formulas):
- Supertrend: ATR-based trend calculation with custom gradient fills
- MACD: Gerald Appel's formula with separation filters
- RSI: J. Welles Wilder's formula with pullback zone logic
- ADX/DMI: Custom trend strength formula inspired by Wilder's directional movement concept, reimplemented with volume weighting and efficiency metrics
- ZLSMA: Zero-lag formula enhanced with Hull MA and momentum prediction
### Custom Implementations
- Trend Strength: Inspired by Wilder's ADX concept but using volume-weighted pressure calculation and efficiency metrics (not traditional +DI/-DI smoothing)
- All code implementations are original
### ORIGINAL FEATURES (70%+ of codebase)
- Multi-Timeframe Bias Table with live updates
- Risk Management System (R-multiple TPs, freeze-on-touch)
- Opening Range Breakout tracker with session management
- Composite Stop Loss calculator using 6+ S/R layers
- Performance optimization system (caching, conditional calcs)
- VIX Fear Index integration
- Previous Day High/Low auto-detection
- Candlestick pattern recognition with interactive tooltips
- Smart label and visual management
- All UI/UX design and table architecture
### DEVELOPMENT PROCESS
**AI Assistance:** This indicator was developed over 2+ months with AI assistance (ChatGPT/Claude) used for:
- Writing Pine Script code based on design specifications
- Optimizing performance and fixing bugs
- Ensuring Pine Script v6 compliance
- Generating documentation
**Author's Role:** All trading concepts, system design, feature selection, integration logic, and strategic decisions are original work by the author. The AI was a coding tool, not the system designer.
**Transparency:** We believe in full disclosure - this project demonstrates how AI can be used as a powerful development tool while maintaining creative and strategic ownership.
---
1. WHY THIS INDICATOR IS DIFFERENT
Most traders use multiple separate indicators on their charts, leading to cluttered screens, conflicting signals, and analysis paralysis. The Suite solves this by integrating proven technical tools into a single, cohesive system.
Key Advantages:
All-in-One Design: Instead of loading 5-10 separate indicators, you get everything in one optimized script. This reduces chart clutter and improves TradingView performance.
Multi-Timeframe Bias Table: Unlike standard indicators that only show the current timeframe, the Bias Table aggregates trend signals across multiple timeframes simultaneously. See at a glance whether 1m, 5m, 15m, 1h are aligned bullish or bearish - no more switching between charts.
Smart Confirmations: The indicator doesn't just give signals - it shows you WHY. Every entry has multiple layers of confirmation (MA cross, MACD momentum, ADX strength, RSI pullback, volume, etc.) that you can toggle on/off.
Dynamic Stop Loss System: Instead of static ATR stops, the SL is calculated from multiple support/resistance layers: UT trailing line, Supertrend, VWAP, swing structure, and MA levels. This creates more intelligent, price-action-aware stops.
R-Multiple Take Profits: Built-in TP system calculates targets based on your initial risk (1R, 1.5R, 2R, 3R). Lines freeze when touched with visual checkmarks, giving you a clean audit trail of partial exits.
Educational Tooltips Everywhere: Every single input has detailed tooltips explaining what it does, typical values, and how it impacts trading. You're not guessing - you're learning as you configure.
Performance Optimized: Smart caching, conditional calculations, and modular design mean the indicator runs fast despite having 15+ features. Turn off what you don't use for even better performance.
No Repainting: All signals respect bar close. Alerts fire correctly. What you see in history is what you would have gotten in real-time.
What Makes It Unique:
Integrated UT Bot + Bias Table: No other indicator combines UT Bot's ATR trailing system with a live multi-timeframe dashboard. You get precision entries with macro trend context.
Candlestick Pattern Recognition with Interactive Tooltips: Patterns aren't just marked - hover over any emoji for a full explanation of what the pattern means and how to trade it.
Opening Range Breakout Tracker: Built-in ORB system for intraday traders with customizable session times and real-time status updates in the Bias Table.
Previous Day High/Low Auto-Detection: Automatically plots PDH/PDL on intraday charts with theme-aware colors. Updates daily without manual input.
Dynamic Row Labels in Bias Table: The table shows your actual settings (e.g., "EMA 10 > SMA 20") not generic labels. You know exactly what's being evaluated.
Modular Filter System: Instead of forcing a fixed methodology, the indicator lets you build your own strategy. Start with just UT Bot, add filters one at a time, test what works for your style.
---
2. WHO WHOULD USE THIS
Designed For:
Intermediate to Advanced Traders: You understand basic technical analysis (MAs, RSI, MACD) and want to combine multiple confirmations efficiently. This isn't a "one-click profit" system - it's a professional toolkit.
Multi-Timeframe Traders: If you trade one asset but check multiple timeframes for confirmation (e.g., enter on 5m after checking 15m and 1h alignment), the Bias Table will save you hours every week.
Trend Followers: The indicator excels at identifying and following trends using UT Bot, Supertrend, and MA systems. If you trade breakouts and pullbacks in trending markets, this is built for you.
Intraday and Swing Traders: Works equally well on 5m-1h charts (day trading) and 4h-D charts (swing trading). Scalpers can use it too with appropriate settings adjustments.
Discretionary Traders: This isn't a black-box system. You see all the components, understand the logic, and make final decisions. Perfect for traders who want tools, not automation.
Works Across All Markets:
Stocks (US, international)
Cryptocurrency (24/7 markets supported)
Forex pairs
Indices (SPY, QQQ, etc.)
Commodities
NOT Ideal For :
Complete Beginners: If you don't know what a moving average or RSI is, start with basics first. This indicator assumes foundational knowledge.
Algo Traders Seeking Black Box: This is discretionary. Signals require context and confirmation. Not suitable for blind automated execution.
Mean-Reversion Only Traders: The indicator is trend-following at its core. While VWAP bands support mean-reversion, the primary methodology is trend continuation.
---
3. CORE COMPONENTS OVERVIEW
The indicator combines these proven systems:
Trend Analysis:
Moving Averages: Four customizable MAs (Fast, Medium, Medium-Long, Long) with six types to choose from (EMA, SMA, WMA, VWMA, RMA, HMA). Mix and match for your style.
Supertrend: ATR-based trend indicator with unique gradient fill showing trend strength. One-sided ribbon visualization makes it easier to see momentum building or fading.
ZLSMA : Zero-lag linear-regression smoothed moving average. Reduces lag compared to traditional MAs while maintaining smooth curves.
Momentum & Filters:
MACD: Standard MACD with separation filter to avoid weak crossovers.
RSI: Pullback zone detection - only enter longs when RSI is in your defined "buy zone" and shorts in "sell zone".
ADX/DMI: Trend strength measurement with directional filter. Ensures you only trade when there's actual momentum.
Volume Filter: Relative volume confirmation - require above-average volume for entries.
Donchian Breakout: Optional channel breakout requirement.
Signal Systems:
UT Bot: The primary signal generator. ATR trailing stop that adapts to volatility and gives clear entry/exit points.
Base Signals: MA cross system with all the above filters applied. More conservative than UT Bot alone.
Market Bias Table: Multi-timeframe dashboard showing trend alignment across 7 timeframes plus macro bias (3-day, weekly, monthly, quarterly, VIX).
Candlestick Patterns: Six major reversal patterns auto-detected with interactive tooltips.
ORB Tracker: Opening range high/low with breakout status (intraday only).
PDH/PDL: Previous day levels plotted automatically on intraday charts.
VWAP + Bands : Session-anchored VWAP with up to three standard deviation band pairs.
---
4. THE UT BOT TRADING SYSTEM
The UT Bot is the heart of the indicator's signal generation. It's an advanced ATR trailing stop that adapts to market volatility.
Why UT Bot is Superior to Fixed Stops:
Traditional ATR stops use a fixed multiplier (e.g., "stop = entry - 2รATR"). UT Bot is smarter:
It TRAILS the stop as price moves in your favor
It WIDENS during high volatility to avoid premature stops
It TIGHTENS during consolidation to lock in profits
It FLIPS when price breaks the trailing line, signaling reversals
Visual Elements You'll See:
Orange Trailing Line: The actual UT stop level that adapts bar-by-bar
Buy/Sell Labels: Aqua triangle (long) or orange triangle (short) when the line flips
ENTRY Line: Horizontal line at your entry price (optional, can be turned off)
Suggested Stop Loss: A composite SL calculated from multiple support/resistance layers:
- UT trailing line
- Supertrend level
- VWAP
- Swing structure (recent lows/highs)
- Long-term MA (200)
- ATR-based floor
Take Profit Lines: TP1, TP1.5, TP2, TP3 based on R-multiples. When price touches a TP, it's marked with a checkmark and the line freezes for audit trail purposes.
Status Messages: "SL Touched โ" or "SL Frozen" when the trade leg completes.
How UT Bot Differs from Other ATR Systems:
Multiple Filters Available: You can require 2-bar confirmation, minimum % price change, swing structure alignment, or ZLSMA directional filter. Most UT implementations have none of these.
Smart SL Calculation: Instead of just using the UT line as your stop, the indicator suggests a better SL based on actual support/resistance. This prevents getting stopped out by wicks while keeping risk controlled.
Visual Audit Trail: All SL/TP lines freeze when touched with clear markers. You can review your trades weeks later and see exactly where entries, stops, and targets were.
Performance Options: "Draw UT visuals only on bar close" lets you reduce rendering load without affecting logic or alerts - critical for slower machines or 1m charts.
Trading Logic:
UT Bot flips direction (Buy or Sell signal appears)
Check Bias Table for multi-timeframe confirmation
Optional: Wait for Base signal or candlestick pattern
Enter at signal bar close or next bar open
Place stop at "Suggested Stop Loss" line
Scale out at TP levels (TP1, TP2, TP3)
Exit remaining position on opposite UT signal or stop hit
---
5. UNDERSTANDING THE MARKET BIAS TABLE
This is the indicator's unique multi-timeframe intelligence layer. Instead of looking at one chart at a time, the table aggregates signals across seven timeframes plus macro trend bias.
Why Multi-Timeframe Analysis Matters:
Professional traders check higher and lower timeframes for context:
Is the 1h uptrend aligning with my 5m entry?
Are all short-term timeframes bullish or just one?
Is the daily trend supportive or fighting me?
Doing this manually means opening multiple charts, checking each indicator, and making mental notes. The Bias Table does it automatically in one glance.
Table Structure:
Header Row:
On intraday charts: 1m, 5m, 15m, 30m, 1h, 2h, 4h (toggle which ones you want)
On daily+ charts: D, W, M (automatic)
Green dot next to title = live updating
Headline Rows - Macro Bias:
These show broad market direction over longer periods:
3 Day Bias: Trend over last 3 trading sessions (uses 1h data)
Weekly Bias: Trend over last 5 trading sessions (uses 4h data)
Monthly Bias: Trend over last 30 daily bars
Quarterly Bias: Trend over last 13 weekly bars
VIX Fear Index: Market regime based on VIX level - bullish when low, bearish when high
Opening Range Breakout: Status of price vs. session open range (intraday only)
These rows show text: "BULLISH", "BEARISH", or "NEUTRAL"
Indicator Rows - Technical Signals:
These evaluate your configured indicators across all active timeframes:
Fast MA > Medium MA (shows your actual MA settings, e.g., "EMA 10 > SMA 20")
Price > Long MA (e.g., "Price > SMA 200")
Price > VWAP
MACD > Signal
Supertrend (up/down/neutral)
ZLSMA Rising
RSI In Zone
ADX โฅ Minimum
These rows show emojis: GREEB (bullish), RED (bearish), GRAY/YELLOW (neutral/NA)
AVG Column:
Shows percentage of active timeframes that are bullish for that row. This is the KEY metric:
AVG > 70% = strong multi-timeframe bullish alignment
AVG 40-60% = mixed/choppy, no clear trend
AVG < 30% = strong multi-timeframe bearish alignment
How to Use the Table:
For a long trade:
Check AVG column - want to see > 60% ideally
Check headline bias rows - want to see BULLISH, not BEARISH
Check VIX row - bullish market regime preferred
Check ORB row (intraday) - want ABOVE for longs
Scan indicator rows - more green = better confirmation
For a short trade:
Check AVG column - want to see < 40% ideally
Check headline bias rows - want to see BEARISH, not BULLISH
Check VIX row - bearish market regime preferred
Check ORB row (intraday) - want BELOW for shorts
Scan indicator rows - more red = better confirmation
When AVG is 40-60%:
Market is choppy, mixed signals. Either stay out or reduce position size significantly. These are low-probability environments.
Unique Features:
Dynamic Labels: Row names show your actual settings (e.g., "EMA 10 > SMA 20" not generic "Fast > Slow"). You know exactly what's being evaluated.
Customizable Rows: Turn off rows you don't care about. Only show what matters to your strategy.
Customizable Timeframes: On intraday charts, disable 1m or 4h if you don't trade them. Reduces calculation load by 20-40%.
Automatic HTF Handling: On Daily/Weekly/Monthly charts, the table automatically switches to D/W/M columns. No configuration needed.
Performance Smart: "Hide BIAS table on 1D or above" option completely skips all table calculations on higher timeframes if you only trade intraday.
---
6. CANDLESTICK PATTERN RECOGNITION
The indicator automatically detects six major reversal patterns and marks them with emojis at the relevant bars.
Why These Six Patterns:
These are the most statistically significant reversal patterns according to trading literature:
High win rate when appearing at support/resistance
Clear visual structure (not subjective)
Work across all timeframes and assets
Studied extensively by institutions
The Patterns:
Bullish Patterns (appear at bottoms):
Bullish Engulfing: Green candle completely engulfs prior red candle's body. Strong reversal signal.
Hammer: Small body with long lower wick (at least 2ร body size). Shows rejection of lower prices by buyers.
Morning Star: Three-candle pattern (large red โ small indecision โ large green). Very strong bottom reversal.
Bearish Patterns (appear at tops):
Bearish Engulfing: Red candle completely engulfs prior green candle's body. Strong reversal signal.
Shooting Star: Small body with long upper wick (at least 2ร body size). Shows rejection of higher prices by sellers.
Evening Star: Three-candle pattern (large green โ small indecision โ large red). Very strong top reversal.
Interactive Tooltips:
Unlike most pattern indicators that just draw shapes, this one is educational:
Hover your mouse over any pattern emoji
A tooltip appears explaining: what the pattern is, what it means, when it's most reliable, and how to trade it
No need to memorize - learn as you trade
Noise Filter:
"Min candle body % to filter noise" setting prevents false signals:
Patterns require minimum body size relative to price
Filters out tiny candles that don't represent real buying/selling pressure
Adjust based on asset volatility (higher % for crypto, lower for low-volatility stocks)
How to Trade Patterns:
Patterns are NOT standalone entry signals. Use them as:
Confirmation: UT Bot gives signal + pattern appears = stronger entry
Reversal Warning: In a trade, opposite pattern appears = consider tightening stop or taking profit
Support/Resistance Validation: Pattern at key level (PDH, VWAP, MA 200) = level is being respected
Best combined with:
UT Bot or Base signal in same direction
Bias Table alignment (AVG > 60% or < 40%)
Appearance at obvious support/resistance
---
7. VISUAL TOOLS AND FEATURES
VWAP (Volume Weighted Average Price):
Session-anchored VWAP with standard deviation bands. Shows institutional "fair value" for the trading session.
Anchor Options: Session, Day, Week, Month, Quarter, Year. Choose based on your trading timeframe.
Bands: Up to three pairs (X1, X2, X3) showing statistical deviation. Price at outer bands often reverses.
Auto-Hide on HTF: VWAP hides on Daily/Weekly/Monthly charts automatically unless you enable anchored mode.
Use VWAP as:
Directional bias (above = bullish, below = bearish)
Mean reversion levels (outer bands)
Support/resistance (the VWAP line itself)
Previous Day High/Low:
Automatically plots yesterday's high and low on intraday charts:
Updates at start of each new trading day
Theme-aware colors (dark text for light charts, light text for dark charts)
Hidden automatically on Daily/Weekly/Monthly charts
These levels are critical for intraday traders - institutions watch them closely as support/resistance.
Opening Range Breakout (ORB):
Tracks the high/low of the first 5, 15, 30, or 60 minutes of the trading session:
Customizable session times (preset for NYSE, LSE, TSE, or custom)
Shows current breakout status in Bias Table row (ABOVE, BELOW, INSIDE, BUILDING)
Intraday only - auto-disabled on Daily+ charts
ORB is a classic day trading strategy - breakout above opening range often leads to continuation.
Extra Labels:
Change from Open %: Shows how far price has moved from session open (intraday) or daily open (HTF). Green if positive, red if negative.
ADX Badge: Small label at bottom of last bar showing current ADX value. Green when above your minimum threshold, red when below.
RSI Badge: Small label at top of last bar showing current RSI value with zone status (buy zone, sell zone, or neutral).
These labels provide quick at-a-glance confirmation without needing separate indicator windows.
---
8. HOW TO USE THE INDICATOR
Step 1: Add to Chart
Load the indicator on your chosen asset and timeframe
First time: Everything is enabled by default - the chart will look busy
Don't panic - you'll turn off what you don't need
Step 2: Start Simple
Turn OFF everything except:
UT Bot labels (keep these ON)
Bias Table (keep this ON)
Moving Averages (Fast and Medium only)
Suggested Stop Loss and Take Profits
Hide everything else initially. Get comfortable with the basic UT Bot + Bias Table workflow first.
Step 3: Learn the Core Workflow
UT Bot gives a Buy or Sell signal
Check Bias Table AVG column - do you have multi-timeframe alignment?
If yes, enter the trade
Place stop at Suggested Stop Loss line
Scale out at TP levels
Exit on opposite UT signal
Trade this simple system for a week. Get a feel for signal frequency and win rate with your settings.
Step 4: Add Filters Gradually
If you're getting too many losing signals (whipsaws in choppy markets), add filters one at a time:
Try: "Require 2-Bar Trend Confirmation" - wait for 2 bars to confirm direction
Try: ADX filter with minimum threshold - only trade when trend strength is sufficient
Try: RSI pullback filter - only enter on pullbacks, not chasing
Try: Volume filter - require above-average volume
Add one filter, test for a week, evaluate. Repeat.
Step 5: Enable Advanced Features (Optional)
Once you're profitable with the core system, add:
Supertrend for additional trend confirmation
Candlestick patterns for reversal warnings
VWAP for institutional anchor reference
ORB for intraday breakout context
ZLSMA for low-lag trend following
Step 6: Optimize Settings
Every setting has a detailed tooltip explaining what it does and typical values. Hover over any input to read:
What the parameter controls
How it impacts trading
Suggested ranges for scalping, day trading, and swing trading
Start with defaults, then adjust based on your results and style.
Step 7: Set Up Alerts
Right-click chart โ Add Alert โ Condition: "Luxy Momentum v6" โ Choose:
"UT Bot โ Buy" for long entries
"UT Bot โ Sell" for short entries
"Base Long/Short" for filtered MA cross signals
Optionally enable "Send real-time alert() on UT flip" in settings for immediate notifications.
Common Workflow Variations:
Conservative Trader:
UT signal + Base signal + Candlestick pattern + Bias AVG > 70%
Enter only at major support/resistance
Wider UT sensitivity, multiple filters
Aggressive Trader:
UT signal + Bias AVG > 60%
Enter immediately, no waiting
Tighter UT sensitivity, minimal filters
Swing Trader:
Focus on Daily/Weekly Bias alignment
Ignore intraday noise
Use ORB and PDH/PDL less (or not at all)
Wider stops, patient approach
---
9. PERFORMANCE AND OPTIMIZATION
The indicator is optimized for speed, but with 15+ features running simultaneously, chart load time can add up. Here's how to keep it fast:
Biggest Performance Gains:
Disable Unused Timeframes: In "Time Frames" settings, turn OFF any timeframe you don't actively trade. Each disabled TF saves 10-15% calculation time. If you only day trade 5m, 15m, 1h, disable 1m, 2h, 4h.
Hide Bias Table on Daily+: If you only trade intraday, enable "Hide BIAS table on 1D or above". This skips ALL table calculations on higher timeframes.
Draw UT Visuals Only on Bar Close: Reduces intrabar rendering of SL/TP/Entry lines. Has ZERO impact on logic or alerts - purely visual optimization.
Additional Optimizations:
Turn off VWAP bands if you don't use them
Disable candlestick patterns if you don't trade them
Turn off Supertrend fill if you find it distracting (keep the line)
Reduce "Limit to 10 bars" for SL/TP lines to minimize line objects
Performance Features Built-In:
Smart Caching: Higher timeframe data (3-day bias, weekly bias, etc.) updates once per day, not every bar
Conditional Calculations: Volume filter only calculates when enabled. Swing filter only runs when enabled. Nothing computes if turned off.
Modular Design: Every component is independent. Turn off what you don't need without breaking other features.
Typical Load Times:
5m chart, all features ON, 7 timeframes: ~2-3 seconds
5m chart, core features only, 3 timeframes: ~1 second
1m chart, all features: ~4-5 seconds (many bars to calculate)
If loading takes longer, you likely have too many indicators on the chart total (not just this one).
---
10. FAQ
Q: How is this different from standard UT Bot indicators?
A: Standard UT Bot (originally by @QuantNomad) is just the ATR trailing line and flip signals. This implementation adds:
- Volume weighting and momentum adjustment to the trailing calculation
- Multiple confirmation filters (swing, %, 2-bar, ZLSMA)
- Smart composite stop loss system from multiple S/R layers
- R-multiple take profit system with freeze-on-touch
- Integration with multi-timeframe Bias Table
- Visual audit trail with checkmarks
Q: Can I use this for automated trading?
A: The indicator is designed for discretionary trading. While it has clear signals and alerts, it's not a mechanical system. Context and judgment are required.
Q: Does it repaint?
A: No. All signals respect bar close. UT Bot logic runs intrabar but signals only trigger on confirmed bars. Alerts fire correctly with no lookahead.
Q: Do I need to use all the features?
A: Absolutely not. The indicator is modular. Many profitable traders use just UT Bot + Bias Table + Moving Averages. Start simple, add complexity only if needed.
Q: How do I know which settings to use?
A: Every single input has a detailed tooltip. Hover over any setting to see:
What it does
How it affects trading
Typical values for scalping, day trading, swing trading
Start with defaults, adjust gradually based on results.
Q: Can I use this on crypto 24/7 markets?
A: Yes. ORB will not work (no defined session), but everything else functions normally. Use "Day" anchor for VWAP instead of "Session".
Q: The Bias Table is blank or not showing.
A: Check:
"Show Table" is ON
Table position isn't overlapping another indicator's table (change position)
At least one row is enabled
"Hide BIAS table on 1D or above" is OFF (if on Daily+ chart)
Q: Why are candlestick patterns not appearing?
A: Patterns are relatively rare by design - they only appear at genuine reversal points. Check:
Pattern toggles are ON
"Min candle body %" isn't too high (try 0.05-0.10)
You're looking at a chart with actual reversals (not strong trending market)
Q: UT Bot is too sensitive/not sensitive enough.
A: Adjust "Sensitivity (KeyรATR)". Lower number = tighter stop, more signals. Higher number = wider stop, fewer signals. Read the tooltip for guidance.
Q: Can I get alerts for the Bias Table?
A: The Bias Table is a dashboard for visual analysis, not a signal generator. Set alerts on UT Bot or Base signals, then manually check Bias Table for confirmation.
Q: Does this work on stocks with low volume?
A: Yes, but turn OFF the volume filter. Low volume stocks will never meet relative volume requirements.
Q: How often should I check the Bias Table?
A: Before every entry. It takes 2 seconds to glance at the AVG column and headline rows. This one check can save you from fighting the trend.
Q: What if UT signal and Base signal disagree?
A: UT Bot is more aggressive (ATR trailing). Base signals are more conservative (MA cross + filters). If they disagree, either:
Wait for both to align (safest)
Take the UT signal but with smaller size (aggressive)
Skip the trade (conservative)
There's no "right" answer - depends on your risk tolerance.
---
FINAL NOTES
The indicator gives you an edge. How you use that edge determines results.
For questions, feedback, or support, comment on the indicator page or message the author.
Happy Trading!
Cari skrip untuk "entry"
Camarilla Pivots + 20 EMA StrategyThis is an intraday volatility and trend-following system for commodities like Natural Gas, combining dynamic pivot levels (Camarilla) with a trend filter (20-period EMA) to improve risk-reward and reduce false breakouts.
Core Components
1. Camarilla Pivots:
These are special support and resistance levels (H3, H4, L3, L4) calculated each day based on the previous day's high, low, and close.
The pivots adapt to daily volatility, giving more relevant breakout and bounce zones than static lines.
H4: Aggressive resistance (used for breakout LONG entry)
H3: Moderate resistance/support (used for bounce or stoploss)
L4: Aggressive support (used for breakout SHORT entry)
L3: Moderate support/resistance (used for bounce or stoploss)
2. 20 EMA (Exponential Moving Average):
Plotted on the 30-minute chart, this acts as a trend filter.
If the price is above 20 EMA: Only look for long trades (bullish bias).
If below 20 EMA: Only look for short trades (bearish bias).
How the Strategy Works
Setup (30-Min Chart):
Camarilla pivots for the day are drawn on the chart.
20 EMA is also plotted.
Trade Filter:
Bullish: Trade ONLY if price is above 20 EMA.
Bearish: Trade ONLY if price is below 20 EMA.
Entry:
LONG: Enter when price breaks and closes above the H4 pivot AND is above 20 EMA.
SHORT: Enter when price breaks and closes below the L4 pivot AND is below 20 EMA.
Stop Loss:
LONG: Place stoploss at H3 (the next lower Camarilla resistance).
SHORT: Place stoploss at L3 (the next higher Camarilla support).
Target:
Always set a profit target at 2x the distance (risk) between entry and stoploss (strict R:R 2).
For example, if your entry is at H4 and stoploss at H3, your target is entry + 2*(entry - stoploss).
Alerts & Visuals:
The strategy plots entry arrows, stoploss and target lines for immediate visual reference.
Alerts trigger on breakout signals so you never miss a trade.
Why This Works Well for Natural Gas
Adapts to volatility: The pivots change daily, handling wide-ranging and choppy price moves better than fixed breakouts.
Trend filter: EMA prevents counter-trend whipsaws, only trades with market momentum.
Risk control: Every trade must meet strict risk-reward criteria, so losses are contained and winners can outweigh losers.
Breaout and followthroughThis indicator is designed to identify and highlight a single, powerful entry signal at the beginning of a new trend. It filters for high-volatility breakout bars that show strong directional conviction, helping traders catch the initial momentum of a potential move. It will only paint one bullish or bearish signal after a trend change is detected, preventing repeat signals during a sustained move.
Core Concept
The indicator combines four key concepts to generate high-probability signals:
Trend Direction: It first establishes the overall trend (bullish or bearish) using a configurable Exponential or Simple Moving Average (EMA/SMA).
Volatility Expansion: It looks for bars with a larger-than-average range by comparing the bar's size to the Average True Range (ATR). This helps identify moments of increased market interest.
Closing Strength (IBS): It uses the Internal Bar Strength (IBS) to measure directional conviction. A high IBS (closing near the top) suggests bullish strength, while a low IBS (closing near the bottom) suggests bearish pressure.
Breakout Confirmation: As an optional but powerful filter, it can confirm the signal by ensuring the bar is breaking above the high or below the low of a user-defined number of previous bars.
A signal is only generated on the first bar that meets all these criteria after the price crosses the trend-defining moving average, making it ideal for capturing the start of a new swing.
Features
Bullish Signals (Green): Highlights the first bar in an uptrend that is larger than the ATR, closes with a high IBS (>70), and optionally breaks out above the recent highs.
Bearish Signals (Red): Highlights the first bar in a downtrend that is larger than the ATR, closes with a low IBS (<30), and optionally breaks out below the recent lows.
"First Signal Only" Logic: The script is hard-coded to show only the initial signal in a new trend, filtering out noise and redundant signals.
Fully Customizable Trend Filter:
Choose between EMA or SMA for trend definition.
Set the MA length (default is a short-term 7-period MA).
Option to show or hide the moving average on the chart.
Optional Breakout Filter:
Enable or disable the requirement for the signal bar to break the high/low of previous bars.
Customize the lookback period for the breakout confirmation.
How to Use
This indicator can be used as a primary signal for a trend-following or momentum-based trading system.
Look for a Green Bar (Bullish Signal): This suggests the start of a potential uptrend. Consider it a signal for a long entry. A logical stop-loss could be placed below the low of the highlighted signal bar.
Look for a Red Bar (Bearish Signal): This suggests the start of a potential downtrend. Consider it a signal for a short entry. A logical stop-loss could be placed above the high of the highlighted signal bar.
Adjust Settings: Use the settings menu to configure the indicator to your preferred market and timeframe. A longer Trend MA Length will result in fewer, more long-term signals, while a shorter length will be more responsive.
As with any tool, this indicator is best used in conjunction with other forms of analysis, such as market structure, support/resistance levels, and proper risk management.
Z-Score Trend Channels [BackQuant]Z-Score Trend Channels
A self-contained price-statistics framework that turns a rolling z-score into price channels, bias states, and trade markers. Run either trend-following or mean-reversion from the same tool with clear, on-chart context.
What it is
A rolling statistical map that measures how far price is from its recent average in standard-deviation units (z-score).
Adaptive channels drawn in price space from fixed z thresholds, so the rails breathe with volatility.
A simple trend proxy from z-score momentum to separate trending from ranging conditions.
On-chart signals for pullback entries, stretched extremes, and practical exits.
Core idea (plain English math)
Rolling mean and volatility - Over a lookback you get the average price and its standard deviation.
Z-score - How many standard deviations the current price is above or below its average: z = (price - mean) / stdev. z near 0 means near average; positive is above; negative is below.
Noise control - An EMA smooths the raw z to reduce jitter and false flickers.
Channels back in price - Fixed z levels are converted back to price to form the upper, lower, and extreme rails.
Trend proxy - A smoothed change in z is used as a lightweight trend-strength line. Positive strength with positive z favors uptrend; negative strength with negative z favors downtrend.
What you see on the chart
Channels and fills - Mean, upper, lower, and optional extreme lines. The area mean->upper tints with the bearish color, mean->lower tints with the bullish color.
Background tint (optional) - Soft green, red, or neutral based on detected trend state.
Signals - Bullish Entry (triangle up) when z exits the oversold zone upward; Bearish Entry (triangle down) when z exits the overbought zone downward; Extreme markers (diamonds) at the extreme bands with a one-bar turn.
Table - Current z, trend state, trend strength, distance to bands, market state tag, and a quick volatility regime label.
Edge labels - MEAN, OB, and OS labels slightly projected forward with level values.
Inputs you will actually use
Z-Score Period - Lookback for mean and stdev. Larger = slower and steadier rails, smaller = more reactive.
Smoothing Period - EMA on z. Lower = earlier but choppier flips; higher = later but cleaner.
Price Source - Default hlc3. Choose close if you prefer session-close logic.
Upper and Lower Thresholds - Default around +2.0 and -2.0. Tighten for more signals, widen for fewer and stronger.
Extreme Upper and Lower - Deeper stretch guards, e.g., +/- 2.5.
Strength Period - EMA on z momentum. Sets how fast the trend proxy flips.
Trend Threshold - Minimum absolute z to accept a directional bias.
Visual toggles - Channels, signals, background tint, stats table, colors, and optional last-bar trend label.
How to use it: trend-following playbook
Read the state - Uptrend when z > Trend Threshold and trend strength > 0. Downtrend when z < -Trend Threshold and trend strength < 0. Neutral otherwise.
Entries - In an uptrend, prefer Bullish Entry signals that fire near the lower channel. In a downtrend, prefer Bearish Entry signals that fire near the upper channel.
Stops - Conservative: beyond the extreme channel on your side. Tighter: just outside the standard band that framed the signal.
Exits - For longs, exit or trim on a cross back through z = 0 or a clean tag of the upper threshold. For shorts, mirror with z = 0 up-cross or tag of the lower threshold. You can also reduce if trend strength flips against you.
Adds - In strong trends, additional signals near your sideโs band can be add points. Avoid adding once z hovers near the opposite band for several bars.
How to use it: mean-reversion playbook
Find stretch - Standard reversions: Bullish Entry when z leaves the oversold zone upward; Bearish Entry when z leaves the overbought zone downward. Aggressive reversions: Extreme markers at extreme bands with a one-bar turn.
Entries - Take the signal as price exits the zone. Prefer setups where trend strength is near zero or tilting against the prior push.
Targets - First target is the mean line. A runner can aim for the opposite standard channel if momentum keeps flipping.
Stops - Outside the extreme band beyond your entry. If fading without extremes, place risk just beyond the opposite standard band.
Filters - Optional: skip counter-trend fades against a very strong trend state unless your risk is tight and predefined.
Reading the stats table
Current Z-Score - Magnitude and sign of displacement now.
Trend State - Uptrend, Downtrend, or Ranging.
Trend Strength - Smoothed z momentum. Higher absolute values imply stronger directional conviction.
Distance to Upper/Lower - Percent distance from price to each band, useful for sizing targets or judging room left.
Market State - Overbought, Oversold, Extreme OB, Extreme OS, or Normal.
Volatility Regime - High, Normal, or Low relative to recent distribution. Expect bands to widen in High and tighten in Low.
Parameter guidance (conceptual)
Z-Score Period - Choose longer for a structural mean, shorter for a reactive mean.
Smoothing Period - Lower for earlier but noisier reads; higher for slower but steadier reads.
Thresholds - Start around +/- 2.0. Tighten for scalping or quiet ranges. Widen for noisy or fast markets.
Trend Threshold and Strength Period - Raise to avoid weak, transient bias. Lower to capture earlier regime shifts.
Practical examples
Trend pullback long - State shows Uptrend. Price tests the lower channel; z dips near or below the lower threshold; a Bullish Entry prints. Stop just below extreme lower; first target mean; keep a runner if trend strength stays positive.
Mean-revert short - State is Ranging. z tags the extreme upper, an Extreme Bearish marker prints, then a Bearish Entry prints on the leave. Stop above extreme upper; target the mean; consider a runner toward the lower channel if strength turns negative.
Potential Questions you might have
Why z-score instead of fixed offsets - Because the bands adapt with volatility. When the tape gets quiet the rails tighten, when it runs hot the rails expand. Your entries stay normalized.
Do I need both modes - No. Many users run only trend pullbacks or only mean-reversions. The tool lets you toggle what you need and keep the chart readable.
Multi-timeframe workflow - A common approach is to set bias from a higher timeframeโs trend state and execute on a lower timeframeโs signals that align with it.
Summary
Z-Score Trend Channels gives you an adaptive mean, volatility-aware rails, a simple trend lens, and clear signals. Trade the trend by buying pullbacks in green and selling pullbacks in red, or fade stretched extremes back to the mean with defined risk. One framework, two strategies, consistent logic.
Opening Range IndicatorComplete Trading Guide: Opening Range Breakout Strategy
What Are Opening Ranges?
Opening ranges capture the high and low prices during the first few minutes of market open. These levels often act as key support and resistance throughout the trading day because:
Heavy volume occurs at market open as overnight orders execute
Institutional activity is concentrated during opening minutes
Price discovery happens as market participants react to overnight news
Psychological levels are established that traders watch all day
Understanding the Three Timeframes
OR5 (5-Minute Range: 9:30-9:35 AM)
Most sensitive - captures immediate market reaction
Quick signals but higher false breakout rate
Best for scalping and momentum trading
Use for early entry when conviction is high
OR15 (15-Minute Range: 9:30-9:45 AM)
Balanced approach - most popular among day traders
Moderate sensitivity with better reliability
Good for swing trades lasting several hours
Primary timeframe for most strategies
OR30 (30-Minute Range: 9:30-10:00 AM)
Most reliable but slower signals
Lower false breakout rate
Best for position trades and trend following
Use when looking for major moves
Core Trading Strategies
Strategy 1: Basic Breakout
Setup:
Wait for price to break above OR15 high or below OR15 low
Enter on the breakout candle close
Stop loss: Opposite side of the range
Target: 2-3x the range size
Example:
OR15 range: $100.00 - $102.00 (Range = $2.00)
Long entry: Break above $102.00
Stop loss: $99.50 (below OR15 low)
Target: $104.00+ (2x range size)
Strategy 2: Multiple Confirmation
Setup:
Wait for OR5 break first (early signal)
Confirm with OR15 break in same direction
Enter on OR15 confirmation
Stop: Below OR30 if available, or OR15 opposite level
Why it works:
Multiple timeframe confirmation reduces false signals and increases probability of sustained moves.
Strategy 3: Failed Breakout Reversal
Setup:
Price breaks OR15 level but fails to hold
Wait for re-entry into the range
Enter reversal trade toward opposite OR level
Stop: Recent breakout high/low
Target: Opposite side of range + extension
Key insight: Failed breakouts often lead to strong moves in the opposite direction.
Advanced Techniques
Range Quality Assessment
High-Quality Ranges (Trade these):
Range size: 0.5% - 2% of stock price
Clean boundaries (not choppy)
Volume spike during range formation
Clear rejection at range levels
Low-Quality Ranges (Avoid these):
Very narrow ranges (<0.3% of stock price)
Extremely wide ranges (>3% of stock price)
Choppy, overlapping candles
Low volume during formation
Volume Confirmation
For Breakouts:
Look for volume spike (2x+ average) on breakout
Declining volume often signals false breakout
Rising volume during range formation shows interest
Market Context Filters
Best Conditions:
Trending market days (SPY/QQQ with clear direction)
Earnings reactions or news-driven moves
High-volume stocks with good liquidity
Volatility above average (VIX considerations)
Avoid Trading When:
Extremely low volume days
Major economic announcements pending
Holidays or half-days
Choppy, sideways market conditions
Risk Management Rules
Position Sizing
Conservative: Risk 0.5% of account per trade
Moderate: Risk 1% of account per trade
Aggressive: Risk 2% maximum per trade
Stop Loss Placement
Inside the range: Quick exit but higher stop-out rate
Outside opposite level: More room but larger risk
ATR-based: 1.5-2x Average True Range below entry
Profit Taking
Target 1: 1x range size (take 50% off)
Target 2: 2x range size (take 25% off)
Runner: Trail remaining 25% with moving stops
Specific Entry Techniques
Breakout Entry Methods
Method 1: Immediate Entry
Enter as soon as price closes above/below range
Fastest entry but highest false signal rate
Best for strong momentum situations
Method 2: Pullback Entry
Wait for breakout, then pullback to range level
Enter when price bounces off former resistance/support
Better risk/reward but may miss some moves
Method 3: Volume Confirmation
Wait for breakout + volume spike
Enter after volume confirmation candle
Reduces false signals significantly
Multiple Timeframe Entries
Aggressive: OR5 break โ immediate entry
Conservative: OR5 + OR15 + OR30 all align โ enter
Balanced: OR15 break with OR30 support โ enter
Common Mistakes to Avoid
1. Trading Poor-Quality Ranges
โ Don't trade ranges that are too narrow or too wide
โ
Focus on clean, well-defined ranges with good volume
2. Ignoring Volume
โ Don't chase breakouts without volume confirmation
โ
Always check for volume spike on breakouts
3. Over-Trading
โ Don't force trades when ranges are unclear
โ
Wait for high-probability setups only
4. Poor Risk Management
โ Don't risk more than planned or use tight stops in volatile conditions
โ
Stick to predetermined risk levels
5. Fighting the Trend
โ Don't fade breakouts in strongly trending markets
โ
Align trades with overall market direction
Daily Trading Routine
Pre-Market (8:00-9:30 AM)
Check overnight news and earnings
Review major indices (SPY, QQQ, IWM)
Identify potential opening range candidates
Set alerts for range breakouts
Market Open (9:30-10:00 AM)
Watch opening range formation
Note volume and price action quality
Mark key levels on charts
Prepare for breakout signals
Trading Session (10:00 AM - 4:00 PM)
Execute breakout strategies
Manage existing positions
Trail stops as profits develop
Look for additional setups
Post-Market Review
Analyze winning and losing trades
Review range quality vs. outcomes
Identify improvement areas
Prepare for next session
Best Stocks/ETFs for Opening Range Trading
Large Cap Stocks (Best for beginners):
AAPL, MSFT, GOOGL, AMZN, TSLA
High liquidity, predictable behavior
Good range formation most days
ETFs (Consistent patterns):
SPY, QQQ, IWM, XLF, XLE
Excellent liquidity
Clear range boundaries
Mid-Cap Growth (Advanced traders):
Stocks with good volume (1M+ shares daily)
Recent news catalysts
Clean technical patterns
Performance Optimization
Track These Metrics:
Win rate by range type (OR5 vs OR15 vs OR30)
Average R/R (risk vs reward ratio)
Best performing market conditions
Time of day performance
Continuous Improvement:
Keep detailed trade journal
Review failed breakouts for patterns
Adjust position sizing based on win rate
Refine entry timing based on backtesting
Final Tips for Success
Start small - Paper trade or use tiny positions initially
Focus on quality - Better to miss trades than take bad ones
Stay disciplined - Stick to your rules even during losing streaks
Adapt to conditions - What works in trending markets may fail in choppy conditions
Keep learning - Markets evolve, so should your approach
The opening range strategy is powerful because it captures natural market behavior, but like all strategies, it requires practice, discipline, and proper risk management to be profitable long-term.
VWAP + Multi-Timeframe RSI StrategyThis strategy combines VWAP trend direction with confirmation from RSI on a higher timeframe. The idea is to only take trades when both intraday momentum and higher-timeframe trend are aligned, increasing accuracy.
LONG Entry:
Price above VWAP (bullish environment).
RSI on the current timeframe is below overbought (room to rise).
RSI on the higher timeframe (default H1) is above 50 (bullish confirmation).
SHORT Entry:
Price below VWAP (bearish environment).
RSI on the current timeframe is above oversold (room to fall).
RSI on the higher timeframe is below 50 (bearish confirmation).
Exit Rule:
Stop-loss near VWAP.
Take-profit at ~2x risk or when major levels are reached.
Best Timeframes:
Use 15m or 30m chart with H1 RSI for intraday trading.
Use 1H chart with Daily RSI for swing trading.
โก The higher-timeframe RSI filter reduces false signals and aligns trades with institutional flow.
Monday's Range Superpowerkyu๐ Settings
You can customize the colors and toggle ON/OFF in the indicator settings.
Works on daily, hourly, and minute charts.
Easily visualize Mondayโs high, low, and mid-line range.
๐ 1. Support & Resistance with Mondayโs Range
Monday High: Acts as the first resistance of the week.
โฝ Example: If price breaks above Mondayโs high after Tuesday, it signals potential bullish continuation โ long setup.
Monday Low: Acts as the first support of the week.
โฝ Example: If price breaks below Mondayโs low, it signals bearish continuation โ short setup.
๐ 2. Mid-Line Trend Confirmation
Monday Mid-Line = average price of Monday.
Price above mid-line โ bullish bias.
Price below mid-line โ bearish bias.
Use mid-line breaks as entry confirmation for long/short positions.
๐ 3. Breakout Strategy
Break of Mondayโs High = bullish breakout โ long entry.
Break of Mondayโs Low = bearish breakout โ short entry.
Place stop-loss inside Mondayโs range for a conservative approach.
๐ 4. False Breakout Strategy
If price breaks Mondayโs high/low but then falls back inside Mondayโs range, it is a False Breakout.
Strategy: Trade in the opposite direction.
โฝ False Breakout at High โ short.
โฝ False Breakout at Low โ long.
Stop-loss at the wick (extreme point) of the failed breakout.
๐ 5. Range-Based Scalping
Use Mondayโs high and low as a trading range.
Sell near Mondayโs High, buy near Mondayโs Low, repeat until breakout occurs.
๐ 6. Weekly Volatility Forecast
Narrow Monday range โ higher chance of strong trend later in the week.
Wide Monday range โ lower volatility expected during the week.
๐ 7. Pattern & Trend Analysis within Monday Range
Look for candlestick patterns around Mondayโs High/Low/Mid-Line.
โฝ Example: Double Top near Mondayโs High = short setup.
โฝ Repeated bounce at Mid-Line = strong long opportunity.
โ
Summary
The Mondayโs Range (Superpowerkyu) Indicator helps traders:
Identify weekly support & resistance
Confirm trend direction with Mid-Line
Trade breakouts & false breakouts
Apply range scalping strategies
Forecast weekly volatility
โก Especially, the False Breakout strategy is powerful as it captures failed moves and sudden sentiment reversals.
FiniteStateMachine๐ฉ OVERVIEW
A flexible framework for creating, testing and implementing a Finite State Machine (FSM) in your script. FSMs use rules to control how states change in response to events.
This is the first Finite State Machine library on TradingView and it's quite a different way to think about your script's logic. Advantages of using this vs hardcoding all your logic include:
โข Explicit logic : You can see all rules easily side-by-side.
โข Validation : Tables show your rules and validation results right on the chart.
โข Dual approach : Simple matrix for straightforward transitions; map implementation for concurrent scenarios. You can combine them for complex needs.
โข Type safety : Shows how to use enums for robustness while maintaining string compatibility.
โข Real-world examples : Includes both conceptual (traffic lights) and practical (trading strategy) demonstrations.
โข Priority control : Explicit control over which rules take precedence when multiple conditions are met.
โข Wildcard system : Flexible pattern matching for states and events.
The library seems complex, but it's not really. Your conditions, events, and their potential interactions are complex. The FSM makes them all explicit, which is some work. However, like all "good" pain in life, this is front-loaded, and *saves* pain later, in the form of unintended interactions and bugs that are very hard to find and fix.
๐ฉ SIMPLE FSM (MATRIX-BASED)
The simple FSM uses a matrix to define transition rules with the structure: state > event > state. We look up the current state, check if the event in that row matches, and if it does, output the resulting state.
Each row in the matrix defines one rule, and the first matching row, counting from the top down, is applied.
A limitation of this method is that you can supply only ONE event.
You can design layered rules using widlcards. Use an empty string "" or the special string "ANY" for any state or event wildcard.
The matrix FSM is foruse where you have clear, sequential state transitions triggered by single events. Think traffic lights, or any logic where only one thing can happen at a time.
The demo for this FSM is of traffic lights.
๐ฉ CONCURRENT FSM (MAP-BASED)
The map FSM uses a more complex structure where each state is a key in the map, and its value is an array of event rules. Each rule maps a named condition to an output (event or next state).
This FSM can handle multiple conditions simultaneously. Rules added first have higher priority.
Adding more rules to existing states combines the entries in the map (if you use the supplied helper function) rather than overwriting them.
This FSM is for more complex scenarios where multiple conditions can be true simultaneously, and you need to control which takes precedence. Like trading strategies, or any system with concurrent conditions.
The demo for this FSM is a trading strategy.
๐ฉ HOW TO USE
Pine Script libraries contain reusable code for importing into indicators. You do not need to copy any code out of here. Just import the library and call the function you want.
For example, for version 1 of this library, import it like this:
import SimpleCryptoLife/FiniteStateMachine/1
See the EXAMPLE USAGE sections within the library for examples of calling the functions.
For more information on libraries and incorporating them into your scripts, see the Libraries section of the Pine Script User Manual.
๐ฉ TECHNICAL IMPLEMENTATION
Both FSM implementations support wildcards using blank strings "" or the special string "ANY". Wildcards match in this priority order:
โข Exact state + exact event match
โข Exact state + empty event (event wildcard)
โข Empty state + exact event (state wildcard)
โข Empty state + empty event (full wildcard)
When multiple rules match the same state + event combination, the FIRST rule encountered takes priority. In the matrix FSM, this means row order determines priority. In the map FSM, it's the order you add rules to each state.
The library uses user-defined types for the map FSM:
โข o_eventRule : Maps a condition name to an output
โข o_eventRuleWrapper : Wraps an array of rules (since maps can't contain arrays directly)
Everything uses strings for maximum library compatibility, though the examples show how to use enums for type safety by converting them to strings.
Unlike normal maps where adding a duplicate key overwrites the value, this library's `m_addRuleToEventMap()` method *combines* rules, making it intuitive to build rule sets without breaking them.
๐ฉ VALIDATION & ERROR HANDLING
The library includes comprehensive validation functions that catch common FSM design errors:
Error detection:
โข Empty next states
โข Invalid states not in the states array
โข Duplicate rules
โข Conflicting transitions
โข Unreachable states (no entry/exit rules)
Warning detection:
โข Redundant wildcards
โข Empty states/events (potential unintended wildcards)
โข Duplicate conditions within states
You can display validation results in tables on the chart, with tooltips providing detailed explanations. The helper functions to display the tables are exported so you can call them from your own script.
๐ฉ PRACTICAL EXAMPLES
The library includes four comprehensive demos:
Traffic Light Demo (Simple FSM) : Uses the matrix FSM to cycle through traffic light states (red โ red+amber โ green โ amber โ red) with timer events. Includes pseudo-random "break" events and repair logic to demonstrate wildcards and priority handling.
Trading Strategy Demo (Concurrent FSM) : Implements a realistic long-only trading strategy using BOTH FSM types:
โข Map FSM converts multiple technical conditions (EMA crosses, gaps, fractals, RSI) into prioritised events
โข Matrix FSM handles state transitions (idle โ setup โ entry โ position โ exit โ re-entry)
โข Includes position management, stop losses, and re-entry logic
Error Demonstrations : Both FSM types include error demos with intentionally malformed rules to showcase the validation system's capabilities.
๐ฉ BRING ON THE FUNCTIONS
f_printFSMMatrix(_mat_rules, _a_states, _tablePosition)
โโPrints a table of states and rules to the specified position on the chart. Works only with the matrix-based FSM.
โโParameters:
โโโโ _mat_rules (matrix)
โโโโ _a_states (array)
โโโโ _tablePosition (simple string)
โโReturns: The table of states and rules.
method m_loadMatrixRulesFromText(_mat_rules, _rulesText)
โโLoads rules into a rules matrix from a multiline string where each line is of the form "current state | event | next state" (ignores empty lines and trims whitespace).
This is the most human-readable way to define rules because it's a visually aligned, table-like format.
โโNamespace types: matrix
โโParameters:
โโโโ _mat_rules (matrix)
โโโโ _rulesText (string)
โโReturns: No explicit return. The matrix is modified as a side-effect.
method m_addRuleToMatrix(_mat_rules, _currentState, _event, _nextState)
โโAdds a single rule to the rules matrix. This can also be quite readble if you use short variable names and careful spacing.
โโNamespace types: matrix
โโParameters:
โโโโ _mat_rules (matrix)
โโโโ _currentState (string)
โโโโ _event (string)
โโโโ _nextState (string)
โโReturns: No explicit return. The matrix is modified as a side-effect.
method m_validateRulesMatrix(_mat_rules, _a_states, _showTable, _tablePosition)
โโValidates a rules matrix and a states array to check that they are well formed. Works only with the matrix-based FSM.
Checks: matrix has exactly 3 columns; no empty next states; all states defined in array; no duplicate states; no duplicate rules; all states have entry/exit rules; no conflicting transitions; no redundant wildcards. To avoid slowing down the script unnecessarily, call this method once (perhaps using `barstate.isfirst`), when the rules and states are ready.
โโNamespace types: matrix
โโParameters:
โโโโ _mat_rules (matrix)
โโโโ _a_states (array)
โโโโ _showTable (bool)
โโโโ _tablePosition (simple string)
โโReturns: `true` if the rules and states are valid; `false` if errors or warnings exist.
method m_getStateFromMatrix(_mat_rules, _currentState, _event, _strictInput, _strictTransitions)
โโReturns the next state based on the current state and event, or `na` if no matching transition is found. Empty (not na) entries are treated as wildcards if `strictInput` is false.
Priority: exact match > event wildcard > state wildcard > full wildcard.
โโNamespace types: matrix
โโParameters:
โโโโ _mat_rules (matrix)
โโโโ _currentState (string)
โโโโ _event (string)
โโโโ _strictInput (bool)
โโโโ _strictTransitions (bool)
โโReturns: The next state or `na`.
method m_addRuleToEventMap(_map_eventRules, _state, _condName, _output)
โโAdds a single event rule to the event rules map. If the state key already exists, appends the new rule to the existing array (if different). If the state key doesn't exist, creates a new entry.
โโNamespace types: map
โโParameters:
โโโโ _map_eventRules (map)
โโโโ _state (string)
โโโโ _condName (string)
โโโโ _output (string)
โโReturns: No explicit return. The map is modified as a side-effect.
method m_addEventRulesToMapFromText(_map_eventRules, _configText)
โโLoads event rules from a multiline text string into a map structure.
Format: "state | condName > output | condName > output | ..." . Pairs are ordered by priority. You can have multiple rules on the same line for one state.
Supports wildcards: Use an empty string ("") or the special string "ANY" for state or condName to create wildcard rules.
Examples: " | condName > output" (state wildcard), "state | > output" (condition wildcard), " | > output" (full wildcard).
Splits lines by \n, extracts state as key, creates/appends to array with new o_eventRule(condName, output).
Call once, e.g., on barstate.isfirst for best performance.
โโNamespace types: map
โโParameters:
โโโโ _map_eventRules (map)
โโโโ _configText (string)
โโReturns: No explicit return. The map is modified as a side-effect.
f_printFSMMap(_map_eventRules, _a_states, _tablePosition)
โโPrints a table of map-based event rules to the specified position on the chart.
โโParameters:
โโโโ _map_eventRules (map)
โโโโ _a_states (array)
โโโโ _tablePosition (simple string)
โโReturns: The table of map-based event rules.
method m_validateEventRulesMap(_map_eventRules, _a_states, _a_validEvents, _showTable, _tablePosition)
โโValidates an event rules map to check that it's well formed.
Checks: map is not empty; wrappers contain non-empty arrays; no duplicate condition names per state; no empty fields in o_eventRule objects; optionally validates outputs against matrix events.
NOTE: Both "" and "ANY" are treated identically as wildcards for both states and conditions.
To avoid slowing down the script unnecessarily, call this method once (perhaps using `barstate.isfirst`), when the map is ready.
โโNamespace types: map
โโParameters:
โโโโ _map_eventRules (map)
โโโโ _a_states (array)
โโโโ _a_validEvents (array)
โโโโ _showTable (bool)
โโโโ _tablePosition (simple string)
โโReturns: `true` if the event rules map is valid; `false` if errors or warnings exist.
method m_getEventFromConditionsMap(_currentState, _a_activeConditions, _map_eventRules)
โโReturns a single event or state string based on the current state and active conditions.
Uses a map of event rules where rules are pre-sorted by implicit priority via load order.
Supports wildcards using empty string ("") or "ANY" for flexible rule matching.
Priority: exact match > condition wildcard > state wildcard > full wildcard.
โโNamespace types: series string, simple string, input string, const string
โโParameters:
โโโโ _currentState (string)
โโโโ _a_activeConditions (array)
โโโโ _map_eventRules (map)
โโReturns: The output string (event or state) for the first matching condition, or na if no match found.
o_eventRule
โโo_eventRule defines a condition-to-output mapping for the concurrent FSM.
โโFields:
โโโโ condName (series string) : The name of the condition to check.
โโโโ output (series string) : The output (event or state) when the condition is true.
o_eventRuleWrapper
โโo_eventRuleWrapper wraps an array of o_eventRule for use as map values (maps cannot contain collections directly).
โโFields:
โโโโ a_rules (array) : Array of o_eventRule objects for a specific state.
Small-Cap โ Sell Every Spike (Rendon1) Small-Cap โ Sell Every Spike v6 โ Strict, No Look-Ahead
Educational use only. This is not financial advice or a signal service.
This strategy targets low/ mid-float runners (โค ~20M) that make parabolic spikes. It shorts qualified spikes and scales out into flushes. Logic is deliberately simple and transparent to avoid curve-fit.
What the strategy does
Detects a parabolic up move using:
Fast ROC over N bars
Big range vs ATR
Volume spike vs SMA
Fresh higher high (no stale spikes)
Enters short at bar close when conditions are met (no same-bar fills).
Manages exits with ATR targets and optional % covers.
Tracks float rotation intraday (manual float input) and blocks trades above a hard limit.
Draws daily spike-high resistance from confirmed daily bars (no repaint / no look-ahead).
Timeframes & market
Designed for 1โ5 minute charts.
Intended for US small-caps; turn Premarket on.
Works intraday; avoid illiquid tickers or names with constant halts.
Entry, Exit, Risk (short side)
Entry: parabolic spike (ROC + RangeโฅATRรK + VolโฅSMAรK, new HH).
Optional confirmations (OFF by default to โsell every spikeโ): upper-wick and VWAP cross-down.
Stop: ATR stop above entry (default 1.2ร ATR).
Targets: TP1 = 1.0ร ATR, TP2 = 2.0ร ATR + optional 10/20/30% covers.
Safety: skip trades if RVOL is low or Float Rotation exceeds your limit (default warn 5ร, hard 7ร).
Inputs (Balanced defaults)
Price band: $2โ$10
Float Shares: set per ticker (from Finviz).
RVOL(50) โฅ 1.5ร
ROC(5) โฅ 1.0%, Range โฅ 1.6ร ATR, Vol โฅ 1.8ร SMA
Cooldown: 10 bars; Max trades/day: 6
Optional: Require wick (โฅ35%) and/or Require VWAP cross-down.
Presets suggestion:
โข Balanced (defaults above)
โข Safer: wick+VWAP ON, Rangeโฅ1.8ร, trades/day 3โ4
โข Micro-float (<5M): ROC 1.4โ1.8%, Rangeโฅ1.9โ2.2ร, Volโฅ2.2ร, RVOLโฅ2.0, wick 40โ50%
No look-ahead / repaint notes
Daily spike-highs use request.security(..., lookahead_off) and shifted โ only closed daily bars.
Orders arm next bar after entry; entries execute at bar close.
VWAP/ATR/ROC/Vol/RVOL are computed on the chart timeframe (no HTF peeking).
How to use
Build a watchlist: Float <20M, RelVol >2, Today +20% (Finviz).
Open 1โ5m chart, enter Float Shares for the ticker.
Start with Balanced, flip to Safer on halty/SSR names or repeated VWAP reclaims.
Scale out into flushes; respect the stop and rotation guard.
Limitations & risk
Backtests on small-caps can be optimistic due to slippage, spreads, halts, SSR, and limited premarket data. Always use conservative sizing. Low-float stocks can squeeze violently.
Alerts
Parabolic UP (candidate short)
SHORT Armed (conditions met; entry at bar close)
Bias + VWAP Pullback โ v4 (PA + BOS/CHOCH)Simple idea: I identify the trend (bias) from the larger timeframe, and only trade pullbacks to the VWAP/EMA during liquidity (London/New York). When the trend is clear, gold moves strongly, and its pullbacks to the balance lines provide clear opportunities.
Timeframe and Sessions (Cairo Time)
Analysis: H1 to determine the trend.
Implementation: 5m (or 1m if professional).
Trading window:
London Opening: 10:00โ12:30
New York Opening: 16:30โ19:00
(avoid the rest of the day unless there is exceptional traffic).
Direction determination (BIAS)
On H1:
If the price is above the 200 EMA and the daily VWAP is bullish and the price is above it โ uptrend (long-only).
If the price is below the 200 EMA and the daily VWAP is bearish and the price is below it โ bearish trend (short-only).
Determine your levels: yesterday's high/low (PDH/PDL) + approximate Asia range (03:00โ09:30).
Entry Rules (Setup A: Trend Continuation)
Asia range breakout towards Bias during liquidity window.
Wait for a withdrawal to:
Daily VWAP, or
EMA50 on 5m frame (best if both cross).
Confirmation: Confirmation low/high on 5m (HL buy/LH sell) + clear impulse candle (Body is greater than average of last 10 candles).
Entry:
Buy: When the price returns above VWAP/EMA50 with a confirmation candle close.
Sell: The exact opposite.
Stop Loss (SL): Below/above the last confirmation low/high or ATR(14, 5m) x 1.5 (largest).
Objectives:
TP1 = 1R (Close 50% and move the rest Break-even).
TP2 = 2.5R to 3R or at an important HTF level (PDH/PDL/Bid/Demand Zone).
Entry Rules (Setup B: Reversion to VWAP โ โMean Reversionโ)
Use with extreme caution, once daily maximum:
Price deviation from VWAP by more than ~1.5 x ATR(14, 5m) with rejection candles appearing near PDH/PDL.
Reverse entry towards the return of VWAP.
SL small behind rejection top/bottom.
Main target: VWAP. (Don't get greedy โ this scenario is for extended periods only.)
News Filtering and Risk Management
Avoid trading 15โ30 minutes before/after strong US news (CPI, NFP, FOMC).
Maximum daily loss: 1.5โ2% of account balance.
Risk per trade: 0.25โ0.5% (if you are learning) or 0.5โ1% (if you are experienced).
Do not exceed two consecutive losing trades per day.
Don't chase the market after the opportunity has passed โ wait for the next pullback.
Smart Deal Management
After TP1: Move stop to entry point + trail the rest with EMA20 on 5m or ATR Trailing = ATR(14)ร1.0.
If the price touches a strong daily level (PDH/PDL) and fails to break, consider taking additional profit.
If VWAP starts to flatten and breaks against the trend on H1, stop trading for the day.
Quick Checklist (Before Entry)
H1 trend is clear and consistent with 200EMA + VWAP.
Penetrating the Asia range towards Bias.
Clean pull to VWAP/EMA50 on 5m.
Confirmation candle and real push.
SL is logical (behind swing/ATRร1.5) and R :R โฅ 1:2.
No red news coming soon.
Example of "ready-made" settings
EMA: 20, 50, 200 on 5m, 200 only on H1.
VWAP: Daily (reset daily).
ATR: 14 on 5m.
Levels: PDH/PDL + Asia Band (03:00โ09:30 Cairo).
Gold Notes
Gold is fast and sharp at the open; don't get in early โ wait for the draw.
Fakeouts are common before news: it is best to call with the trend after the price returns above/below VWAP.
Don't expect 80% consistent wins every day โ the advantage comes from discipline, filtering out bad days, and only withdrawing when you're on the right track.
ุชุนุชุจุฑ ุดุฑูุฉ ุงูู
ุงุณุฉ ุงูุฃูู
ุงููุฉ ุฃุญุฏ ุงูู
ุคุณุณุงุช ุงูุนุงู
ูุฉ ุจุงูู
ู
ููุฉ ุงูุนุฑุจูุฉ ุงูุณุนูุฏูุฉ ูููุง ุชุงุฑูุฎ ุทููู ู
ู ุงูุฎุฏู
ุงุช ุงููุซูุฑุฉ ูุงูู
ุชููุนุฉ ุงูุชู ู
ุงุฒุงูุช ุชูุฏู
ูุง ูููุซูุฑ ู
ู ุงูุนู
ูุงุก ุฏุงุฎู ุฌู
ูุน ู
ุฏู ูุฃุญูุงุก ุงูู
ู
ููุฉ ุญูุซ ููุฏู
ุฃูุถู ู
ุง ูุฏููุง ู
ู ุฎูุงู ู
ุฌู
ูุนุฉ ุงูุดุฑูุงุช ุงูุชุงููุฉ ูุงูุชู ู
ู ุฎูุงููุง ุณุชุชููู ูู ู
ุง ุชุญุชุงุฌ ุฅููุฉ ูู ูู ุงูู
ุฌุงู ุงูู
ุฎุชููุฉ ููุญู ูุนู
ู ู
ูุฐ ุนุงู
2015 ูููุง ุณุงุจูุงุช ุงุนู
ุงู ูู ู
ุฎุชูู ุงูู
ุฌุงูุงุช ุงูุญูููุฉ ุงูุชู ูุฎุฏู
ู
ู ุฎูุงููุง ุนู
ูุงุฆูุง ููููุฑ ููู
ุฃุฑุฎุต ุงูุฃุณุนุงุฑ ูุจุฃุนูู ุฌูุฏุฉ ู
ู ุงูู
ู
ูู ุชููุฑูุง ูู ุงูู
ุฌุงูุงุช ุงูุชุงููุฉ :-
ุฎุฏู
ุงุช ุชูุธูู ุงูู
ูุงุฒู ูุงูููู ูุงูุดูู
ุฎุฏู
ุงุช ุนุฒู ุงูุฎุฒุงูุงุช ุชูุธูู ุบุณูู ุตูุงูุฉ ุงุตูุงุญ
ุฎุฏู
ุงุช ุฌูู ุงูุจูุงุท ูุงูุฑุฎุงู
ูุงูุณูุฑุงู
ูู
ุฎุฏู
ุงุช ููู ุงูุนูุด ุนู
ุงูุฉ ููุจูููุฉ ู
ุฏุฑุจุฉ
ุฎุฏู
ุงุช ู
ูุงูุญุฉ ุงูุญุดุฑุงุช ุจุฌุฏุฉ
ูู ูุฐุฉ ุงูุฎุฏู
ุงุช ูุฃูุซุฑ ูููุฑูุง ููู ุงูู
ุชุนุงูุฏูู ุจุฃูุถู ุงูุทุฑู ู
ุน ุชูููุฑ ุฎุทุท ูุจุฑุงู
ุฌ ู
ุชููุนุฉ ูุฃุชู
ุงู
ุงูุนู
ู ุงูู
ุณููุฏ ุฅูููุง ุจุฃูุถู ูุฃุญุฏุซ ุงูุทุฑู ุงูุญุฏูุซุฉ ูุงูุนุตุฑูุฉ ุณูุงุก ูู ุดุฑูุงุช ุงููุธุงูุฉ ุจุฌุฏุฉ ูู
ูุฉ ุงูู
ูุฑู
ุฉ ุฃู ุดุฑูุงุช ููู ุงูุนูุด ุจุฌุฏุฉ ุนู
ุงูุฉ ููุจูููุฉ ูุจุงูู ุงูุฎุฏู
ุงุช ู
ุซู ุฌูู ูุชูู
ูุน ุงูุฑุฎุงู
ุจู
ูุฉ ูุฌุฏุฉ ููุง ููุณู ุดุฑูุฉ ู
ูุงูุญุฉ ุญุดุฑุงุช ุจุฌุฏุฉ ุงูุชู ุณุงุนุฏุช ุขูุงู ุงูู
ูุงุทููู ุนูู ุชูุธูู ู
ูุงุฒููู
ู
ู ุงูุญุดุฑุงุช ุจุฃูุถู ู
ุจูุฏุงุช ุญุดุฑูุฉ.
TURT Donchian Ladder v3.13How to trade TURT+ with the v3.13 script
1) Pick the system & arm the entry
โข In the script, choose System = S1 (20D) or S2 (55D).
The HUD always shows both rails for reference, but the ladder (Entry/+Adds) uses the system you pick.
โข Your Entry is shown as Pivot + 0.1รN (rounded).
โข Place a stop-limit โparentโ order at that Entry price. (Classic Turtle uses an entry stop; I suggest a tight limit offset so you donโt chase a blow-through.)
โข Initial stop = N2 = Entry โ 2รN (rounded). Put that in immediately.
If you like only confirming on a bar close, leave confirmClose = true and place the parent after the close that breaks out. If you want intrabar fills, set confirmClose = false and keep the stop-limit active intraday.
2) Size it the way you planned
โข Set acctEquity / riskCapPct / posCapUSD / entryFrac / entryRiskFrac / sizingMode.
โข HUD gives Rec Entry Qty (when flat) and, once in, it shows:
โข Next Rung (price)
โข Suggested AddShares (honors RiskCap & PosCap)
โข Proj Stop if Add (ratcheted N2)
โข A limiter note (RiskCap or PosCap) if youโre constrained.
3) After entry fills, stage the ADDs (only at fixed +N steps)
โข Adds are NOT โevery Donchian break.โ You add only at:
โข Add-1 = Entry + 0.5รN
โข Add-2 = Entry + 1.0รN
โข Add-3 = Entry + 1.5รN (optional)
โข Use the HUDโs Suggested AddShares for each rung (it respects your RiskCap/PosCap).
โข Place stop-limit orders for each add (either immediately as a contingent OTO chain that arms only after Entry fills, or you arm each add when price approachesโyour choice).
โข On each add fill, ratchet the catastrophic stop for the entire position to Last-Add โ 2รN (the script and HUD show Proj Stop if Add so you know where it will land). Never move it lower.
Pro tip: If your broker supports OTO/OTOCO:
โข OTO parent = Entry stop-limit.
โข On fill, fire an OCO with the N2 stop (no target), and also stage child stop-limits for Add-1 / Add-2 / Add-3 with the correct sizes. If your broker canโt chain that deep, just use the scriptโs alerts (Entry/Add-1/Add-2/Add-3/Exits) to place/adjust orders quickly.
4) Exits (two layers)
โข Catastrophic (always on): the N2 stop youโre ratcheting (Last-Add โ 2รN).
โข Trend exits (runner):
โข S1: 10-low close (HUD shows it).
โข S2: 20-low close (HUD shows it).
โข Profit-taking (optional): sell ~50% at +2.5R to +3R vs current N2; let the runner trail with 10-low/20-low. You can keep N2 as a hard backstop.
5) Should you pre-set everything or buy live?
Both work; pick the style that fits you:
Preset (Turtle-pure, rules-based)
โข โ
You wonโt miss the breakout; minimal discretion.
โข โ
Broker handles fills even if youโre away.
โข โ ๏ธ You may get the occasional intraday โpokeโ (use confirmClose + place after close if you want fewer).
Buy on break manually
โข โ
Lets you check tape/volume or any extra gates before clicking.
โข โ ๏ธ Higher chance of slippage or of simply missing the trigger.
A nice hybrid: place the Entry order, then arm Add-1/2/3 when price is nearing each rung and the HUD shows Suggested AddShares > 0 (green risk read).
โธป
6) Quick checklist per trade
1. System: S1 or S2?
2. Levels: Entry / Add-1 / Add-2 / Add-3 / 10-low / 20-low / N2 (rounded).
3. Sizing: confirm RiskCap/PosCap; HUD shows Suggested AddShares and limiter.
4. Orders:
โข Parent Entry stop-limit.
โข N2 stop (rounded).
โข Stage adds (stop-limits) with sizes from HUD.
5. On fill: ratchet stop to Last-Add โ 2รN; adjust remaining adds and sizes.
โธป
7) Example with your MU position (pattern)
โข Youโre already in: set entryQty and entryPman in the inputs to match your fill.
โข HUD now focuses on Next Rung, Suggested AddShares, and Proj Stop if Add.
โข If Suggested AddShares = 0 and limiter says RiskCap or PosCap, youโll still see the next rung price and Proj Stop if Add so you can decide whether to override.
โธป
Bottom line
โข Entry: buy the Donchian breakout + 0.1N with a stop-limit (Turtle style).
โข Adds: only at +0.5N steps, sized by HUD; not on every future Donchian break.
โข Stops: keep (and ratchet) the N2 catastrophic; trail runner on 10-low / 20-low.
If you want, tell me your broker/platform and Iโll map this to exact order ticket types (stop-limit/OTO/OCO) and a tiny checklist you can keep next to your screen.
Marubozu Detector with Dynamic SL/TP
Strategy Overview:
This indicator detects a "Marubozu" bullish pattern or a โMarubozuโ bearish pattern to suggest potential buy and sell opportunities. It uses dynamic Stop Loss (SL) and Take Profit (TP) management, based on either market volatility (ATR) or liquidity zones.
This tool is intended for educational and informational purposes only.
Key Features:
Entry: Based on detecting Marubozu bullish or bearish candle pattern.
Exit: Targets are managed through ATR multiples or previous liquidity levels (swing highs or swing lows).
Smart Liquidity: Optionally identify deeper liquidity targets.
Full Alerts: Buy and Sell signals supported with customizable alerts.
Visualized Trades: Entry, SL, and TP levels are plotted on the chart.
User Inputs:
ATR Length, ATR Multipliers
Take Profit Mode (Liquidity/ATR)
Swing Lookback and Strength
Toggleable Buy/Sell alerts
All Time Frames
๐ How to Use:
Add the Indicator:
Apply the script to your chart from the TradingView indicators panel.
Look for Buy Signals:
A buy signal is triggered when the script detects a "Marubozu" bullish pattern.
Entry, Stop Loss, and Take Profit levels are plotted automatically.
Look for Sell Signals:
A Sell signal is triggered when the script detects a "Marubozu" bearish pattern.
Entry, Stop Loss, and Take Profit levels are plotted automatically.
Choose Take Profit Mode:
ATR Mode: TP is based on a volatility target.
Liquidity Mode: TP is based on past swing highs.
Set Alerts (Optional):
Enable Buy/Sell alerts in the settings to receive real-time notifications.
Practice First:
Always backtest and paper trade before live use.
๐ Disclaimer:
This script does not offer financial advice.
No guarantees of profit or performance are made.
Use in demo accounts or backtesting first.
Always practice proper risk management and seek advice from licensed professionals if needed.
โ
Script Compliance:
This script is designed in full accordance with TradingViewโs House Rules for educational tools.
No financial advice is provided, no performance is guaranteed, and users are encouraged to backtest thoroughly.
Position Size CalculatorPosition Size Calculator
This open-source Pine Scriptยฎ indicator helps traders manage risk by calculating position size, margin, and risk/reward based on account size, leverage, entry, stop-loss, and take-profit. It features a customizable table and optional chart lines/labels for clear trade planning across stocks, forex, crypto, and futures.
What It Does
- Position Size: Computes units to trade based on risk percentage and stop-loss distance, capped by leverage.
- Margin: Calculates initial margin in base currency and USD, with account size percentage.
- Risk/Reward: Shows risk-reward ratio, percentage price movements, and USD gains/losses.
- Visualization: Displays results in a table and optional chart lines/labels with customizable styles.
How It Works
- Precision: Adjusts price formatting using syminfo.mintick for accuracy across assets.
- Calculations: Position size = accountSize * (riskPercent / 100) / |entry - stoploss|, capped by accountSize * leverage / entry. Margin = positionSize / leverage. Risk-reward = |takeprofit - entry| / |stoploss - entry|.
- Display: Table shows metrics; optional lines/labels plot entry, stop-loss, and take-profit with percentage and USD details.
How to Use
- Set Inputs:
1- Account Size (USD): Your capital (e.g., 1000).
2- % Risk per Trade: Risk tolerance (e.g., 1%).
3- Leverage: Broker leverage (e.g., 1x, 10x).
4- Entry, Stop Loss, Take Profit: Trade prices.
5- Show Lines and Labels: Enable chart overlays.
- Customize: Adjust table position, colors, and line styles (Solid, Dashed, Dotted).
- View Results: Table shows position size, margin, and risk/reward. Chart lines/labels (if enabled) display prices, percentages, and USD outcomes.
- Apply: Use metrics for trade execution; modify code for custom features.
Notes
- Ensure valid inputs (entry โ stop-loss, both positive) to avoid โN/Aโ.
- Open-source: Inspect or extend the code for your needs.
- Contact the author via TradingView for feedback.
Sunmool's Silver Bullet Model FinderICT Silver Bullet Model Indicator - Complete Guide
๐ Overview
The ICT Silver Bullet Model indicator is a supplementary tool for utilizing ICT's (Inner Circle Trader) market structure analysis techniques. This indicator detects institutional liquidity hunting patterns and automatically identifies structural levels, helping traders analyze market structure more effectively.
๐ฏ Core Features
1. Structural Level Identification
STL (Short Term Low): Recent support levels formed in the short term
STH (Short Term High): Recent resistance levels formed in the short term
ITL (Intermediate Term Low): Stronger support levels with more significance
ITH (Intermediate Term High): Stronger resistance levels with more significance
2. Kill Zone Time Display
London Kill Zone: 02:00-05:00 (default)
New York Kill Zone: 08:30-11:00 (default)
These are the most active trading hours for institutional players where significant price movements occur
3. Smart Sweep Detection
Bear Sweep (๐ป): Pattern where price sweeps below lows then recovers - Simply indicates sweep occurrence
Bull Sweep (๐บ): Pattern where price sweeps above highs then declines - Simply indicates sweep occurrence
Important: Sweep labels only mark liquidity hunting locations, not directional bias.
๐ง Configuration Parameters
Basic Settings
Sweep Detection Lookback: Number of candles for sweep detection (default: 20)
Structure Point Lookback: Number of candles for structural point detection (default: 10)
Sweep Threshold: Percentage threshold for sweep validation (default: 0.1%)
Time Settings
London Kill Zone: Active hours for London session
New York Kill Zone: Active hours for New York session
Visualization Settings
Customizable colors for each level type
Enable/disable alert notifications
๐ How to Use
1. Chart Setup
Most effective on 1-minute to 1-hour timeframes
Recommended for major currency pairs (EUR/USD, GBP/USD, etc.)
Also applicable to cryptocurrencies and indices
2. Signal Interpretation
๐ป Bear Sweep / ๐บ Bull Sweep Labels
Simply indicate liquidity hunting occurrence points
Not directional bias indicators
Reference for understanding overall context on HTF
๐ข Silver Bullet Long (Huge Green Triangle)
After Bear Sweep occurrence
Within Kill Zone timeframe
Current price positioned above swept level
โ Actual BUY entry signal
๐ด Silver Bullet Short (Huge Red Triangle)
After Bull Sweep occurrence
Within Kill Zone timeframe
Current price positioned below swept level
โ Actual SELL entry signal
3. Risk Management
Use swept levels as stop-loss reference points
Approach signals outside Kill Zone hours with caution
Recommended to use alongside other technical analysis tools
๐ก Trading Strategies
Silver Bullet Strategy
Preparation Phase: Monitor charts 30 minutes before Kill Zone
Sweep Observation: Identify liquidity hunting points with ๐ป๐บ labels (reference only)
Entry: Enter ONLY when huge triangle Silver Bullet signal appears within Kill Zone
Take Profit: Target opposite structural level or 1:2 reward ratio
Stop Loss: Beyond the swept level
Important: Small sweep labels are NOT trading signals!
Multi-Timeframe Approach
Step 1: HTF (Higher Time Frame) Sweep Reference
Observe ๐ป๐บ sweep labels on 4-hour and daily charts
Reference only sweeps occurring at major structural levels
HTF sweeps are used to identify liquidity hunting points
Reference only, not for directional bias
Step 2: Transition to LTF (Lower Time Frame)
Move to 15-minute, 5-minute, and 1-minute charts
Analyze LTF with reference to HTF sweep information
Use STL, STH, ITL, ITH for precise entry point identification
Structural levels on LTF are the core of actual trading decisions
Only huge triangle (Silver Bullet) signals are actual entry signals
Recommended Usage
Identify overall sweep occurrence points on HTF (๐ป๐บ labels)
Use this indicator on LTF to identify structural levels
Reference only huge triangle signals for actual trading during Kill Zone
Small sweep labels (๐ป๐บ) are for reference only, not entry signals
๐ Information Table Interpretation
Real-time information in the top-right table:
Kill Zone Status: Current active session status
Level Counts: Number of each structural level type
โ ๏ธ Important Disclaimers
Backtesting results do not guarantee future performance
Exercise caution during high market volatility periods
Always apply proper risk management
Recommend comprehensive analysis with other analytical tools
๐ Learning Resources
Study original ICT concepts through free YouTube educational content
Research Market Structure analysis techniques
Optimize through backtesting for personal use
๐ฌ Technical Implementation
Algorithm Logic
Pivot Point Detection: Uses TradingView's built-in pivot functions to identify swing highs and lows
Classification System: Automatically categorizes levels based on recent price action frequency
Sweep Validation: Confirms legitimate sweeps through price action analysis
Time-Based Filtering: Prioritizes signals during institutional active hours
Performance Optimization
Efficient array management prevents memory overflow
Dynamic level cleanup maintains chart clarity
Real-time calculation ensures minimal lag
๐ ๏ธ Customization Tips
Adjust lookback periods based on market volatility
Modify kill zone times for different market sessions
Experiment with sweep threshold for different instruments
Color-code levels according to personal preference
๐ Expected Outcomes
When properly implemented, this indicator can help traders:
Identify high-probability reversal points
Time entries with institutional flow
Reduce false signals through kill zone filtering
Improve risk-to-reward ratios
This indicator automates ICT's concepts into a user-friendly tool that can be enhanced through continuous learning and practical application. Success depends on understanding the underlying market structure principles and combining them with proper risk management techniques.
Pasrsifal.RegressionTrendStateSummary
The Parsifal.Regression.Trend.State Indicator analyzes the leading coefficients of linear and quadratic regressions of price (against time). It also considers their first- and second-order changes. These features are aggregated into a Trend-State background, shown as a gradient color. In addition, the indicator generates fast and slow signals that can be used as potential entry- or exit triggers.
This tool is designed for advanced trend-following strategies, leveraging information from multiple trendline features.
Background
Trendlines provide insight into the state of a trend or the โtrendinessโ of a price process. While moving averages or pivot-based lines can serve as envelopes and breakout levels, they are often too lagging for swing traders, who need tools that adapt more closely to price swings, ideally using trendlines, around which the price process swings continuously.
Regression lines address this by cutting directly through the data, making them a natural anchor for observing how price winds around a central trendline within a chosen lookback period.
Regression Trendlines
โข Linear Regression:
o Minimizes distance to all closing values over the lookback period.
o The slope represents the short-term linear trend.
o The change of slope indicates trend acceleration or deceleration.
o Linear regression lags during phases of rapid market shifts.
โข Quadratic Regression:
o Fits a second-degree polynomial to minimize deviation from closing prices.
o The convexity term (leading coefficient) reflects curvature:
๏ง Positive convexity โ accelerating uptrend or fading downtrend.
๏ง Negative convexity โ accelerating downtrend or fading uptrend.
o The change of convexity detects early shifts in momentum and often reacts faster than slope features.
Features Extracted
The indicator evaluates six features:
โข Linear features: slope, first derivative of slope, second derivative of slope.
โข Quadratic features: convexity term, first derivative of the convexity term, second derivative of the convexity term.
โข Linear features: capture broad, background trend behavior.
โข Quadratic features: detect deviations, accelerations, and smaller-scale dynamics.
Quadratic terms generally react first to market changes, while linear terms provide stability and context.
Dynamics of Market Moves as seen by linear and quadratic regressions
โข At the start of a rapid move:
The change of convexity reacts first, capturing the shift in dynamics before other features. The convexity term then follows, while linear slope features lag further behind. Because convexity measures deviation from linearity, it reflects accelerating momentum more effectively than slope.
โข At the end of a rapid move:
Again, the change of convexity responds first to fading momentum, signaling the transition from above-linear to below-linear dynamics. Even while a strong trend persists, the change of convexity may flip sign early, offering a warning of weakening strength. The convexity term itself adjusts more slowly but may still turn before the price process does. Linear features lag the most, typically only flipping after price has already reversed, thereby smoothing out the rapid, more sensitive reactions of quadratic terms.
________________________________________
Parsifal Regression.Trend.State Method
1. Feature Mapping:
Each feature is mapped to a range between -1 and 1, preserving zero-crossings (critical for sign interpretation).
2. Aggregation:
A heuristic linear combination*) produces a background information value, visualized as a gradient color scale:
o Deep green โ strong positive trend.
o Deep red โ strong negative trend.
o Yellow โ neutral or transitional states.
3. Signals:
o Fast signal (oscillator): ranges from -1 to 1, reflecting short-term trend state.
o Slow signal (smoothed): moving average of the fast signal.
o Their interactions (crossovers, zero-crossings) provide actionable trading triggers.
How to Use
The Trend-State background gradient provides intuitive visual feedback on the aggregated regression features (slope, convexity, and their changes). Because these features reflect not only current trend strength but also their acceleration or deceleration, the color transitions help anticipate evolving market states:
โข Solid Green: All features near their highs. Indicates a strong, accelerating uptrend. May also reflect explosive or hyperbolic upside moves (including gaps).
โข Fading Solid Green: A recently strong uptrend is losing momentum. Price may shift into a slower uptrend, consolidation, or even a reversal.
โข Fading Green โ Yellow: Often appears as a dirty yellow or a rapidly mixing pattern of green and red. Signals that the uptrend is weakening toward neutrality or beginning to turn negative.
โข Yellow โ Deepening Red: Two possible scenarios:
o Coming from a strong uptrend โ suggests a sharp fade, though the trend may still technically be up.
o Coming from a weaker uptrend or sideways market โ suggests the start of an accelerating downtrend.
โข Solid Red: All features near their lows. Indicates a strong, accelerating downtrend. May also reflect crash-type conditions or downside gaps.
โข Fading Solid Red: A recently strong downtrend is losing strength. Market may move into a slower decline, consolidation, or early reversal upward.
โข Fading Red โ Yellow : The downtrend is weakening toward neutral, with potential for a bullish shift.
โข Yellow โ Increasing Green: Two possible scenarios:
o Coming from a strong downtrend, it reflects a sharp fade of bearish momentum, though the market may still technically be trending down.
o Coming from a weaker downtrend or sideways movement, it suggests the start of an accelerating uptrend.
Note: Market evolution does not always follow this neat โcolor cycle.โ It may jump between states, skip stages, or reverse abruptly depending on market conditions. This makes the background coloring particularly valuable as a contextual map of current and evolving price dynamics.
Signal Crossovers:
Although the fast signal is very similar (but not identical) to the background coloring, it provides a numerical representation indicating a bullish interpretation for rising values and bearish for falling.
o High-confidence entries:
๏ง Fast signal rising from < -0.7 and crossing above the slow signal โ potential long entry.
๏ง Fast signal falling from > +0.7 and crossing below the slow signal โ potential short entry.
o Low-confidence entries:
๏ง Crossovers near zero may still provide a valid trigger but may be noisy and should be confirmed with other signals.
o Zero-crossings:
๏ง Indicate broader state changes, useful for conservative positioning or option strategies. For confirmation of a Fast signal 0-crossing, wait for the Slow signal to cross as well.
________________________________________
*) Note on Aggregation
While the indicator currently uses a heuristic linear combination of features, alternatives such as Principal Component Analysis (PCA) could provide a more formal aggregation. However, while in the absence of matrix algebra, the required eigenvalue decomposition can be approximated, its computational expense does not justify the marginal higher insight in this case. The current heuristic approach offers a practical balance of clarity, speed, and accuracy.
13/48 EMA Trading Scalper (ATR TP/SL)13/48 EMA Trading Scalper (ATR TP/SL)
What it does:
This tool looks for price โtouchesโ of the 13-EMA, only takes CALL entries when the 13 is above the 48 (uptrend) and PUT entries when the 13 is below the 48 (downtrend), and confirms with a simple candle pattern (green > red with expansion for calls, inverse for puts). Touch sensitivity is ATR-scaled, so signals adapt to volatility. Each trade gets auto-drawn entry, TP, and SL lines, colored labels with $ / % distance from entry, plus optional TP/SL hit alerts. A rotating color palette and per-bar label staggering help keep the chart readable. Old objects are auto-pruned via maxTracked.
How it works
Trend filter: 13-EMA vs 48-EMA.
Entry: ATR-scaled touch of the 13-EMA + candle confirmation.
Risk: TP/SL = ATR multiples you control.
Visuals: Entry/TP/SL lines (extend right), vertical entry marker (optional), multi-line labels.
Hygiene: maxTracked keeps only the last N tradesโ objects; labels are staggered to reduce overlap.
Alerts: Buy Call, Buy Put, Take Profit Reached, Stop Loss Hit.
Key Inputs
Fast EMA (13), Trend EMA (48), ATR Length (14)
Touch Threshold (x ATR) โ how close price must come to the EMA
Take Profit (x ATR), Stop Loss (x ATR)
maxTracked โ number of recent trades to keep on chart
Tips
Start with Touch = 0.10โ0.20 ร ATR; TP=2รATR, SL=1รATR, then tune per symbol/timeframe.
Works on intraday and higher TFs; fewer, cleaner signals on higher TFs.
This is an indicator, not a brokerโalways backtest and manage risk.
Painel Tรฉcnico (4H x 1D) โ Clean UI + Alertas BrenoG๐ Main Functions
1๏ธโฃ Analysis in two fixed timeframes
4 hours and 1 day analyzed in parallel.
Each column in the table displays the data for its respective timeframe.
2๏ธโฃ Entry point based on oversold conditions
The โentry pointโ is not the current price, but rather the last candle that went into oversold territory (RSI โค configured threshold).
If there has been no recent oversold condition, the current price is used as a fallback.
All calculations (Buy Zone, Stops, TPs) are based on this point.
3๏ธโฃ Buy Zone
Defined as:
java
Copiar
Editar
Low Zone = entry * (1 - width%)
High Zone = entry
Always visible in the table, but alerts can be set to trigger only if RSI is oversold at the moment of entry.
4๏ธโฃ Automatic Stops
Moderate Stop and Conservative Stop, calculated as a % below the entry point.
Displayed in the table with black text on a gray background for emphasis.
Alerts trigger when price crosses below these levels.
5๏ธโฃ Take Profits (TP1โTP4)
Calculated from the entry point:
By percentage (usePercentTP = true) or
By fixed prices (usePercentTP = false).
The table displays:
Target price
% gain over the entry point
They only appear when RSI > 50 and EMA50 > EMA200 (the โalignmentโ condition).
Alerts trigger only on breakouts upward.
6๏ธโฃ Context Indicators
RSI โ shows numeric value and green/red color.
MACD โ indicates if the MACD line is above or below the signal line.
EMAs 50/200 โ indicates โGolden Crossโ or โDeath Crossโ.
Price vs EMA200 โ dedicated row showing โAboveโ or โBelow EMA 200โ with green/red color.
7๏ธโฃ Visual Panel
Semiโtransparent dark gray background, thin borders.
Colored header:
Blue for 4H
Orange for 1D
Rows separated by data type for easy reading.
Configurable font size (tiny to large).
Table position configurable (top_left, top_right, etc.).
8๏ธโฃ Integrated Alerts
Entry/Exit of Buy Zone
Touch of each TP
Touch of each Stop
RSI entering Oversold
All alerts are separated by timeframe with clear, fixed messages.
๐ Simple Summary:
Itโs an intelligent panel that combines multiโtimeframe technical analysis, automatic calculation of entries/stops/TPs based on oversold conditions, and readyโtoโuse alerts โ all presented in a visual, compact, and fully configurable format.
Nifty50 Swing Trading Super Indicator# ๐ Nifty50 Swing Trading Super Indicator - Complete Guide
**Created by:** Gaurav
**Date:** August 8, 2025
**Version:** 1.0 - Optimized for Indian Markets
---
## ๐ Table of Contents
1. (#quick-start-guide)
2. (#indicator-overview)
3. (#installation-instructions)
4. (#parameter-settings)
5. (#signal-interpretation)
6. (#trading-strategy)
7. (#risk-management)
8. (#optimization-tips)
9. (#troubleshooting)
---
## ๐ฏ Quick Start Guide
### What You Get
โ
**2 Complete Pine Script Indicators:**
- `swing_trading_super_indicator.pine` - Universal version for all markets
- `nifty_optimized_super_indicator.pine` - Specifically optimized for Nifty50 & Indian stocks
โ
**Key Features:**
- Multi-component signal confirmation system
- Optimized for daily and 3-hour timeframes
- Built-in risk management with dynamic stops and targets
- Real-time signal strength monitoring
- Gap analysis for Indian market characteristics
### Immediate Setup
1. Copy the Pine Script code from `nifty_optimized_super_indicator.pine`
2. Paste into TradingView Pine Editor
3. Add to chart on daily or 3-hour timeframe
4. Look for ๐BUY and ๐ปSELL signals
5. Use the information table for signal confirmation
---
## ๐ Indicator Overview
### Core Components Integration
**๐ฏ Range Filter (35% Weight)**
- Primary trend identification using adaptive volatility filtering
- Optimized sampling period: 21 bars for Indian market volatility
- Enhanced range multiplier: 3.0 to handle market gaps
- Provides trend direction and strength measurement
**โก PMAX (30% Weight)**
- Volatility-adjusted trend confirmation using ATR-based calculations
- Dynamic multiplier adjustment based on market volatility
- 14-period ATR with 2.5 multiplier for swing trading sensitivity
- Offers trailing stop functionality
**๐๏ธ Support/Resistance (20% Weight)**
- Dynamic level identification using pivot point analysis
- Tighter channel width (3%) for precise Indian market levels
- Enhanced strength calculation with historical interaction weighting
- Provides entry/exit timing and breakout signals
**๐ EMA Alignment (15% Weight)**
- Multi-timeframe moving average confirmation
- Key EMAs: 9, 21, 50, 200 (popular in Indian markets)
- Hierarchical alignment scoring for trend strength
- Additional trend validation layer
### Advanced Features
**๐
Gap Analysis**
- Automatic detection of significant price gaps (>2%)
- Gap strength measurement and impact on signals
- Specific optimization for Indian market overnight gaps
- Visual gap markers on chart
**โฐ Multi-Timeframe Integration**
- Higher timeframe bias from daily/weekly data
- Configurable daily bias weight (default 70%)
- 3-hour confirmation for precise entry timing
- Prevents counter-trend trades against major timeframe
**๐ก๏ธ Risk Management**
- Dynamic stop-loss calculation using multiple methods
- Automatic profit target identification
- Position sizing guidance based on signal strength
- Anti-whipsaw logic to prevent false signals
---
## ๐ฅ Installation Instructions
### Step 1: Access TradingView
1. Open TradingView.com
2. Navigate to Pine Editor (bottom panel)
3. Create a new indicator
### Step 2: Copy the Code
**For Nifty50 & Indian Stocks (Recommended):**
```pinescript
// Copy entire content from nifty_optimized_super_indicator.pine
```
**For Universal Use:**
```pinescript
// Copy entire content from swing_trading_super_indicator.pine
```
### Step 3: Configure and Apply
1. Click "Add to Chart"
2. Select daily or 3-hour timeframe
3. Adjust parameters if needed (defaults are optimized)
4. Enable alerts for signal notifications
### Step 4: Verify Installation
- Check that all components are visible
- Confirm information table appears in top-right
- Test with known trending stocks for signal validation
---
## โ๏ธ Parameter Settings
### ๐ฏ Range Filter Settings
```
Sampling Period: 21 (optimized for Indian market volatility)
Range Multiplier: 3.0 (handles overnight gaps effectively)
Source: Close (most reliable for swing trading)
```
### โก PMAX Settings
```
ATR Length: 14 (standard for daily/3H timeframes)
ATR Multiplier: 2.5 (balanced for swing trading sensitivity)
Moving Average Type: EMA (responsive to price changes)
MA Length: 14 (matches ATR period for consistency)
```
### ๐๏ธ Support/Resistance Settings
```
Pivot Period: 8 (shorter for Indian market dynamics)
Channel Width: 3% (tighter for precise levels)
Minimum Strength: 3 (higher quality levels only)
Maximum Levels: 4 (focus on strongest levels)
Lookback Period: 150 (sufficient historical data)
```
### ๐ Super Indicator Settings
```
Signal Sensitivity: 0.65 (balanced for swing trading)
Trend Strength Requirement: 0.75 (high quality signals)
Gap Threshold: 2.0% (significant gap detection)
Daily Bias Weight: 0.7 (strong higher timeframe influence)
```
### ๐จ Display Options
```
Show Range Filter: โ
(trend visualization)
Show PMAX: โ
(trailing stops)
Show S/R Levels: โ
(key price levels)
Show Key EMAs: โ
(trend confirmation)
Show Signals: โ
(buy/sell alerts)
Show Trend Background: โ
(visual trend state)
Show Gap Markers: โ
(gap identification)
```
---
## ๐ Signal Interpretation
### ๐ BUY Signals
**Requirements for BUY Signal:**
- Price above Range Filter with upward trend
- PMAX showing bullish direction (MA > PMAX line)
- Support/resistance breakout or favorable positioning
- EMA alignment supporting upward movement
- Higher timeframe bias confirmation
- Overall signal strength > 75%
**Signal Strength Indicators:**
- **90-100%:** Extremely strong - Maximum position size
- **80-89%:** Very strong - Large position size
- **75-79%:** Strong - Standard position size
- **65-74%:** Moderate - Reduced position size
- **<65%:** Weak - Wait for better opportunity
### ๐ป SELL Signals
**Requirements for SELL Signal:**
- Price below Range Filter with downward trend
- PMAX showing bearish direction (MA < PMAX line)
- Resistance breakdown or unfavorable positioning
- EMA alignment supporting downward movement
- Higher timeframe bias confirmation
- Overall signal strength > 75%
### โ๏ธ NEUTRAL Signals
**Characteristics:**
- Conflicting signals between components
- Low overall signal strength (<65%)
- Range-bound market conditions
- Wait for clearer directional bias
### ๐ Information Table Guide
**Component Status:**
- **BULL/BEAR:** Current signal direction
- **Strength %:** Component contribution strength
- **Status:** Additional context (STRONG/WEAK/ACTIVE/etc.)
**Overall Signal:**
- **๐ STRONG BUY:** All systems aligned bullish
- **๐ป STRONG SELL:** All systems aligned bearish
- **โ๏ธ NEUTRAL:** Mixed or weak signals
---
## ๐ผ Trading Strategy
### Daily Timeframe Strategy
**Setup:**
1. Apply indicator to daily chart of Nifty50 or Indian stocks
2. Wait for ๐BUY or ๐ปSELL signal with >75% strength
3. Confirm higher timeframe bias alignment
4. Check for significant support/resistance levels
**Entry:**
- Enter on signal bar close or next bar open
- Use 3-hour chart for precise entry timing
- Avoid entries during major news events
- Consider gap analysis for overnight positions
**Position Sizing:**
- **>90% Strength:** 3-4% of portfolio
- **80-89% Strength:** 2-3% of portfolio
- **75-79% Strength:** 1-2% of portfolio
- **<75% Strength:** Avoid or minimal size
### 3-Hour Timeframe Strategy
**Setup:**
1. Confirm daily timeframe bias first
2. Apply indicator to 3-hour chart
3. Look for signals aligned with daily trend
4. Use for entry/exit timing optimization
**Entry Refinement:**
- Wait for 3H signal confirmation
- Enter on pullbacks to key levels
- Use tighter stops for better risk/reward
- Monitor intraday support/resistance
### Risk Management Rules
**Stop Loss Placement:**
1. **Primary:** Use indicator's dynamic stop level
2. **Secondary:** Below/above nearest support/resistance
3. **Maximum:** 2-3% of portfolio per trade
4. **Trailing:** Move stops with PMAX line
**Profit Taking:**
1. **Target 1:** First resistance/support level (50% position)
2. **Target 2:** Second resistance/support level (30% position)
3. **Runner:** Trail remaining 20% with PMAX
**Position Management:**
- Review positions at daily close
- Adjust stops based on new signals
- Exit if trend changes to opposite direction
- Reduce size during high volatility periods
---
## ๐ฏ Optimization Tips
### For Nifty50 Trading
- Use daily timeframe for primary signals
- Monitor sector rotation impact
- Consider index futures for better liquidity
- Watch for RBI policy and global cues impact
### For Individual Stocks
- Verify stock follows Nifty correlation
- Check sector-specific news and events
- Ensure adequate liquidity for position size
- Monitor earnings calendar for volatility
### Market Condition Adaptations
**Trending Markets:**
- Increase position sizes for strong signals
- Use wider stops to avoid whipsaws
- Focus on trend continuation signals
- Reduce counter-trend trading
**Range-Bound Markets:**
- Reduce position sizes
- Use tighter stops and quicker profits
- Focus on support/resistance bounces
- Increase signal strength requirements
**High Volatility Periods:**
- Reduce overall exposure
- Use smaller position sizes
- Increase stop-loss distances
- Wait for clearer signals
### Performance Monitoring
- Track win rate and average profit/loss
- Monitor signal quality over time
- Adjust parameters based on market changes
- Keep trading journal for pattern recognition
---
## ๐ง Troubleshooting
### Common Issues
**Q: Signals appear too frequently**
A: Increase "Trend Strength Requirement" to 0.8-0.9
**Q: Missing obvious trends**
A: Decrease "Signal Sensitivity" to 0.5-0.6
**Q: Too many false signals**
A: Enable "3H Confirmation" and increase strength requirements
**Q: Indicator not loading**
A: Check Pine Script version compatibility (requires v5)
### Parameter Adjustments
**For More Sensitive Signals:**
- Decrease Signal Sensitivity to 0.5-0.6
- Decrease Trend Strength Requirement to 0.6-0.7
- Increase Range Filter multiplier to 3.5-4.0
**For More Conservative Signals:**
- Increase Signal Sensitivity to 0.7-0.8
- Increase Trend Strength Requirement to 0.8-0.9
- Enable all confirmation features
### Performance Issues
- Reduce lookback periods if chart loads slowly
- Disable some visual elements for better performance
- Use on liquid stocks/indices for best results
---
## ๐ Support & Updates
This super indicator combines the best of Range Filter, PMAX, and Support/Resistance analysis specifically optimized for Indian market swing trading. The multi-component approach significantly improves signal quality while the built-in risk management features help protect capital.
**Remember:** No indicator is 100% accurate. Always combine with proper risk management, market analysis, and your trading experience for best results.
**Happy Trading! ๐**
Gemini Trend Following SystemStrategy Description: The Gemini Trend Following System
Core Philosophy
This is a long-term trend-following system designed for a position trader or a patient swing trader, not a day trader. The fundamental goal is to capture the majority of a stock's major, multi-month or even multi-year uptrend.
The core principle is: "Buy weakness in a confirmed uptrend, and sell only when the uptrend's structure is fundamentally broken."
It operates on the belief that it's more profitable to ride a durable trend than to chase short-term breakouts or worry about daily price fluctuations. It prioritizes staying in a winning trade over frequent trading.
The Three Pillars of the Strategy
The script's logic is built on three distinct pillars, processed in order:
1. The Regime Filter: "Is This Stock in a Healthy Uptrend?"
Before even considering a trade, the script acts as a strict gatekeeper. It will only "watch" a stock if it meets all the criteria of a healthy, long-term uptrend. This is the most important part of the strategy as it filters out weak or speculative stocks.
A stock passes this filter if:
The 50-day Simple Moving Average (SMA) is above the 200-day SMA. This is the classic definition of a "Golden Cross" state, indicating the medium-term trend is stronger than the long-term trendโa hallmark of a bull market for the stock.
The stock's performance over the last year is positive. The Rate of Change (ROC) must be above a minimum threshold (e.g., 15%). This ensures we are only looking at stocks that have already demonstrated significant strength.
The 200-day SMA itself is rising. This is a crucial check to ensure the very foundation of the trend is solid and not flattening out or beginning to decline.
If a stock doesn't meet these conditions, the script ignores it completely.
2. The Entry Trigger: "When to Buy the Dip"
Once a stock is confirmed to be in a healthy uptrend, the script does not buy immediately. Instead, it patiently waits for a point of lower risk and higher potential rewardโa pullback.
The entry trigger is a specific, two-step sequence:
The stock price first dips and closes below its 50-day SMA. This signifies a period of temporary weakness or profit-taking.
The price then recovers and closes back above the 50-day SMA within a short period (10 bars).
This sequence is a powerful signal. It suggests that institutional buyers view the 50-day SMA as a key support level and have stepped in to defend it, overpowering the sellers. The entry occurs at this point of confirmed support, marking the likely resumption of the uptrend. On the chart, this event is highlighted with a teal background.
3. The Exit Strategy: "When is the Trend Over?"
The exit logic is designed to keep you in the trade as long as possible and only sell when the trend's character has fundamentally changed. It uses a dual-exit system:
Primary Exit (Trend Failure): The main reason to sell is a "Death Cross"โwhen the 50-day SMA crosses below the 200-day SMA. This is a robust, albeit lagging, signal that the long-term uptrend is over and a bearish market structure is taking hold. This exit condition is designed to ignore normal market corrections and only trigger when the underlying trend has truly broken. On the chart, this is highlighted with a maroon background.
Safety-Net Exit (Catastrophic Stop-Loss): To protect against a sudden market crash or a company-specific disaster, a "safety-net" stop-loss is placed at the time of entry. This stop is set far below the entry price, typically underneath the 200-day SMA. It is a "just-in-case" measure that should only be triggered in a severe and rapid decline, protecting your capital from an unexpected black swan event.
Who is This Strategy For?
Position Traders: Investors who are comfortable holding a stock for many months to over a year.
Patient Swing Traders: Traders who want to capture large price swings over weeks and months, not days.
Investors using a Rules-Based Approach: Anyone looking to apply a disciplined, non-emotional system to their long-term portfolio.
Ideal Market Conditions
This strategy excels in markets with clear, durable trends. It performs best on strong, leading stocks during a sustained bull market. It will underperform significantly or generate losses in choppy, sideways, or range-bound markets, where the moving averages will frequently cross back and forth, leading to "whipsaw" trades.
SM Trap Detector โ Liquidity Sweeps & Institutional ReversalsOverview:
This script is designed to help traders detect Smart Money traps, liquidity grabs, and false breakouts with high precision.
Inspired by institutional trading logic (SMC, ICT, Wyckoff), this tool combines:
๐ฆ Liquidity Zone Mapping โ Detects stop hunt targets near highs/lows
๐จ Trap Candle Detection โ Identifies fakeouts using wick + volume logic
โ
Reversal Confirmation โ Entry signals based on real market structure
๐งญ Dashboard Panel โ Always see the last trap type, price, and confirmation
๐ Real-Time Alerts โ Stay notified of traps and entry points
๐ง Logic Breakdown:
Trap Candle = Large wick, small body, volume spike, and sweep of a liquidity zone
Confirmed Entry = Reversal price action following the trap (engulfing-style)
๐ Best Used On:
Markets: Crypto, Forex, Stocks
Timeframes: No limitation but works best on 1H, 4H, Daily
๐ Suggested Use:
Trade only confirmed entries for best results
Place stops beyond wick highs/lows
Target previous structure or use RR-based exits
๐ Backtest Tip:
Use alerts + replay mode to manually validate past traps.
Note: Please backtest before using it for entry.
SMC_CommonLibrary "SMC_Common"
Common types and utilities for Smart Money Concepts indicators
get_future_time(bars_ahead)
โโParameters:
โโโโ bars_ahead (int)
get_time_at_offset(offset)
โโParameters:
โโโโ offset (int)
get_mid_time(time1, time2)
โโParameters:
โโโโ time1 (int)
โโโโ time2 (int)
timeframe_to_string(tf)
โโParameters:
โโโโ tf (string)
is_psychological_level(price)
โโParameters:
โโโโ price (float)
detect_swing_high(src_high, lookback)
โโParameters:
โโโโ src_high (float)
โโโโ lookback (int)
detect_swing_low(src_low, lookback)
โโParameters:
โโโโ src_low (float)
โโโโ lookback (int)
detect_fvg(h, l, min_size)
โโParameters:
โโโโ h (float)
โโโโ l (float)
โโโโ min_size (float)
analyze_volume(vol, volume_ma)
โโParameters:
โโโโ vol (float)
โโโโ volume_ma (float)
create_label(x, y, label_text, bg_color, label_size, use_time)
โโParameters:
โโโโ x (int)
โโโโ y (float)
โโโโ label_text (string)
โโโโ bg_color (color)
โโโโ label_size (string)
โโโโ use_time (bool)
SwingPoint
โโFields:
โโโโ price (series float)
โโโโ bar_index (series int)
โโโโ bar_time (series int)
โโโโ swing_type (series string)
โโโโ strength (series int)
โโโโ is_major (series bool)
โโโโ timeframe (series string)
LiquidityLevel
โโFields:
โโโโ price (series float)
โโโโ bar_index (series int)
โโโโ bar_time (series int)
โโโโ liq_type (series string)
โโโโ touch_count (series int)
โโโโ is_swept (series bool)
โโโโ quality_score (series float)
โโโโ level_type (series string)
OrderBlock
โโFields:
โโโโ start_bar (series int)
โโโโ end_bar (series int)
โโโโ start_time (series int)
โโโโ end_time (series int)
โโโโ top (series float)
โโโโ bottom (series float)
โโโโ ob_type (series string)
โโโโ has_liquidity_sweep (series bool)
โโโโ has_fvg (series bool)
โโโโ is_mitigated (series bool)
โโโโ is_breaker (series bool)
โโโโ timeframe (series string)
โโโโ mitigation_level (series float)
StructureBreak
โโFields:
โโโโ level (series float)
โโโโ break_bar (series int)
โโโโ break_time (series int)
โโโโ break_type (series string)
โโโโ direction (series string)
โโโโ is_confirmed (series bool)
โโโโ source_swing_bar (series int)
โโโโ source_time (series int)
SignalData
โโFields:
โโโโ signal_type (series string)
โโโโ entry_price (series float)
โโโโ stop_loss (series float)
โโโโ take_profit (series float)
โโโโ risk_reward_ratio (series float)
โโโโ confluence_count (series int)
โโโโ confidence_score (series float)
โโโโ strength (series string)
BTC 1m Chop Top/Bottom Reversal (Stable Entries)Strategy Description: BTC 5m Chop Top/Bottom Reversal (Stable Entries)
This strategy is engineered to capture precise reversal points during Bitcoinโs choppy or sideways price action on the 5-minute timeframe. It identifies short-term tops and bottoms using a confluence of volatility bands, momentum indicators, and price structure, optimized for high-probability scalping and intraday reversals.
Core Logic:
Volatility Filter: Uses an EMA with ATR bands to define overextended price zones.
Momentum Divergence: Confirms reversals using RSI and MACD histogram shifts.
Price Action Filter: Requires candle confirmation in the direction of the trade.
Locked Signal Logic: Prevents repaints and disappearing trades by confirming signals only once per bar.
Trade Parameters:
Short Entry: Above upper band + overbought RSI + weakening MACD + bearish candle
Long Entry: Below lower band + oversold RSI + strengthening MACD + bullish candle
Take Profit: ยฑ0.75%
Stop Loss: ยฑ0.4%
This setup is tuned for traders using tight risk control and leverage, where execution precision and minimal drawdown tolerance are critical.
Smart Order Blocks [Pro Version]Hereโs a **clear, detailed "How It Works" explanation** for this indicator:
---
## โ
**Smart Order Blocks \ โ How It Works**
### **Purpose**
This indicator detects **Order Blocks (OBs)** based on **pivot highs and lows**, and automatically marks **Bullish** and **Bearish OB zones** on the chart with optional extensions and alerts. It is designed to help traders identify **institutional price levels** where liquidity is often engineered for future price moves.
---
### **Customization Options**
โ **Source** โ Choose between Wicks or Bodies for OB calculation.
โ **Pivot Settings** โ Adjust sensitivity for detecting pivots.
โ **Extend OBs** โ Keep zones visible until tapped, or fix a specific width.
โ **Show Labels** โ Displays OB type and strength on chart.
โ **Colors** โ Configure Bullish, Bearish, and Invalid OB colors.
---
### **Practical Usage**
* **Entry Strategy**:
* Wait for price to **revisit a Bullish OB** in an uptrend โ Long entry.
* Wait for price to **revisit a Bearish OB** in a downtrend โ Short entry.
* Combine with:
* **Market Structure (HH/HL or LH/LL)**.
* **Confirmation signals** (e.g., candlestick pattern, break of structure).
* **Risk Management** โ Stop loss outside OB zone.
---
### โ
**Summary in One Sentence**
The indicator automatically identifies **institutional OB zones**, shows their strength, extends them until mitigated, and alerts you when price interacts with these key liquidity levels, helping you trade like Smart Money.
---






















