Smart Range Breakout System (Zeiierman)█ Overview
Smart Range Breakout System (Zeiierman) is a full breakout–trend–risk framework engineered around volatility compression, adaptive range detection, and a volatility-adaptive structural mapping layer that continuously reshapes itself as price migrates away from compression zones. Rather than reacting to simple line breaks, the system identifies statistically quiet regimes, models the expansion phase as momentum re-enters the market, and then deploys a unified architecture of trend projection, dynamic trailing stops, and risk–reward structuring that evolves in real time with the unfolding move.
This tool is designed for traders who want a self-contained breakout workflow: first detect valid ranges, then trade the expansion, then manage the trend and exits via automatically generated levels and alerts.
⚪ Why This One Is Unique
The core engine combines a custom price-contraction model with volatility-responsive boundary levels to detect when the market is transitioning between quiet and active phases. From this model, the script generates a smoothed synthetic average that acts as the reference point for identifying compression zones and validating breakout conditions. Using this foundation, the system builds a complete visual trade map: breakout boxes that mark consolidation, breakout markers that signal expansion, a trend cloud that tracks directional bias, adaptive trailing stops that follow price movement, and optional risk-reward levels that automatically adjust to each new breakout.
Unlike conventional breakout indicators that rely on a single high/low lookback, this system uses:
A price contraction engine that re-weights candle structure through a momentum-like transform, generating a stabilized price that better captures compression and release.
An adaptive low-volatility counter that waits for statistically quiet behavior before declaring a range.
█ Main Features
⚪ Breakout Signals With Dynamic Risk-Reward Levels
The system identifies meaningful breakouts emerging from compressed price zones and immediately maps a complete trade structure around each signal.
Each breakout generates:
Directional breakout markers to confirm expansion
Entry, Stop, TP1, and TP2 levels that are automatically projected
A dynamic trailing stop is added to lock in profits as the price moves
Risk and reward zones visualized through adaptive fills
Labels that update in real time as targets are reached or invalidated
This creates a clear, self-contained decision map that helps traders evaluate opportunities, manage risk, and track the progression of each breakout without manual calculations.
⚪ Trend Cloud
A continuously updating Trend Cloud highlights the active directional regime and offers immediate visual trend identification through its color-coded bias. It shows whether a breakout aligns with the prevailing direction, provides a smoother and more stable representation of the trend than raw price alone, and creates an intuitive backdrop for distinguishing trend-following opportunities from countertrend setups. By filtering out noise and emphasizing directional stability, the cloud helps improve timing, signal quality, and overall alignment with the dominant market structure.
█ How to Use
⚪ Breakout Trading from Range Boxes
1. Identify Compression Zones
Look for periods where the Range Breakout Box appears: this signals a statistically quiet regime where price has compressed around a bounded range.
The box top and bottom approximate the upper and lower bounds of the market’s recent equilibrium.
2. Trade the Expansion
Bullish Breakout:
Triggered when the synthetic price crosses above the box top.
A green breakout marker appears below the price (triangle up).
This signals that price is breaking out of the compression zone with enough momentum to establish a meaningful structural move to the upside.
Bearish Breakout:
Triggered when the price crosses below the box bottom.
A red breakout marker appears above the price (triangle down).
Signals a breakdown out of the range to the downside.
⚪ Trend Following with the Trend Cloud
The Trend Cloud is a volatility-responsive band that adjusts to the system’s internal trend. In bullish conditions, it shifts to the up-color beneath price, and in bearish conditions, it flips to the down-color above price, giving a clear visual read of market direction.
The cloud effectively separates impulsive trend legs from noise, so you can align breakout trades only with the dominant directional regime.
Long Setups
Favor long setups (Break Up) when the price is traveling above or inside a bullish cloud.
Short Steups
Favor short setups (Break Down) when the price is below or inside a bearish cloud.
Ignore counter-trend breakouts that form directly against a strong, stable cloud unless you are intentionally trading mean reversion.
⚪ Breakout Management and Risk-Reward
Once a breakout occurs, the system instantly activates a directional trailing stop that follows the trend. For long setups, the stop stays below the price and moves upward as momentum builds. For short setups, it stays above the price and moves downward as the trend strengthens. If price hits the trailing stop, an X-cross appears on the chart to mark the exit, and the stop is reset for the next signal. You can adjust the sensitivity to make the stop tighter or more relaxed, depending on your preference.
When Risk-Reward Levels are enabled, the script also builds a complete trade structure around the breakout. It places an entry line at the breakout close, and projects two target levels forward. The area between entry and stop is shaded as risk, while the area toward the targets is shaded as reward. Labels update automatically as targets are reached, turning into a clear confirmation mark when a level is hit and signaling with an icon if the stop is touched.
Together, the trailing stop and risk-reward ladder create a clear, real-time map of each breakout’s progression, helping you manage risk, monitor targets, and follow the move with structure and confidence.
█ How It Works
⚪ Compression Detection & Range Formation
The system identifies quiet market phases where price contracts into narrow zones and stabilizes around a synthetic equilibrium level. These zones form the foundation for valid breakout opportunities.
Calculation: Persistence-based boundary tracking with volatility-normalized change detection and equilibrium anchoring to identify statistically constrained price regimes.
⚪ Breakout Engine
Breakouts occur only when the internal average breaks out of a validated compression zone, confirming that the market is transitioning from containment to expansion.
Calculation: Boundary-crossing logic on dispersion-expanded structures with directional state shifts encoded through threshold-gated transitions.
⚪ Trend State
A dynamic trend state guides directional bias, while the Trend Cloud visually expresses this bias directly on the chart, shifting beneath or above the price depending on the active regime.
Calculation: Dual-regime state modeling using filtered directional vectors, volatility-responsive offsets, and continuity enforcement to avoid noise-driven flips.
-----------------
Disclaimer
The content provided in my scripts, indicators, ideas, algorithms, and systems is for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to buy or sell any financial instruments. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
Trend Analysis
Safe Supertrend Strategy (No Repaint)Overview
The Safe Supertrend is a repaint-free version of the popular Supertrend trend-following indicator.
Most Supertrend indicators appear perfect on historical charts because they flip intrabar and then repaint after the candle closes.
This version fixes that by using close-of-bar confirmation only, making every trend flip 100% stable, safe, and non-repainting.
Why This Supertrend Doesn’t Repaint
Most Supertrend indicators calculate their trend direction using the current bar’s data.
But during a live candle:
ATR expands and contracts
The upper/lower bands move
Price moves above/below the band temporarily
A false flip appears → then disappears when the candle closes
That is classic repainting.
This indicator avoids all of that by using:
close > upper
close < lower
This means:
Trend direction flips only based on the previous candle,
No intrabar calculations,
No flickering signals,
No “perfect but fake” historical performance.
Every signal you see on the chart is exactly what was available in real-time.
How It Works
Calculates ATR (Average True Range) and SMA centerline
Builds upper and lower volatility bands
Confirms trend flips only after the previous bar closes
Plots clear bull and bear reversal signals
Works on all markets (crypto, stocks, forex, indices)
No repainting, no recalc, no misleading flips.
Bullish Signal (Trend Up)
A bullish trend begins only when:
The previous candle closes above the upper ATR band,
And this flip is fully confirmed.
A green triangle marks the start of a new uptrend.
Bearish Signal (Trend Down)
A bearish trend begins only when:
The previous candle closes below the lower ATR band,
And the downtrend is confirmed.
A red triangle signals the start of a new downtrend.
Inputs
ATR Length - default 10
ATR Multiplier - default 3.0
Works on all timeframes and market
Simple, but powerful.
Why Use This Version Instead of a Regular Supertrend?
Most Supertrends:
Look great historically
But repaint continuously on live charts
Give false trend flips intrabar
Cannot be reliably used in strategies
This version:
Uses strict previous-bar logic
Never repaints trend direction
Works perfectly in live trading
Backtests accurately
Is ideal for algorithmic strategies
Ideal For:
Trend-following strategies
Breakout trading
Algo trading systems
Reversal detection
Filtering market noise
Swing trading & scalping
Final Note
This is a safer, more reliable Supertrend designed for real-world use — not perfect-looking repaint illusions.
If you use Supertrend in your trading system, this no-repaint version ensures your signals are trustworthy and consistent.
Supertrend Scalper v1.0 (빌립's Trading)Supertrend Scalper V1.0 – 초대전용 스캘핑 인디케이터
이 스크립트는 Supertrend 추세를 기반으로, 지지/저항 되돌림 구간에서 단기 스캘핑 진입 타이밍만 직관적으로 보여주는 초대전용 인디케이터입니다.
Supertrend 방향이 유지되는 구간에서, 슈퍼트렌드 라인 근처 되돌림 발생 시에만 BUY / SELL 진입 신호를 생성합니다.
신호는 봉 마감(종가 확정) 기준으로만 확정되며, 과도한 실시간 깜빡임을 최소화했습니다.
한 번 진입 신호가 발생하면 해당 포지션의 TP / SL 가격이 터치될 때까지 추가 신호가 나오지 않으며, 항상 한 포지션만 운영하는 구조로 설계되어 있습니다.
진입 라벨 색상:
최초 BUY 진입: 초록색
최초 SELL 진입: 빨간색
TP 도달: 핑크색
SL 도달: 파란색
→ 색깔만 봐도 진입/청산 결과를 한눈에 확인할 수 있습니다.
기본적으로 3분 / 5분 / 15분 등의 단기 타임프레임에서 크립토 선물 스캘핑을 염두에 두고 설계되었지만, 시장/종목/타임프레임에 따라 사용자가 직접 테스트 후 활용하시길 권장합니다.
⚠ 면책사항
이 인디케이터는 교육 및 연구용 참고 도구일 뿐, 특정 매수/매도/투자를 직접적으로 권유하는 것이 아닙니다.
모든 매매 결정과 그에 따른 손익은 전적으로 사용자 본인의 책임입니다. 실제 사용 전 반드시 충분한 백테스트와 모의투자를 통해 전략 적합성을 검증하시기 바랍니다.
Supertrend Scalper is a short-term trend-following scalping indicator built on the Supertrend concept.
The script looks for pullbacks to the Supertrend line in the direction of the prevailing trend and prints clear BUY / SELL labels only after the bar is closed (close-confirmed signals to reduce repaint-like noise).
Once a signal appears and a position is considered open, the script tracks a fixed TP (%) and SL (%) from the entry price:
- Initial BUY label = green
- Initial SELL label = red
- When TP is hit, the label changes to pink
- When SL is hit, the label changes to blue
Only one position is active at a time. No new signals are generated until either TP or SL is reached, which helps to avoid over-trading in choppy zones.
Default settings are optimized for lower timeframes (e.g. 3m/5m/15m crypto futures scalping), but users should adjust parameters and backtest according to their own market, symbol and risk profile. This script is for educational and informational purposes only and is not financial advice.
Fast RSI with Divergence, Signal and Volume Spike1. This is fast RSI, with configurable left and right lookback bars
2. Signal on lower band crossover and upper band crossunder
3. Volume Spike indication with configurable average volume multiplier.
Hold targets when you see higher than average volume spike.
Fractals Trend [BigBeluga]🔵 OVERVIEW
Fractals Trend is a trend-following overlay that leverages fractal swing points to define dynamic support and resistance zones. By storing and averaging recent high and low fractals, it determines trend direction and plots a smooth band that flips depending on market bias—displaying support during uptrends and resistance during downtrends .
🔵 CONCEPTS
Fractal Swings: Fractals are identified using a customizable length. A high fractal forms when the current high is the highest in a range; a low fractal when the current low is the lowest.
Fractal Memory: The indicator keeps a rolling window of recent high and low fractals inside arrays, limited by the user-defined storage quantity.
switch
upperF => FracrtalsUpper.push(high )
lowerF => FracrtalsLower.push(low )
FracrtalsUpper.size() > fCount => FracrtalsUpper.shift()
FracrtalsLower.size() > fCount => FracrtalsLower.shift()
Trend Detection: Price crossing above the average, min/max or median high fractals signals an uptrend; crossing below average, min/max or median low fractals signals a downtrend.
Dynamic Band Plotting: Depending on the trend, the script plots the average of either the upper or lower fractals as a trailing support or resistance line.
Visual Confirmation: Fractal labels appear as triangle markers at highs and lows, providing additional structural context.
🔵 FEATURES
Automatically detects high and low fractals using customizable length.
Stores a defined number of fractals to smooth out noise and reduce false signals.
Flips trend bias dynamically with colored band and smooth transitions.
Plots fractal-based support in bullish trends, resistance in bearish trends.
Triangle markers show real-time fractal highs and lows.
Fully configurable visuals, color themes, and fractal detection logic.
Clean, non-intrusive overlay that works on any market or timeframe.
🔵 HOW TO USE
Use the colored band as a directional filter: green = uptrend (support), orange = downtrend (resistance).
Combine with entry signals or break/retest strategies when price approaches the band.
Use triangle markers to confirm structural swing points.
Adjust Fractals Length to tune sensitivity—shorter values detect quicker shifts, longer values reduce noise.
Change the fractal bands type to adapt trend detection to different market conditions.
Use in conjunction with momentum or volume tools for confluence.
🔵 CONCLUSION
Fractals Trend offers a lightweight, intuitive way to track market bias using price structure alone. Its smart switching logic and clean visuals make it a powerful tool for trend traders seeking structure-based dynamic S/R—without laggy moving averages or overcomplicated signals.
jhehli LiquidityWhat are BSL and SSL?
In the context of Smart Money Concepts, liquidity simply refers to pending orders—specifically Stop Losses and Buy/Sell Stop orders—resting above old highs and below old lows.
BSL (Buy-Side Liquidity): This is found above Swing Highs. Retail traders who are short the market will place their "Buy Stop" protective orders here. Additionally, breakout traders place "Buy Limit" orders here. Smart Money views this area as a pool of willing buyers. To fill large sell orders, institutions must drive price up into this liquidity to pair their massive sell interest with these buy stops.
SSL (Sell-Side Liquidity): This is found below Swing Lows. Retail traders who are long the market place their "Sell Stop" protective orders here. Smart Money targets these levels to accumulate long positions. They need the market to sell off into these levels so they can buy from the willing sellers at a discount.
How this Indicator Works
This tool automates the process of market structure analysis by identifying key Swing Highs and Swing Lows.
Detection: It scans price action to find fractal highs and lows (classic swing points) where price has rejected a level.
Visualization: It projects a line from these points, clearly marking where the "stops" are likely residing.
Liquidity Raids: When price pierces these levels, it is considered a "Liquidity Raid" or "Stop Hunt."
How to Use This in Your Trading
Do not treat these lines simply as Support and Resistance. In the ICT methodology, old highs and lows are targets, not barriers.
For Reversals: Wait for a "Turtle Soup" or "Judas Swing." This occurs when price aggressively expands into a BSL or SSL level to trigger stops, only to quickly reverse back into the trading range. This indicates that Smart Money has finished their accumulation or distribution.
For Bias: If the higher timeframe trend is Bullish, expect SSL to be raided to fuel the move, while BSL becomes the target (Draw on Liquidity).
By using this indicator, you remove the guesswork of manually marking every swing point, allowing you to focus on price action and the reaction at these critical liquidity pools.
Crypto Edition 0.1a trend following pullback strategy.. the strategy has to be optimized on current market regime.works great on lower timeframe ie 1m to 15m.
SMC Trend Reversal by Pooja🌟 SMC Trend Reversal by Pooja — CHoCH + BOS + RSI Confirmation
🔥 Smart Money Concepts • Trend Reversal Detection • Multi-Asset Optimized
The SMC Trend Reversal by Pooja is a powerful market-structure indicator designed for traders who follow Smart Money Concepts (SMC) and want to identify trend reversals, BOS, and CHoCH with high clarity.
It blends pivot-based structure breaks, RSI confirmation, and an optional session filter, giving traders a clean and reliable view of market shifts across Crypto, Forex, Indices, and Equity Derivatives.
✨ 🔰 Why SMC Matters in Crypto & Forex?
Both Crypto and Forex markets:
Trade 24/7 / 5 days with high volatility
React strongly to liquidity zones, market structure shifts, and smart money footprints
Often reverse sharply after liquidity grabs
Follow clean CHoCH → BOS → Trend progression sequences
This is why CHoCH (Change of Character) and BOS (Break of Structure) are crucial tools used by professional SMC traders to catch early trend reversals.
This indicator automates that process for you.
No clutter. No repaints. No noise.
Just pure SMC structure.
🚀 Key Features
🟣 CHoCH Detection (Change of Character)
Detects when the market shifts direction
A CHoCH appears when the trend flips from down → up or up → down
Highlights the earliest sign of a trend reversal
Draws a clean CHoCH line across structure
Works beautifully in volatile markets like Crypto & Forex
🔵 BOS Detection (Break of Structure)
Identifies structural continuation in the same direction
Helps confirm the new trend after CHoCH
Clear BOS lines to visualize progression of market flow
Ideal for trend-following and breakout traders
🧠 RSI-Based Confirmation (Optional)
To avoid fake CHoCH signals, the indicator uses RSI filtering:
RSI > Upper Level → Show “B” Buy Label
RSI < Lower Level → Show “S” Sell Label
This improves accuracy especially in:
Fast crypto markets (BTC, ETH, SOL etc.)
Liquidity-driven assets (Forex, Indices)
⏱️ Session Block (Asia/Kolkata Compatible)
Avoid signals in the first few minutes of market open or in volatile windows.
Block signals in a selected time range
Perfect for Indian market opening volatility (09:00–09:25)
🎯 Clean, Minimal, Easy-to-Read Visuals
✔ Horizontal structural lines
✔ Color-coded CHoCH and BOS
✔ Buy (B) / Sell (S) labels only when meaningful
✔ No unnecessary clutter
✔ Suitable for both beginners and advanced SMC traders
📢 Built-In Alerts
Receive notifications for:
🔔 Bullish CHoCH
🔔 Bearish CHoCH
🔔 Bullish BOS
🔔 Bearish BOS
Perfect for mobile, desktop, and webhook automation.
📈 How It Helps Your Trading
✔ Catch early trend reversals with confidence
✔ Avoid false signals with RSI filtering
✔ Trade like Smart Money (Institutional concepts)
✔ Works on all timeframes — scalping to swing
✔ Specially powerful on Crypto & Forex due to their structure-driven nature
✔ Cleaner charts → Better decisions → Higher probability trades
🧩 Who Should Use This Indicator?
✔ SMC / ICT style traders
✔ Breakout and trend-following traders
✔ Reversal traders
✔ Crypto & Forex scalpers
✔ Option buyers looking for early trend shifts
✔ Intraday NIFTY / BANKNIFTY traders
⚠️ Disclaimer
This indicator is for educational purposes and market analysis only.
It does not guarantee profits. Always practice risk management and test your settings before using it live.
Recursive WMA Angle StrategyDescription: This strategy utilizes a recursive Weighted Moving Average (WMA) calculation to determine the trend direction and strength based on the slope (angle) of the curve. By calculating the angle of the smoothed moving average in degrees, the script filters out noise and aims to enter trades only during strong momentum phases.
How it Works:
Recursive WMA: The script calculates a series of nested WMAs (M1 to M5), creating a very smooth yet responsive curve.
Angle Calculation: It measures the rate of change of this curve over a user-defined lookback period and converts it into an angle (in degrees).
Entry Condition (Long): A long position is opened when the calculated angle exceeds the Min Angle for BUY threshold (default: 0.2), indicating a strong upward trend.
Exit Condition: The position is closed when the angle drops below the Min Angle for SELL threshold (default: -0.2), indicating a sharp trend reversal.
Settings:
MA Settings: Adjust the base lengths for the recursive calculation.
Angle Settings: Fine-tune the sensitivity by changing the Buy/Sell angle thresholds.
Date Filter: Restrict the backtest to a specific date range.
Note: This strategy is designed for Long-Only setups.
First Light Beacon - ETHFirst Light Beacon -ETH — (Patent Pending)
The FLB indicator is a patent-pending institutional-grade zone engine designed to simplify complex market structure into clear, actionable visuals. This version is for electronic trading hours.
It automatically generates dynamic zones, trend bias, liquidity pulses, and contextual signals without exposing the proprietary First Light Beacon framework that powers the logic beneath the surface.
This tool is built for traders who want a structured, rules-based environment without clutter, and who value fast, reliable visual cues for decision-making.
What the Indicator Does
Dynamic FLB Zones
Generates time-based or session-based zones that adapt to market structure.
Visualizes the active range with Buy Line, Sell Line, and Mid Line options.
Optional dynamic zone fill paints the entire active zone using smooth gradients for instant clarity.
Prior zones are carried forward as End Caps, highlighting historically reactive areas.
Trend & Context Layers
The Beacon Line provides a smoothed, directional trend signal that flips green/red with real-time alerts.
Multiple candle coloring modes help interpret momentum, contraction, expansion, and trend shifts at a glance.
Volume Dots (Bookmap-Style Liquidity Signals)
Plots volume-weighted “liquidity dots” directly on the candles.
Dot size and color intensity scale with how unusual the volume is compared to recent data.
Helps identify absorption, exhaustion, liquidity grabs, and key turning points.
Optional Tools
Doji-based Higher Time Frame Zones
Squeeze Zone Bands
Contraction/Expansion Pattern Detection
Optional Buy/Sell FLB Signals (purely visual—NOT a TradingView strategy)
SETTINGS BREAKDOWN (User Guide)
Below is a simple, non-proprietary explanation of each settings group in the menu.
1. First Light Beacon Zones
The core of the indicator.
You choose how and when the zones regenerate, and what visual components you want displayed.
Sensitivity
Adjusts how tight or expansive the zone boundaries appear.
Lower = tighter, Higher = wider.
Trade Mode
Session: Uses predefined sessions (New York, London, Asia, etc.)
Time Based: Regenerates zones on any timeframe (15s, 1m, 5m, 1D, 1W, etc.)
Named Session Zones
Select which session you want to track when Trade Mode = Session.
Time-Based Zone Interval
Sets the interval that triggers zone resets when Trade Mode = Time Based.
Alert for New Zone
Sends an alert when a new time-based zone forms.
Interval Labels
Shows a label whenever a new zone begins.
Previous Zone Labels
Shows where prior zones started (useful for backtesting).
Buy Line / Sell Line / Mid Line
Toggles each line individually.
Dynamic Zone Fill
Shades the entire zone using gradient bands.
End Caps
Projects old zone boundaries forward to show where price may react in the future.
Rejection Mode
Stateful: Multi-bar logic for deeper confirmation
Close-Outside: One-bar wick/close behavior
2. Status Table
Displays the current zone or session in the chart corner of your choice.
Choose the corner (Top Right, Top Left, etc.)
Choose text size (Small/Normal)
3. Candle Color
Multiple candle-color presets compatible with the FLB ecosystem.
Option 1: Momentum ranges
Option 2: Trend-based smoothing
Option 3: Volatility/contraction logic
Users may customize colors for each mode.
4. Utility Tools
Optional supporting visuals.
Vertical Line at 30% of Zone
Marks early zone timing.
Doji Zones
Creates HTF support/resistance bands based on Doji structures.
Doji Time Frame
Select which timeframe the Doji zones come from.
Squeeze Zone
Short-term compression bands (EMA-based).
5. Beacon Line
Trend guide that flips color on directional bias change.
Alerts fire automatically when the Beacon flips.
6. Super Smoother
A clean smoothing line to help frame bias.
7. Contraction & Expansion
Identifies micro- and macro-patterns of tightening vs. expanding volatility.
Show minor/major patterns
Show breakout regions
Display liquidity lines
8. Volume Dots (Liquidity)
Bookmap-style volume intensity visualization.
Lookback and StDev settings
Dot colors and sizes
Option to show only extreme volume events
Optional text labels for extremes
9. FLB Signals
On/off Buy & Sell tags based on adaptive trailing logic combined with volume behavior.
Visual aid only—not for automation or backtesting.
RSI Driven ATR Trend [NeuraAlgo]
RSI Driven ATR Trend
Dynamic Trend Detection and Strength Analysis
Unlock the market’s hidden rhythm with the RSI Driven ATR Trend , a sophisticated tool designed to measure trend direction and strength using a combination of RSI momentum and ATR-based volatility . This indicator provides real-time insights into bullish and bearish phases, helping traders identify potential turning points and optimize entry and exit decisions.
1.Core In Logic:
Dynamically calculates trend levels based on RSI and ATR interactions.
Highlights trend direction with intuitive color coding: green for bullish, red for bearish.
Displays trend strength as a percentage to quantify momentum intensity.
Automatic visual cues for potential trend reversals with “Turn Up” and “Turn Down” labels.
Advanced smoothing and dynamic gating ensure responsive yet stable trend detection.
Compatible with all timeframes and instruments.
2.Inputs Explained:
Rsi Factor: Adjusts the sensitivity of the RSI in trend calculation. Higher values make the trend detection more responsive to momentum changes.
Multiplier: Multiplies the effect of Rsi Factor to fine-tune trend responsiveness.
Bar Back: Number of bars used for peak and dip calculations, determining how far back the indicator looks for trend changes.
Period: Lookback period used in trend gating and ATR calculations.
Source: Price source for calculations (default is close).
Main Colors: Customize bullish and bearish trend colors.
3.How it Works:
The indicator calculates RSI values and ATR-based dynamic ranges to determine upper and lower trend levels.
Trend direction is determined by price crossing above (bullish) or below (bearish) the dynamic trend line.
Trend strength is expressed as a percentage relative to the trend line, helping you assess momentum intensity.
Visual cues like "Turn Up" and "Turn Down" labels indicate potential trend reversals.
Bars are colored dynamically based on trend direction for quick interpretation.
Ideal for traders seeking a clear, actionable view of market trends without the clutter of multiple indicators. RSI Driven ATR Trend translates complex price behavior into an easy-to-read visual guide, helping you make smarter trading decisions.
Happy Trading!
LockedEye MTF CRT Map SentinelOverview
This script provides a structured multi-timeframe display of market conditions.
It summarizes key elements from M1 up to D1 using five components:
- CRT (Continuation/Reversal Trigger)
- MA6 micro-trend filter
- Candle-close direction
- MA250 macro trend filter
- Sentiment percentage computed from the above signals
The panel is designed to present information at a glance, allowing traders to understand how different timeframes align or disagree.
The purpose is not to merge random indicators. Each row uses a specific rule-based calculation that contributes to an integrated multi-timeframe read. The focus is on market structure, micro-trend, and directional pressure as expressed across several intervals.
How the Script Works
The script does not rely on external indicators. All calculations are performed internally through candle relationships, moving averages, MTF requests, and simple classification logic.
1. CRT Logic (Continuation and Reversal)
CRT identifies two types of behavior in each timeframe:
Continuation: The current candle closes outside the previous candle’s high or low.
Reversal after a sweep: Price takes the previous high or low but closes back inside the range.
A close outside the previous range suggests continuation.
A sweep followed by a close back inside suggests a shift in pressure or reversal .
The CRT row labels these conditions as Bull, Bear, or Wait.
2. MA6 Micro-Trend
The script uses a 6-period simple moving average to understand immediate trend pressure.
Close and open both above the MA6 = Bull
Close and open both below the MA6 = Bear
Mixed = Wait
This gives a quick view of short-term momentum without repainting.
3. Candle-Close Direction
This uses a simple comparison:
Close > Open = Bull
Close < Open = Bear
Equal = Neutral
It is a raw directional signal without interpretation.
4. MA250 Macro Filter
The script applies a 250-period MA to understand the broader trend.
Break above the MA250 = BR (BullRun)
Break below the MA250 = BC(BearCrash)
Inside range = Neutral
This acts as a long-term directional filter .
5. Sentiment Computation
The script aggregates CRT, MA6, and Candle-Close across all timeframes.
Each timeframe contributes a value.
The script then calculates the percentage of bull, bear, and neutral signals.
A short text summary explains whether signals are aligned or mixed.
How to Use the Panel
Multi-Timeframe Alignment
The panel is most useful when interpreting how lower and higher timeframes behave together:
When many timeframes show the same direction, it reflects stronger alignment.
When timeframes disagree, market conditions are more mixed or range-bound.
Users can watch for shifts when multiple rows turn from mixed to aligned.
Trend-Following Context
If higher timeframes (H2–D1) show consistent directional readings in CRT, MA6, and MA250, users may treat that as broader structural context.
Lower timeframes (M1–M15) can then be used to observe pullbacks or shifts within that larger trend.
Counter-Trend Context
If higher timeframes show one direction but lower timeframes show the opposite, this may indicate short-term reactions or pullbacks.
The script does not assume these reactions will continue; it only shows the multi-frame condition so users can decide how to interpret it.
Liquidity Sweep Context
CRT will classify moments when price takes a previous high or low and re-enters the range.
This is included so users can detect areas where the market moves beyond a level and immediately rejects it.
Alerts
The script includes alert conditions for:
CRT Bull or Bear flips on the chart’s timeframe
Multi-timeframe consensus reaching a user-defined threshold
Users can create alerts through the TradingView alert menu once the indicator is added to the chart.
Note:
The script includes a non-repaint mode for alert stability. This mode ensures only confirmed candle closes are used in calculations.
Chart Use
The script displays a fixed panel on the chart.
Users may select the panel’s position to avoid covering price action.
Users are advised to publish with a clean chart where only this script is active, unless pairing is required for explanation.
Toggles:
Close Candle(Non Repaint)
Monitor: BTCUSD along w RSI
Monitor 2: Any Coin
Flip M1-D1
Fast CRT
Final Notes
This script does not forecast future price movement and does not claim accuracy, profitability, or performance results.
It is a diagnostic tool that organizes real-time price behavior across multiple timeframes.
Users should apply their own judgment and risk management.
Volume Matrix Pro [ChartNation]Volume Matrix Pro is a comprehensive volume profile indicator that combines delta-colored volume distribution analysis with adaptive pivot detection and automated volume node identification. The indicator visualizes where institutional volume accumulated at specific price levels, providing traders with precise entry zones backed by actual trading data.
KEY FEATURES:
Delta-Colored Volume Profile: Displays volume distribution across price bins with automatic delta coloring - green bins show buyer dominance, red bins show seller control at each price level
High Volume Nodes (HVN) Detection: Automatically identifies and marks price levels with ≥80% of POC volume using yellow diamond markers - these act as magnetic support/resistance zones where institutions built positions
Low Volume Nodes (LVN) Detection: Marks thin volume areas with gray diamond markers - zones where price moves quickly with minimal friction, ideal for breakout targets
Adaptive Smart Pivots: ATR-based pivot detection that automatically adjusts length based on market volatility - catches more swings in low volatility, filters to major reversals in high volatility
Point of Control (POC) Line: Identifies the price level with maximum traded volume - the market's center of gravity. Line colors by delta: green when buyers dominated, red when sellers controlled the level
Value Area Lines: Dotted lines marking the 70% value area (configurable 50-98%) with delta-based coloring showing cumulative buyer/seller pressure within the range
Circle Pivot Markers: Clean visual markers at confirmed pivot points with translucent horizontal lines extending to current bar
Extend-Until-Touch: Pivot lines automatically retract when price touches them, keeping charts clean and showing active levels only
Dual Profile Modes: Left-side profile (default) or right-pinned bars ahead of price with fully customizable width and padding
Volume-Filtered Pivots: Only displays pivots with significant volume backing (≥20% of POC by default) - institutional turning points, not noise
HOW IT WORKS:
The indicator divides the lookback range (default 200 bars) into volume bins (default 50) and calculates total volume and delta (buying vs selling pressure) at each price level. Each bin is colored green if buyers dominated (close > open majority) or red if sellers controlled (close < open majority).
High Volume Nodes mark price levels where the most trading occurred - these become magnetic support/resistance zones. The Point of Control identifies the single price with maximum volume, acting as the market's gravitational center.
Smart Pivots use ATR to adapt to changing volatility, then filter against the volume profile. Only pivots with substantial volume backing are displayed, ensuring you see institutional turning points, not random noise.
RECOMMENDED SETTINGS:
Scalping (1-5 min): 100 lookback bars, 40 bins, 5-7 pivot length
Day Trading (15 min - 1 hour): 200 lookback bars, 50 bins, 10 pivot length (default)
Swing Trading (4 hour - Daily): 300-500 lookback bars, 60 bins, 15-20 pivot length
USAGE TIPS:
Enter long when price touches green HVN zones with adaptive pivot confirmation
Enter short when price reaches red HVN zones with pivot confirmation
Use POC as first target when entering below it, or as support backup when entering above
Watch for LVN zones as potential breakout acceleration areas
Combine green delta bins + HVN + pivot for highest-probability setups
WHAT MAKES THIS DIFFERENT:
Unlike traditional volume profiles, Volume Matrix Pro colors each bin individually by delta, giving granular insight into buyer/seller control at every price level. The adaptive pivot system adjusts automatically to volatility, while volume-filtering ensures only institutionally-backed turning points are displayed. High/Low Volume Node detection is fully automated with visual markers.
IMPORTANT NOTES:
This is a volume analysis tool - use with trend analysis and risk management
High Volume Nodes show where volume accumulated historically, not future support/resistance guarantees
Adaptive pivots adjust to volatility automatically but can still produce false signals in choppy markets
Best used as confirmation alongside price action, not as a standalone system
Profile recalculates on each bar to reflect current lookback range
NeuraEdge Block Trades v1.0NEURAEDGE BLOCK TRADES
═══════════════════════════════════════════════════════════════════════
We are excited to release Block Trades!
WHY THIS INDICATOR EXISTS?
Retail traders face a fundamental challenge: institutions move markets, but their activity is hidden. When smart money accumulates at support or distributes at resistance, retail traders often find themselves on the wrong side of the move.
Understanding where institutions are actively buying or selling is crucial for:
• Validating trade setups with volume confirmation
• Identifying supply and demand zones that actually hold
• Avoiding false breakouts driven by retail sentiment
• Spotting accumulation before major moves up
• Detecting distribution before major moves down
Most volume indicators simply show size without context. Block Trades was created to bridge this gap by detecting abnormally large volume bars and determining their directional bias, giving retail traders insight into institutional activity.
═══════════════════════════════════════════════════════════════════════
WHAT IT DOES:
Block Trades identifies volume spikes that likely represent institutional order flow and classifies them as buying pressure, selling pressure, or contested zones. The indicator then validates these prints against directional flow analysis and groups nearby prints into accumulation or distribution clusters.
This helps you answer critical questions:
• Is this support level being defended by institutions?
• Are smart money players distributing into this rally?
• Is heavy volume confirming my trade or warning against it?
• Where are institutional interest zones forming?
KEY FEATURES:
• Multi-tier volume detection (Large: 2x, Huge: 3x, Massive: 5x average)
• Directional classification with flow validation
• Accumulation/distribution zone detection
• Print clustering for institutional interest areas
• Confluence scoring system (0-10 points)
• Real-time statistics dashboard
• Clean, minimal chart labels
═══════════════════════════════════════════════════════════════════════
HOW IT WORKS:
VOLUME SPIKE DETECTION
The indicator monitors volume against a moving average baseline. When current volume significantly exceeds this average (default thresholds: 2x, 3x, 5x), it flags the bar as a potential institutional print.
DIRECTIONAL CLASSIFICATION
Buy Print: Large volume + closes in top 70% of range
Sell Print: Large volume + closes in bottom 70% of range
Neutral Print: Large volume + mid-range close (absorption/contested)
The close position within the bar's range reveals who won the battle. A bar with massive volume that closes near its high indicates aggressive buying. The same volume closing near the low indicates aggressive selling.
FLOW VALIDATION
Each print is validated against underlying institutional flow calculations. This filters out volume spikes that don't align with directional pressure, significantly reducing false signals. Buy prints require bullish flow, sell prints require bearish flow.
ACCUMULATION & DISTRIBUTION ZONES
When multiple prints occur at similar price levels with consistent direction:
• Repeated buy prints + bullish trend = Accumulation (institutions building positions)
• Repeated sell prints + bearish trend = Distribution (institutions unloading positions)
These zones often become powerful support/resistance levels because institutions have established significant positions there.
PRINT CLUSTERING
The indicator groups nearby prints (within configurable ATR distance) into clusters. When 3 or more prints form a cluster, it marks an institutional interest zone. These clusters frequently act as price magnets and reversal points.
PRINT CLUSTERING
The indicator groups nearby prints (within configurable ATR distance) into clusters. When 3 or more prints form a cluster, it marks an institutional interest zone. These clusters frequently act as price magnets and reversal points.
CONFLUENCE SCORING
Each print receives a confluence score (0-10 points) based on:
• Volume size (Massive: +3, Huge: +2, Large: +1)
• Flow alignment (+2 points, configurable)
• Trend alignment (+1)
• New high/low made (+1)
• Extreme close position (+1)
Prints with 5+ points receive a star marker, indicating ultra-high conviction setups.
═══════════════════════════════════════════════════════════════════════
HOW TRADERS USE IT:
USE CASE 1: TRADE VALIDATION
Your system signals a long entry at support. Check Block Trades:
• Buy prints present at this level? Institutions defending = Take the trade
• Sell prints present? Institutions distributing = Skip or wait
• No prints? Proceed with normal risk management
USE CASE 2: IDENTIFYING EXHAUSTION
Price rallies to resistance with heavy volume:
• Sell prints appear = Distribution, institutions unloading into strength
• Likely reversal coming, consider shorts or exit longs
• Confirmed by multiple sell prints = High conviction reversal setup
USE CASE 3: FINDING SUPPORT/RESISTANCE
Accumulation cluster forms at 450 level:
• Multiple buy prints over several sessions
• Institutions building positions at this price
• 450 becomes high-probability support for future pullbacks
• Use for entries or stop placement
USE CASE 4: BREAKOUT CONFIRMATION
Price breaks above key resistance:
• Buy print on breakout bar = Real institutional participation
• High confluence score (5+) = Ultra-high conviction
• Fake breakout would show sell prints or no prints
USE CASE 5: AVOIDING TRAPS
Price spikes up on huge volume:
• Sell print appears (closes low in range) = Trap
• Institutions selling into retail FOMO
• Avoid chasing, prepare for reversal
═══════════════════════════════════════════════════════════════════════
VISUAL ELEMENTS:
ON-CHART LABELS
Buy Print: Green label below bar showing size (LARGE/HUGE/MASSIVE)
Sell Print: Red label above bar showing size
Contested Print: Orange label at bar high (large volume, mid-range close)
Accumulation: Green "ACCUM" label with diamond symbol
Distribution: Red "DISTRIB" label with diamond symbol
WHAT CONTESTED MEANS:
When a bar has massive volume but closes in the middle of its range (neither top nor bottom 70%), it indicates a battle between buyers and sellers with no clear winner. This often occurs at:
• Major support/resistance levels where institutions are absorbing supply/demand
• Transition zones before a directional move
• Areas of genuine price discovery and uncertainty
Contested prints can signal absorption (institutions quietly building positions) or genuine indecision. Watch for follow-through on the next bar to determine which side won.
LABEL MODIFIERS
∆ checkmark = Flow validated (institutional flow aligns with print)
Star symbol = High confluence (5+ points, ultra-high conviction)
CLUSTER ZONES
Semi-transparent boxes marking areas where multiple prints occurred
Extend to the right to show ongoing institutional interest zones
Color-coded: green for bullish clusters, red for bearish clusters
DASHBOARD (TOP RIGHT)
• Current volume state and ratio
• Institutional flow direction
• Cumulative trend direction
• Recent print count (last 20 bars)
• Active cluster count
• Volume thresholds
STATISTICS (BOTTOM LEFT)
• Total session prints
• Buy/sell percentage split
═══════════════════════════════════════════════════════════════════════
SETTINGS:
PRINT DETECTION
• Volume Lookback Period: 20 bars (for average calculation)
• Large Print Threshold: 2.0x average
• Huge Print Threshold: 3.0x average
• Massive Print Threshold: 5.0x average
• Min Candle Size: 0.3x ATR (filters doji bars)
CLASSIFICATION
• Directional Threshold: 70% (how far in range to qualify as buy/sell)
• Show Neutral Prints: Toggle contested zones
• Require New High/Low: Optional stricter filter
INSTITUTIONAL FLOW
• Enable Flow Confluence: On/Off toggle
• Flow Confluence Weight: 2 points (adjustable 1-5)
CLUSTERING
• Enable Clustering: On/Off
• Cluster Distance: 1.0x ATR (how close prints must be)
• Min Prints for Cluster: 3 prints
• Show Cluster Zones: On/Off
DISPLAY
• Show Print Labels: Toggle all labels
• Show Accumulation/Distribution/Contested Labels: Toggle special labels
• Label Size: Tiny/Small/Normal
• Colors: Customizable buy/sell/neutral colors
FILTERS
• Minimum Volume: 0 (set threshold to ignore low volume bars)
• Session Filter: Avoid first/last 15 minutes (low liquidity)
═══════════════════════════════════════════════════════════════════════
BEST PRACTICES:
DO:
✓ Use as confluence with your primary trading system
✓ Pay attention to accumulation/distribution zones
✓ Look for high confluence prints (5+ stars)
✓ Validate breakouts with print direction
✓ Use cluster zones as future support/resistance
✓ Combine with higher timeframe analysis
✓ Works best on liquid instruments (major pairs, indices, large cap stocks)
DON'T:
✗ Trade prints as standalone buy/sell signals
✗ Ignore the directional classification (context matters)
✗ Use on low-volume instruments (prints less reliable)
✗ Chase every print without confluence confirmation
✗ Trade during low liquidity hours (first/last 15 min)
✗ Expect 100% accuracy (it's a confluence tool, not crystal ball)
OPTIMAL TIMEFRAMES:
• 5-minute to 1-hour charts for intraday trading
• 1-hour to 4-hour charts for swing trading
• Daily charts for position trading
BEST INSTRUMENTS:
• Major forex pairs (EUR/USD, GBP/USD, etc.)
• Index futures (ES, NQ, YM)
• High-volume stocks (SPY, QQQ, TSLA, AAPL, etc.)
• Major cryptocurrencies (BTC, ETH)
═══════════════════════════════════════════════════════════════════════
IMPORTANT DISCLAIMERS
METHODOLOGY DISCLAIMER
This indicator identifies abnormally large volume bars and estimates their directional bias based on price action and flow analysis. It does NOT have access to:
• Actual dark pool transaction data
• Off-exchange Alternative Trading System (ATS) prints
• Level 2 order book data
• Individual trade sizes or timestamps
• Institutional order identification
The prints detected are estimates based on publicly available volume and price data from TradingView. They indicate probable institutional activity patterns but are not confirmed block trades or dark pool executions.
USAGE DISCLAIMER
Block Trades is designed as a CONFLUENCE tool to validate trade setups - not as a standalone trading system. The indicator does not:
• Generate specific entry/exit signals
• Provide stop loss or take profit levels
• Constitute a complete trading strategy
• Guarantee profitable trades
Prints should be interpreted within the context of:
• Your overall trading strategy
• Market structure and trend
• Support/resistance levels
• Risk management rules
• Multiple timeframe analysis
RISK DISCLAIMER
Trading involves substantial risk of loss and is not suitable for every investor. Past performance is not indicative of future results. This indicator is a tool for technical analysis only and does NOT constitute financial advice, investment advice, trading advice, or a recommendation to buy or sell any securities or financial instruments.
You should not make any investment decision without conducting your own research and due diligence. The accuracy, completeness, and timeliness of the information provided by this indicator is not guaranteed. No representation is being made that using this indicator will guarantee profits or prevent losses.
By using this indicator, you acknowledge that you understand and accept all risks associated with trading, and you agree that the developer is not liable for any losses you may incur.
═══════════════════════════════════════════════════════════════════════
ALERTS
Available alert conditions:
• Massive Buy Print
• Massive Sell Print
• Huge Buy Print
• Huge Sell Print
• Accumulation Detected
• Distribution Detected
• High Confluence Buy (5+ points)
• High Confluence Sell (5+ points)
Happy Trading!
Classic Dual Momentum – 12-Month Absolute Momentum - AntonacciThis indicator calculates the 12-month absolute momentum exactly as described in Gary Antonacci’s Dual Momentum framework.
It automatically adjusts the lookback period based on the chart’s timeframe:
Daily chart: 252 bars
Weekly chart: 52 bars
Monthly chart: 12 bars
Other timeframes: Estimated automatically using bar time difference
The script computes the 12-month rate of return and displays it as a color-coded column plot:
Green: Positive 12-month momentum
Red: Negative 12-month momentum
A customizable moving average is included to help visualize longer-term trends in the momentum signal.
How It’s Used (from Dual Momentum theory)
This indicator provides the absolute momentum filter used in classic Dual Momentum strategies:
If the 12-month return of an asset is above the risk-free return → trend is positive
If it is below the risk-free return → trend is negative
This absolute momentum check is a key component of the Global Equities Momentum (GEM) model presented in Gary Antonacci’s book Dual Momentum Investing.
Why This Indicator Exists
It gives traders a clean, accurate way to visualize the 12-month trend strength across any timeframe, without the distortions caused by bar length differences.
Scaling_mastery:Free TrendlinesScaling_mastery Trendlines is a clean, trading-ready smart trendline tool built for the Scaling_mastery community.
It automatically finds swing highs/lows and draws dynamic trendlines or channels that stay locked to price, on any symbol and any timeframe.
🔧 Modes
Trendline type
Wicks – classic trendlines anchored on candle wicks (high/low).
Bodies – trendlines anchored on candle bodies (open/close), great for closing structure.
Channel – 3-line channel:
outer lines form a band around price
middle line runs through the centre of the channel
thickness is adjustable (Small / Medium / Large).
Trend strength
Controls how strong the pivots must be to form a line.
Weak → more lines, reacts faster.
Medium → balanced, good for most pairs.
Strong → only the cleanest swings, higher-probability trendlines.
🎨 Visual controls
Max support / resistance lines – cap how many lines are kept on chart.
Show broken lines – hide broken trendlines or keep them for structure history.
Extend lines – None / Right / Both.
Support / Resistance colors – separate colors for active vs broken.
Channel thickness – Small / Medium / Large (0.5% / 1% / 2% of price).
Channel outer lines – color for channel edges.
Channel middle line – color + style (dotted / dashed / solid).
Broken lines are automatically faded + dotted, so you can instantly see what’s still respected and what’s already been taken out.
🧠 How to use
Add the indicator to any chart.
Start with:
Trendline type: Wicks
Trend strength: Strong
Max lines: 1–2 for both support & resistance
Once you like the behavior, experiment with:
Switching between Wicks / Bodies / Channel
Adjusting Channel thickness and Trend strength
Use the lines as a visual confluence tool with your own strategy:
HTF trend direction
LTF entries / retests
Liquidity grabs around broken lines
This script doesn’t generate entries or risk management – it’s designed to give you clean, reliable structure so you can execute your own edge.
⚠️ Disclaimer
This tool is for educational and visual purposes only and is not financial advice.
Always do your own research and manage risk.
Reversal Candlestick Setups (Doji, Outside, Extreme, Wick)Reversal Candlestick Setups – Doji, Outside, Extreme & Wick
This indicator identifies four high-probability reversal candlestick patterns across all timeframes: Doji Reversals, Outside Reversals, Extreme Reversals, and Wick Reversals. Each setup is based on clearly defined quantitative rules, allowing traders to filter noise and focus on strong reversal signals instead of relying on subjective visual interpretation.
The tool automatically scans every candle, highlights qualifying patterns on the chart, and provides alert options for both bullish and bearish versions of all four setups. This makes it suitable for intraday traders, swing traders, and positional traders seeking early reversal confirmation.
Included Setups
1. Doji Reversal Setup
Identifies candles with extremely small bodies relative to their range, combined with a smaller-than-average bar size. Useful for spotting market indecision before a directional shift.
2. Outside Reversal Setup
Flags candles that engulf the previous candle’s high–low range and exceed the average range by a multiplier. This is designed to capture strong momentum reversals driven by aggressive buying or selling.
3. Extreme Reversal Setup
Highlights large-bodied candles that dominate their overall range and exceed twice the average bar size. These signals aim to catch climactic exhaustion and institutional-level reversals.
4. Wick Reversal Setup
Detects candles with long rejection wicks, small bodies, and closes near an extreme of the range, supported by above-average bar size. Ideal for identifying sharp intrabar rejections.
Key Features
• Automatically detects all four reversal setups
• Works on all timeframes and symbols
• Customizable variables for deeper testing and optimization
• Clear bullish and bearish labels directly on the chart
• Fully integrated alert conditions for real-time notifications
• Suitable for crypto, stocks, indices, forex, and commodities
Who This Indicator Is For
• Traders who want objective, rule-based reversal detection
• Price action traders looking to enhance accuracy
• Systematic traders wanting quantifiable candlestick criteria
• Beginners learning reversal structures with visual guidance
• Professionals integrating reversal patterns into algorithmic or discretionary systems
How to Use
Add the indicator to your chart and enable alerts for the specific setups you want to track (e.g., “Bullish Wick Reversal”). Combine these signals with market structure, trend filters, volume analysis, or momentum indicators for increased conviction.
STARKPROFITS SCALPER 2.0señales compra y venta..tendencia y estructura del mercado.se basa en tendencia
Lorentzian Harmonic Flow - Adaptive ML⚡ LORENTZIAN HARMONIC FLOW — ADAPTIVE ML COMPLETE SYSTEM
THEORETICAL FOUNDATION: TEMPORAL RELATIVITY MEETS MACHINE LEARNING
The Lorentzian Harmonic Flow Adaptive ML system represents a paradigm shift in technical analysis by addressing a fundamental limitation that plagues traditional indicators: they assume time flows uniformly across all market conditions. In reality, markets experience time compression during volatile breakouts and time dilation during consolidation. A 50-period moving average calculated during a quiet overnight session captures vastly different market information than the same calculation during a high-volume news event.
This indicator solves this problem through Lorentzian spacetime modeling , borrowed directly from Einstein's special relativity. By calculating a dynamic gamma factor (γ) that measures market velocity relative to a volatility-based "speed of light," every calculation adapts its effective lookback period to the market's intrinsic clock. Combined with a dual-memory architecture, multi-regime detection, and Bayesian strategy selection, this creates a system that genuinely learns which approaches work in which market conditions.
CRITICAL DISTINCTION: TRUE ADAPTIVE LEARNING VS STATIC CLASSIFICATION
Before diving into the system architecture, it's essential to understand how this indicator fundamentally differs from traditional "Lorentzian" implementations, particularly the well-known Lorentzian Classification indicator.
THE ORIGINAL LORENTZIAN CLASSIFICATION APPROACH:
The pioneering Lorentzian Classification indicator (Jdehorty, 2022) introduced the financial community to Lorentzian distance metrics for pattern matching. However, it used offline training methodology :
• External Training: Required Python scripts or external ML tools to train the model on historical data
• Static Model: Once trained, the model parameters remained fixed
• No Real-Time Learning: The indicator classified patterns but didn't learn from outcomes
• Look-Ahead Bias Risk: Offline training could inadvertently use future data
• Manual Retraining: To adapt to new market conditions, users had to retrain externally and reload parameters
This was groundbreaking for bringing ML concepts to Pine Script, but it wasn't truly adaptive. The model was a snapshot—trained once, deployed, static.
THIS SYSTEM: TRUE ONLINE LEARNING
The Lorentzian Harmonic Flow Adaptive ML system represents a complete architectural departure :
✅ FULLY SELF-CONTAINED:
• Zero External Dependencies: No Python scripts, no external training tools, no data exports
• 100% Pine Script: Entire learning pipeline executes within TradingView
• One-Click Deployment: Load indicator, it begins learning immediately
• No Manual Configuration: System builds its own training data in real-time
✅ GENUINE FORWARD-WALK LEARNING:
• Real-Time Adaptation: Every trade outcome updates the model
• Forward-Only Logic: System uses only past confirmed data—zero look-ahead bias
• Continuous Evolution: Parameters adapt bar-by-bar based on rolling performance
• Regime-Specific Memory: Learns which patterns work in which conditions independently
✅ GETS BETTER WITH TIME:
• Week 1: Bootstrap mode—gathering initial data across regimes
• Month 2-3: Statistical significance emerges, parameter adaptation begins
• Month 4+: Mature learning, regime-specific optimization, confident selection
• Year 2+: Deep pattern library, proven parameter sets, robust to regime shifts
✅ NO RETRAINING REQUIRED:
• Automatic Adaptation: When market structure changes, system detects via performance degradation
• Memory Refresh: Old patterns naturally decay, new patterns replace them
• Parameter Evolution: Thresholds and multipliers adjust to current conditions
• Regime Awareness: If new regime emerges, enters bootstrap mode automatically
THE FUNDAMENTAL DIFFERENCE:
Traditional Lorentzian Classification:
"Here are patterns from the past. Current state matches pattern X, which historically preceded move Y. Signal fired."
→ Static knowledge, fixed rules, periodic retraining required
LHF Adaptive ML:
"In Trending Bull regime, Strategy B has 58% win rate and 1.4 Sharpe over last 30 trades. In High Vol Range, Strategy C performs better with 61% win rate and 1.8 Sharpe. Current state is Trending Bull, so I select Strategy B. If Strategy B starts failing, I'll adapt parameters or switch strategies. I'm learning which patterns matter in which contexts, and I improve every trade."
→ Dynamic learning, contextual adaptation, self-improving system
WHY THIS MATTERS:
Markets are non-stationary. A model trained on 2023 data may fail in 2024 when Fed policy shifts, volatility regime changes, or market structure evolves. Static models require constant human intervention—retraining, re-optimization, parameter updates.
This system learns continuously . It doesn't need you to tell it when markets changed. It discovers regime shifts through performance feedback, adapts parameters accordingly, and rebuilds its pattern library organically. The system running in Month 12 is fundamentally smarter than the system in Month 1—not because you retrained it, but because it learned from 1,000+ real outcomes.
This is the difference between pattern recognition (static ML) and reinforcement learning (adaptive ML). One classifies, the other learns and improves.
PART 1: LORENTZIAN TEMPORAL DYNAMICS
Markets don't experience time uniformly. During explosive volatility, price can compress weeks of movement into minutes. During consolidation, time dilates. Traditional indicators ignore this, using fixed periods regardless of market state.
The Lorentzian approach models market time using the Lorentz factor from special relativity:
γ = 1 / √(1 - v²/c²)
Where:
• v (velocity): Trend momentum normalized by ATR, calculated as (close - close ) / (N × ATR)
• c (speed limit): Realized volatility + volatility bursts, multiplied by c_multiplier parameter
• γ (gamma): Time dilation factor that compresses or expands effective lookback periods
When trend velocity approaches the volatility "speed limit," gamma spikes above 1.0, compressing time. Every calculation length becomes: base_period / γ. This creates shorter, more responsive periods during explosive moves and longer, more stable periods during quiet consolidation.
The system raises gamma to an optional power (gamma_power parameter) for fine control over compression strength, then applies this temporal scaling to every calculation in the indicator. This isn't metaphor—it's quantitative adaptation to the market's intrinsic clock.
PART 2: LORENTZIAN KERNEL SMOOTHING
Traditional moving averages use uniform weights (SMA) or exponential decay (EMA). The Lorentzian kernel uses heavy-tailed weighting:
K(distance, γ) = 1 / (1 + (distance/γ)²)
This Cauchy-like distribution gives more influence to recent extremes than Gaussian assumptions suggest, capturing the fat-tailed nature of financial returns. For any calculation requiring smoothing, the system loops through historical bars, computes Lorentzian kernel weights based on temporal distance and current gamma, then produces weighted averages.
This creates adaptive smoothing that responds to local volatility structure rather than imposing rigid assumptions about price distribution.
PART 3: HARMONIC FLOW (Multi-Timeframe Momentum)
The core directional signal comes from Harmonic Flow (HFL) , which blends three gamma-compressed Lorentzian smooths:
• Short Horizon: base_period × short_ratio / γ (default: 34 × 0.5 / γ ≈ 17 bars, faster with high γ)
• Mid Horizon: base_period × mid_ratio / γ (default: 34 × 1.0 / γ ≈ 34 bars, anchor timeframe)
• Long Horizon: base_period × long_ratio / γ (default: 34 × 2.5 / γ ≈ 85 bars, structural trend)
Each produces a Lorentzian-weighted smooth, converted to a z-score (distance from smooth normalized by ATR). These z-scores are then weighted-averaged:
HFL = (w_short × z_short + w_mid × z_mid + w_long × z_long) / (w_short + w_mid + w_long)
Default weights (0.45, 0.35, 0.20) favor recent momentum while respecting longer structure. Scalpers can increase short weight; swing traders can emphasize long weight. The result is a directional momentum indicator that captures multi-timeframe flow in compressed time.
From HFL, the system derives:
• Flow Velocity: HFL - HFL (momentum acceleration)
• Flow Acceleration: Second derivative (turning points)
• Temporal Compression Index (TCI): base_period / compressed_length (shows how much time is compressed)
PART 4: DUAL MEMORY ARCHITECTURE
Markets have memory—current conditions resonate with past regimes. But memory operates on two timescales, inspiring this indicator's dual-memory design:
SHORT-TERM MEMORY (STM):
• Capacity: 100 patterns (configurable 50-200)
• Decay Rate: 0.980 (50% weight after ~35 bars)
• Update Frequency: Every 10 bars
• Purpose: Capture current regime's tactical patterns
• Storage: Recent market states with 10-bar forward outcomes
• Analogy: Hippocampus (rapid encoding, fast fade)
LONG-TERM MEMORY (LTM):
• Capacity: 512 patterns (configurable 256-1024)
• Decay Rate: 0.997 (50% weight after ~230 bars)
• Quality Gate: Only high-quality patterns admitted (adaptive threshold per regime)
• Purpose: Strategic pattern library validated across regimes
• Storage: Validated patterns from weeks/months of history
• Analogy: Neocortex (slow consolidation, persistent storage)
Each memory stores 6-dimensional feature vectors:
1. HFL (harmonic flow strength)
2. Flow Velocity (momentum)
3. Flow Acceleration (turning points)
4. Volatility (realized vol EMA)
5. Entropy (market uncertainty)
6. Gamma (time compression state)
Plus the actual outcome (10-bar forward return).
K-NEAREST NEIGHBORS (KNN) PATTERN MATCHING:
When evaluating current market state, the system queries both memories using Lorentzian distance :
distance = Σ (1 - K(|feature_current - feature_memory|, γ))
This calculates similarity across all 6 dimensions using the same Lorentzian kernel, weighted by current gamma. The system finds K nearest neighbors (default: 8), weights each by:
• Similarity: Lorentzian kernel distance
• Age: Exponential decay based on bars since pattern
• Regime: Only patterns from similar regimes count
The weighted average of these neighbors' outcomes becomes the prediction. High-confidence predictions require both high similarity and agreement between multiple neighbors.
REGIME-AWARE BLENDING:
STM and LTM predictions are blended adaptively:
• High Vol Range regime: Trust STM 70% (recent matters in chaos)
• Trending regimes: Trust LTM 70% (structure matters in trends)
• Normal regimes: 50/50 blend
Agreement metric: When STM and LTM strongly disagree, the system flags low confidence—often indicating regime transition or novel market conditions requiring caution.
PART 5: FIVE-REGIME MARKET CLASSIFICATION
Traditional regime detection stops at "trending vs ranging." This system detects five distinct market states using linear regression slope and volatility analysis:
REGIME 0: TRENDING BULL ↗
• Detection: LR slope > trend_threshold (default: 0.3)
• Characteristics: Sustained positive HFL, elevated gamma, low entropy
• Best Strategy: B (Flow Momentum)
• Trading Behavior: Follow momentum, trail stops, pyramid winners
REGIME 1: TRENDING BEAR ↘
• Detection: LR slope < -trend_threshold
• Characteristics: Sustained negative HFL, elevated gamma, low entropy
• Best Strategy: B (Flow Momentum)
• Trading Behavior: Follow momentum short, aggressive exits on reversal
REGIME 2: HIGH VOL RANGE ↔
• Detection: |slope| < threshold AND vol_ratio > vol_expansion_threshold (default: 1.5)
• Characteristics: Oscillating HFL, high gamma spikes, high entropy
• Best Strategies: A (Squeeze Breakout) or C (Memory Pattern)
• Trading Behavior: Fade extremes, tight stops, quick profits
REGIME 3: LOW VOL RANGE —
• Detection: |slope| < threshold AND vol_ratio < vol_expansion_threshold
• Characteristics: Low HFL magnitude, gamma ≈ 1, squeeze conditions
• Best Strategy: A (Squeeze Breakout)
• Trading Behavior: Wait for breakout, wide stops on breakout entry
REGIME 4: TRANSITION ⚡
• Detection: Trend reversal OR volatility spike > 1.5× threshold
• Characteristics: Erratic gamma, high entropy, conflicting signals
• Best Strategy: None (often unfavorable)
• Trading Behavior: Stand aside, wait for clarity
Each regime gets a confidence score (0-1) measuring how clearly defined it is. Low confidence indicates messy, ambiguous conditions.
PART 6: THREE INDEPENDENT TRADING STRATEGIES
Rather than one signal logic, the system implements three distinct approaches:
STRATEGY A: SQUEEZE BREAKOUT
• Logic: Bollinger Bands squeeze release + HFL direction + flow velocity confirmation
• Calculation: Compares BB width to Keltner Channel width; fires when BB expands beyond KC
• Strength Score: 70 + compression_strength × 0.3 (tighter squeeze = higher score)
• Best Regimes: Low Vol Range (3), Transition exit (4→0 or 4→1)
• Pattern: Volatility contraction → directional expansion
• Philosophy: Calm before the storm; compression precedes explosion
STRATEGY B: LORENTZIAN FLOW MOMENTUM
• Logic: Strong HFL (×flow_mult) + positive velocity + gamma > 1.1 + NOT squeezing
• Calculation: |HFL × flow_mult| > 0.12, velocity confirms direction, gamma shows acceleration
• Strength Score: |HFL × flow_mult| × 80 + gamma × 10
• Best Regimes: Trending Bull (0), Trending Bear (1)
• Pattern: Established momentum → acceleration in compressed time
• Philosophy: Trend is friend when spacetime curves
STRATEGY C: MEMORY PATTERN MATCHING
• Logic: Dual KNN prediction > threshold + high confidence + agreement + HFL confirms
• Calculation: |memory_pred| > 0.005, memory_conf > 1.0, agreement > 0.5, HFL direction matches
• Strength Score: |prediction| × 800 × agreement
• Best Regimes: High Vol Range (2), sometimes others with sufficient pattern library
• Pattern: Historical similarity → outcome resonance
• Philosophy: Markets rhyme; learn from validated patterns
Each strategy generates independent strength scores. In multi-strategy mode (enabled by default), the system selects one strategy per regime based on risk-adjusted performance. In weighted mode (multi-strategy disabled), all three fire simultaneously with configurable weights.
PART 7: ADAPTIVE LEARNING & BAYESIAN SELECTION
This is where machine learning meets trading. The system maintains 15 independent performance matrices :
3 strategies × 5 regimes = 15 tracking systems
For each combination, it tracks:
• Trade Count: Number of completed trades
• Win Count: Profitable outcomes
• Total Return: Sum of percentage returns
• Squared Returns: For variance/Sharpe calculation
• Equity Curve: Virtual P&L assuming 10% risk per trade
• Peak Equity: All-time high for drawdown calculation
• Max Drawdown: Peak-to-trough decline
RISK-ADJUSTED SCORING:
For current regime, the system scores each strategy:
Sharpe Ratio: (mean_return / std_dev) × √252
Calmar Ratio: total_return / max_drawdown
Win Rate: wins / trades
Combined Score = 0.6 × Sharpe + 0.3 × Calmar + 0.1 × Win_Rate
The strategy with highest score is selected. This is similar to Thompson Sampling (multi-armed bandits) but uses deterministic selection rather than probabilistic sampling due to Pine Script limitations.
BOOTSTRAP MODE (Critical for Understanding):
For the first min_regime_samples trades (default: 10) in each regime:
• Status: "🔥 BOOTSTRAP (X/10)" displayed in dashboard
• Behavior: All signals allowed (gathering data)
• Regime Filter: Disabled (can't judge with insufficient data)
• Purpose: Avoid cold-start problem, build statistical foundation
After reaching threshold:
• Status: "✅ FAVORABLE" (score > 0.5) or "⚠️ UNFAVORABLE" (score ≤ 0.5)
• Behavior: Only trade favorable regimes (if enable_regime_filter = true)
• Learning: Parameters adapt based on outcomes
This solves a critical problem: you can't know which strategy works in a regime without data, but you can't get data without trading. Bootstrap mode gathers initial data safely, then switches to selective mode once statistical confidence emerges.
PARAMETER ADAPTATION (Per Regime):
Three parameters adapt independently for each regime based on outcomes:
1. SIGNAL QUALITY THRESHOLD (30-90):
• Starts: base_quality_threshold (default: 60)
• Adaptation:
Win Rate < 45% → RAISE threshold by learning_rate × 10 (be pickier)
Win Rate > 55% → LOWER threshold by learning_rate × 5 (take more)
• Effect: System becomes more selective in losing regimes, more aggressive in winning regimes
2. LTM QUALITY GATE (0.2-0.8):
• Starts: 0.4 (if adaptive gate enabled)
• Adaptation:
Sharpe < 0.5 → RAISE gate by learning_rate (demand better patterns)
Sharpe > 1.5 → LOWER gate by learning_rate × 0.5 (accept more patterns)
• Effect: LTM fills with high-quality patterns from winning regimes
3. FLOW MULTIPLIER (0.5-2.0):
• Starts: 1.0
• Adaptation:
Strong win (+2%+) → MULTIPLY by (1 + learning_rate × 0.1)
Strong loss (-2%+) → MULTIPLY by (1 - learning_rate × 0.1)
• Effect: Amplifies signal strength in profitable regimes, dampens in unprofitable
Each regime evolves independently. Trending Bull might develop threshold=55, gate=0.35, mult=1.3 while High Vol Range develops threshold=70, gate=0.50, mult=0.9.
PART 8: SHADOW PORTFOLIO VALIDATION
To validate learning objectively, the system runs three virtual portfolios :
Shadow Portfolio A: Trades only Strategy A signals
Shadow Portfolio B: Trades only Strategy B signals
Shadow Portfolio C: Trades only Strategy C signals
When any signal fires:
1. Open virtual position for corresponding strategy
2. On exit, calculate P&L (10% risk per trade)
3. Update equity, win count, profit factor
Dashboard displays:
• Equity: Current virtual balance (starts $10,000)
• Win%: Overall win rate across all regimes
• PF: Profit Factor (gross_profit / gross_loss)
This transparency shows which strategies actually perform, validates the selection logic, and prevents overfitting. If Shadow C shows $12,500 equity while A and B show $9,800, it confirms Strategy C's edge.
PART 9: HISTORICAL PRE-TRAINING
The system includes historical pre-training to avoid cold-start:
On Chart Load (if enabled):
1. Scan past pretrain_bars (default: 200)
2. Calculate historical HFL, gamma, velocity, acceleration, volatility, entropy
3. Compute 10-bar forward returns as outcomes
4. Populate STM with recent patterns
5. Populate LTM with high-quality patterns (quality > 0.4)
Effect:
• Without pre-training: Memories empty, no predictions for weeks, pure bootstrap
• With pre-training: System starts with pattern library, predictions from day one
Pre-training uses only past data (no future peeking) and fills memories with validated outcomes. This dramatically accelerates learning without compromising integrity.
PART 10: COMPREHENSIVE INPUT SYSTEM
The indicator provides 50+ inputs organized into logical groups. Here are the key parameters and their market-specific guidance:
🧠 ADAPTIVE LEARNING SYSTEM:
Enable Adaptive Learning (true/false):
• Function: Master switch for regime-specific strategy selection and parameter adaptation
• Enabled: System learns which strategies work in which regimes (recommended)
• Disabled: All strategies fire simultaneously with fixed weights (simpler, less adaptive)
• Recommendation: Keep enabled for all markets; system needs 2-3 months to mature
Learning Rate (0.01-0.20):
• Function: Speed of parameter adaptation based on outcomes
• Stocks/ETFs: 0.03-0.05 (slower, more stable)
• Crypto: 0.05-0.08 (faster, adapts to volatility)
• Forex: 0.04-0.06 (moderate)
• Timeframes:
1-5min scalping: 0.08-0.10 (rapid adaptation)
15min-1H day trading: 0.05-0.07 (balanced)
4H-Daily swing: 0.03-0.05 (conservative)
• Tradeoff: Higher = responsive but may overfit; Lower = stable but slower to adapt
Min Samples Per Regime (5-30):
• Function: Trades required before exiting bootstrap mode
• Active trading (>5 signals/day): 8-10 trades
• Moderate (1-5 signals/day): 10-15 trades
• Swing (few signals/week): 5-8 trades
• Logic: Bootstrap mode until this threshold; then uses Sharpe/Calmar for regime filtering
• Tradeoff: Lower = faster exit (risky, less data); Higher = more validation (safer, slower)
🌍 REGIME DETECTION:
Regime Lookback Period (20-200):
• Function: Bars used for linear regression to classify regime
• By Timeframe:
1-5min: 30-50 bars (~2-4 hour context)
15min: 40-60 bars (daily context)
1H: 50-100 bars (weekly context)
4H: 100-150 bars (monthly context)
Daily: 50-75 bars (quarterly context)
• By Market:
Crypto: 40-60 (faster regime changes)
Forex: 50-75 (moderate stability)
Stocks: 60-100 (slower structural trends)
• Tradeoff: Shorter = more regime switches (reactive); Longer = fewer switches (stable)
Trend Strength Threshold (0.1-0.8):
• Function: Minimum normalized LR slope to classify as trending vs ranging
• Lower (0.1-0.2): More markets classified as trending
• Higher (0.4-0.6): Only strong trends qualify
• Recommendations:
Choppy markets (BTC, small caps): 0.25-0.35
Smooth trends (major FX pairs): 0.30-0.40
Strong trends (indices during bull): 0.20-0.30
• Effect: Controls sensitivity of trending vs ranging classification
Vol Expansion Factor (1.2-3.0):
• Function: Volatility ratio to classify high-vol regimes (current_vol / avg_vol)
• By Asset:
Bitcoin: 1.4-1.6 (frequent vol spikes)
Altcoins: 1.3-1.5 (very volatile)
Major FX (EUR/USD): 1.6-2.0 (stable baseline)
Stocks (SPY): 1.5-1.8 (moderate)
Penny stocks: 1.3-1.4 (always volatile)
• Impact: Higher = fewer "High Vol Range" classifications; Lower = more sensitive to volatility spikes
🎯 SIGNAL GENERATION:
Base Quality Threshold (30-90):
• Function: Starting signal strength requirement (adapts per regime)
• THIS IS YOUR MAIN SIGNAL FREQUENCY CONTROL
• Conservative (70-80): Fewer, higher-quality signals
• Balanced (55-65): Moderate signal flow
• Aggressive (40-50): More signals, more noise
• By Trading Style:
Scalping (1-5min): 50-60
Day trading (15min-1H): 60-70
Swing (4H-Daily): 65-75
• Adaptive Behavior: System raises this in losing regimes (pickier), lowers in winning regimes (take more)
Min Confidence (0.1-0.9):
• Function: Minimum confidence score to fire signal
• Calculation: (Signal_Strength / 100) × Regime_Confidence
• Recommendations:
High-frequency (scalping): 0.2-0.3 (permissive)
Day trading: 0.3-0.4 (balanced)
Swing/position: 0.4-0.6 (selective)
• Interaction: During Transition regime (low regime confidence), even strong signals may fail confidence check; creates natural regime filtering
Only Trade Favorable Regimes (true/false):
• Function: Block signals in unfavorable regimes (where all strategies have negative risk-adjusted scores)
• Enabled (Recommended): Only trades when best strategy has positive Sharpe in current regime; auto-disables during bootstrap; protects capital
• Disabled: Always allows signals regardless of historical performance; use for manual regime assessment
• Bootstrap: Auto-allows trading until min_regime_samples reached, then switches to performance-based filtering
Min Bars Between Signals (1-20):
• Function: Prevents signal spam by enforcing minimum spacing
• By Timeframe:
1min: 3-5 bars (3-5 minutes)
5min: 3-6 bars (15-30 minutes)
15min: 4-8 bars (1-2 hours)
1H: 5-10 bars (5-10 hours)
4H: 3-6 bars (12-24 hours)
Daily: 2-5 bars (2-5 days)
• Logic: After signal fires, no new signals for X bars
• Tradeoff: Lower = more reactive (may overtrade); Higher = more patient (may miss reversals)
🌀 LORENTZIAN CORE:
Base Period (10-100):
• Function: Core time period for flow calculation (gets compressed by gamma)
• THIS IS YOUR PRIMARY TIMEFRAME KNOB
• By Timeframe:
1-5min scalping: 20-30 (fast response)
15min-1H day: 30-40 (balanced)
4H swing: 40-55 (smooth)
Daily position: 50-75 (very smooth)
• By Market Character:
Choppy (crypto, small caps): 25-35 (faster)
Smooth (major FX, indices): 35-50 (moderate)
Slow (bonds, utilities): 45-65 (slower)
• Gamma Effect: Actual length = base_period / gamma; High gamma compresses to ~20 bars, low gamma expands to ~50 bars
• Default 34 (Fibonacci) works well across most assets
Velocity Period (5-50):
• Function: Window for trend velocity calculation: (price_now - price ) / (N × ATR)
• By Timeframe:
1-5min scalping: 8-12 (fast momentum)
15min-1H day: 12-18 (balanced)
4H swing: 14-21 (smooth trend)
Daily: 18-30 (structural trend)
• By Market:
Crypto (fast moves): 10-14
Stocks (moderate): 14-20
Forex (smooth): 18-25
• Impact: Feeds into gamma calculation (v/c ratio); shorter = more sensitive to velocity spikes → higher gamma
• Relationship: Typically vel_period ≈ base_period / 2 to 2/3
Speed-of-Market (c) (0.5-3.0):
• Function: "Speed limit" for gamma calculation: c = realized_vol + vol_burst × c_multiplier
• By Asset Volatility:
High vol (BTC, TSLA): 1.0-1.3 (lower c = more compression)
Medium vol (SPY, EUR/USD): 1.3-1.6 (balanced)
Low vol (bonds, utilities): 1.6-2.5 (higher c = less compression)
• What It Does:
Lower c → velocity hits "speed limit" sooner → higher gamma → more compression
Higher c → velocity rarely hits limit → gamma stays near 1 → less adaptation
• Effect on Signals: More compression (low c) = faster regime detection, more responsive; Less compression (high c) = smoother, less adaptive
• Tuning: Start at 1.4; if gamma always ~1.0, lower to 1.0-1.2; if gamma spikes >5 often, raise to 1.6-2.0
Gamma Power (0.5-2.0):
• Function: Exponent applied to gamma: final_gamma = gamma^power
• Compression Strength:
0.5-0.8: Softens compression (gamma 4 → 2)
1.0: Linear (gamma 4 → 4)
1.2-2.0: Amplifies compression (gamma 4 → 16)
• Use Cases:
Reduce power (<1.0) if adaptive lengths swing too wildly or getting whipsawed
Increase power (>1.0) for more aggressive regime adaptation in fast markets
• Most users should leave at 1.0; only adjust if gamma behavior needs tuning
Max Kernel Lookback (20-200):
• Function: Computational limit for Lorentzian smoothing (performance control)
• Recommendations:
Fast PC / simple chart: 80-100
Slow PC / complex chart: 40-60
Mobile / lots of indicators: 30-50
• Impact: Each kernel smoothing loops through this many bars; higher = more accurate but slower
• Default 60 balances accuracy and speed; lower to 40-50 if indicator is slow
🎼 HARMONIC FLOW:
Short Horizon (0.2-1.0):
• Function: Fast timeframe multiplier: short_length = base_period × short_ratio / gamma
• Default: 0.5 (captures 2× faster flow than base)
• By Style:
Scalping: 0.3-0.4 (very fast)
Day trading: 0.4-0.6 (moderate)
Swing: 0.5-0.7 (balanced)
• Effect: Lower = more weight on micro-moves; Higher = smooths out fast fluctuations
Mid Horizon (0.5-2.0):
• Function: Medium timeframe multiplier: mid_length = base_period × mid_ratio / gamma
• Default: 1.0 (equals base_period, anchor timeframe)
• Usually keep at 1.0 unless specific strategy needs fine-tuning
Long Horizon (1.0-5.0):
• Function: Slow timeframe multiplier: long_length = base_period × long_ratio / gamma
• Default: 2.5 (captures trend/structure)
• By Style:
Scalping: 1.5-2.0 (less long-term influence)
Day trading: 2.0-3.0 (balanced)
Swing: 2.5-4.0 (strong trend component)
• Effect: Higher = more emphasis on larger structure; Lower = more reactive to recent price action
Short Weight (0-1):
Mid Weight (0-1):
Long Weight (0-1):
• Function: Relative importance in HFL calculation (should sum to 1.0)
• Defaults: Short: 0.45, Mid: 0.35, Long: 0.20 (day trading balanced)
• Preset Configurations:
SCALPING (fast response):
Short: 0.60, Mid: 0.30, Long: 0.10
DAY TRADING (balanced):
Short: 0.45, Mid: 0.35, Long: 0.20
SWING (trend-following):
Short: 0.25, Mid: 0.35, Long: 0.40
• Effect: More short weight = responsive but noisier; More long weight = smoother but laggier
🧠 DUAL MEMORY SYSTEM:
Enable Pattern Memory (true/false):
• Function: Master switch for KNN pattern matching via dual memory
• Enabled (Recommended): Strategy C (Memory Pattern) can fire; memory predictions influence all strategies; prediction arcs shown; heatmaps available
• Disabled: Only Strategy A and B available; faster performance (less computation); pure technical analysis (no pattern matching)
• Keep enabled for full system capabilities; disable only if CPU-constrained or testing pure flow signals
STM Size (50-200):
• Function: Short-Term Memory capacity (recent pattern storage)
• Characteristics: Fast decay (0.980), captures current regime, updates every 10 bars, tactical pattern matching
• Sizing:
Active markets (crypto): 80-120
Moderate (stocks): 100-150
Slow (bonds): 50-100
• By Timeframe:
1-15min: 60-100 (captures few hours of patterns)
1H: 80-120 (captures days)
4H-Daily: 100-150 (captures weeks/months)
• Tradeoff: More = better recent pattern coverage; Less = faster computation
• Default 100 is solid for most use cases
LTM Size (256-1024):
• Function: Long-Term Memory capacity (validated pattern storage)
• Characteristics: Slow decay (0.997), only high-quality patterns (gated), regime-specific recall, strategic pattern library
• Sizing:
Fast PC: 512-768
Medium PC: 384-512
Slow PC/Mobile: 256-384
• By Data Needs:
High-frequency (lots of patterns): 512-1024
Moderate activity: 384-512
Low-frequency (swing): 256-384
• Performance Impact: Each KNN search loops through entire LTM; 512 = good balance of coverage and speed; if slow, drop to 256-384
• Fills over weeks/months with validated patterns
STM Decay (0.95-0.995):
• Function: Short-Term Memory age decay rate: age_weight = decay^bars_since_pattern
• Decay Rates:
0.950: Aggressive fade (50% weight after 14 bars)
0.970: Moderate fade (50% after 23 bars)
0.980: Balanced (50% after 35 bars)
0.990: Slow fade (50% after 69 bars)
• By Timeframe:
1-5min: 0.95-0.97 (fast markets, old patterns irrelevant)
15min-1H: 0.97-0.98 (balanced)
4H-Daily: 0.98-0.99 (slower decay)
• Philosophy: STM should emphasize RECENT patterns; lower decay = only very recent matters; 0.980 works well for most cases
LTM Decay (0.99-0.999):
• Function: Long-Term Memory age decay rate
• Decay Rates:
0.990: 50% weight after 69 bars
0.995: 50% weight after 138 bars
0.997: 50% weight after 231 bars
0.999: 50% weight after 693 bars
• Philosophy: LTM should retain value for LONG periods; pattern from 6 months ago might still matter
• Usage:
Fast-changing markets: 0.990-0.995
Stable markets: 0.995-0.998
Structural patterns: 0.998-0.999
• Warning: Be careful with very high decay (>0.998); market structure changes, old patterns may mislead
• 0.997 balances long-term memory with regime evolution
K Neighbors (3-21):
• Function: Number of similar patterns to query in KNN search
• By Sample Size:
Small dataset (<100 patterns): 3-5
Medium dataset (100-300): 5-8
Large dataset (300-1000): 8-13
Very large (>1000): 13-21
• Tradeoff:
Fewer K (3-5): More reactive to closest matches; noisier; outlier-sensitive; better when patterns very distinct
More K (13-21): Smoother, more stable predictions; may dilute strong signals; better when patterns overlap
• Rule of Thumb: K ≈ √(memory_size) / 3; For STM=100, LTM=512: K ≈ 8-10 ideal
Adaptive Quality Gate (true/false):
• Function: Adapts LTM entry threshold per regime based on Sharpe ratio
• Enabled: Quality gate adapts: Low Sharpe → RAISE gate (demand better patterns); High Sharpe → LOWER gate (accept more patterns); each regime has independent gate
• Disabled: Fixed quality gate (0.4 default) for all regimes
• Recommended: Keep ENABLED; helps LTM focus on proven pattern types per regime; prevents weak patterns from polluting memory
🎯 MULTI-STRATEGY SYSTEM:
Enable Strategy Learning (true/false):
• Function: Core learning feature for regime-specific strategy selection
• Enabled: Tracks 3 strategies × 5 regimes = 15 performance matrices; selects best strategy per regime via Sharpe/Calmar/WinRate; adaptive strategy switching
• Disabled: All strategies fire simultaneously (weighted combination); no regime-specific selection; simpler but less adaptive
• Recommended: ENABLED (this is the core of the adaptive system); disable only for testing or simplification
Strategy A Weight (0-1):
• Function: Weight for Strategy A (Squeeze Breakout) when multi-strategy disabled
• Characteristics: Fires on Bollinger squeeze release; best in Low Vol Range, Transition; compression → expansion pattern
• When Multi-Strategy OFF: Default 0.33 (equal weight); increase to 0.4-0.5 for choppy ranges with breakouts; decrease to 0.2-0.3 for trending markets
• When Multi-Strategy ON: This is ignored (system auto-selects based on performance)
Strategy B Weight (0-1):
• Function: Weight for Strategy B (Lorentzian Flow) when multi-strategy disabled
• Characteristics: Fires on strong HFL + velocity + gamma; best in Trending Bull/Bear; momentum → acceleration pattern
• When Multi-Strategy OFF: Default 0.33; increase to 0.4-0.5 for trending markets; decrease to 0.2-0.3 for choppy/ranging markets
• When Multi-Strategy ON: Ignored (auto-selected)
Strategy C Weight (0-1):
• Function: Weight for Strategy C (Memory Pattern) when multi-strategy disabled
• Characteristics: Fires when dual KNN predicts strong move; best in High Vol Range; requires memory system enabled + sufficient data
• When Multi-Strategy OFF: Default 0.34; increase to 0.4-0.6 if strong pattern repetition and LTM has >200 patterns; decrease to 0.2-0.3 if new to system; set to 0.0 if memory disabled
• When Multi-Strategy ON: Ignored (auto-selected)
📚 PRE-TRAINING:
Historical Pre-Training (true/false):
• Function: Bootstrap feature that fills memory on chart load
• Enabled: Scans past bars to populate STM/LTM before live trading; calculates historical outcomes (10-bar forward returns); builds initial pattern library; system starts with context, not blank slate
• Disabled: Memories only populate in real-time; takes weeks to build pattern library
• Recommended: ENABLED (critical for avoiding "cold start" problem); disable only for testing clean learning
Training Bars (50-500):
• Function: How many historical bars to scan on load (limited by available history)
• Recommendations:
1-5min charts: 200-300 (few hours of history)
15min-1H: 200-400 (days/weeks)
4H: 300-500 (months)
Daily: 200-400 (years)
• Performance:
100 bars: ~1 second
300 bars: ~2-3 seconds
500 bars: ~4-5 seconds
• Sweet Spot: 200-300 (enough patterns without slow load)
• If chart loads slowly: Reduce to 100-150
🎨 VISUALIZATION:
Show Regime Background (true/false):
• Function: Color-code background by current regime
• Colors: Trending Bull (green tint), Trending Bear (red tint), High Vol Range (orange tint), Low Vol Range (blue tint), Transition (purple tint)
• Helps visually track regime changes
Show Flow Bands (true/false):
• Function: Plot upper/lower bands based on HFL strength
• Shows dynamic support/resistance zones; green fill = bullish flow; red fill = bearish flow
• Useful for visual trend confirmation
Show Confidence Meter (true/false):
• Function: Plot signal confidence (0-100) in separate pane
• Calculation: (Signal_Strength / 100) × Regime_Confidence
• Gold line = current confidence; dashed line = minimum threshold
• Signals fire when confidence exceeds threshold
Show Prediction Arc (true/false):
• Function: Dashed line projecting expected price move based on memory prediction
• NOT a price target - a probability vector; steep arc = strong expected move; flat arc = weak/uncertain prediction
• Green = bullish prediction; red = bearish prediction
Show Signals (true/false):
• Function: Triangle markers at entry points
• ▲ Green = Long signal; ▼ Red = Short signal
• Markers show on bar close (non-repainting)
🏆 DASHBOARD:
Show Dashboard (true/false):
• Function: Main info panel showing all system metrics
• Sections: Lorentzian Core, Regime, Dual Memory, Adaptive Parameters, Regime Performance, Shadow Portfolios, Current Signal Status
• Essential for understanding system state
Dashboard Position: Top Left, Top Right, Bottom Left, Bottom Right
Individual Section Toggles:
• System Stats: Lorentzian Core section (Gamma, v/c, HFL, TCI)
• Memory Stats: Dual Memory section (STM/LTM predictions, agreement)
• Shadow Portfolios: Shadow Portfolio table (equity, win%, PF)
• Adaptive Params: Adaptive Parameters section (threshold, quality gate, flow mult)
🔥 HEATMAPS:
Show Dual Heatmaps (true/false):
• Function: Visual pattern density maps for STM and LTM
• Layout: X-axis = pattern age (left=recent, right=old); Y-axis = outcome direction (top=bearish, bottom=bullish); Color intensity = pattern count; Color hue = bullish (green) vs bearish (red)
• Warning: Can clutter chart; disable if not using
Heatmap Position: Screen position for heatmaps (STM at selected position, LTM offset)
Resolution (5-15):
• Function: Grid resolution (bins)
• Higher = more detailed but smaller cells; Lower = clearer but less granular
• 10 is good balance; reduce to 6-8 if hard to read
PART 11: DASHBOARD METRICS EXPLAINED
The comprehensive dashboard provides real-time transparency into every aspect of the adaptive system:
⚡ LORENTZIAN CORE SECTION:
Gamma (γ):
• Range: 1.0 to ~10.0 (capped)
• Interpretation:
γ ≈ 1.0-1.2: Normal market time, low velocity
γ = 1.5-2.5: Moderate compression, trending
γ = 3.0-5.0: High compression, explosive moves
γ > 5.0: Extreme compression, parabolic volatility
• Usage: High gamma = system operating in compressed time; expect shorter effective periods and faster adaptation
v/c (Velocity / Speed Limit):
• Range: 0.0 to 0.999 (approaches but never reaches 1.0)
• Interpretation:
v/c < 0.3: Slow market, low momentum
v/c = 0.4-0.7: Moderate trending
v/c > 0.7: Approaching "speed limit," high velocity
v/c > 0.9: Parabolic move, system at limit
• Color Coding: Red (>0.7), Gold (0.4-0.7), Green (<0.4)
• Usage: High v/c warns of extreme conditions where trend may exhaust
HFL (Harmonic Flow):
• Range: Typically -3.0 to +3.0 (can exceed in extremes)
• Interpretation:
HFL > 0: Bullish flow
HFL < 0: Bearish flow
|HFL| > 0.5: Strong directional bias
|HFL| < 0.2: Weak, indecisive
• Color: Green (positive), Red (negative)
• Usage: Primary directional indicator; strategies often require HFL confirmation
TCI (Temporal Compression Index):
• Calculation: base_period / compressed_length
• Interpretation:
TCI ≈ 1.0: No compression, normal time
TCI = 1.5-2.5: Moderate compression
TCI > 3.0: Significant compression
• Usage: Shows how much time is being compressed; mirrors gamma but more intuitive
╔═══ REGIME SECTION ═══╗
Current:
• Display: Regime name with icon (Trending Bull ↗, Trending Bear ↘, High Vol Range ↔, Low Vol Range —, Transition ⚡)
• Color: Gold for visibility
• Usage: Know which regime you're in; check regime performance to see expected strategy behavior
Confidence:
• Range: 0-100%
• Interpretation:
>70%: Very clear regime definition
40-70%: Moderate clarity
<40%: Ambiguous, mixed conditions
• Color: Green (>70%), Gold (40-70%), Red (<40%)
• Usage: High confidence = trust regime classification; low confidence = regime may be transitioning
Mode:
• States:
🔥 BOOTSTRAP (X/10): Still gathering data for this regime
✅ FAVORABLE: Best strategy has positive risk-adjusted score (>0.5)
⚠️ UNFAVORABLE: All strategies have negative scores (≤0.5)
• Color: Orange (bootstrap), Green (favorable), Red (unfavorable)
• Critical Importance: This tells you whether the system will trade or stand aside (if regime filter enabled)
╔═══ DUAL MEMORY KNN SECTION ═══╗
STM (Size):
• Display: Number of patterns currently in STM (0 to stm_size)
• Interpretation: Should fill to capacity within hours/days; if not filling, check that memory is enabled
STM Pred:
• Range: Typically -0.05 to +0.05 (representing -5% to +5% expected 10-bar move)
• Color: Green (positive), Red (negative)
• Usage: STM's prediction based on recent patterns; emphasis on current regime
LTM (Size):
• Display: Number of patterns in LTM (0 to ltm_size)
• Interpretation: Fills slowly (weeks/months); only validated high-quality patterns; check quality gate if not filling
LTM Pred:
• Range: Similar to STM pred
• Color: Green (positive), Red (negative)
• Usage: LTM's prediction based on long-term validated patterns; more strategic than tactical
Agreement:
• Display:
✅ XX%: Strong agreement (>70%) - both memories aligned
⚠️ XX%: Moderate agreement (40-70%) - some disagreement
❌ XX%: Conflict (<40%) - memories strongly disagree
• Color: Green (>70%), Gold (40-70%), Red (<40%)
• Critical Usage: Low agreement often precedes regime change or signals novel conditions; Strategy C won't fire with low agreement
╔═══ ADAPTIVE PARAMS SECTION ═══╗
Threshold:
• Display: Current regime's signal quality threshold (30-90)
• Interpretation: Higher = pickier; lower = more permissive
• Watch For: If steadily rising in a regime, system is struggling (low win rate); if falling, system is confident
• Default: Starts at base_quality_threshold (usually 60)
Quality:
• Display: Current regime's LTM quality gate (0.2-0.8)
• Interpretation: Minimum quality score for pattern to enter LTM
• Watch For: If rising, system demanding higher-quality patterns; if falling, accepting more diverse patterns
• Default: Starts at 0.4
Flow Mult:
• Display: Current regime's flow multiplier (0.5-2.0)
• Interpretation: Amplifies or dampens HFL for Strategy B
• Watch For: If >1.2, system found strong edge in flow signals; if <0.8, flow signals underperforming
• Default: Starts at 1.0
Learning:
• Display: ✅ ON or ❌ OFF
• Shows whether adaptive learning is enabled
• Color: Green (on), Red (off)
╔═══ REGIME PERFORMANCE SECTION ═══╗
This table shows ONLY the current regime's statistics:
S (Strategy):
• Display: A, B, or C
• Color: Gold if selected strategy; gray if not
• Shows which strategies have data in this regime
Trades:
• Display: Number of completed trades for this pair
• Interpretation: Blank or low numbers mean bootstrap mode; >10 means statistical significance building
Win%:
• Display: Win rate percentage
• Color: Green (>55%), White (45-55%), Red (<45%)
• Interpretation: 52%+ is good; 58%+ is excellent; <45% means struggling
• Note: Short-term variance is normal; judge after 20+ trades
Sharpe:
• Display: Annualized Sharpe ratio
• Color: Green (>1.0), White (0-1.0), Red (<0)
• Interpretation:
>2.0: Exceptional (rare)
1.0-2.0: Good
0.5-1.0: Acceptable
0-0.5: Marginal
<0: Losing
• Usage: Primary metric for strategy selection (60% weight in score)
╔═══ SHADOW PORTFOLIOS SECTION ═══╗
Shows virtual equity tracking across ALL regimes (not just current):
S (Strategy):
• Display: A, B, or C
• Color: Gold if currently selected strategy; gray otherwise
Equity:
• Display: Current virtual balance (starts $10,000)
• Color: Green (>$10,000), White ($9,500-$10,000), Red (<$9,500)
• Interpretation: Which strategy is actually making virtual money across all conditions
• Note: 10% risk per trade assumed
Win%:
• Display: Overall win rate across all regimes
• Color: Green (>55%), White (45-55%), Red (<45%)
• Interpretation: Aggregate performance; strategy may do well in some regimes and poorly in others
PF (Profit Factor):
• Display: Gross profit / gross loss
• Color: Green (>1.5), White (1.0-1.5), Red (<1.0)
• Interpretation:
>2.0: Excellent
1.5-2.0: Good
1.2-1.5: Acceptable
1.0-1.2: Marginal
<1.0: Losing
• Usage: Confirms win rate; high PF with moderate win rate means winners >> losers
╔═══ STATUS BAR ═══╗
Display States:
• 🟢 LONG: Currently in long position (green background)
• 🔴 SHORT: Currently in short position (red background)
• ⬆️ LONG SIGNAL: Long signal present but not yet confirmed (waiting for bar close)
• ⬇️ SHORT SIGNAL: Short signal present but not yet confirmed
• ⚪ NEUTRAL: No position, no signal (white background)
Usage: Immediate visual confirmation of system state; check before manually entering/exiting
PART 12: VISUAL ELEMENT INTERPRETATION
REGIME BACKGROUND COLORS:
Green Tint: Trending Bull regime - expect Strategy B (Flow) to dominate; focus on long momentum
Red Tint: Trending Bear regime - expect Strategy B (Flow) shorts; focus on short momentum
Orange Tint: High Vol Range - expect Strategy A (Squeeze) or C (Memory); trade breakouts or patterns
Blue Tint: Low Vol Range - expect Strategy A (Squeeze); wait for compression release
Purple Tint: Transition regime - often unfavorable; system may stand aside; high uncertainty
Usage: Quick visual regime identification without reading dashboard
FLOW BANDS:
Upper Band: close + HFL × ATR × 1.5
Lower Band: close - HFL × ATR × 1.5
Green Fill: HFL positive (bullish flow); bands act as dynamic support/resistance in uptrend
Red Fill: HFL negative (bearish flow); bands act as dynamic resistance/support in downtrend
Usage:
• Bullish flow: Price bouncing off lower band = trend continuation; breaking below = possible reversal
• Bearish flow: Price rejecting upper band = trend continuation; breaking above = possible reversal
CONFIDENCE METER (Separate Pane):
Gold Line: Current signal confidence (0-100)
Dashed Line: Minimum confidence threshold
Interpretation:
• Line above threshold: Signal likely to fire if strength sufficient
• Line below threshold: Even if signal logic met, won't fire (insufficient confidence)
• Gradual rise: Signal building strength
• Sharp spike: Sudden conviction (check if sustainable)
Usage: Real-time signal probability; helps anticipate upcoming entries
PREDICTION ARC:
Dashed Line: Projects from current close to expected price 8 bars forward
Green Arc: Bullish memory prediction
Red Arc: Bearish memory prediction
Steep Arc: High conviction (strong expected move)
Flat Arc: Low conviction (weak/uncertain move)
Important: NOT a price target; this is a probability vector based on KNN outcomes; actual price may differ
Usage: Directional bias from pattern matching; confirms or contradicts flow signals
SIGNAL MARKERS:
▲ Green Triangle (below bar):
• Long signal confirmed on bar close
• Entry on next bar open
• Non-repainting (appears after bar closes)
▼ Red Triangle (above bar):
• Short signal confirmed on bar close
• Entry on next bar open
• Non-repainting
Size: Tiny (unobtrusive)
Text: "L" or "S" in marker
Usage: Historical signal record; alerts should fire on these; verify against dashboard status
DUAL HEATMAPS (If Enabled):
STM HEATMAP:
• X-axis: Pattern age (left = recent, right = older, typically 0-50 bars)
• Y-axis: Outcome direction (top = bearish outcomes, bottom = bullish outcomes)
• Color Intensity: Brightness = pattern count in that cell
• Color Hue: Green tint (bullish), Red tint (bearish), Gray (neutral)
Interpretation:
• Dense bottom-left: Many recent bullish patterns (bullish regime)
• Dense top-left: Many recent bearish patterns (bearish regime)
• Scattered: Mixed outcomes, ranging regime
• Empty areas: Few patterns (low data)
LTM HEATMAP:
• Similar layout but X-axis spans wider age range (0-500+ bars)
• Shows long-term pattern distribution
• Denser = more validated patterns
Comparison Usage:
• If STM and LTM heatmaps look similar: Current regime matches historical patterns (high agreement)
• If STM bottom-heavy but LTM top-heavy: Recent bullish activity contradicts historical bearish patterns (low agreement, transition signal)
PART 13: DEVELOPMENT STORY
The creation of the Lorentzian Harmonic Flow Adaptive ML system represents over six months of intensive research, mathematical exploration, and iterative refinement. What began as a theoretical investigation into applying special relativity to market time evolved into a complete adaptive learning framework.
THE CHALLENGE:
The fundamental problem was this: markets don't experience time uniformly, yet every indicator treats a 50-period calculation the same whether markets are exploding or sleeping. Traditional adaptive indicators adjust parameters based on volatility, but this is reactive—by the time you measure high volatility, the explosive move is over. What was needed was a framework that measured the market's intrinsic velocity relative to its own structural limits, then compressed time itself proportionally.
THE LORENTZIAN INSIGHT:
Einstein's special relativity provides exactly this framework through the Lorentz factor. When an object approaches the speed of light, time dilates—but from the object's reference frame, it experiences time compression. By treating price velocity as analogous to relativistic velocity and volatility structure as the "speed limit," we could calculate a gamma factor that compressed lookback periods during explosive moves.
The mathematics were straightforward in theory but devilishly complex in implementation. Pine Script has no native support for dynamically-sized arrays or recursive functions, forcing creative workarounds. The Lorentzian kernel smoothing required nested loops through historical bars, calculating kernel weights on the fly—a computational nightmare. Early versions crashed or produced bizarre artifacts (negative gamma values, infinite loops during volatility spikes).
Optimization took weeks. Limiting kernel lookback to 60 bars while still maintaining smoothing quality. Pre-calculating gamma once per bar and reusing it across all calculations. Caching intermediate results. The final implementation balances mathematical purity with computational reality.
THE MEMORY ARCHITECTURE:
With temporal compression working, the next challenge was pattern memory. Simple moving average systems have no memory—they forget yesterday's patterns immediately. But markets are non-stationary; what worked last month may not work today. The solution: dual-memory architecture inspired by cognitive neuroscience.
Short-Term Memory (STM) would capture tactical patterns—the hippocampus of the system. Fast encoding, fast decay, always current. Long-Term Memory (LTM) would store validated strategic patterns—the neocortex. Slow consolidation, persistent storage, regime-spanning wisdom.
The KNN implementation nearly broke me. Calculating Lorentzian distance across 6 dimensions for 500+ patterns per query, applying age decay, filtering by regime, finding K nearest neighbors without native sorting functions—all while maintaining sub-second execution. The breakthrough came from realizing we could use destructive sorting (marking found neighbors as "infinite distance") rather than maintaining separate data structures.
Pre-training was another beast. To populate memory with historical patterns, the system needed to scan hundreds of past bars, calculate forward outcomes, and insert patterns—all on chart load without timing out. The solution: cap at 200 bars, optimize loops, pre-calculate features. Now it works seamlessly.
THE REGIME DETECTION:
Five-regime classification emerged from empirical observation. Traditional trending/ranging dichotomy missed too much nuance. Markets have at least four distinct states: trending up, trending down, volatile range, quiet range—plus a chaotic transition state. Linear regression slope quantifies trend; volatility ratio quantifies expansion; combining them creates five natural clusters.
But classification is useless without regime-specific learning. That meant tracking 15 separate performance matrices (3 strategies × 5 regimes), computing Sharpe ratios and Calmar ratios for sparse data, implementing Bayesian-like strategy selection. The bootstrap mode logic alone took dozens of iterations—too strict and you never get data, too permissive and you blow up accounts during learning.
THE ADAPTIVE LAYER:
Parameter adaptation was conceptually elegant but practically treacherous. Each regime needed independent thresholds, quality gates, and multipliers that adapted based on outcomes. But naive gradient descent caused oscillations—win a few trades, lower threshold, take worse signals, lose trades, raise threshold, miss good signals. The solution: exponential smoothing via learning rate (α) and separate scoring for selection vs adaptation.
Shadow portfolios provided objective validation. By running virtual accounts for all strategies simultaneously, we could see which would have won even when not selected. This caught numerous bugs where selection logic was sound but execution was flawed, or vice versa.
THE DASHBOARD & VISUALIZATION:
A learning system is useless if users can't understand what it's doing. The dashboard went through five complete redesigns. Early versions were information dumps—too much data, no hierarchy, impossible to scan. The final version uses visual hierarchy (section headers, color coding, strategic whitespace) and progressive disclosure (show current regime first, then performance, then parameters).
The dual heatmaps were a late addition but proved invaluable for pattern visualization. Seeing STM cluster in one corner while LTM distributed broadly immediately signals regime novelty. Traders grasp this visually faster than reading disagreement percentages.
THE TESTING GAUNTLET:
Testing adaptive systems is uniquely challenging. Static backtest results mean nothing—the system should improve over time. Early "tests" showed abysmal performance because bootstrap periods were included. The breakthrough: measure pre-learning baseline vs post-learning performance. A system going from 48% win rate (first 50 trades) to 56% win rate (trades 100-200) is succeeding even if absolute performance seems modest.
Edge cases broke everything repeatedly. What happens when a regime never appears in historical data? When all strategies fail simultaneously? When memory fills with only bearish patterns during a bull run? Each required careful handling—bootstrap modes, forced diversification, quality gates.
THE DOCUMENTATION:
This isn't an indicator you throw on a chart with default settings and trade immediately. It's a learning system that requires understanding. The input tooltips alone contain over 10,000 words of guidance—market-specific recommendations, timeframe-specific settings, tradeoff explanations. Every parameter needed not just a description but a philosophical justification and practical tuning guide.
The code comments span 500+ lines explaining theory, implementation decisions, edge cases. Future maintainers (including myself in six months) need to understand not just what the code does but why certain approaches were chosen over alternatives.
WHAT ALMOST DIDN'T WORK:
The entire project nearly collapsed twice. First, when initial Lorentzian smoothing produced complete noise—hours of debugging revealed a simple indexing error where I was accessing instead of in the kernel loop. One character, entire system broken.
Second, when memory predictions showed zero correlation with outcomes. Turned out the KNN distance metric was dominated by the gamma dimension (values 1-10) drowning out normalized features (values -1 to 1). Solution: apply kernel transformation to all dimensions, not just final distance. Obvious in retrospect, maddening at the time.
THE PHILOSOPHY:
This system embodies a specific philosophy: markets are learnable but non-stationary. No single strategy works forever, but regime-specific patterns persist. Time isn't uniform, memory isn't perfect, prediction isn't possible—but probabilistic edges exist for those willing to track them rigorously.
It rejects the premise that indicators should give universal advice. Instead, it says: "In this regime, based on similar past states, Strategy B has a 58% win rate and 1.4 Sharpe. Strategy A has 45% and 0.2 Sharpe. I recommend B. But we're still in bootstrap for Strategy C, so I'm gathering data. Check back in 5 trades."
That humility—knowing what it knows and what it doesn't—is what makes it robust.
PART 14: PROFESSIONAL USAGE PROTOCOL
PHASE 1: DEPLOYMENT (Week 1-4)
Initial Setup:
1. Load indicator on primary trading chart with default settings
2. Verify historical pre-training enabled (should see ~200 patterns in STM/LTM on first load)
3. Enable all dashboard sections for maximum transparency
4. Set alerts but DO NOT trade real money
Observation Checklist:
• Dashboard Validation:
✓ Lorentzian Core shows reasonable gamma (1-5 range, not stuck at 1.0 or spiking to 10)
✓ HFL oscillates with price action (not flat or random)
✓ Regime classifications make intuitive sense
✓ Confidence scores vary appropriately
• Memory System:
✓ STM fills within first few hours/days of real-time bars
✓ LTM grows gradually (few patterns per day, quality-gated)
✓ Predictions show directional bias (not always 0.0)
✓ Agreement metric fluctuates with regime changes
• Bootstrap Tracking:
✓ Dashboard shows "🔥 BOOTSTRAP (X/10)" for each regime
✓ Trade counts increment on regime-specific signals
✓ Different regimes reach threshold at different rates
Paper Trading:
• Take EVERY signal (ignore unfavorable warnings during bootstrap)
• Log each trade: entry price, regime, selected strategy, outcome
• Calculate your actual P&L assuming proper risk management (1-2% risk per trade)
• Do NOT judge system performance yet—focus on understanding behavior
Troubleshooting:
• No signals for days:
- Check base_quality_threshold (try lowering to 50-55)
- Verify enable_regime_filter not blocking all regimes
- Confirm signal confidence threshold not too high (try 0.25)
• Signals every bar:
- Raise base_quality_threshold to 65-70
- Increase min_bars_between to 8-10
- Check if gamma spiking excessively (raise c_multiplier)
• Memory not filling:
- Confirm enable_memory = true
- Verify historical pre-training completed (check STM size after load)
- May need to wait 10 bars for first real-time update
PHASE 2: VALIDATION (Week 5-12)
Statistical Emergence:
By week 5-8, most regimes should exit bootstrap. Look for:
✓ Regime Performance Clarity:
- At least 2-3 strategies showing positive Sharpe in their favored regimes
- Clear separation (Strategy B strong in Trending, Strategy A strong in Low Vol Range, etc.)
- Win rates stabilizing around 50-60% for winning strategies
✓ Shadow Portfolio Divergence:
- Virtual portfolios showing clear winners ($10K → $11K+) and losers ($10K → $9K-)
- Profit factors >1.3 for top strategy
- System selection aligning with best shadow portfolio
✓ Parameter Adaptation:
- Thresholds varying per regime (not stuck at initial values)
- Quality gates adapting (some regimes higher, some lower)
- Flow multipliers showing regime-specific optimization
Validation Questions:
1. Do patterns make intuitive sense?
- Strategy B (Flow) dominating Trending Bull/Bear? ✓ Expected
- Strategy A (Squeeze) succeeding in Low Vol Range? ✓ Expected
- Strategy C (Memory) working in High Vol Range? ✓ Expected
- Random strategy winning everywhere? ✗ Problem
2. Is unfavorable filtering working?
- Regimes with negative Sharpe showing "⚠️ UNFAVORABLE"? ✓ System protecting capital
- Transition regime often unfavorable? ✓ Expected
- All regimes perpetually unfavorable? ✗ Settings too strict or asset unsuitable
3. Are memories agreeing appropriately?
- High agreement during stable regimes? ✓ Expected
- Low agreement during transitions? ✓ Expected (novel conditions)
- Perpetual conflict? ✗ Check memory sizes or decay rates
Fine-Tuning (If Needed):
Too Many Signals in Losing Regimes:
→ Increase learning_rate to 0.07-0.08 (faster adaptation)
→ Raise base_quality_threshold by 5-10 points
→ Enable regime filter if disabled
Missing Profitable Setups:
→ Lower base_quality_threshold by 5-10 points
→ Reduce min_confidence to 0.25-0.30
→ Check if bootstrap mode blocking trades (let it complete)
Excessive Parameter Swings:
→ Reduce learning_rate to 0.03-0.04
→ Increase min_regime_samples to 15-20 (more data before adaptation)
Memory Disagreement Too Frequent:
→ Increase LTM size to 768-1024 (broader pattern library)
→ Lower adaptive_quality_gate requirement (allow more patterns)
→ Increase K neighbors to 10-12 (smoother predictions)
PHASE 3: LIVE TRADING (Month 4+)
Pre-Launch Checklist:
1. ✓ At least 3 regimes show positive Sharpe (>0.8)
2. ✓ Top shadow portfolio shows >53% win rate and >1.3 profit factor
3. ✓ Parameters have stabilized (not changing more than 10% per month)
4. ✓ You understand every dashboard metric and can explain regime/strategy behavior
5. ✓ You have proper risk management plan independent of this system
Position Sizing:
Conservative (Recommended for Month 4-6):
• Risk per trade: 0.5-1.0% of account
• Max concurrent positions: 1-2
• Total exposure: 10-25% of intended full size
Moderate (Month 7-12):
• Risk per trade: 1.0-1.5% of account
• Max concurrent positions: 2-3
• Total exposure: 25-50% of intended size
Full Scale (Year 2+):
• Risk per trade: 1.5-2.0% of account
• Max concurrent positions: 3-5
• Total exposure: 100% (still following risk limits)
Entry Execution:
On Signal Confirmation:
1. Verify dashboard shows signal type (▲ LONG or ▼ SHORT)
2. Check regime mode (avoid if "⚠️ UNFAVORABLE" unless testing)
3. Note selected strategy (A/B/C) and its regime Sharpe
4. Verify memory agreement if Strategy C selected (want >60%)
Entry Method:
• Market entry: Next bar open after signal (for exact backtest replication)
• Limit entry: Slight improvement (2-3 ticks) if confident in direction
Stop Loss Placement:
• Strategy A (Squeeze): Beyond opposite band or recent swing point
• Strategy B (Flow): 1.5-2.0 ATR from entry against direction
• Strategy C (Memory): Based on predicted move magnitude (tighter if pred > 2%)
Exit Management:
System Exit Signals:
• Opposite signal fires: Immediate exit, potential reversal entry
• 20 bars no exit signal: System implies position stale, consider exiting
• Regime changes to unfavorable: Tighten stop, consider partial exit
Manual Exit Conditions:
• Stop loss hit: Take loss, log for validation (system expects some losses)
• Profit target hit: If using fixed targets (2-3R typical)
• Major news event: Flatten during high-impact news (system can't predict these)
Warning Signs (Exit Criteria):
🚨 Stop Trading If:
1. All regimes show negative Sharpe for 4+ weeks (market structure changed)
2. Your results >20% worse than shadow portfolios (execution problem)
3. Parameters hitting extremes (thresholds >85 or <35 across all regimes)
4. Memory agreement <30% for extended periods (unprecedented conditions)
5. Account drawdown >20% (risk management failure, system or otherwise)
⚠️ Reduce Size If:
1. Win rate drops 10%+ from peak (temporary regime shift)
2. Selected strategy underperforming another by >30% (selection lag)
3. Consecutive losses >5 (variance or problem, reduce until clarity)
4. Major market regime change (Fed policy shift, war, etc. - let system re-adapt)
PART 15: THEORETICAL IMPLICATIONS & LIMITATIONS
WHAT THIS SYSTEM REPRESENTS:
Contextual Bandits:
The regime-specific strategy selection implements a contextual multi-armed bandit problem. Each strategy is an "arm," each regime is a "context," and we select arms to maximize expected reward given context. This is reinforcement learning applied to trading.
Experience Replay:
The dual-memory architecture mirrors DeepMind's DQN breakthrough. STM = recent experience buffer; LTM = validated experience replay. This prevents catastrophic forgetting while enabling rapid adaptation—a key challenge in neural network training.
Meta-Learning:
The system learns how to learn. Parameter adaptation adjusts the system's own sensitivity and selectivity based on outcomes. This is "learning to learn"—optimizing the optimization process itself.
Non-Stationary Optimization:
Traditional backtesting assumes stationarity (past patterns persist). This system assumes non-stationarity and continuously adapts. The goal isn't finding "the best parameters" but tracking the moving optimum.
Regime-Conditional Policies:
Rather than a single strategy for all conditions, this implements regime-specific policies. This is contextual decision-making—environment state determines action selection.
FINAL WISDOM:
"The market is a complex adaptive system. To trade it successfully, one must also adapt. This indicator provides the framework—memory, learning, regime awareness—but wisdom comes from understanding when to trade, when to stand aside, and when to defer to conditions the system hasn't yet learned. The edge isn't in the algorithm alone; it's in the partnership between mathematical rigor and human judgment."
— Inspired by the intersection of Einstein's relativity, Kahneman's behavioral economics, and decades of quantitative trading research
Taking you to school. — Dskyz, Trade with insight. Trade with anticipation.
Carlos Money Printer (CMP 4.5)⭐ Carlos Money Printer (CMP 4.5) – Overview
Designed for precision day trading, swing filtering, and high-accuracy scalping.
Carlos Money Printer (CMP) 4.5 is a next-generation trading system engineered to identify high-probability trend expansions and disciplined exits using a multi-layer confirmation engine. CMP is built for traders who want clean visual signals, reduced noise, and a systematic approach that avoids emotional decision-making.
What CMP 4.5 Does
CMP analyzes market structure across multiple dimensions and automatically highlights:
🔥 1. High-Accuracy Entry Zones
CMP detects early-stage price expansions using a proprietary volatility engine (“BAM” signals) plus directional confirmation, giving traders visibility into explosive trend opportunities before most indicators react.
📈 2. Trend Direction & Strength
CMP reads trend behavior using a dynamic trend spine, allowing the system to clearly distinguish between pullbacks, trend continuation, and early reversal conditions.
🧠 3. Multi-Timeframe Confirmation
The built-in 6-timeframe dashboard shows whether higher-timeframes agree with the chart you're trading — giving you a fast snapshot of market alignment without flipping charts.
🎯 4. Sniper Entry System (Full/Moderate Modes)
CMP 4.5 offers two confluence-based entry models:
FULL Sniper Mode – highest confidence, strongest confluence
MOD Sniper Mode – more frequent entries with controlled risk
Both modes emphasize clean structure and avoid low-quality signals.
🚀 5. Intelligent Exit Engine (5m-Based)
CMP includes a hybrid exit model that combines:
Trend deceleration
Momentum reversal
Volatility exhaustion
Structural flip signals
This gives you objective, systematic exit points — no guessing, no chasing.
📊 6. Built-In Tools for Traders
ORB High/Low Zones (first 15 minutes)
ADR / ADT Daily Range Tracking
VWAP
Trend coloring
Clean chart-optimized visuals
Everything is integrated so you can trade from a single indicator.
🌟 Why Traders Like CMP
CMP is engineered to remove noise from the chart and show only the most useful information:
No clutter
No complicated settings
No lagging confirmation
No hype indicators
Just clean trend signals, controlled entries, and disciplined exits.
⚠️ Important Notice
CMP 4.5 is proprietary and licensed exclusively under the K&T Trust.
This is a private-use system intended for educational and non-commercial analysis.
Reproduction or redistribution of the source code is prohibited.
⚠️ Disclaimer
The Carlos Money Printer (CMP 4.5) indicator is a technical analysis tool designed for educational and informational purposes only. It does not constitute financial advice, investment advice, or trading recommendations. Like all trading indicators, CMP 4.5 cannot guarantee future performance, profitability, or accuracy. Markets involve risk, including the potential loss of capital.
By using CMP 4.5, the trader acknowledges and agrees that:
All trading decisions are made at their own risk,
Past performance does not guarantee future results,
CMP 4.5 is not a substitute for personal research or professional financial advice,
Neither the creator, K&T Trust, nor any affiliates are responsible for losses, damages, or outcomes resulting from its use.
CMP 4.5 is a tool — powerful, refined, and more advanced than many indicators — but it is not a promise, not a guarantee, and not liability-bearing.
Use it with proper risk management, discipline, and personal judgment.
BTC GOD — DEFINITIVE BTC MULTI INDICATORBTC GOD — The Ultimate Bitcoin Cycle Indicator (2025 Edition)
The one indicator every serious BTC holder and trader has been waiting for.
A single script that perfectly combines the 5 most powerful and accurate Bitcoin indicators ever created — all 100 % official versions:
- Official Pi Cycle Top (LookIntoBitcoin) → in 2013, 2017 & 2021 (3/3 hits)
- Official MVRV Z-Score (Glassnode / LookIntoBitcoin) → every major bottom (2015, 2018–19, 2022)
- Dynamic Bull/Bear background (red bear-market when price drops X % from cycle ATH + monthly RSI filter)
- Monthly Golden/Death Cross (50-month EMA vs 200-week EMA) → huge, unmistakable signals
- SuperTrend + 200-week EMA + 50-month EMA
- Cycle ATH/ATL tracking with flashing alert in the table when new highs/lows are made
- Exact days to/from the next halving + optimal accumulation zone (200–750 days post-halving)
- Fully customizable inputs for experienced traders
Zero repainting. Zero errors. Works on every timeframe.
This is the indicator used by people who truly understand Bitcoin’s 4-year cycles.
If you could only keep ONE Bitcoin indicator for the rest of your life… this would be it.
Save it, test it, and you’ll instantly see why it’s called BTC GOD.
Built with love and obsession for Bitcoin cycles.
Last update: November 2025
Painel de Probabilidade Multi-Timeframe Long ShortPainel de Probabilidade Multi-Timeframe for best possibility for Long ou Short
Price vs 200 EMA / 50 EMA / VWAP TablePrice vs 200 EMA / 50 EMA / VWAP Table
This indicator displays a compact real-time table showing where current price is trading relative to three major dynamic levels: 200 EMA, 50 EMA, and VWAP.
It provides an instant read on trend strength, bias, and distance from key moving levels — all in one glance.
Color-coded signals:
Lime → Price above
Red → Price below
Gray → Price at / near
Features
Adjustable table position (4 corners)
Adjustable text size
Toggle % distance and points distance
Clean, lightweight, and non-intrusive
Works on all timeframes and assets






















