Swing Failure Pattern (SFP) DetectorDescription
The Swing Failure Pattern (SFP) Detector is a powerful tool designed to help traders identify potential liquidity grabs and reversal zones using local and higher timeframe (HTF) swing points.
🧠 What It Does
This indicator detects Swing Failure Patterns—a price action concept where price breaks a previous swing high/low but closes back within range, suggesting a failed breakout and potential reversal. It highlights both local SFPs and HTF SFPs for added confluence.
⚙️ Core Logic
Swing Detection: Uses pivot highs/lows over a configurable length or an optional dynamic length based on ATR volatility.
SFP Criteria:
Bearish SFP: High exceeds last swing high, but candle closes below that swing level.
Bullish SFP: Low undercuts last swing low, but candle closes above that swing level.
HTF Support: Detects higher timeframe pivots using request.security() and overlays HTF SFPs on the current chart.
Visual Aids: SFP labels and optional background highlights are drawn when a valid pattern is detected. Dashed horizontal lines track the last swing points used in the logic.
Alerts: Four alert conditions are provided to notify users of local and HTF SFPs.
📌 How To Use It
Apply this indicator to any chart and timeframe.
Use dynamic length mode for adaptive responsiveness in volatile or low-volume environments.
Watch for SFPs at known liquidity zones (e.g., support/resistance, OB/FVG zones).
Use HTF SFPs as confirmation for higher conviction entries or exits.
🔒 Closed Source Justification
While the SFP concept is known, this script introduces a dual-frame detection engine that synchronizes pivot points across timeframes, applies volatility-adjusted swing detection, and includes a memory-efficient rendering logic to maintain responsiveness—even on dense charts. These enhancements provide practical trading edge and execution confidence that go beyond standard open-source implementations.
📈 Best Use Cases
Liquidity sweep confirmations
Smart Money Concept (SMC) trading
HTF/MTF alignment strategies
Reversal entries and scalp setups
🛠️ Inputs
Swing Length for Current TF: Set the fixed lookback period for local swings.
Use Dynamic Swing Length (ATR-Based): Enable auto-adjusting lookback using volatility.
Higher Timeframe for SFP Overlay: Select your HTF (e.g., D for daily).
Swing Length for HTF: Set HTF pivot detection sensitivity.
Highlight Background on SFP: Toggle background color highlighting on detection.
Disclaimer
This tool is intended for educational and informational purposes only. Trading involves risk, and past performance does not guarantee future results. Always do your own research and consult a financial advisor if necessary.
Chart patterns
IKODO Harmonic PatternsIKODO Harmonic Patterns How its Works
IKODO Harmonic Patterns automatically scans your chart to detect Gartley , Bat , Butterfly , and Crab harmonic patterns in real-time, using strict Fibonacci ratio checks with configurable tolerance and pivot lengths.
Pivot Detection
Uses pivot highs/lows with a configurable length to mark potential turning points on the chart.
Stores and updates the last 50 pivots for performance.
Pattern Identification
Continuously checks for XABCD structures:
Confirms alternating pivot highs/lows.
Calculates XA, AB, BC, CD, AD legs.
Validates Fibonacci ratios within your defined tolerance:
Gartley: AB = 0.618 XA, AD = 0.786 XA
Bat: AB = 0.382/0.5 XA, AD = 0.886 XA
Butterfly: AB = 0.786 XA, AD = 1.272/1.618 XA
Crab: AB = 0.382/0.618 XA, AD = 1.618 XA
Visualization
Draws XABCD lines and labels on your chart.
Displays entry, three target levels (T1, T2, T3), and a stop-loss suggestion for risk management.
Uses color coding:
Green for bullish patterns.
Red for bearish patterns.
Orange for potential (forming) patterns.
Alerts & Table Stats
Generates alerts when a valid pattern completes.
Displays a live table showing:
Count of each pattern type found.
Total patterns detected.
Number of pivots tracked.
Potential Pattern Projection
If a potential pattern is forming (XAB complete, D pending), the indicator:
Projects the potential D point based on Fibonacci extensions.
Marks the path with dotted/dashed lines.
Displays a label with expected D price and pattern type.
Why Use This?
Automates advanced harmonic detection without manual drawing.
Helps in identifying precise reversal points for high-R/R trades.
Supports visual learning of harmonics while trading.
Previous Day O H L C Calculation By Md//@version=6
indicator("Previous Day O H L C Calculation By Md", overlay=true)
// Check if the previous daily candle is green (bullish) or red (bearish)
previousCandleBullish = close > open
previousCandleBearish = close < open
// Calculate the difference for bullish candles: previous day's high minus previous day's open
bullishCalculation = high - open
// Calculate the difference for bearish candles: previous day's low minus previous day's close
bearishCalculation = low - close
// Show the result at the top of the current daily candle if the previous candle was bullish
if previousCandleBullish
label.new(bar_index, high, "Bullish Calc: " + str.tostring(bullishCalculation), color=color.green, textcolor=color.white, style=label.style_label_left, size=size.small)
// Show the result at the bottom of the current daily candle if the previous candle was bearish
if previousCandleBearish
label.new(bar_index, low, "Bearish Calc: " + str.tostring(bearishCalculation), color=color.red, textcolor=color.white, style=label.style_label_left, size=size.small)
HTF Previous Candle Sweeps (1H–4D) - Safesa f as. as f. f sf s. sa fs. fsadsjaf dsadf jsdaf sdjf sajk fj sdfj saf d sj sadsd
HTF Previous Candle Sweeps (1H–4D)This is a TVS entry module, marking out the DOL and Previous candle sweeps.
Fred - FVG BOS ToolsCombining the BOS and FVG tool. I combined these 2 tools due to the lack of indicators on the free version of TradingView
HTF Previous Candle Sweeps (1H–4D)This is the TVS indicator, marking out DOL and previous candle sweeps.
Rapid Candle PATTERNS V2.0Indicator Title: Rapid Candle Patterns - High-Probability Signals
Description
Tired of noisy charts filled with weak and ambiguous candlestick patterns? The Rapid Candle Patterns indicator is engineered to solve this problem by moving beyond simple textbook definitions. It identifies only high-probability reversal and continuation signals by focusing on the underlying market dynamics: momentum, liquidity, and confirmation.
This is not just another pattern indicator; it's a professional-grade tool designed to help you spot truly significant price action events.
How The Logic Works & Why It's More Accurate
Each pattern in this script has been enhanced with stricter, more intelligent rules to filter out noise and reduce false signals. Here’s what makes our logic superior:
1. The Liquidity Grab Hammer & Inverted Hammer
Standard Logic: A simple hammer shows a long lower wick, suggesting buyers pushed the price back up.
Our Enhanced Logic: We don't just look for a hammer shape. Our signal is only valid if the hammer’s low takes out the low of the previous candle (a "liquidity grab" or "stop hunt").
Why It's More Accurate: This sequence is incredibly powerful. It shows that sellers attempted to push the market lower, triggered stop-loss orders below the prior low, and then were decisively overpowered by buyers who reversed the price. This isn't just a reversal; it's a failed breakdown, often trapping sellers and fueling a stronger move in the opposite direction.
2. The "True" Bullish & Bearish Harami
Standard Logic: A small candle forms within the high-low range of the previous candle. This can often be misleading if the prior candle has long wicks and a tiny body.
Our Enhanced Logic: We enforce a "dual containment" rule. For a Harami to be valid, its body must be contained within the body of the previous candle. We also ensure the Harami candle itself is not a Doji, meaning it must show some conviction.
Why It's More Accurate: This ensures you are seeing a genuine and significant contraction in momentum. It filters out scenarios where a large-bodied candle forms inside the wicks of a doji-like candle, which is not a true Harami. Our logic captures the "pregnant" pattern as it was intended—a moment of quiet consolidation before a potential new move.
3. The "Power" Bullish & Bearish Engulfing
Standard Logic: A candle's body engulfs the body of the previous candle. This is a common signal, but it often lacks follow-through.
Our Enhanced Logic: Our "Power Engulfing" requires two conditions: (1) The body must engulf the prior candle's body, AND (2) the candle must close beyond the entire high/low range of the prior candle.
Why It's More Accurate: This is the ultimate sign of confirmation. It doesn't just show that one side has won the battle for the session; it proves they had enough force to break the entire structure of the previous candle. This signifies immense momentum and dramatically increases the probability that the trend will continue in the direction of the engulfing candle.
4. The Quantified Doji
Our Logic: Instead of being a subjective pattern, a Doji is defined quantitatively. It's a candle whose body is less than or equal to a user-defined percentage (default 9%) of its total range.
Why It's More Accurate: It provides a consistent and objective measure of market indecision. Furthermore, any candle identified as a Doji is automatically disqualified from being a Hammer, ensuring clear and distinct signals.
User Customization
Toggle Patterns On/Off: Declutter your chart by only showing the patterns you want to see.
Fine-Tune Logic: Use the "Pattern Logic" settings to adjust the sensitivity of the Doji and Harami detectors to perfectly match your trading style, asset, and timeframe.
Disclaimer: This indicator is a powerful tool for identifying high-probability price action. However, no single indicator is a complete trading system. Always use these signals as part of a comprehensive strategy, combined with analysis of market structure, support/resistance levels, and other forms of confluence.
Morning & Evening Star (with Alerts)This indicator will print a marker whenever a morning or evening star pattern is created.
The condition is that the 3rd candle needs to have higher volume than the 2nd candle or the 2nd candle has to have 1.5x the volume of the first candle.
You can also create alerts with it.
Context is this pattern needs to be visible at key points as support & resistance, Supply and demand, Trendlines..etc
Previous Day/Week/Month - High/Lows + Open/Close (RC)Its an indicator marking previous day and previous week and last month's high, low open, close.
RSI Swing with EMA and BB Short/Long SignalsThis script gives you the following feature;
1. Top & Lower Top , when it exceed specified RSI threshold (default is 70)
2. Bottom & Higher Bottom, when it exceed specified RSI threshold (default is 30)
3. LONG sign , which is bouncing UP at EMAs (7, 20, 50)
4. SHORT sign, which is bouncing DOWN at EMAs (7, 20, 50)
You can adjust the RSI parameters(threshold and evaluation period) by yourself.
If the "bounce UP/DOWN" signs show up frequently, it can be a sign for the upcoming breakout direction.
If the "bounce UP/DOWN" signs show up with "Higher Bottom or Lower Top", it can be a sign for the trend reversal, especially after the bounce for deep BB break.
If you want to purchase the source code, please contanct me via direct chat in Tradingview.
RSI Swing with EMA and BB Short/Long SignalsThis script gives you the following feature;
1. Top & Lower Top , when it exceed specified RSI threshold (default is 70)
2. Bottom & Higher Bottom, when it exceed specified RSI threshold (default is 30)
3. LONG sign , which is bouncing UP at EMAs (7, 20, 50)
4. SHORT sign, which is bouncing DOWN at EMAs (7, 20, 50)
You can adjust the RSI parameters(threshold and evaluation period) by yourself.
If the "bounce UP/DOWN" signs show up frequently, it can be a sign for the upcoming breakout direction.
If the "bounce UP/DOWN" signs show up with "Higher Bottom or Lower Top", it can be a sign for the trend reversal, especially after the bounce for deep BB break.
If you want the source code, please contanct me.
RSI Divergence (Nikko)RSI Divergence by Nikko
🧠 RSI Divergence Detector — Nikko Edition This script is an enhanced RSI Divergence detector built with Pine Script v6, modified for better visuals and practical usability. It uses linear regression to detect bullish and bearish divergences between the RSI and price action — one of the most reliable early signals in technical analysis.
✅ Improvements from the Original:
- Clean divergence lines using regression fitting.
- Optional label display to reduce clutter (Display Labels toggle).
- Adjustable line thickness (Display Line Width).
- A subtle heatmap background to highlight RSI overbought/oversold zones.
- Uses max accuracy with high calc_bars_count and custom extrapolation window.
🔍 How It Works: The script applies linear regression (least squares method) on both RSI data, and Price (close) data.
It then compares the direction of RSI vs. direction of Price over a set length. If price is making higher highs while RSI makes lower highs, it's a bearish divergence. If price is making lower lows while RSI makes higher lows, it's a bullish divergence. Additional filters (e.g., momentum and slope thresholds) are used to validate only strong divergences.
🔧 Input Parameters: RSI Length: The RSI period (default: 14). RSI Divergence Length: The lookback period for regression (default: 25). Source: Which price data to calculate RSI from (default: close). Display Labels: Show/hide “Bullish” or “Bearish” labels on the chart. Display Line Width: Adjusts how thick the plotted divergence lines appear.
📣 Alerts: Alerts are built-in for both RSI Buy (bullish divergence) and RSI Sell (bearish divergence) so you can use it in automation or notifications.
🚀 Personal Note: I’ve been using this script daily in my own trading, which is why I took time to improve both the logic and visual clarity. If you want a divergence tool that doesn't clutter your chart but gives strong signals, this might be what you're looking for.
cd_secret_candlestick_patterns_CxHi traders,
With this indicator, we aim to uncover secret candlestick formations that even advanced traders may miss—especially those that can't be detected by classic pattern indicators, unless you're a true master of candlestick patterns or candle math.
________________________________________
General Idea:
We'll try to identify candlestick patterns by regrouping candles into custom-sized segments that you define.
You might ask: “Why do I need this? I can just look at different timeframes and spot the structure anyway.” But it’s not the same.
For example, if you're using a 1-minute chart and add a higher-timeframe candle overlay (like 5-minute), the candles you see start at fixed timestamps like 0, 5, 10, etc.
However, in this indicator, we redraw new candles by grouping them from the current candle backward in batches of five.
These candles won't match the standard view—only when aligned with exact time multiples (e.g., 0 and 5 minutes) will they look the same.
In classic charts:
• You see 5-minute candles that begin every 0 and 5 minutes.
In this tool:
• You see a continuously updating set of 5 merged 1-minute candles redrawn every minute.
What about the structures forming in between those fixed timeframes?
That’s exactly what we’ll be able to detect—while also making the lower timeframe chart more readable.
________________________________________
Candle Merging:
Let’s continue with an example.
Assume we choose to merge 5 candles. Then the new candle will be formed using:
open = open
close = close
high = math.max(high , high , high , high , high)
low = math.min(low , low , low , low , low)
This logic continues backward on the chart, creating merged candles in groups of 5.
Since the selected patterns are made up of 3, 4, or 5 candles, we redraw 5 such merged candles to analyze.
________________________________________
Which Patterns Are Included?
A total of 18 bullish and bearish patterns are included.
You’ll find both widely known formations and a few personal ones I use, marked as (MeReT).
You can find the pattern list and visual reference here:
________________________________________
Entry and Filtering Suggestions:
Let me say this clearly:
Entering a trade every time a pattern forms will not make you profitable in the long run.
You need a clear trade plan and should only act when you can answer questions like:
• Where did the pattern appear?
• When and under what conditions?
It’s more effective to trade in the direction of the trend and look for setups around support/resistance, supply/demand zones, key levels, or areas confirmed by other indicators.
Whether you enter immediately after the pattern or wait for a retest is a personal choice—but risk management is non-negotiable.
One of the optional filters I’ve included is a Higher Timeframe (HTF) condition, which is my personal preference:
When enabled, the highest or lowest price among the pattern candles must match the high or low of the current HTF candle.
You can see in the image below the decrease in the number of detected patterns on the 1-minute chart when using no filter (blue labels) compared to when the 1-hour timeframe filter is applied (red labels).
Additionally, I’ve added a “protected” condition for engulfing patterns to help filter out weak classic engulf patterns.
________________________________________
Settings:
From the menu, you can configure:
• Number of candles for regrouping
• Distance between the last candle and newly drawn candles
• Show/hide options
• HTF filter toggle and timeframe selection
• Color, label placement, and text customization
• Pattern list (select which to display or trigger alerts for)
My preferred setup:
While trading on the 1-minute chart, I typically set the higher timeframe to 15m or 1H, and switch the candle count between 2 and 3 depending on the situation.
⚠️ Important note:
The “Show” and “Alert” options are controlled by a single command.
Alerts are automatically created for any pattern you choose to display.
________________________________________
What’s Next?
In future updates, I plan to add:
• Pattern success rate statistics
• Multi-broker confirmation for pattern validation
Lastly, keep in mind:
The more candles a pattern is based on, the more reliable it may be.
I'd love to hear your feedback and suggestions.
Cheerful trading! 🕊️📈
Morning Structure – Live 30 Min Range📝 Description:
This indicator captures the morning price structure by tracking the high and low during the first 30 minutes after market open (default: 9:30 AM to 10:00 AM, New York time).
🔧 How it works:
At market open, it begins tracking the highest high and lowest low
The high and low lines are dynamic and update in real-time during the first 30 minutes
Once the 30-minute range completes, the lines freeze at their final values
Lines extend horizontally across the rest of the session to mark the "Morning Range"
✅ Key Features:
Tracks live price action during the morning session
Freezes the structure after 30 minutes (or user-defined)
Automatically resets each new trading day
Built-in timezone setting (America/New_York) to align with standard U.S. market hours
Clean visual lines that scroll naturally with the chart
⚙️ Use Cases:
Identify morning breakout zones
Define support and resistance early in the session
Combine with breakout, fade, or range-trading strategies
⚠️ Note:
This version does not include alerts or labels, by design (clean and focused).
Those can be added easily for custom strategies.
Trap Candle (Trend H4 + RSI Filter)🔍 Trap Candle (Trend H4 + RSI Filter)
Description:
The Trap Candle indicator is designed to identify a specific and powerful two-candle price action pattern that often signals a false breakout followed by a strong reversal. It combines pure price action with two objective filters to increase signal quality and trend alignment.
📊 Pattern Logic:
Bullish Trap: The current candle breaks the previous candle’s low, but closes above its high (and is bullish).
Bearish Trap: The current candle breaks the previous candle’s high, but closes below its low (and is bearish).
This pattern often reveals institutional traps or stop hunts before directional movement.
🧠 Trend Filter (H4):
Ensures long signals occur only when the H4 close is higher than the previous H4 close (uptrend).
Ensures short signals occur only in a H4 downtrend.
Designed to align intraday entries (M15, H1) with higher timeframe momentum.
💪 RSI Confirmation:
Includes a configurable RSI filter on the current timeframe.
Only long signals are shown when RSI is above a user-defined threshold (e.g. 55).
Only short signals are shown when RSI is below a user-defined threshold (e.g. 45).
⚙️ Key Features:
Full customization of RSI period and thresholds.
Clean, visual signal plotting on the chart (with “Trap L” or “Trap S” labels).
Built-in alerts for both long and short trap candle setups.
Perfect for traders who want to trade smart reversals with trend and momentum confirmation.
✅ Recommended Timeframes:
M15 and H1 (entry)
Uses H4 for trend bias
If you’re looking to filter out noise and spot only the highest quality reversal setups, the Trap Candle (Trend H4 + RSI Filter) is a solid tool for any price action-based strategy.
First Candle🕯️ First Candle Indicator (First 5-Minute Candle High/Low)
The First Candle indicator automatically marks the high and low of the first 5-minute candle of the U.S. trading session . These levels can act as key intraday support and resistance zones, often used in breakout, scalping, or opening-range trading strategies.
📌 Key Features:
Automatic detection of the first candle of the U.S. session based on the selected timeframe (default is 5 minutes).
Horizontal lines are plotted at the high and low of that candle, with fully customizable colors and thickness.
Labels show the exact level and timeframe used for the high and low.
Resets daily, removing previous session data at the start of a new session.
Displays a visual marker (blue triangle) when the first candle is detected.
Allows users to select different timeframes for defining the "first candle" (e.g., 1, 5, 15 minutes).
⚙️ Customizable Inputs:
Show First Candle Lines: toggle the display of high/low lines.
Timeframe for Marking: choose the timeframe to detect the first candle (e.g., 5 minutes).
High Line Color / Low Line Color: set the color of each level line.
Line Thickness: adjust the width of the lines (1 to 5 pixels).
🧠 Strategic Applications:
Identify breakout zones right after the market opens.
Define opening range for pullback or continuation setups.
Set clear reference levels for intraday trading decisions.
Predictive Time & AlertsPredictive Time Engine (ICT Macros)
Summary
The Predictive Time Engine is a visual tool designed specifically for traders who utilize Time & Price based methodologies, particularly those inspired by ICT (Inner Circle Trader) concepts.
The primary purpose of this indicator is to visualize the critical "time windows" where market liquidity is most likely to be significantly manipulated or distributed. Instead of only appearing in real-time, this indicator is predictive: at the beginning of each day, it will automatically calculate and draw all selected macro sessions for the day ahead, serving as your daily time roadmap.
With this tool, you will no longer miss these crucial moments and can be better prepared to anticipate price action.
Key Features
Predictive Visualization: Automatically projects and draws all macro time windows for the current trading day, giving you a forward-looking view of where the action is likely to occur.
ICT Macro Time Filter: Based on the "Hourly-Macros" concept, which are specific 20-minute periods within each hour (e.g., 09:50 - 10:10) where the price delivery algorithm (IPDA) is often active. You can select and enable each macro window you wish to monitor.
Full Customization: You have complete control over how the information is displayed. Choose between:
Outline: A clean, transparent box frame.
Background: A solid, colored background for the time zone.
Vertical Lines (Dotted, Dashed, Solid): Marks the beginning of each macro session with a vertical line in your chosen style.
Real-time Alerts: Set up notifications in TradingView to get an alert precisely when the price enters one of your selected Macro Time windows.
Automatic Management: Drawings from previous days are automatically cleared to keep your chart clean and focused on the current day's schedule.
The Concept Behind the Indicator
This indicator is inspired by the concept that the market moves in fractal Time Cycles, from yearly down to 90-minute periods. Each of these time cycles often follows a pattern of AMD (Accumulation, Manipulation, Distribution).
Accumulation: A phase of order gathering.
Manipulation: Price is often driven in the opposite direction of its true intent to sweep liquidity (stop losses).
Distribution: The true price move towards a liquidity target (Draw On Liquidity).
The Macro Time windows marked by this indicator are often the stage where the Manipulation phase or the beginning of the Distribution phase occurs. By knowing when these times are approaching, traders can be on high alert and look for confirming trade setups in the most potent areas and times.
How to Use
Configure Sessions: Open the indicator's Settings.
In the "1. General Settings" tab, ensure the Timezone matches your chart's local time (Default: "America/New_York").
In the "2. Active Macro Sessions" tab, check the box for each macro time window you want to monitor.
Choose Display Style: In "General Settings", select your preferred "Display Style" (Outline, Background, or various Line types). You can also change the color.
Set Up Alerts (Optional):
Click the "Alert" clock icon in the TradingView toolbar.
In the "Condition" section, select this indicator: Predictive Time Engine.
From the dropdown below it, ensure "Sesi Makro Dimulai" (Macro Session Start) is selected.
Set your desired notification options and click "Create".
Chart Interpretation: Use the marked time zones as high-alert areas. Pay close attention to how price reacts when entering or leaving these zones to find potential entry opportunities that align with your trading strategy.
Disclaimer: This tool is provided for educational and analytical purposes only. It is not financial advice. All trading decisions are solely your responsibility. Conduct your own research and manage your risk appropriately.
Altcoins vs Stablecoins (with signals)This indicator visualizes the ratio of altcoin market dominance (excluding the top 10) to the combined dominance of the two largest stablecoins (USDT + USDC).
📊 Formula:
OTHERS.D / (USDT.D + USDC.D)
🔍 Purpose:
Rising values indicate increasing capital flow into altcoins — a potential altseason signal
Falling values suggest capital rotation into stablecoins — risk-off behavior
🟢 Bullish Signal:
When the ratio crosses above 1.3, a green arrow appears — signaling possible altcoin momentum
🔴 Bearish Signal:
When the ratio crosses below 0.9, a red arrow appears — signaling capital flight into stablecoins
✅ Useful for:
Timing market phases
Spotting early altseason entries
Portfolio rotation and risk monitoring
200 SMA + VWAP + Manual ADX Entry Signal200 SMA + VWAP + Manual ADX Entry Signal – Indicator Description
This custom indicator is designed for trend-following intraday traders who want a powerful, rules-based entry confirmation system. It combines three proven tools—the 200-period Simple Moving Average (SMA), Volume-Weighted Average Price (VWAP), and a manually coded ADX (Average Directional Index)—to identify high-probability long entries in strong, directional markets.
By filtering trades through a combination of trend direction, mean-reversion reference, and momentum strength, this indicator helps traders avoid false breakouts, whipsaws, and low-quality setups. It’s particularly well-suited for traders using 15-minute charts, leveraged ETFs, or high-beta stocks, where precision entries and trend confirmation are critical to consistent profitability.
⸻
✅ What This Indicator Does
This indicator visually displays:
• The 200-period SMA (orange line) – a long-term trend filter.
• The VWAP (blue line) – a dynamic intraday price average used by institutions.
• A buy signal triangle below the price bar – when all bullish criteria are met.
• It also includes an alert condition so traders can be notified when a new buy signal appears in real time.
Behind the scenes, the indicator calculates trend and strength conditions and plots a BUY signal only when all three tools agree that a bullish move is in play.
⸻
🔍 The Three-Pillar Entry System
1. 200 SMA Filter – Defining Market Bias
The 200 SMA is a widely used institutional benchmark that represents long-term trend direction. In this indicator:
• A trade is only considered valid if price is above the 200 SMA.
• This helps eliminate trades in downtrending or range-bound markets.
• It ensures that entries are aligned with broader directional bias.
By filtering out trades below the 200 SMA, you instantly remove a majority of low-probability setups and whipsaw environments.
⸻
2. VWAP – Institutional Mean Price Anchor
VWAP (Volume-Weighted Average Price) is often used by hedge funds and algorithmic systems to judge whether price is considered “expensive” or “cheap” within a given trading session.
• This version of VWAP is anchored to the current intraday session.
• Trades are only considered valid if price is above the VWAP, which shows market consensus is favoring the upside.
• VWAP provides both confirmation and support levels, helping ensure your entry isn’t into overextended territory.
By combining the 200 SMA and VWAP filters, the indicator ensures that trades are only taken when price is strong on both the macro and micro timeframes.
⸻
3. ADX – Confirming Momentum Strength
ADX (Average Directional Index) is used to measure trend strength without regard to direction. However, TradingView has limited functionality with the ta.adx() call in some environments, so this script includes a custom-coded version of ADX that follows standard Wilder’s smoothing and directional movement logic.
• A BUY signal only triggers if ADX is above a user-defined threshold (default is 20) and rising from the previous bar.
• This means not only is the market trending — but the trend is strengthening.
This final filter prevents entries in chop or decaying rallies, and ensures you’re catching the strongest part of a move, not the tail end.
⸻
⚙️ Logic Summary
A BUY signal is plotted when:
• Price > 200 SMA ✅
• Price > VWAP ✅
• ADX > 20 and rising ✅
Only when all three conditions are true does the indicator plot a green triangle below the price bar.
This visual simplicity makes it ideal for fast trade decisions, and the alert function allows hands-free monitoring during busy sessions.
⸻
🧠 Recommended Use
This indicator works best on:
• 15-minute to 1-hour charts
• Intraday leveraged ETFs (e.g., TQQQ, SPYU, SQQQ)
• Trend-following strategies
• Breakout continuation trades
⸻
📉 Limitations
• This is a long-only system by design. If you want to trade short, you’ll need to invert the logic (e.g., price < 200 SMA, price < VWAP, ADX > threshold).
• It doesn’t generate exit signals. You should pair this with your own take-profit or trailing stop strategy.
• While it works great for momentum entries, it may underperform in range-bound or news-driven chop markets.
⸻
🛠️ Settings Customization
• SMA Length: default is 200; adjust for faster or slower trend confirmation.
• ADX Length: default is 14; shorter periods = more sensitive, longer = smoother.
• ADX Threshold: default is 20; raise to 25 or 30 to only catch very strong moves.
These settings give you flexibility to match the indicator to your trading style.
⸻
🚀 Final Thoughts
The 200 SMA + VWAP + Manual ADX Entry Signal is a battle-tested, rule-based tool to help you:
• Enter only when the trend, mean, and momentum align
• Avoid fakeouts and poor risk-reward entries
• Automate part of your setup process without overcomplication
This is the kind of filter used by professional traders to reduce screen time and improve trade quality. If you’re looking to build confidence in your intraday trading with clear, logical entries — this indicator will help you stay consistent and systematic.
Happy trading!
LANZ Strategy 1.0 [Backtest]🔷 LANZ Strategy 1.0 — Time-Based Session Trading with Smart Reversal Logic and Risk-Controlled Limit Orders
This backtest version of LANZ Strategy 1.0 brings precision to session-based trading by using directional confirmation, pre-defined risk parameters, and limit orders that execute overnight. Designed for the 1-hour timeframe, it allows traders to evaluate the system with configurable SL, TP, and risk settings in a fully automated environment.
🧠 Core Strategy Logic:
1. Directional Confirmation at 18:00 NY:
At 18:00 NY, the system compares the 08:00 open vs the 18:00 close:
If the direction matches the previous day, the signal is reversed.
If the direction differs, the current day's trend is kept.
This logic is designed to avoid momentum exhaustion and capture corrective reversals.
2. Entry Level Definition:
Based on the confirmed direction:
For BUY, the Low of the day is used as Entry Point (EP).
For SELL, the High of the day becomes EP.
The system plots a Stop Loss and Take Profit based on user-defined pip inputs (default: SL = 18 pips, TP = 54 pips → RR 1:3).
3. Time-Limited Entry Execution (LIMIT Orders):
Orders are sent after 18:00 NY and can be triggered anytime between 18:00 and 08:00 NY.
If EP is not touched before 08:00, the order is automatically cancelled.
4. Manual Close Feature:
If the trade is still open at the configured hour (default 09:00 NY), the system closes all positions, simulating realistic intraday exit scenarios.
5. Lot Size Calculation Based on Risk:
Lot size is dynamically calculated using the account size, risk percentage, and SL distance.
This ensures consistent risk exposure regardless of market volatility.
⚙️ Step-by-Step Flow:
08:00 NY → Captures the open of the day.
18:00 NY → Confirms direction and defines EP, SL, and TP.
After 18:00 NY → If conditions are met, a LIMIT order is placed at EP.
Between 18:00–08:00 NY → If price touches EP, the trade is executed.
At 08:00 NY → If EP wasn’t touched, the order is cancelled.
At Configured Manual Close Time (default 09:00 NY) → All open positions are force-closed if still active.
🧪 Backtest Settings:
Timeframe: 1-hour only
Order Type: strategy.entry() with limit=
SL/TP Configurable: Yes, in pips
Risk Input: % of capital per trade
Manual Close Time: Fully adjustable (default 09:00 NY)
👨💻 Credits:
Developed by LANZ
Strategy logic and trading concept built with clarity and precision.
Code structure and documentation by Kairos, your AI trading assistant.
Designed for high-confidence execution and clean backtesting performance.
Price-EMA Z-Score Backgroundhe “Price‑to‑EMA Z‑Score Background” indicator is designed to give you a clear, visual sense of when price has moved unusually far away from its smoothed trend, and to highlight those moments as potential overextension or mean‑reversion opportunities. Under the hood, it first computes a standard exponential moving average (EMA) of your chosen lookback length, then measures the raw difference between the current close and that EMA on every bar. To make that raw deviation comparable across different markets and timeframes, it converts the series of differences into a z‑score—subtracting the rolling mean of the deviations and dividing by their rolling standard deviation over a second lookback window.
Once you’ve normalized price‑to‑EMA distance into z‑score units, you can set two simple trigger levels: one upper threshold and one lower threshold. Whenever the z‑score climbs above the upper threshold, the chart background glows green, signaling that price is extended far above its EMA (and might be ripe for a pullback). Whenever the z‑score falls below the lower threshold, the background turns red, calling out an equally extreme move below the EMA (and a possible oversold bounce). Between those bands, no shading appears, letting you know price is trading within its “normal” range around the trend.
By adjusting the EMA period, the z‑score lookback, and the two trigger levels, you can dial in early warning signals (e.g. ±1 σ) or wait for very stretched moves (±2 σ or more). Used in concert with your favorite momentum or pattern tools—or even as a standalone visual cue—this simple background‑shading approach makes it easy to spot when a market is running too hot or too cold relative to its own recent average.
Yield Curve Regime Shading with LegendTakes two symbols (e.g. two futures contracts, two FX pairs, etc.) as inputs.
Calculates the “regime” as the sign of the change in their difference over an n‑period lookback.
Lets you choose whether you want to color the bars themselves or shade the background.
How it works
Inputs
symbolA, symbolB: the two tickers you’re comparing.
n: lookback in bars to measure the change in the spread.
mode: pick between “Shading” or “Candle Color”.
Data fetching
We use request.security() to pull each series at the chart’s timeframe.
Regime calculation
spread = priceA – priceB
spreadPrev = ta.valuewhen(not na(spread), spread , 0) (i.e. the spread n bars ago)
If spread > spreadPrev → bullish regime
If spread < spreadPrev → bearish regime
Plotting
Shading: apply bgcolor() in green/red.
Candle Color: use barcolor() to override the bar color.