[CT] Donchian Histogram w/Candle ColorsDonchian Histogram, originally created by RafaelZioni and enhanced with optional price bar coloring, is a momentum-style oscillator that shows where the current close sits inside a dynamic Donchian channel and how that position is evolving over time. The script calculates a rolling high and low over a multi-session lookback period based on your chosen Donchian timeframe, then normalizes the close within that range to create a percentage position between the recent high and low. This normalized value is smoothed with a signal length and plotted as a histogram around a zero line, making it easy to see whether price is pressing toward the upper side of its recent range, the lower side, or oscillating near the middle. Positive values indicate that price is trading closer to the Donchian high, negative values indicate price is closer to the Donchian low, and the magnitude of the histogram reflects how strongly price is favoring one side of the range. The color logic highlights this state visually: stronger positive conditions can be shown in teal, moderate positive conditions in lime, stronger negative conditions in red, and neutral or transitional states in orange. The script also includes an option to color the actual chart candles with the same colors as the histogram, so traders can see Donchian-based pressure directly on the main price chart without constantly looking down at the lower pane. The indicator works on completed bars using standard highest/lowest and moving average functions, so it behaves like a normal oscillator and does not use any lookahead tricks. It is best used as a contextual tool to gauge whether price is pushing to the edges of its recent range or reverting toward balance, and to visually synchronize that information with candle colors when desired.
Sentiment
[CT] ATR Ratio MTFThis indicator is an enhanced, multi-timeframe version of the original “ATR ratio” by RafaelZioni. Huge thanks to RafaelZioni for the core concept and base logic. The script still combines an ATR-based ratio (Z-score style reading of where price sits within its recent ATR envelope) with an ATR Supertrend, but expands it into a more flexible trade-decision and visual context tool.
The ATR ratio is normalized so you can quickly see when price is pressing into extended bullish or bearish territory, while the Supertrend defines directional bias and a dynamic support-resistance trail. You can choose any higher timeframe in the settings, allowing you to run the ATR ratio and Supertrend from a larger anchor timeframe while trading on a lower chart.
Upgrades include a full Pine Script v6 rewrite, multi-timeframe support for both the ATR ratio and Supertrend, user-controlled colors for the Supertrend in bull and bear modes, and optional bar coloring so price bars automatically reflect Supertrend direction. Entry, pyramiding and take-profit logic from the original script are preserved, giving you a familiar framework with more control over timeframe, visuals and trend bias.
This indicator is designed to give you a clean directional framework that blends volatility, trend, and timing into one view. The ATR ratio side of the script shows you where price sits inside a recent ATR-based envelope. When the ATR ratio pushes up and sustains above the bullish threshold, it signals that price is trading in an extended, momentum-driven zone relative to recent volatility. When it drops and holds below the bearish threshold, it shows the opposite: sellers have pushed price down into an extended bearish zone. The optional background coloring simply makes these bullish and bearish environments easier to see at a glance.
On top of that, the Supertrend and bar colors tell you what side of the market to favor. The Supertrend is calculated from ATR on whatever timeframe you choose in the settings. If you set the MTF input to a higher timeframe, the Supertrend and ATR ratio become your higher time frame bias while you trade on a lower chart. When price is above the MTF Supertrend, the line uses your bullish color and, if bar coloring is enabled, candles adopt your bullish bar color. That is your “long only” environment: you generally look for buys when price is above the Supertrend and the ATR ratio is either turning up from neutral or already in a bullish zone. When price is below the MTF Supertrend, the line uses your bearish color and candles can shift to your bearish bar color; that is where you focus on shorts, especially when the ATR ratio is rolling over or holding in the bearish zone.
The built-in long and short conditions are meant as signal prompts, not rigid rules. Long signals fire when the ATR ratio crosses up through a positive level while the Supertrend is bullish. Short signals fire when the ATR ratio crosses down through a negative level while the Supertrend is bearish. The script tracks how many longs or shorts have been taken in sequence (pyramiding) and will only allow a new signal up to the limit you set, so you can control how aggressively you stack positions in a trend. The take-profit logic then watches the percentage move from your last entry and flags “TP” when that move has reached your take-profit percent, helping you standardize exits instead of eyeballing them bar by bar.
In practice you typically start by choosing your anchor timeframe for the MTF setting, for example a 1-hour or 4-hour Supertrend and ATR ratio while watching a 5-minute or 15-minute chart. You then use the Supertrend direction and bar colors as your bias filter, only taking signals in the direction of the trend, and you use the ATR ratio behavior to judge whether you are entering into strength, fading an extreme, or trading inside a neutral consolidation. Over time this gives you a consistent way to answer three questions on every chart: which side am I allowed to trade, how extended is price within its recent volatility, and where are my structured entries and exits based on that framework.
Simulateur Carnet d'Ordres & Liquidité [Sese] - Custom🔹 Indicator Name
Order Book & Liquidity Simulator - Custom
🔹 Concept and Functionality
This indicator is a technical analysis tool designed to visually simulate market depth (Order Book) and potential liquidity zones.
It is important to adhere to TradingView's transparency rules: This script does not access real Level 2 data (the actual exchange order book). Instead, it uses a deductive algorithm based on historical Price Action to estimate where Buy Limit (Bid) and Sell Limit (Ask) orders might be resting.
Methodology used by the script:
Pivot Detection: The indicator scans for significant Swing Highs and Swing Lows over a user-defined lookback period (Length).
Level Projection: These pivots are projected to the right as horizontal lines.
Red Lines (Ask): Represent potential resistance zones (sellers).
Blue Lines (Bid): Represent potential support zones (buyers).
Liquidity Management (Absorption): The script is dynamic. If the current price crosses a line, the indicator assumes the liquidity at that level has been consumed (orders filled). The line is then automatically deleted from the chart.
Density Profile (Right Side): Horizontal bars appear to the right of the current price. These approximate a "Time Price Opportunity" or Volume Profile, showing where the market has spent the most time recently.
🔹 User Manual (Settings)
Here is how to configure the inputs to match your trading style:
1. Detection Algorithm
Lookback Length (Candles): Determines the sensitivity of the pivots.
Low value (e.g., 10): Shows many lines (scalping/short term).
High value (e.g., 50): Shows only major structural levels (swing trading).
Volume Factor: (Technical note: In this specific code version, this variable is calculated but the lines are primarily drawn based on geometric pivots).
2. Visual Settings
Show Price Lines (Bid/Ask): Toggles the horizontal Support/Resistance lines on or off.
Show Volume Profile: Toggles the heatmap-style bars on the right side of the chart.
Extend Lines: If checked, untouched lines will extend to the right towards the current price bar.
3. Colors and Transparency Management
Customize the aesthetics to keep your chart clean:
Bid / Ask Colors: Choose your base colors (Default is Blue and Red).
Line Transparency (%): Crucial for chart visibility.
0% = Solid, bright colors.
80-90% = Very subtle, faint lines (recommended if you overlay this on other tools).
Text Size: Adjusts the size of the price labels ("BUY LIMIT" / "SELL LIMIT").
🔹 How to Read the Indicator
Rejections: Unbroken lines act as potential walls. Watch for price reaction when approaching a blue line (support) or red line (resistance).
Breakouts/Absorption: When a line disappears, it means the level has been breached. The market may then seek the next liquidity level (the next line).
Density (Right-side boxes): More opaque/visible boxes indicate a price zone "accepted" by the market (consolidation). Empty gaps suggest an imbalance where price might move through quickly.
⚠️ Disclaimer
This script is for educational and technical analysis purposes only. It is a simulation based on price history, not real-time order book data. Past performance is not indicative of future results. Trading involves risk.
Ben D"s IndicatorIt Auto Draws and Detects, Channels draws buy and sell signals based on over bought, oversold and a few other indicators. It works on all time frames! Enjoy! Leave a comment if you like it.
VIX Futures Spread (VX1 - VX2)Calculate the currente VIX front vs next contract spread.
Allow to identify if the market is in Contango or Backwardation
Display the result as a color coded histogram
Santhosh Time Block HighlighterI have created an indicator to differentiate market trend/momentum in different time zone during trading day. This will help us to understand the market pattern to avoid entering trade during consolidation/distribution. Its helps to measure the volatility and market sentiment
@Aladdin's Trading Web – Command CenterThe indicator uses standard Pine Script functionality including z-score normalization, standard deviation calculations, percentage change measurements, and request.security calls for multiple predefined symbols. There are no proprietary algorithms, external data feeds, or restricted calculation methods that would require protecting the source code.
Description:
The @Aladdin's Trading Web – Command Center indicator provides a composite market regime assessment through a weighted combination of multiple intermarket relationships. The indicator calculates normalized z-scores across several key market components including banks, volatility, the US dollar, credit spreads, interest rates, and alternative assets.
Each component is standardized using z-score methodology over a user-defined lookback period and combined according to configurable weighting parameters. The resulting composite measure provides a normalized assessment of the prevailing market environment, with the option to invert rate relationships for specific market regime conditions.
The indicator focuses on capturing the synchronized behavior across these interconnected market segments to provide a unified view of systemic market conditions.
MTF Trading Helper & Multi AlertsHi dear fellows, I´m using this indicator for my trading, so every then and when I will publish updates on this one.
This indicator should help to identify the right trading setup. I´m using it to trade index futures and stocks.
MTF Trading Helper & Multi Alerts
Overview
This indicator provides a clear visual representation of trend direction across three timeframes. It helps traders identify trend alignment, potential reversals, and optimal entry/exit points by analyzing the relationship between different smoothed timeframes.
You can set up multiple alerts (as one alert in Tradingview)
How It Works
The indicator displays three colored circles representing the smoothed candle direction on three different timeframes:
Bottom plot represents the overall trend direction, the plot in the middle shows intermediate momentum, and the one on top captures short-term price action.
When a color change occurs, the circle appears in a darker shade to highlight the transition.
🟢 Green = Bullish - 🔴 Red = Bearish
This change can also trigger multiple alerts.
Timeframe Settings - important
Choose between two trading setups, either for:
Intraday 1-minute candles or 1h for swing trading. Set up your chart accordingly to that timeframe.
Intraday | 1Min chart candles
Swing | 1 hour chart candles
Plots
TF3 represents the overall trend direction (bottom), TF2 shows intermediate momentum (middle), and TF1 captures short-term price action (top).
Interpretation & Strategy Alerts
1. Trend Bullish (TF3 turns Green)
The higher timeframe has shifted bullish - a potential new uptrend is forming.
Example: You're watching ES-mini on the Intraday setting. TF3 turns green after being red for several days. This signals the broader trend may be shifting bullish - consider looking for long opportunities.
2. Trend Bearish (TF3 turns Red)
The higher timeframe has shifted bearish - consider protecting profits or exiting long positions.
Example: You hold a long position in Es-mini. TF3 turns red, indicating the macro trend is weakening. This is your signal to take profits or tighten stop-losses.
3. Possible Accumulation (TF3 Red + TF2 turns Green)
While the overall trend is still bearish, the medium timeframe shows buying pressure. Smart money may be accumulating - watch closely for a potential trend reversal.
Example: Es-mini has been in a downtrend (TF3 red). Suddenly TF2 turns green while TF3 remains red. This could indicate institutional buying before a reversal. Don't buy yet, but add it to your watchlist and wait for confirmation.
4. Trend Continuation (TF3 Green + TF2 turns Green)
The medium timeframe realigns with the bullish macro trend - a potential buying opportunity as momentum returns to the uptrend.
Example: Es-mini is in an uptrend (TF3 green). After a pullback, TF2 was red but now turns green again. The pullback appears to be over - this is a trend continuation signal and a potential entry point.
5. Buy the Dip (TF3 + TF2 Green + TF1 turns Green)
All timeframes are now aligned bullish. The short-term pullback is complete and price is resuming the uptrend - optimal entry for short-term trades.
Example: Es-mini is trending up (TF3 + TF2 green). A small dip caused TF1 to turn red briefly. When TF1 turns green again, all three timeframes are aligned - this is your "Buy the Dip" signal with strong confirmation.
6. Sell the Dip (TF3 + TF2 Green + TF1 turns Red)
Short-term weakness within an uptrend. This can be used to take partial profits, wait for a better entry, or trail stops tighter.
Example: You're long on ES-mini with TF3 and TF2 green. TF1 turns red, indicating short-term selling pressure. Consider taking partial profits here and wait for TF1 to turn green again (Buy the Dip) to add back to your position.
How to Use
Choose your scenario: Select "Intraday" 1min-chart for day trading or "Swing" 1h-chart for swingtrading
Enable alerts: Turn on the strategy alerts you want to receive in the settings
Wait for signals: Let the indicator notify you when conditions align
Confirm with price action: Always use additional confirmation before entering trades
Best Practices
✅ Use TF3 as your trend filter - only take longs when TF3 turns green and hold them :)
✅ Use TF2 for timing - wait for TF2 to align with TF3 for swings.
✅ Use TF2 for early entries (accumulation phase) when TF3 is still red. Watch out!
✅ Use TF1 for entries when TF3 and TF2 are green. Only buy if TF1 is red. Keep it short and sweet.
✅ Combine with support/resistance levels for better entries
✅ Use proper risk management - no indicator is 100% accurate
Disclaimer
This indicator is for educational purposes only. Past performance does not guarantee future results. Always do your own research and use proper risk management. Never risk more than you can afford to lose.
Super-AO with Risk Management Strategy Template - 11-29-25Super-AO Strategy with Advanced Risk Management Template
Signal Lynx | Free Scripts supporting Automation for the Night-Shift Nation 🌙
1. Overview
Welcome to the Super-AO Strategy. This is more than just a buy/sell indicator; it is a complete, open-source Risk Management (RM) Template designed for the Pine Script community.
At its core, this script implements a robust swing-trading strategy combining the SuperTrend (for macro direction) and the Awesome Oscillator (for momentum). However, the real power lies under the hood: a custom-built Risk Management Engine that handles trade states, prevents repainting, and manages complex exit conditions like Staged Take Profits and Advanced Adaptive Trailing Stops (AATS).
We are releasing this code to help traders transition from simple indicators to professional-grade strategy structures.
2. Quick Action Guide (TL;DR)
Best Timeframe: 4 Hours (H4) and above. Designed for Swing Trading.
Best Assets: "Well-behaved" assets with clear liquidity (Major Forex pairs, BTC, ETH, Indices).
Strategy Type: Trend Following + Momentum Confirmation.
Key Feature: The Risk Management Engine is modular. You can strip out the "Super-AO" logic and insert your own strategy logic into the template easily.
Repainting: Strictly Non-Repainting. The engine calculates logic based on confirmed candle closes.
3. Detailed Report: How It Works
A. The Strategy Logic: Super-AO
The entry logic is based on the convergence of two classic indicators:
SuperTrend: Determines the overall trend bias (Green/Red).
Awesome Oscillator (AO): Measures market momentum.
The Signal:
LONG (+2): SuperTrend is Green AND AO is above the Zero Line AND AO is Rising.
SHORT (-2): SuperTrend is Red AND AO is below the Zero Line AND AO is Falling.
By requiring momentum to agree with the trend, this system filters out many false signals found in ranging markets.
B. The Risk Management (RM) Engine
This script features a proprietary State Machine designed by Signal Lynx. Unlike standard strategies that simply fire orders, this engine separates the Signal from the Execution.
Logic Injection: The engine listens for a specific integer signal: +2 (Buy) or -2 (Sell). This makes the code a Template. You can delete the Super-AO section, write your own logic, and simply pass a +2 or -2 to the RM_EngineInput variable. The engine handles the rest.
Trade States: The engine tracks the state of the trade (Entry, In-Trade, Exiting) to prevent signal spamming.
Aggressive vs. Conservative:
Conservative Mode: Waits for a full trend reversal before taking a new trade.
Aggressive Mode: Allows for re-entries if the trend is strong and valid conditions present themselves again (Pyramiding Type 1).
C. Advanced Exit Protocols
The strategy does not rely on a single exit point. It employs a "Layered Defense" approach:
Hard Stop Loss: A fixed percentage safety net.
Staged Take Profits (Scaling Out): The script allows you to set 3 distinct Take Profit levels. For example, you can close 10% of your position at TP1, 10% at TP2, and let the remaining 80% ride the trend.
Trailing Stop: A standard percentage-based trailer.
Advanced Adaptive Trailing Stop (AATS): This is a highly sophisticated volatility stop. It calculates market structure using Hirashima Sugita (HSRS) levels and Bollinger Bands to determine the "floor" and "ceiling" of price action.
If volatility is high: The stop loosens to prevent wicking out.
If volatility is low: The stop tightens to protect profit.
D. Repainting Protection
Many Pine Script strategies look great in backtesting but fail in live trading because they rely on "real-time" price data that disappears when the candle closes.
This Risk Management engine explicitly pulls data from the previous candle close (close , high , low ) for its calculations. This ensures that the backtest results you see match the reality of live execution.
4. For Developers & Modders
We encourage you to tear this code apart!
Look for the section titled // Super-AO Strategy Logic.
Replace that block with your own RSI, MACD, or Price Action logic.
Ensure your logic outputs a 2 for Buy and -2 for Sell.
Connect it to RM_EngineInput.
You now have a fully functioning Risk Management system for your custom strategy.
5. About Signal Lynx
Automation for the Night-Shift Nation 🌙
This code has been in action since 2022 and is a known performer in PineScript v5. We provide this open source to help the community build better, safer automated systems.
If you are looking to automate your strategies, please take a look at Signal Lynx in your search.
License: Mozilla Public License 2.0 (Open Source). If you make beneficial modifications, please release them back to the community!
$TGM | Topological Geometry Mapper (Custom)TGM | Topological Geometry Mapper (Custom) – 2025 Edition
The first indicator that reads market structure the way institutions actually see it: through persistent topological features (Betti-1 collapse) instead of lagging price patterns.
Inspired by algebraic topology and persistent homology, TGM distills regime complexity into a single, real-time proxy using the only two macro instruments that truly matter:
• CBOE:VIX – market fear & convexity
• TVC:DXY – dollar strength & global risk appetite
When the weighted composite β₁ persistence drops below the adaptive threshold → market structure radically simplifies. Noise dies. Order flow aligns. A directional explosion becomes inevitable.
Features
• Structural Barcode Visualization – instantly see complexity collapsing in real time
• Dynamic color system:
→ Neon green = long breakout confirmed
→ red = short breakout confirmed
→ yellow = simplification in progress (awaiting momentum)
→ deep purple = complex/noisy regime
• Clean HUD table with live β₁ value, threshold, regime status and timestamp
• Built-in high-precision alerts (Long / Short / Collapse)
• Zero repaint – uses only confirmed data
• Works on every timeframe and every market
Best used on:
BTC, ETH, ES/NQ, EURUSD, GBPUSD, NAS100, SPX500, Gold – anywhere liquidity is institutional.
This is not another repainted RSI or MACD mashup.
This is structural regime detection at the topological level.
Welcome to the future of market geometry.
Made with love for the real traders.
Open-source. No paywalls. No BS.
#topology #betti #smartmoney #ict #smc #orderflow #regime #institutional
Elite Energy Alpha MatrixThe Elite Energy Alpha Matrix indicator provides comprehensive analysis of the energy sector, focusing on the complex relationships between crude oil benchmarks, natural gas, energy-related ETFs, and the performance dynamics across various energy sub-sectors.
The indicator tracks multiple energy price data sources including WTI crude oil, Brent crude, natural gas, and oil ETFs, enabling detailed monitoring of price relationships and divergences within the energy complex.
Key analytical components include:
• Correlation analysis between major energy benchmarks
• Multi-timeframe examination of energy price relationships
• Sector rotation detection within energy sub-sectors including integrated oil majors, exploration and production companies, oilfield services, refiners, pipelines, and renewable energy
• Performance monitoring across different energy market segments
The indicator provides a structured framework for analyzing the internal dynamics of the energy sector, identifying periods of alignment or divergence between different energy price instruments, and monitoring relative performance across energy sub-sectors.
This approach enables users to assess the consistency of price movements across the energy complex and identify situations where different components of the energy market are exhibiting divergent behavior, which can provide insight into the underlying drivers affecting the sector.2.6s
Santhosh Zero lag Trend change AlertThis indicator alert whenever these is a change in trend direction. Change input to match with your Asset/Index. This works well in all time frame, I recommend this for Scalping and Position trading
VWAP & EMA9 Cross AlertAlerts when EMA9 and VWAP Cross. This provides an indicator of general market direction based on these 2 indicators.
Super-AO with Risk Management Alerts Template - 11-29-25Super-AO with Risk Management: ALERTS & AUTOMATION Edition
Signal Lynx | Free Scripts supporting Automation for the Night-Shift Nation 🌙
1. Overview
This is the Indicator / Alerts companion to the Super-AO Strategy.
While the Strategy version is built for backtesting (verifying profitability and checking historical performance), this Indicator version is built for Live Execution.
We understand the frustration of finding a great strategy, only to realize you can't easily hook it up to your trading bot. This script solves that. It contains the exact same "Super-AO" logic and "Risk Management Engine" as the strategy version, but it is optimized to send signals to automation platforms like Signal Lynx, 3Commas, or any Webhook listener.
2. Quick Action Guide (TL;DR)
Purpose: Live Signal Generation & Automation.
Workflow:
Use the Strategy Version to find profitable settings.
Copy those settings into this Indicator Version.
Set a TradingView Alert using the "Any Alert() function call" condition.
Best Timeframe: 4 Hours (H4) and above.
Compatibility: Works with any webhook-based automation service.
3. Why Two Scripts?
Pine Script operates in two distinct modes:
Strategy Mode: Calculates equity, drawdowns, and simulates orders. Great for research, but sometimes complex to automate.
Indicator Mode: Plots visual data on the chart. This is the preferred method for setting up robust alerts because it is lighter weight and plots specific values that automation services can read easily.
The Golden Rule: Always backtest on the Strategy, but trade on the Indicator. This ensures that what you see in your history matches what you execute in real-time.
4. How to Automate This Script
This script uses a "Visual Spike" method to trigger alerts. Instead of drawing equity curves, it plots numerical values at the bottom of your chart when a trade event occurs.
The Signal Map:
Blue Spike (2 / -2): Entry Signal (Long / Short).
Yellow Spike (1 / -1): Risk Management Close (Stop Loss / Trend Reversal).
Green Spikes (1, 2, 3): Take Profit Levels 1, 2, and 3.
Setup Instructions:
Add this indicator to your chart.
Open your TradingView "Alerts" tab.
Create a new Alert.
Condition: Select SAO - RM Alerts Template.
Trigger: Select Any Alert() function call.
Message: Paste your JSON webhook message (provided by your bot service).
5. The Logic Under the Hood
Just like the Strategy version, this indicator utilizes:
SuperTrend + Awesome Oscillator: High-probability swing trading logic.
Non-Repainting Engine: Calculates signals based on confirmed candle closes to ensure the alert you get matches the chart reality.
Advanced Adaptive Trailing Stop (AATS): Internally calculates volatility to determine when to send a "Close" signal.
6. About Signal Lynx
Automation for the Night-Shift Nation 🌙
We are providing this code open source to help traders bridge the gap between manual backtesting and live automation. This code has been in action since 2022.
If you are looking to automate your strategies, please take a look at Signal Lynx in your search.
License: Mozilla Public License 2.0 (Open Source). If you make beneficial modifications, please release them back to the community!
Superior-Range Bound Renko - Alerts - 11-29-25 - Signal LynxSuperior-Range Bound Renko – Alerts Edition with Advanced Risk Management Template
Signal Lynx | Free Scripts supporting Automation for the Night-Shift Nation 🌙
1. Overview
This is the Alerts & Indicator Edition of Superior-Range Bound Renko (RBR).
The Strategy version is built for backtesting inside TradingView.
This Alerts version is built for automation: it emits clean, discrete alert events that you can route into webhooks, bots, or relay engines (including your own Signal Lynx-style infrastructure).
Under the hood, this script contains the same core engine as the strategy:
Adaptive Range Bounding based on volatility
Renko Brick Emulation on standard candles
A stack of Laguerre Filters for impulse detection
K-Means-style Adaptive SuperTrend for trend confirmation
The full Signal Lynx Risk Management Engine (state machine, layered exits, AATS, RSIS, etc.)
The difference is in what we output:
Instead of placing historical trades, this version:
Plots the entry and RM signals in a separate pane (overlay = false)
Exposes alertconditions for:
Long Entry
Short Entry
Close Long
Close Short
TP1, TP2, TP3 hits (Staged Take Profit)
This makes it ideal as the signal source for automated execution via TradingView Alerts + Webhooks.
2. Quick Action Guide (TL;DR)
Best Timeframe:
4H and above. This is a swing-trading / position-trading style engine, not a micro-scalper.
Best Assets:
Volatile but structured markets, e.g.:
BTC, ETH, XAUUSD (Gold), GBPJPY, and similar high-volatility majors or indices.
Script Type:
indicator() – Alerts & Visualization Only
No built-in order placement
All “orders” are emitted as alerts for your external bot or manual handling
Strategy Type:
Volatility-Adaptive Trend Following + Impulse Detection
using Renko-like structure and multi-layer Laguerre filters.
Repainting:
Designed to be non-repainting on closed candles.
The underlying Risk Management engine is built around previous-bar data (close , high , low ) for execution-critical logic.
Intrabar values can move while the bar is forming (normal for any advanced signal), but once a bar closes, the alert logic is stable.
Recommended Alert Settings:
Condition: one of the built-in signals (see section 3.B)
Options: “Once Per Bar Close” is strongly recommended for automation
Message: JSON, CSV, or simple tokens – whatever your webhook / relay expects
3. Detailed Report: How the Alerts Edition Works
A. Relationship to the Strategy Version
The Alerts Edition shares the same internal logic as the strategy version:
Same Adaptive Lookback and volatility normalization
Same Range and Close Range construction
Same Renko Brick Emulator and directional memory (renkoDir)
Same Fib structures, Laguerre stack, K-Means SuperTrend, and Baseline signals (B1, B2)
Same Risk Management Engine and layered exits
In the strategy script, these signals are wired into strategy.entry, strategy.exit, and strategy.close.
In the alerts script:
We still compute the final entry/exit signals (Fin, CloseEmAll, TakeProfit1Plot, etc.)
Instead of placing trades, we:
Plot them for visual inspection
Expose them via alertcondition(...) so that TradingView can fire alerts.
This ensures that:
If you use the same settings on the same symbol/timeframe, the Alerts Edition and Strategy Edition agree on where entries and exits occur.
(Subject only to normal intrabar vs. bar-close differences.)
B. Signals & Alert Conditions
The alerts script focuses on discrete, automation-friendly events.
Internally, the main signals are:
Fin – Final entry decision from the RM engine
CloseEmAll – RM-driven “hard close” signal (for full-position exits)
TakeProfit1Plot / 2Plot / 3Plot – One-time event markers when each TP stage is hit
On the chart (in the separate indicator pane), you get:
plot(Fin) – where:
+2 = Long Entry event
-2 = Short Entry event
plot(CloseEmAll) – where:
+1 = “Close Long” event
-1 = “Close Short” event
plot(TP1/TP2/TP3) (if Staged TP is enabled) – integer tags for TP hits:
+1 / +2 / +3 = TP1 / TP2 / TP3 for Longs
-1 / -2 / -3 = TP1 / TP2 / TP3 for Shorts
The corresponding alertconditions are:
Long Entry
alertcondition(Fin == 2, title="Long Entry", message="Long Entry Triggered")
Fire this to open/scale a long position in your bot.
Short Entry
alertcondition(Fin == -2, title="Short Entry", message="Short Entry Triggered")
Fire this to open/scale a short position.
Close Long
alertcondition(CloseEmAll == 1, title="Close Long", message="Close Long Triggered")
Fire this to fully exit a long position.
Close Short
alertcondition(CloseEmAll == -1, title="Close Short", message="Close Short Triggered")
Fire this to fully exit a short position.
TP 1 Hit
alertcondition(TakeProfit1Plot != 0, title="TP 1 Hit", message="TP 1 Level Reached")
First staged take profit hit (either long or short). Your bot can interpret the direction based on position state or message tags.
TP 2 Hit
alertcondition(TakeProfit2Plot != 0, title="TP 2 Hit", message="TP 2 Level Reached")
TP 3 Hit
alertcondition(TakeProfit3Plot != 0, title="TP 3 Hit", message="TP 3 Level Reached")
Together, these give you a complete trade lifecycle:
Open Long / Short
Optionally scale out via TP1/TP2/TP3
Close remaining via Close Long / Close Short
All while the Risk Management Engine enforces the same logic as the strategy version.
C. Using This Script for Automation
This Alerts Edition is designed for:
Webhook-based bots
Execution relays (e.g., your own Lynx-Relay-style engine)
Dedicated external trade managers
Typical setup flow:
Add the script to your chart
Same symbol, timeframe, and settings you use in the Strategy Edition backtests.
Configure Inputs:
Longs / Shorts enabled
Risk Management toggles (SL, TS, Staged TP, AATS, RSIS)
Weekend filter (if you do not want weekend trades)
RBR-specific knobs (Adaptive Lookback, Brick type, ATR vs Standard Brick, etc.)
Create Alerts for Each Event Type You Need:
Long Entry
Short Entry
Close Long
Close Short
TP1 / TP2 / TP3 (optional, if your bot handles partial closes)
For each:
Condition: the corresponding alertcondition
Option: “Once Per Bar Close” is strongly recommended
Message:
You can use structured JSON or a simple token set like:
{"side":"long","event":"entry","symbol":"{{ticker}}","time":"{{timenow}}"}
or a simpler text for manual trading like:
LONG ENTRY | {{ticker}} | {{interval}}
Wire Up Your Bot / Relay:
Point TradingView’s webhook URL to your execution engine
Parse the messages and map them into:
Exchange
Symbol
Side (long/short)
Action (open/close/partial)
Size and risk model (this script does not position-size for you; it only signals when, not how much.)
Because the alerts come from a non-repainting, RM-backed engine that you’ve already validated via the Strategy Edition, you get a much cleaner automation pipeline.
D. Repainting Protection (Alerts Edition)
The same protections as the Strategy Edition apply here:
Execution-critical logic (trailing stop, TP triggers, SL, RM state changes) uses previous bar OHLC:
open , high , low , close
No security() with lookahead or future-bar dependencies.
This means:
Alerts are designed to fire on states that would have been visible at bar close, not on hypothetical “future history.”
Important practical note:
Intrabar: While a bar is forming, internal conditions can oscillate.
Bar Close: With “Once Per Bar Close” alerts, the fired signal corresponds to the final state of the engine for that candle, matching your Strategy Edition expectations.
4. For Developers & Modders
You can treat this Alerts script as an ”RM + Alert Framework” and inject any signal logic you want.
Where to plug in:
Find the section:
// BASELINE & SIGNAL GENERATION
You’ll see how B1 and B2 are built from the RBR stack and then combined:
baseSig = B2
altSig = B1
finalSig = sigSwap ? baseSig : altSig
To use your own logic:
Replace or wrap the code that sets baseSig / altSig with your own conditions:
e.g., RSI, MACD, Heikin Ashi filters, candle patterns, volume filters, etc.
Make sure your final decision is still:
2 → Long / Buy signal
-2 → Short / Sell signal
0 → No trade
finalSig is then passed into the RM engine and eventually becomes Fin, which:
Drives the Long/Short Entry alerts
Interacts with the RM state machine to integrate properly with AATS, SL, TS, TP, etc.
Because this script already exposes alertconditions for key lifecycle events, you don’t need to re-wire alerts each time — just ensure your logic feeds into finalSig correctly.
This lets you use the Signal Lynx Risk Management Engine + Alerts wrapper as a drop-in chassis for your own strategies.
5. About Signal Lynx
Automation for the Night-Shift Nation 🌙
Signal Lynx builds tools and templates that help traders move from:
“I have an indicator” → “I have a structured, automatable strategy with real risk management.”
This Superior-Range Bound Renko – Alerts Edition is the automation-focused companion to the Strategy Edition. It’s designed for:
Traders who backtest with the Strategy version
Then deploy live signals with this Alerts version via webhooks or bots
While relying on the same non-repainting, RM-driven logic
We release this code under the Mozilla Public License 2.0 (MPL-2.0) to support the Pine community with:
Transparent, inspectable logic
A reusable Risk Management template
A reference implementation of advanced adaptive logic + alerts
If you are exploring full-stack automation (TradingView → Webhooks → Exchange / VPS), keep Signal Lynx in your search.
License: Mozilla Public License 2.0 (Open Source).
If you build improvements or helpful variants, please consider sharing them back with the community.
Superior-Range Bound Renko - Strategy - 11-29-25 - SignalLynxSuperior-Range Bound Renko Strategy with Advanced Risk Management Template
Signal Lynx | Free Scripts supporting Automation for the Night-Shift Nation 🌙
1. Overview
Welcome to Superior-Range Bound Renko (RBR) — a volatility-aware, structure-respecting swing-trading system built on top of a full Risk Management (RM) Template from Signal Lynx.
Instead of relying on static lookbacks (like “14-period RSI”) or plain MA crosses, Superior RBR:
Adapts its range definition to market volatility in real time
Emulates Renko Bricks on a standard, time-based chart (no Renko chart type required)
Uses a stack of Laguerre Filters to detect genuine impulse vs. noise
Adds an Adaptive SuperTrend powered by a small k-means-style clustering routine on volatility
Under the hood, this script also includes the full Signal Lynx Risk Management Engine:
A state machine that separates “Signal” from “Execution”
Layered exit tools: Stop Loss, Trailing Stop, Staged Take Profit, Advanced Adaptive Trailing Stop (AATS), and an RSI-style stop (RSIS)
Designed for non-repainting behavior on closed candles by basing execution-critical logic on previous-bar data
We are publishing this as an open-source template so traders and developers can leverage a professional-grade RM engine while integrating their own signal logic if they wish.
2. Quick Action Guide (TL;DR)
Best Timeframe:
4 Hours (H4) and above. This is a high-conviction swing-trading system, not a scalper.
Best Assets:
Volatile instruments that still respect market structure:
Bitcoin, Ethereum, Gold (XAUUSD), high-volatility Forex pairs (e.g., GBPJPY), indices with clean ranges.
Strategy Type:
Volatility-Adaptive Trend Following + Impulse Detection.
It hunts for genuine expansion out of ranges, not tiny mean-reversion nibbles.
Key Feature:
Renko Emulation on time-based candles.
We mathematically model Renko Bricks and overlay them on your standard chart to define:
“Equilibrium” zones (inside the brick structure)
“Breakout / impulse” zones (when price AND the impulse line depart from the bricks)
Repainting:
Designed to be non-repainting on closed candles.
All RM execution logic uses confirmed historical data (no future bars, no security() lookahead). Intrabar flicker during formation is allowed, but once a bar closes the engine’s decisions are stable.
Core Toggles & Filters:
Enable Longs and Shorts independently
Optional Weekend filter (block trades on Saturday/Sunday)
Per-module toggles: Stop Loss, Trailing Stop, Staged Take Profits, AATS, RSIS
3. Detailed Report: How It Works
A. The Strategy Logic: Superior RBR
Superior RBR builds its entry signal from multiple mathematical layers working together.
1) Adaptive Lookback (Volatility Normalization)
Instead of a fixed 100-bar or 200-bar range, the script:
Computes ATR-based volatility over a user-defined period.
Normalizes that volatility relative to its recent min/max.
Maps the normalized value into a dynamic lookback window between a minimum and maximum (e.g., 4 to 100 bars).
High Volatility:
The lookback shrinks, so the system reacts faster to explosive moves.
Low Volatility:
The lookback expands, so the system sees a “bigger picture” and filters out chop.
All the core “Range High/Low” and “Range Close High/Low” boundaries are built on top of this adaptive window.
2) Range Construction & Quick Ranges
The engine constructs several nested ranges:
Outer Range:
rangeHighFinal – dynamic highest high
rangeLowFinal – dynamic lowest low
Inner Close Range:
rangeCloseHighFinal – highest close
rangeCloseLowFinal – lowest close
Quick Ranges:
“Half-length” variants of those, used to detect more responsive changes in structure and volatility.
These ranges define:
The macro box price is trading inside
Shorter-term “pressure zones” where price is coiling before expansion
3) Renko Emulation (The Bricks)
Rather than using the Renko chart type (which discards time), this script emulates Renko behavior on your normal candles:
A “brick size” is defined either:
As a standard percentage move, or
As a volatility-driven (ATR) brick, optionally inhibited by a minimum standard size
The engine tracks a base value and derives:
brickUpper – top of the emulated brick
brickLower – bottom of the emulated brick
When price moves sufficiently beyond those levels, the brick “shifts”, and the directional memory (renkoDir) updates:
renkoDir = +2 when bricks are advancing upward
renkoDir = -2 when bricks are stepping downward
You can think of this as a synthetic Renko tape overlaid on time-based candles:
Inside the brick: equilibrium / consolidation
Breaking away from the brick: momentum / expansion
4) Impulse Tracking with Laguerre Filters
The script uses multiple Laguerre Filters to smooth price and brick-derived data without traditional lag.
Key filters include:
LagF_1 / LagF_W: Based on brick upper/lower baselines
LagF_Q: Based on HLCC4 (high + low + 2×close)/4
LagF_Y / LagF_P: Complex averages combining brick structures and range averages
LagF_V (Primary Impulse Line):
A smooth, high-level impulse line derived from a blend of the above plus the outer ranges
Conceptually:
When the impulse line pushes away from the brick structure and continues in one direction, an impulse move is underway.
When its direction flips and begins to roll over, the impulse is fading, hinting at mean reversion back into the range.
5) Fib-Based Structure & Swaps
The system also layers in Fib levels derived from the adaptive ranges:
Standard levels (12%, 23.6%, 38.2%, 50%, 61%, 76.8%, 88%) from the main range
A secondary “swap” set derived from close-range dynamics (fib12Swap, fib23Swap, etc.)
These Fibs are used to:
Bucket price into structural zones (below 12, between 23–38, etc.)
Detect breakouts when price and Laguerre move beyond key Fib thresholds
Drive zSwap logic (where a secondary Fib set becomes the active structure once certain conditions are met)
6) Adaptive SuperTrend with K-Means-Style Volatility Clustering
Under the hood, the script uses a small k-means-style clustering routine on ATR:
ATR is measured over a fixed period
The range of ATR values is split into Low, Medium, High volatility centroids
Current ATR is assigned to the nearest centroid (cluster)
From that, a SuperTrend variant (STK) is computed with dynamic sensitivity:
In quiet markets, SuperTrend can afford to be tighter
In wild markets, it widens appropriately to avoid constant whipsaw
This SuperTrend-based oscillator (LagF_K and its signals) is then combined with the brick and Laguerre stack to confirm valid trend regimes.
7) Final Baseline Signals (+2 / -2)
The “brain” of Superior RBR lives in the Baseline & Signal Generation block:
Two composite signals are built: B1 and B2:
They combine:
Fib breakouts
Renko direction (renkoDir)
Expansion direction (expansionQuickDir)
Multiple Laguerre alignments (LagF_Q, LagF_W, LagF_Y, LagF_Z, LagF_P, LagF_V)
They also factor in whether Fib structures are expanding or contracting.
A user toggle selects the “Baseline” signal:
finalSig = B2 (default) or B1 (alternate baseline)
finalSig is then filtered through the RM state machine and only when everything aligns, we emit:
+2 = Long / Buy signal
-2 = Short / Sell signal
0 = No new trade
Those +2 / -2 values are what feed the Risk Management Engine.
B. The Risk Management (RM) Engine
This script features the Signal Lynx Risk Management Engine, a proprietary state machine built to separate Signal from Execution.
Instead of firing orders directly on indicator conditions, we:
Convert the raw signal into a clean integer (Fin = +2 / -2 / 0)
Feed it into a Trade State Machine that understands:
Are we flat?
Are we in a long or short?
Are we in a closing sequence?
Should we permit re-entry now or wait?
Logic Injection / Template Concept:
The RM engine expects a simple integer:
+2 → Buy
-2 → Sell
Everything else (0) is “no new trade”
This makes the script a template:
You can remove the Superior RBR block
Drop in your own logic (RSI, MACD, price action, etc.)
As long as you output +2 or -2 into the same signal channel, the RM engine can drive all exits and state transitions.
Aggressive vs Conservative Modes:
The input AgressiveRM (Aggressive RM) governs how we interpret signals:
Conservative Mode (Aggressive RM = false):
Uses a more filtered internal signal (AF) to open trades
Effectively waits for a clean trend flip / confirmation before new entries
Minimizes whipsaw at the cost of fewer trades
Aggressive Mode (Aggressive RM = true):
Reacts directly to the fresh alert (AO) pulses
Allows faster re-entries in the same direction after RM-based exits
Still respects your pyramiding setting; this script ships with pyramiding = 0 by default, so it will not stack multiple positions unless you change that parameter in the strategy() call.
The state machine enforces discipline on top of your signal logic, reducing double-fires and signal spam.
C. Advanced Exit Protocols (Layered Defense)
The exit side is where this template really shines. Instead of a single “take profit or stop loss,” it uses multiple, cooperating layers.
1) Hard Stop Loss
A classic percentage-based Stop Loss (SL) relative to the entry price.
Acts as a final “catastrophic protection” layer for unexpected moves.
2) Standard Trailing Stop
A percentage-based Trailing Stop (TS) that:
Activates only after price has moved a certain percentage in your favor (tsActivation)
Then trails price by a configurable percentage (ts)
This is a straightforward, battle-tested trailing mechanism.
3) Staged Take Profits (Three Levels)
The script supports three staged Take Profit levels (TP1, TP2, TP3):
Each stage has:
Activation percentage (how far price must move in your favor)
Trailing amount for that stage
Position percentage to close
Example setup:
TP1:
Activate at +10%
Trailing 5%
Close 10% of the position
TP2:
Activate at +20%
Trailing 10%
Close another 10%
TP3:
Activate at +30%
Trailing 5%
Close the remaining 80% (“runner”)
You can tailor these quantities for partial scaling out vs. letting a core position ride.
4) Advanced Adaptive Trailing Stop (AATS)
AATS is a sophisticated volatility- and structure-aware stop:
Uses Hirashima Sugita style levels (HSRS) to model “floors” and “ceilings” of price:
Dungeon → Lower floors → Mid → Upper floors → Penthouse
These levels classify where current price sits within a long-term distribution.
Combines HSRS with Bollinger-style envelopes and EMAs to determine:
Is price extended far into the upper structure?
Is it compressed near the lower ranges?
From this, it computes an adaptive factor that controls how tight or loose the trailing level (aATS / bATS) should be:
High Volatility / Penthouse areas:
Stop loosens to avoid getting wicked out by inevitable spikes.
Low Volatility / compressed structure:
Stop tightens to lock in and protect profit.
AATS is designed to be the “smart last line” that responds to context instead of a single fixed percentage.
5) RSI-Style Stop (RSIS)
On top of AATS, the script includes a RSI-like regime filter:
A McGinley Dynamic mean of price plus ATR bands creates a dynamic channel.
Crosses above the top band and below the lower band change a directional state.
When enabled (UseRSIS):
RSIS can confirm or veto AATS closes:
For longs: A shift to bearish RSIS can force exits sooner.
For shorts: A shift to bullish RSIS can do the same.
This extra layer helps avoid over-reactive stops in strong trends while still respecting a regime change when it happens.
D. Repainting Protection
Many strategies look incredible in the Strategy Tester but fail in live trading because they rely on intrabar values or future-knowledge functions.
This template is built with closed-candle realism in mind:
The Risk Management logic explicitly uses previous bar data (open , high , low , close ) for the key decisions on:
Trailing stop updates
TP triggers
SL hits
RM state transitions
No security() lookahead or future-bar access is used.
This means:
Backtest behavior is designed to match what you can actually get with TradingView alerts and live automation.
Signals may “flicker” intrabar while the candle is forming (as with any strategy), but on closed candles, the RM decisions are stable and non-repainting.
4. For Developers & Modders
We strongly encourage you to mod this script.
To plug your own strategy into the RM engine:
Look for the section titled:
// BASELINE & SIGNAL GENERATION
You will see composite logic building B1 and B2, and then selecting:
baseSig = B2
altSig = B1
finalSig = sigSwap ? baseSig : altSig
You can replace the content used to generate baseSig / altSig with your own logic, for example:
RSI crosses
MACD histogram flips
Candle pattern detectors
External condition flags
Requirements are simple:
Your final logic must output:
2 → Buy signal
-2 → Sell signal
0 → No new trade
That output flows into the RM engine via finalSig → AlertOpen → state machine → Fin.
Once you wire your signals into finalSig, the entire Risk Management system (Stops, TPs, AATS, RSIS, re-entry logic, weekend filters, long/short toggles) becomes available for your custom strategy without re-inventing the wheel.
This makes Superior RBR not just a strategy, but a reference architecture for serious Pine dev work.
5. About Signal Lynx
Automation for the Night-Shift Nation 🌙
Signal Lynx focuses on helping traders and developers bridge the gap between indicator logic and real-world automation. The same RM engine you see here powers multiple internal systems and templates, including other public scripts like the Super-AO Strategy with Advanced Risk Management.
We provide this code open source under the Mozilla Public License 2.0 (MPL-2.0) to:
Demonstrate how Adaptive Logic and structured Risk Management can outperform static, one-layer indicators
Give Pine Script users a battle-tested RM backbone they can reuse, remix, and extend
If you are looking to automate your TradingView strategies, route signals to exchanges, or simply want safer, smarter strategy structures, please keep Signal Lynx in your search.
License: Mozilla Public License 2.0 (Open Source).
If you make beneficial modifications, please consider releasing them back to the community so everyone can benefit.
Super-AO Engine - Sentiment Ribbon - 11-29-25Super-AO Sentiment Ribbon by Signal Lynx
Overview:
The Super-AO Sentiment Ribbon is the visual companion to the Super-AO Strategy Suite.
While the main strategy handles the complex mathematics of entries and risk management, this tool provides a simple "Traffic Light" visual at the top of your chart to gauge the overall health of the market.
How It Works:
This indicator takes the core components of the Super-AO strategy (The SuperTrend and the Awesome Oscillator), calculates the spread between them and the current price, and generates a normalized "Sentiment Score."
Reading the Colors:
🟢 Lime / Green: Strong Upward Momentum. Ideally, you only want to take Longs here.
🟤 Olive / Yellow: Trend is weakening. Be careful with new entries, or consider taking profit.
⚪ Gray: The "Kill Zone." The market is chopping sideways. Automated strategies usually suffer here.
🟠 Orange / Red: Strong Downward Momentum. Ideally, you only want to take Shorts here.
Integration:
This script uses the same default inputs as our Super-AO Strategy Template and Alerts Template. Use them together to confirm your automated entries visually.
About Signal Lynx:
Free Scripts supporting Automation for the Night-Shift Nation 🌙
(www.signallynx.com)
ZY Target TerminatorThe indicator generates trading signals. The profitability displayed on the signal at the time it is generated is the maximum profitability of the trade opened with the preceding signal. Therefore, avoid trading pairs and trends where this ratio is insufficient.
Extended SOPR Indicator — SSOPR Tops (A/B toggle)Extended SOPR Indicator — SSOPR Tops and Lows (A/B toggle)
Observation-only. Data: Glassnode SOPR.
Overview
This indicator extends the classical SOPR (Spent Output Profit Ratio) to improve readability and reduce noise on charts. SOPR measures whether coins moved on-chain were spent at a profit or at a loss. In brief: SOPR > 1 → spending at profit; SOPR < 1 → spending at loss. SSOPR (from "Smoothed SOPR") applies optional log transform (centers baseline at 0), smoothing (standard or adaptive), and adds structured signals: Z‑score lows (capitulation), buy zones , and top detection after prolonged elevation.
Why extend SOPR? (SSOPR vs classical SOPR)
• Noise reduction: Raw daily SOPR can whipsaw around its baseline. SSOPR uses smoothing and (optionally) adaptive smoothing so regimes are visible without overfitting.
• Better readability: The log transform shifts the break-even line to 0, making “profit territory” (above 0) and “loss territory” (below 0) visually intuitive on oscillators.
• Actionable context: Z‑score highlights extreme lows (capitulation risk), a simple buy-zone threshold marks potential accumulation, and a structured top pattern (with a time factor) helps frame distribution phases after sustained elevation.
What the script plots
• Smoothed SOPR (SSOPR): An orange line representing the smoothed SOPR (with optional log transform and optional adaptive smoothing).
• Top markers: A red triangle appears once at the onset of a confirmed top pattern.
• Background shading:
– Soft green: Buy zone when SSOPR falls below the “Buy Threshold.” (+ Z‑score capitulation zones (extreme lows)).
– Soft red: Top‑zone shading when the top criteria are met but before the single triangle fires.
Inputs & parameters
• Smoothing Length (default 14): Base window for smoothing SSOPR. Higher values = smoother, slower response.
• Apply Log Transform (default ON): Uses log(SOPR) so the baseline is 0 (log(1)=0). Above 0 → net profit regime; below 0 → net loss regime.
• Adaptive Smoothing (default OFF): Expands smoothing length as volatility rises using a standard deviation proxy; reduces whipsaws while preserving structure.
• Z‑score Threshold for Lows (default −2.5): Highlights capitulation zones when SSOPR deviates far below its rolling mean.
• SSOPR Buy Threshold (default −0.02): Simple rule-of-thumb level for potential accumulation context when below (log scale).
• SSOPR Top Threshold (default +0.005): Minimum elevation required for “profit territory” when assessing tops (log scale).
• Min Bars Above Threshold Before Top (default 50): Ensures prolonged elevation before calling a top.
• Lookback for Peak Detection (default 50): Window used to locate the recent high.
• Drop % from Peak to Confirm Top (default 5%): Confirms the start of distribution from a local high.
• Highlight Background : Toggles shaded zones.
Top detection (indicator-only)
A top fires when ALL of the following are true:
SSOPR spent at least Min Bars Above Threshold above the Top Threshold (sustained elevation).
The rising phase test passes (Option A or B; see below).
A drop from the local peak exceeds Drop % within the Lookback window.
The peak occurred in profit territory (SSOPR > Top Threshold).
To avoid repeated signals during the decline, the script emits the triangle once, at onset.
Rising‑phase switch: Option A vs Option B
• Option A — Up‑step ratio : Over the last A: Bars for Rising Check (default 50), it requires that at least A: Required Up‑Step Ratio (default 60%) of bars were rising (each bar compared to the previous). This favors gradual, persistent advances and filters out “choppy” lifts.
• Option B — Net slope : Compares current SSOPR to its value B: Bars Back for Net Slope ago (default 50). If higher, the series is considered rising. This is simpler and reacts faster in volatile phases but can admit brief pseudo‑trends.
Guidance : Prefer A for conservative confirmation in slow, persistent cycles; use B when trend moves are strong and you need timely detection.
Interpretation guide
• Regimes (log view): Above 0 → spending at profit; below 0 → spending at loss.
• Capitulation lows: When Z‑score < threshold, conditions often reflect forced/liquidity‑driven spending. Treat as context, not signals.
• Buy zone: SSOPR < Buy Threshold flags potential accumulation conditions (combine with price structure).
• Tops: After prolonged elevation, a confirmed top often coincides with profit‑taking/distribution phases.
Recommended timeframes
• Daily : Code optimized for daily timeframe.
Method summary
• SSOPR source: GLASSNODE:BTC_SOPR (via request.security ).
• Optional log transform: sopr → log(sopr) to normalize around 0.
• Smoothing: SMA over Smoothing Length , optionally adaptive using local volatility (std dev).
• Z‑score: (SSOPR − mean) / std dev, highlighting extreme lows.
• Top: Requires long elevation above Top Threshold , rising‑phase (A/B), and a subsequent drop > Drop % from recent high.
Limitations & notes
• SOPR reflects on‑chain movements; some activity occurs off‑chain (exchanges, internal transfers). Not all moves imply sale; aggregation makes it a usable proxy for profit/loss realization.
• Higher smoothing reduces noise but delays signals; adaptive smoothing can help but is still a trade‑off.
• Treat thresholds as context markers. They are not entry/exit signals by themselves.
• Use with price structure, volume, and other on‑chain indicators (e.g., realized price bands, dormancy/CDD) for confluence.
How to use (examples)
• Advance holding above 0 (log view): Retests of 0 from above that hold—while SSOPR remains elevated—often mark absorption; look for Top conditions only after sustained elevation and a confirmed drop from peak.
• Downtrend below 0: Rejections near 0 can align with continued loss realization; extreme Z‑score lows suggest capitulation risk—context for accumulation, not a blind buy.
Recommended settings
• Weekly: Log ON, Smoothing Length 14–30, Adaptive ON, Buy Threshold −0.02, Top Threshold +0.005, Rising Method A, Min Bars 50.
• Daily: Log ON, Smoothing Length 14–20, Adaptive OFF or ON (depending on noise), Rising Method B for timely slope checks.
Credits & references
• SOPR metric: Renato Shirakashi; documentation: Glassnode , CryptoQuant , overview: Bitbo .
Disclaimer
This script is for research/education on market behavior. It is not financial advice. Indicators provide context; decisions remain your responsibility.
Tags
bitcoin, btc, on‑chain, sopr, ssopr, glassnode, oscillator, regime, distribution, capitulation
RSI Regimes + Cardwell Sweet SpotsRSI based upon Cardwell principles, with a strength evaluation based upon the ADX, VWAP, velocity of both, and Cardwell RSI principles of a sweet spot of a RSI.
Bitcoin vs. S&P 500 Performance Comparison**Full Description:**
**Overview**
This indicator provides an intuitive visual comparison of Bitcoin's performance versus the S&P 500 by shading the chart background based on relative strength over a rolling lookback period.
**How It Works**
- Calculates percentage returns for both Bitcoin and the S&P 500 (ES1! futures) over a specified lookback period (default: 75 bars)
- Compares the returns and shades the background accordingly:
- **Green/Teal Background**: Bitcoin is outperforming the S&P 500
- **Red/Maroon Background**: S&P 500 is outperforming Bitcoin
- Displays a real-time performance difference label showing the exact percentage spread
**Key Features**
✓ Rolling performance comparison using customizable lookback period (default 75 bars)
✓ Clean visual representation with adjustable transparency
✓ Works on any timeframe (optimized for daily charts)
✓ Real-time performance differential display
✓ Uses ES1! (E-mini S&P 500 continuous futures) for accurate comparison
✓ Fine-tuning adjustment factor for precise calibration
**Use Cases**
- Identify market regimes where Bitcoin outperforms or underperforms traditional equities
- Spot trend changes in relative performance
- Assess risk-on vs risk-off periods
- Compare Bitcoin's momentum against broader market conditions
- Time entries/exits based on relative strength shifts
**Settings**
- **S&P 500 Symbol**: Default ES1! (can be changed to SPX or other indices)
- **Lookback Period**: Number of bars for performance calculation (default: 75)
- **Adjustment Factor**: Fine-tune calibration to match specific data feeds
- **Transparency Controls**: Customize background shading intensity
- **Show/Hide Label**: Toggle performance difference display
**Best Practices**
- Use on daily timeframe for swing trading and position analysis
- Combine with other momentum indicators for confirmation
- Watch for color transitions as potential regime change signals
- Consider using multiple timeframes for comprehensive analysis
**Technical Details**
The indicator calculates rolling percentage returns using the formula: ((Current Price / Price ) - 1) × 100, then compares Bitcoin's return to the S&P 500's return over the same period. The background color dynamically updates based on which asset is showing stronger performance.
Atlas 8 Currency Session Momentum (6H, London)This indicator calculates real-time currency strength for the 8 major currencies (USD, EUR, GBP, JPY, AUD, NZD, CAD, CHF) using a balanced multi-pair engine and a 6-hour momentum reset.
🔍 How it works
The indicator computes the relative strength of each currency by averaging the percentage change of 7 major cross-pairs for each currency.
A currency's value increases when pairs where it is the base appreciate, and decreases when pairs where it is the quote depreciate.
This creates a symmetric and stable strength calculation similar to institutional relative-value models.
🕒 Session-based Momentum Reset
The global trading day is split into 4 × 6-hour blocks:
• 00:00–06:00 Tokyo
• 06:00–12:00 London
• 12:00–18:00 New York
• 18:00–24:00 Late US/Asia pre-open
At each new 6-hour session, all strength lines reset to 0.
This highlights fresh intraday momentum generated by liquidity transitions between sessions.
🎯 What the indicator shows
• Relative strength of all 8 currencies
• Smooth momentum curves using EMA smoothing
• Vertical dividers at each new session
• Background color for each session
• Real intraday build-up of strength/weakness (not cumulative from previous day)
This tool is designed for intraday traders who follow cross-currency momentum during session transitions (Tokyo → London → NY).
🧭 How to use it
• Look for the strongest vs weakest currency after each session reset
• Identify fresh trends during London and NY opens
• Confirm currency-pair bias using strength divergence
• Track momentum exhaustion when lines flatten or converge






















