S&D DirectionThis indicator displays the most recent candle close direction for up to five custom timeframes, as selected in the settings. For each chosen timeframe, it shows whether the last confirmed candle close was bullish (close above the previous high) or bearish (close below the previous low). The indicator labels each timeframe in the top right corner, using green text for bullish closes and red for bearish closes. The displayed timeframes can be customized, and the direction (long/short) is clearly shown after each label.
Indicators and strategies
Market to NAV Premium Arbitrage Alpha IndicatorBitcoin treasury companies such as Microstrategy are known for trading at significant premiums. but how big exactly is the premium? And how can we measure it in real time?
I developed this quantitative tool to identify statistical mispricings between market capitalization and net asset value (NAV), specifically designed for arbitrage strategies and alpha generation in Bitcoin-holding companies, such as MicroStrategy or Sharplink Gaming, or SPACs used primarily to hold cryptocurrencies, Bitcoin ETFs, and other NAV-based instruments. It can probably also be used in certain spin-offs.
KEY FEATURES:
✅ Real-time Premium/Discount Calculation
• Automatically retrieves market cap data from TradingView
• Calculates precise NAV based on underlying asset holdings (for example Bitcoin)
• Formula: (Market Cap - NAV) / NAV × 100
✅ Statistical Analysis
• Historical percentile rankings (customizable lookback period)
• Standard deviation bands (2σ) for extreme value detection (close to these values might be seen as interesting points to short or go long)
• Smoothing period to reduce noise
✅ Multi-Source Market Cap Detection
• You can add the ticker of the NAV asset, but if necessary, you can also put it manually. Priority system: TradingView data → Calculated → Manual override
✅ Advanced NAV Modeling
• Basic NAV: Asset holdings + cash.
• Adjusted NAV: Includes software business value, debt, preferred shares. If the company has a lot of this kind of intrinsic value, put it in the "cash" field
• Support for any underlying asset (BTC, ETH, etc.)
TRADING APPLICATIONS:
🎯 Pairs Trading Signals
• Long/Short opportunities when premium reaches statistical extremes
• Mean reversion strategies based on historical ranges
• Risk-adjusted position sizing using percentile ranks
🎯 Arbitrage Detection
• Identifies when market pricing significantly deviates from fair value
• Quantifies the magnitude of mispricing for profit potential
• Historical context for timing entry/exit points
CONFIGURATION OPTIONS:
• Underlying Asset: Any symbol (default: COINBASE:BTCUSD) NEEDS MANUAL INPUT
• Asset Quantity: Precise holdings amount (for example, how much BTC does the company currently hold). NEEDS MANUAL INPUT
• Cash Holdings: Additional liquid assets. NEEDS MANUAL INPUT
• Market Cap Mode: Auto-detect, calculated, or manual
• Advanced Adjustments: Business value, debt, preferred shares
• Display Settings: Lookback period, smoothing, custom colors
IT CAN BE USED BY:
• Quantitative traders focused on statistical arbitrage
• Institutional investors monitoring NAV-based instruments
• Bitcoin ETF and MSTR traders seeking alpha generation
• Risk managers tracking premium/discount exposures
• Academic researchers studying market efficiency (as you can see, markets are not efficient 😉)
10-Day Avg Upside vs Downside VolumeUpside Volume: The total volume on days when the stock closes higher than the previous day.
Downside Volume: The total volume on days when the stock closes lower than the previous day.
It calculates the 10-day simple moving average of both upside and downside volumes.
An optional ratio line is included to visualize relative buying vs selling pressure.
RV Indicator This Pine Script defines a custom Relative Volatility (RV) Indicator, which measures the ratio of directional price movement to volatility over a specified number of bars. Below is a full explanation of what this script does.
Title:
RV Indicator — Relative Volatility Oscillator
Purpose:
This indicator measures how aggressively price is moving compared to recent volatility, and smooths the result with a signal line. It can be used to gauge momentum shifts and trend strength.
How It Works – Step by Step
1. Measuring Price Momentum (v1)
It calculates the difference between the close and open prices of the last 4 candles.
A weighted average is applied:
The current candle and the one 3 bars ago get weight 1.
The two middle candles (1 and 2 bars ago) get weight 2.
This creates a smoothed momentum measure:
If close > open (bullish), v1 is positive.
If close < open (bearish), v1 is negative.
2. Measuring Volatility (v2)
Similarly, it calculates the high-low range for the last 4 candles.
The same weighting (1, 2, 2, 1) is applied.
This gives a smoothed volatility measure.
3. Combining Momentum and Volatility (RV Ratio)
For the past ti bars (default: 10), it sums up:
All v1 values (momentum sum)
All v2 values (volatility sum)
Then it divides them:
𝑅𝑉= sum of price momentum % sum of volatility
This produces the RV value:
RV > 0: Momentum is bullish (price is generally moving up relative to its volatility).
RV < 0: Momentum is bearish (price is moving down relative to its volatility).
4. Smoothed Signal Line (rvsig)
A smoothed version of the RV is created using a weighted average of the latest 4 RV values.
This acts like a signal line, similar to how MACD uses a signal line.
Crossovers between RV and this signal line can be used to detect shifts in momentum.
5. Visual Output
Orange Line (RV): Shows the raw momentum/volatility ratio.
Blue Line (Signal): A smoother line that follows RV more slowly.
Zero Line: Divides bullish vs. bearish momentum.
How to Use It in Trading
1. Look for Crossovers:
If RV crosses above its signal line → Possible buy signal (momentum turning bullish).
If RV crosses below its signal line → Possible sell signal (momentum turning bearish).
2. Check the Zero Line:
If both RV and Signal are above zero, momentum is bullish.
If both are below zero, momentum is bearish.
3. Filter False Signals:
Combine RV with a trend filter (like a 50 or 200 EMA) to avoid trading against the main trend.
Disclaimer: This script is for informational and educational purposes only. It does not constitute financial advice or a recommendation to buy or sell any asset. All trading decisions are solely your responsibility. Use at your own risk.
Swing FX Pro Panel v1Description:
"Swing FX Pro Panel v1" is a professional swing trading strategy tailored for the Forex market and other highly liquid assets. The core logic is based on the crossover of two Exponential Moving Averages (EMA), allowing the strategy to detect trend shifts and generate precise entry signals.
The script includes an interactive performance panel that dynamically displays:
initial capital,
risk per trade (%),
the number of trades taken during a selected period (e.g., 6 months),
win/loss statistics,
ROI (Return on Investment),
maximum drawdown,
win ratio.
EMA 8/21/50 + VWAP Crossover Alert IndicatorOverview of the Indicator
This is a custom Pine Script v5 indicator for TradingView titled "EMA 8/21/50 + VWAP Crossover Alert Indicator" (short title: "EMA+VWAP Cross Alert"). It's designed as an overlay indicator, meaning it plots directly on your price chart rather than in a separate pane. The primary purpose is to detect and alert on crossovers between the 8-period Exponential Moving Average (EMA) and the 21-period EMA, which can signal potential bullish or bearish momentum shifts. These are classic short-term trend reversal or continuation signals often used in trading strategies like momentum or swing trading.
To enhance analysis, it also includes:
A 50-period EMA for medium-term trend context (e.g., to confirm if the overall trend aligns with the crossover).
A Volume Weighted Average Price (VWAP) line, which provides a benchmark for the average price weighted by volume, useful for identifying intraday value areas or fair price levels.
The indicator works across all timeframes (e.g., Daily, 4H, 1H, 15M, 5M, 3M) because the calculations are based on the chart's current bars and adapt to volatility and data resolution. It's not a trading strategy (no entry/exit logic or backtesting), but an alert tool—signals are visual and can trigger notifications in TradingView. Always combine it with risk management, as crossovers can produce false signals in ranging or choppy markets.
Scalper - Pattern Recognition & Price Action🔍 Introducing the Ultimate Scalping Toolkit for TradingView
📊 “Scalper – Pattern Recognition & Price Action”
💥 Unlock precision trading with one of the most advanced Pine Script indicators ever built!
✅ Key Features:
📌 Multiple Moving Averages (SMA, EMA, HMA, VWMA & more) – fully customizable per timeframe
🔍 Candlestick Pattern Detection – from Engulfing & Doji to Morning/Evening Stars and Three Soldiers/Crows
⚡ Smart Price Action Tools – Fair Value Gaps, Order Blocks, Breakout Zones
🧠 Confluence Engine – Aggregates multi-signal zones for high-probability entries
📉 Dynamic Support & Resistance Lines – auto-detected from historical swing points
📈 RSI & CCI Reversal Zones – spot hidden turning points before the crowd
🎯 Perfect for Scalpers, Day Traders & Pattern Hunters
💡 This is not just another indicator — it's a complete trading assistant that identifies structure, signals strength, and simplifies decision-making.
🚀 Plug it into your TradingView chart today and start seeing the market in a whole new way.
👉 DM us for access : t.me
Gann Single Square Swing Trading System with Gann AnglesGann Single Square Swing Trading System
This script automatically detects "squares" - geometric patterns where price movement equals time movement. When price moves the same distance as the number of bars (time), it creates powerful support/resistance levels based on Gann theory.
Key Visual Elements
• Box: The detected square pattern
• Dark Blue Line (50%): Most important trading level
• Green Lines: Profit target levels (125%, 150%)
• Red Lines: Stop loss levels (-25%, -50%)
• Colored Angle Lines: Gann angles for trend direction
• Quality Score: Blue label showing setup strength (aim for 70%+)
Simple Trading Rules
LONG Trades (Green 🟢 Square)
1. Entry: Buy when price touches the dark blue 50% line from above
2. Stop Loss: Place below the red -25% line
3. Take Profit: Exit at green 125% line (first target) or 150% line (second target)
SHORT Trades (Red 🔴 Square)
1. Entry: Sell when price touches the dark blue 50% line from below
2. Stop Loss: Place above the red -25% line
3. Take Profit: Exit at green 125% line (first target) or 150% line (second target)
Entry Checklist
✅ Square quality score > 70%
✅ Price touches 50% level (dark blue line)
✅ Volume above average (if volume filter enabled)
✅ Clear square formation visible
Alerts
The script generates automatic alerts when price reaches the 50% trading level. Enable alerts in TradingView to get notified of setups.
Bottom Line: Wait for the alert → Check quality score → Enter at 50% level → Set stop at red line → Take profit at green line.
Stochastic Z-Score [AlgoAlpha]🟠 OVERVIEW
This indicator is a custom-built oscillator called the Stochastic Z-Score , which blends a volatility-normalized Z-Score with stochastic principles and smooths it using a Hull Moving Average (HMA). It transforms raw price deviations into a normalized momentum structure, then processes that through a stochastic function to better identify extreme moves. A secondary long-term momentum component is also included using an ALMA smoother. The result is a responsive oscillator that reacts to sharp imbalances while remaining stable in sideways conditions. Colored histograms, dynamic oscillator bands, and reversal labels help users visually assess shifts in momentum and identify potential turning points.
🟠 CONCEPTS
The Z-Score is calculated by comparing price to its mean and dividing by its standard deviation—this normalizes movement and highlights how far current price has stretched from typical values. This Z-Score is then passed through a stochastic function, which further refines the signal into a bounded range for easier interpretation. To reduce noise, a Hull Moving Average is applied. A separate long-term trend filter based on the ALMA of the Z-Score helps determine broader context, filtering out short-term traps. Zones are mapped with thresholds at ±2 and ±2.5 to distinguish regular momentum from extreme exhaustion. The tool is built to adapt across timeframes and assets.
🟠 FEATURES
Z-Score histogram with gradient color to visualize deviation intensity (optional toggle).
Primary oscillator line (smoothed stochastic Z-Score) with adaptive coloring based on momentum direction.
Dynamic bands at ±2 and ±2.5 to represent regular vs extreme momentum zones.
Long-term momentum line (ALMA) with contextual coloring to separate trend phases.
Automatic reversal markers when short-term crosses occur at extremes with supporting long-term momentum.
Built-in alerts for oscillator direction changes, zero-line crosses, overbought/oversold entries, and trend confirmation.
🟠 USAGE
Use this script to track momentum shifts and identify potential reversal areas. When the oscillator is rising and crosses above the previous value—especially from deeply negative zones (below -2)—and the ALMA is also above zero, this suggests bullish reversal conditions. The opposite holds for bearish setups. Reversal labels ("▲" and "▼") appear only when both short- and long-term conditions align. The ±2 and ±2.5 thresholds act as momentum warning zones; values inside are typical trends, while those beyond suggest exhaustion or extremes. Adjust the length input to match the asset’s volatility. Enable the histogram to explore underlying raw Z-Score movements. Alerts can be configured to notify key changes in momentum or zone entries.
Momentum 8% 4% 9MMomentum 8% 4% 9M is a simple yet effective visual indicator designed to highlight significant daily price moves and high volume activity on your stock charts.
Features:
Daily Price Move Highlights:
Background turns green when the daily price gain is equal to or greater than 8%, signaling strong bullish momentum.
Background turns red when the daily price drop is equal to or less than -4%, indicating notable bearish moves.
High Volume Marker:
Displays a small yellow upward triangle below the bar on days when the trading volume exceeds 9 million, helping you easily spot volume spikes.
This indicator provides clear visual cues directly on your price chart, making it easier to spot days of unusual market activity without cluttering your chart with excessive labels. It is ideal for traders looking to quickly identify big moves and volume surges for further analysis or trading decisions.
How it works:
The script calculates the daily percentage change from the previous close and compares it with predefined thresholds (8% up, 4% down). Volume is checked against the threshold of 9 million shares. Appropriate background colors and shape markers are then plotted accordingly.
MA Cross With Buy and SellThe Enhanced MA Cross indicator helps traders identify changes in market trends by tracking two moving averages: one short-term and one long-term. When the short-term average crosses above the long-term one, it suggests that momentum is shifting upward, often signaling a buying opportunity. Conversely, when the short-term average drops below the long-term, it may indicate that selling pressure is increasing, signaling a possible exit or short position.
This indicator is particularly useful in trending markets—places where prices are clearly moving up or down—like during strong moves in stocks, crypto, forex, or commodities. It gives you visual buy and sell markers right on the chart, and you can even enable alerts so you don't miss key moments.
However, it's not a great tool for sideways or ranging markets, where prices bounce around without direction. In those situations, the crossover signals can become noisy and less reliable.
Overall, it's a simple, beginner-friendly tool for spotting trend shifts and making more confident trade entries and exits. If needed, we can make it even smarter by combining it with other indicators to filter out bad signals.
Candlestick Patterns Backtester [Optimized]Candlestick Patterns Backtester
What this is: This indicator is based on a really cool candlestick pattern backtester that I found (I'll update this later when I remember where I got it from or find the actual author). The original had this massive table showing win/loss ratios for a bunch of candlestick patterns, and according to the built-in backtester, it was actually profitable - which was pretty impressive.
The Problem: I played around with the original for a while but honestly wasn't really able to get it to work well at all for actual trading. It was still pretty cool to look at though! The main issues were:
It was just a big static table - hard to do anything useful with it
Couldn't send signals out to other strategies
The code was a monster - like 2,000+ lines of repetitive mess
What I Did: I completely refactored this thing and got it down from 2,000+ lines to just a few hundred lines. Much cleaner now! Here's what it does:
45+ Candlestick Patterns - All the classics are in there
Dynamic Filtering - Set your own requirements (minimum win rate, profit factor, total trades, etc.)
Flexible Logic - Choose AND/OR logic for your filters
Signal Generation - Creates actual buy/sell signals you can use with other strategies
Visual Badges - Shows pattern badges on chart when they meet your criteria
Active Patterns Table - Only shows patterns that are currently profitable based on your settings
Settings You Can Adjust:
Minimum win rate threshold
Minimum profit factor
Minimum number of trades required
Whether to use AND or OR logic for filtering
Colors, badge display, debug options
Reality Check: Trading these patterns really wasn't for me, but it was still a great learning experience. The backtesting results look good on paper, but as always, past performance doesn't guarantee future results. Use this as a research tool and educational resource more than anything else.
Credit: This is based on someone else's original work that I heavily modified and optimized. I'll update this description once I track down the original author to give proper credit where it's due.
This introduction captures your casual, honest tone while explaining the technical improvements you made and setting realistic expectations about the indicator's practical use.
Prev Candle Quarters (MTF) – % + PriceThis TradingView indicator visualizes quarter levels (25%, 50%, 75%, 100%) of the previous candle body from a user-selected higher timeframe, helping traders identify key reaction zones within a candle’s structure.
ulti-Timeframe Input: Choose between 15m, 1H, or 2H candles for your measurement basis.
Body-Based Calculation: Measures from open to close of the previous candle (not wick-to-wick), reflecting where price actually closed.
Precise Quarter Levels: Automatically draws horizontal lines at 25%, 50%, 75%, and 100% of the candle body.
Custom Toggles: Enable or disable each individual level via checkboxes.
Price + % Labels: Each level includes a clean label showing the exact price and corresponding percentage.
Williams Percent Range with ThresholdEnhance your trading analysis with the "Williams Percent Range with Threshold" indicator, a powerful modification of the classic Williams %R oscillator. This custom version introduces customizable uptrend and downtrend thresholds, combined with dynamic candlestick coloring to visually highlight market trends. Originally designed to identify overbought and oversold conditions, this script takes it a step further by allowing traders to define specific threshold levels for trend detection, making it a versatile tool for momentum and trend-following strategies.
Key Features:
Customizable Thresholds: Set your own uptrend (default: -16) and downtrend (default: -67) thresholds to adapt the indicator to your trading style.
Dynamic Candlestick Coloring: Candles turn green during uptrends, red during downtrends, and gray in neutral conditions, providing an intuitive visual cue directly on the price chart.
Flexible Length: Adjust the lookback period (default: 50) to fine-tune sensitivity.
Overlay Design: Integrates seamlessly with your price chart, enhancing readability without clutter.
How It Works:
The Williams %R calculates the current closing price's position relative to the highest and lowest prices over a specified period, expressed as a percentage between -100 and 0. This version adds trend detection based on user-defined thresholds, with candlestick colors reflecting the trend state. The indicator plots the %R line with color changes (green for uptrend, red for downtrend) and includes dashed lines for the custom thresholds.
Usage Tips:
Use the uptrend threshold (-16 by default) to identify potential buying opportunities when %R exceeds this level.
Apply the downtrend threshold (-67 by default) to spot selling opportunities when %R falls below.
Combine with other indicators (e.g., moving averages or support/resistance levels) for confirmation signals.
Adjust the length and thresholds based on the asset's volatility and your trading timeframe.
Supertrend with ADX & MTF MA Filter# **Supertrend with ADX & MTF MA Filter - Comprehensive Explanation**
---
## **1. Purpose of This Indicator**
This indicator combines three powerful technical analysis tools to create a robust trading system:
✅ **Supertrend** (Trend-following)
✅ **ADX Filter** (Trend strength confirmation)
✅ **MTF MA Filter** (Multi-timeframe trend direction confirmation)
**Primary Goals:**
✔ **Identify high-probability trend reversals** with confirmation from multiple indicators
✔ **Filter out weak trends** using ADX (Average Directional Index)
✔ **Add higher timeframe context** with MTF (Multi-TimeFrame) Moving Average
✔ **Reduce false signals** by requiring confluence between all three components
---
## **2. Core Logic & Components**
### **A. Supertrend (Base Indicator)**
- **Calculation:**
```pine
up = hl2 - (Multiplier * ATR(Periods))
dn = hl2 + (Multiplier * ATR(Periods))
```
- **Bullish trend** when price > `up` (green line)
- **Bearish trend** when price < `dn` (red line)
- **Why Supertrend?**
- Simple yet effective trend-following system
- Adapts to volatility via ATR (Average True Range)
---
### **B. ADX Filter (Trend Strength Confirmation)**
- **ADX Calculation:**
```pine
= calcADX(adxLength, adxSmoothing)
strongTrend = adxVal >= adxThreshold
```
- **ADX > Threshold (Default: 20)** = Strong trend
- **DI+ > DI-** = Bullish momentum
- **DI- > DI+** = Bearish momentum
- **Why ADX?**
- Avoids trading in choppy markets (low ADX = weak trend)
- Confirms if Supertrend signals occur in a strong trend
---
### **C. MTF MA Filter (Higher Timeframe Trend Alignment)**
- **Moving Average Calculation:**
```pine
= getMA(maSource, maLength, maType, maTF)
```
- **MA Type:** SMA, EMA, WMA, or DEMA
- **Timeframe:** Any (1m, 5m, 1H, 4H, D, W, M)
- **Trend Direction:**
- **Buy Signal:** MA must be **rising**
- **Sell Signal:** MA must be **falling**
- **Why MTF MA?**
- Aligns trades with the **higher timeframe trend**
- Reduces counter-trend entries
---
## **3. How to Use This Indicator**
### **A. Buy Conditions (All Must Be True)**
1. **Supertrend turns bullish** (price crosses above `up` line)
2. **ADX ≥ Threshold** (trend is strong)
3. **Higher timeframe MA is rising** (confirms bullish bias)
### **B. Sell Conditions (All Must Be True)**
1. **Supertrend turns bearish** (price crosses below `dn` line)
2. **ADX ≥ Threshold** (trend is strong)
3. **Higher timeframe MA is falling** (confirms bearish bias)
### **C. Recommended Settings**
| Parameter | Recommended Value | Description |
|-----------|------------------|-------------|
| **ATR Period** | 14 | Sensitivity of Supertrend |
| **Multiplier** | 1.5-3.0 | Adjust for volatility |
| **ADX Threshold** | 20-25 | Higher = stricter trend filter |
| **MA Length** | 20-50 | Smoothness of trend filter |
| **MA Timeframe** | 1H/D | Align with trading style |
---
## **4. Trading Strategies**
### **A. Trend-Following Strategy**
- **Enter:** When all 3 conditions align (Supertrend + ADX + MA)
- **Exit:** When Supertrend flips or ADX drops below threshold
### **B. Pullback Strategy**
- **Wait for:**
- Supertrend in trend direction
- ADX remains strong
- MA still aligned
- **Enter:** On pullback to Supertrend line
### **C. Multi-Timeframe Confirmation**
- **Intraday traders:** Use 4H/D MA for trend bias
- **Swing traders:** Use D/W MA for trend bias
---
## **5. Advantages Over Standard Supertrend**
✔ **Fewer false signals** (ADX filters weak trends)
✔ **Higher timeframe alignment** (avoids trading against larger trends)
✔ **Customizable MA types** (SMA, EMA, WMA, DEMA)
✔ **Works on all markets** (stocks, forex, crypto)
---
### **Final Thoughts**
This indicator is designed for traders who want **high-confidence trend signals** by combining:
🔹 **Supertrend** (entry trigger)
🔹 **ADX** (trend strength filter)
🔹 **MTF MA** (higher timeframe trend alignment)
By requiring all three components to align, it significantly improves signal quality compared to standalone Supertrend systems.
**→ Best for:** Swing trading, trend-following, and avoiding choppy markets.
WT + Stoch RSI Reversal ComboOverview – WT + Stoch RSI Reversal Combo
This custom TradingView indicator combines WaveTrend (WT) and Stochastic RSI (Stoch RSI) to detect high-probability market reversal zones and generate Buy/Sell signals.
It enhances accuracy by requiring confirmation from both oscillators, helping traders avoid false signals during noisy or weak trends.
🔧 Key Features:
WaveTrend Oscillator with optional Laguerre smoothing.
Stochastic RSI with adjustable smoothing and thresholds.
Buy/Sell combo signals when both indicators agree.
Histogram for WT momentum visualization.
Configurable overbought/oversold levels.
Custom dotted white lines at +100 / -100 levels for reference.
Alerts for buy/sell combo signals.
Toggle visibility for each element (lines, signals, histogram, etc.).
✅ How to Use the Indicator
1. Add to Chart
Paste the full Pine Script code into TradingView's Pine Editor and click "Add to Chart".
2. Understand the Signals
Green Triangle (BUY) – Appears when:
WT1 crosses above WT2 in oversold zone.
Stoch RSI %K crosses above %D in oversold region.
Red Triangle (SELL) – Appears when:
WT1 crosses below WT2 in overbought zone.
Stoch RSI %K crosses below %D in overbought region.
⚠️ A signal only appears when both WT and Stoch RSI agree, increasing reliability.
3. Tune Settings
Open the settings ⚙️ and adjust:
Channel Lengths, smoothing, and thresholds for both indicators.
Enable/disable visibility of:
WT lines
Histogram
Stoch RSI
Horizontal level lines
Combo signals
4. Use with Price Action
Use this indicator in conjunction with support/resistance zones, chart patterns, or trendlines.
Works best on lower timeframes (5m–1h) for scalping or 1h–4h for swing trading.
5. Set Alerts
Set alerts using:
"WT + Stoch RSI Combo BUY Signal"
"WT + Stoch RSI Combo SELL Signal"
This helps you catch setups in real time without watching the chart constantly.
📊 Ideal Use Cases
Reversal trading from extremes
Mean reversion strategies
Timing entries/exits during consolidations
Momentum confirmation for breakouts
Lorentzian Theory Classifier🧮 Lorentzian Theory Classifier: An Observatory for Market Spacetime
Transcend the flat plane of traditional charting. Enter the curved, dynamic reality of market spacetime. The Lorentzian Theory Classifier (LTC) is not an indicator; it is a computational observatory. It is an instrument engineered to decode the geometry of market behavior, revealing the hidden curvatures and resonant frequencies that precede significant turning points.
We discard the outdated tools of Euclidean simplicity and embrace a more profound truth: financial markets, much like the cosmos described by general relativity, are governed by a fabric that is warped by the mass of participation and the energy of volatility. The LTC is your lens to perceive this fabric, to move beyond predicting lines on a chart and begin reading the very architecture of probability.
The Resonance Manifold: Standard Euclidean models search for historical analogues within a rigid sphere, missing the crucial outliers that define market extremes. The LTC's Lorentzian Resonance engine operates in a curved, non-Euclidean space, allowing it to connect with these "fat-tail" events—the true genesis points of major reversals.
🌌 THE THEORETICAL FRAMEWORK: A new Grand Unified Theory of Market Analysis
The LTC is built upon a revolutionary synthesis of concepts from special relativity, quantum mechanics, and information theory. It reframes market analysis not as a problem of forecasting, but as a problem of state recognition in a non-Euclidean manifold.
1. The Lorentzian Kernel: The Mathematics of Reality
Financial markets are not Gaussian. Their reality is one of "fat tails"—sudden, high-impact events that standard models dismiss as anomalies. The LTC acknowledges this reality by using the mathematically pure and robust Lorentzian kernel as its core engine:
Similarity(x, y) = 1 / (1 + (||x − y||² / γ²))
||x − y||²: The squared distance between the current market state (x) and a historical state (y) in our 8-dimensional feature space.
γ (Gamma): A dynamic bandwidth parameter, our "Lorentz factor," which adapts to market entropy (chaos). In calm markets, gamma is small, demanding precise resonance. In chaotic markets, gamma expands, intelligently seeking broader patterns.
This heavy-tailed function is revolutionary. It correctly assigns profound significance to the rare, extreme events that truly define market structure, while gracefully tuning out the noise of mundane price action. It doesn't just calculate; it understands context.
2. The 8-Dimensional State Vector: The Market's Quantum Fingerprint
To achieve a holistic view, the LTC projects the market onto an 8-dimensional Hilbert space, where each dimension represents a critical "observable":
Momentum & Acceleration (f_rsi, f_roc): The market's velocity and its rate of change.
Cyclical Position (f_stoch, f_cci): The market's location within its recent oscillation cycles.
Energy & Participation (f_vol, f_cor): The force of capital flow and its harmony with price.
Chaos & Uncertainty (f_ent, f_mom): The degree of randomness and the standardized force of price changes.
These are not eight separate indicators. They are entangled properties of a single "market wavefunction." The LTC's genius lies in measuring the geometric distance between these complete quantum states.
3. The k-NN Oracle: A Council of Past Universes
The LTC employs a k-Nearest Neighbors algorithm, but in our curved Lorentzian spacetime. It poses a constant, profound question: " Which moments in history are most geometrically congruent to the present moment across all eight dimensions? "
It then summons a "council" of these historical neighbors. Each neighbor's future outcome (did price ascend or descend?) casts a vote, weighted by its resonant similarity. The result is a probabilistic forecast of stunning clarity:
Prognosis: The final weighted consensus on future direction.
Assurance: The degree of unanimity within the council—a direct measure of the prediction's confidence.
The Funnel of Conviction: The LTC's process is a rigorous distillation of information. Raw, chaotic market data is resolved into a clean 8-dimensional state vector. The Lorentzian Kernel filters these states for resonance, which are then passed to the k-NN Oracle for a vote. Noise is eliminated at each stage, resulting in a single, validated, high-conviction signal.
⚙️ THE COMMAND CONSOLE: A Guide to Calibrating Your Observatory
Mastering the LTC's inputs is to become an architect of your own analytical universe. Each parameter is a dial that tunes the observatory's focus, from galactic structures to subatomic fluctuations. The tooltips in-script—over 6,000 words of documentation—provide immediate reference; this guide provides the philosophy.
A summarized guide to the Core, Signal, Supreme, and Visual controls is included directly in the indicator's code and tooltips. We encourage all users to explore these settings to tune the LTC to their unique analytical style.
🏆 THE SUPREME DASHBOARD: Your Mission Control
The dashboard is not a data table; it is your command interface with market reality. It translates the intricate dance of probabilities and vectors into clear, actionable intelligence.
⚡ ORACLE STATUS
Prognosis: The primary directional vector. Its color, magnitude, and emoji (⚡) reveal the strength and conviction of the Oracle's forward guidance.
Assurance: A real-time gauge of prediction quality, from "LOW" (high uncertainty) to "ELITE" (overwhelming statistical consensus). Interpret this as your core risk metric: trade with conviction when Assurance is ELITE; trade with caution when it is LOW.
🔮 RESONANCE ANALYSIS
Chaos: A direct measurement of market entropy. "LOW CHAOS" signifies a predictable, orderly regime. "HIGH CHAOS" is a warning of randomness and unpredictability, where trend-following logic may fail.
Turbulence: A measure of raw volatility. When the market is "TURBULENT," expect wider price swings and increased risk. Use this metric to adjust stop-loss distances and profit targets dynamically.
🏆 PERFORMANCE & ⚔️ GUARD METRICS
These sections provide illustrative statistics on the script's recent historical behavior. Metrics like Yield Ratio and Guard Index offer a quick heuristic on the prevailing risk-reward environment. Crucially, these are for observational context only and are not a substitute for your own rigorous testing and analysis.
🎨 THE VISUAL MANIFESTATION: Charting the Unseen
The LTC's visuals are designed to transform your chart from a 2D price graph into a 4D informational battlespace.
The Dynamic Aura (Background Color): This is the ambient energy field of the market. A luminous green (Ascend) signifies a bullish resonance field; a deep red (Descend) indicates bearish pressure.
The Assurance Shroud (Blue Bands): A visualization of confidence. When the shroud is wide and expansive , the Oracle's vision is clear and its predictions are robust.
The Prognosis Arc (Curved Line): A geodesic projection of the market's most likely path, based on the current Prognosis.
The Turbulence Cloud (Orange Mist): A visual warning system for market chaos. When this entropic mist expands , it is a clear sign that you are navigating a nebula of high unpredictability.
Oracle Markers (▲▼): The final, validated signals. These are not merely pivot points. They are moments in spacetime where a structural pivot has been confirmed and then ratified by a high-conviction vote from the Lorentzian Oracle. They are the pinnacles of confluence.
The Analyst's Observatory: The LTC transforms your chart into a command center for market analysis, providing a complete, at-a-glance view of market state, risk, and probabilistic trajectory.
🔧 THE ARCHITECT'S VISION: From a Blank Slate to a New Cosmos
The LTC was not assembled; it was derived. It began not with code, but with first principles, asking: "If we were to build an instrument to measure the market today, unbound by the technical dogmas of the 20th century, what would it look like?" The answer was clear: it must be multi-dimensional, it must be adaptive, and it must be built on a mathematical framework that respects the "fat-tailed" nature of reality.
The decision to use a pure Lorentzian kernel was non-negotiable. It represented a commitment to intellectual honesty over computational ease. The development of the Supreme Dashboard was driven by the philosophy of the "glass cockpit"—a belief that a trader's greatest asset is not a black box signal, but a transparent and intuitive flow of high-quality information. This script is the result of that unwavering vision: to create not just another indicator, but a new lens through which to perceive the market.
⚠️ RISK DISCLOSURE & PHILOSOPHY OF USE
The Lorentzian Theory Classifier is an instrument of profound analytical power, intended for the serious, discerning trader. It does not generate infallible signals. It generates high-probability, data-driven hypotheses based on a rigorous and transparent methodology. All trading involves substantial risk, and the future is fundamentally unknowable. Past performance, whether real or simulated, is no guarantee of future results. Use this tool to augment your own skill, to confirm your own analysis, and to manage your own risk within a well-defined trading plan.
"The effort to understand the universe is one of the very few things that lifts human life a little above the level of farce, and gives it some of the grace of tragedy."
— Steven Weinberg, Nobel Laureate in Physics
Trade with rigor. Trade with perspective. Trade with enlightenment. Trade with insight. Trade with anticipation.
— Dskyz, for DAFE Trading Systems
HTF OHLC Candle + 50% @MaxMaseratiHTF OHLC Candle + 50% @MaxMaserati
This advanced multi-timeframe indicator displays higher timeframe OHLC data as visual candle boxes and extended key levels on lower timeframe charts, providing essential context for institutional trading decisions.
Core Functionality:
Multi-Timeframe Box Display:
Main Timeframe Box (Default H4): Shows complete higher timeframe candles as colored boxes with separate body and wick visualization, including bullish (green) and bearish (red) candle representation with customizable transparency levels.
Independent Box 2 (Default M15): Secondary timeframe display with lime/fuchsia color scheme, allowing traders to monitor intermediate timeframes simultaneously with different visual styling.
Independent Box 3 (Default H1): Third independent timeframe with blue/orange color scheme, providing additional context for multi-timeframe analysis and confluence identification.
OHLC Level Analysis:
Each timeframe box includes individual Open, High, Low, and Close level lines with customizable colors and visibility settings. These levels act as key support and resistance zones that institutional traders often respect.
50% Retracement Levels:
Automatic calculation and display of 50% levels between each timeframe's high and low, representing critical equilibrium zones where price often finds support or resistance during retracements.
Extended Line System:
Current Live Timeframe Extended Lines: Real-time extension of the forming candle's Open, High, Low, and 50% levels with customizable line weights and label positioning.
TF2 Extended Lines (Default H4): Previous completed candle's key levels extended forward, showing immediate higher timeframe reference points for current price action.
TF3 Extended Lines (Default Daily): Longer-term reference levels from daily or weekly timeframes, providing macro trend context and major institutional levels.
Key Features:
Smart Timeframe Detection: Only displays boxes for timeframes higher than the current chart timeframe, preventing redundant information and maintaining chart clarity.
Global Box Limit Control: Intelligent cleanup system that maintains optimal performance by limiting total displayed elements while preserving the most recent and relevant timeframe periods.
Comprehensive Customization: Full control over colors, transparency, line weights, label sizes, and visibility for each timeframe component, allowing personalized setups for different trading styles.
Label System: Automatic timeframe identification labels (H4, M15, D1, etc.) positioned on each box for instant timeframe recognition and clear multi-timeframe organization.
Current Candle Options: Optional display of forming/current candles for each timeframe, enabling real-time monitoring of developing price action and potential setup completion.
This indicator is essential for traders utilizing multi-timeframe analysis, institutional trading concepts, and higher timeframe confluence strategies, providing clear visual representation of key levels and candle structures that drive major market movements.
VWAP Combo: Bands + MACD + Volume + AlertsBands: These are dynamic bands using a 20-period standard deviation and 1.5× width by default. Adjust lookback or bandMultiplier to tighten or widen.
Candle Colors: Green = MACD bullish, Red = bearish.
Volume Spike: Orange triangle when volume > 1.5× average.
Alerts: Fire on breakout, bounce, or combo confirmation.
RSS-Stochastik [afterworktrading]Hi all,
this is the first script from the series "afterworktrading". The goal is to develop and provide tools for traders with a fulltime job or little time for trading/analyzing charts.
Over time some of the scripts will also be linked to complete trading systems.
Let's start with my favourite one, the "RSS-Stochastik" with alert function.
The RSS-concept (Relative Spread Strength, developed by Ian Copsey) is based on the variance between a "short" and a "long" moving averages (or "slow" and "fast"), here between two EMA.
This variance is calculated and plotted in a RSI-diagram to show "overbought" and "oversold" conditions, helping to identify an ideal entry setup for trend continuation or catching a possible reversal.
Compared to the conventional RSI etc., possible reversal or trend continuation areas are often better represented in terms of quality, as an example see the Amazon-Chart.
The EMA-values, limit value thresholds and background colors can be set in the script. As a special feature, alarms can be set to be notified when a value has reached the extreme range. This reduces the screen time to the minimum.
In my personal trading, this indicator forms the basis for almost all trades, but is not a pure signal indicator on its own.
However, the informative value can be further improved if volume or support/resistance zones etc. are linked to the RSS, see example NASDAQ future with support zone price or 200 EMA.
Example for a possible RSS-Trade-Setup:
- choose an asset with a strong trend
- set alerts for crossing the oversold or overbought condition in direction of the trend
- in case of an alert check possible support/resistance areas on the current chart level (EMA, price zones, volume zones, anchored VWAP etc.)
- trade in the direction of the trend using your preferred entry setup
In my opinion, the system can be used very well, especially in trend phases, in order to obtain optimal entries.
Does it works also on lower timeframes?
Yes, it might work on every timeframe with a strong trend of high quality. Please see attached a 5m-Chart of GPBUSD-pair, notice the signal quality in direction of the trend.
Like every trading system this is not the "holy grail setup" and you will have losing trades. But handling this indicator with care you can have better entries especially in trend direction with less screen time due to the alert function.
Good luck with it! Further indicators will be published in the coming months, some will also be based on the RSS system.
As always: no liability for losing trades, no investment advice etc. Observe the risk limit for every trade!
BARTRADINGPREDV4Please note, that all of the indicators on the chart are working together. I am showing all of the indicators so that you might see the benefits of these indicators working as one. Do your own research. Trade smart. I code tools not advice. So please make decisions based on your trading style and knowledge. Use my scripts freely but please note they are protected by Mozilla.
Script Summary: BARTRADINGPREDV4
This Pine Script indicator is a comprehensive trading tool that overlays on your TradingView chart. It combines moving averages, regression channels, volume analysis, RSI filtering, and pattern recognition to assist in making trading decisions. It also provides a forward-looking projection to help anticipate future price movement.
Key Features & Logic
1. Moving Averages
HMA (High Moving Average): Simple moving average of the high price over a user-defined lookback period.
LMA (Low Moving Average): Simple moving average of the low price over the same period.
HLMA (High-Low Moving Average): The average of HMA and LMA, providing a midline reference.
2. RSI Filtering
Optionally enables a Relative Strength Index (RSI) filter to help avoid trades when the market is not trending strongly.
Only allows buy signals if RSI is above 50, and sell signals if RSI is below 50 (if enabled).
3. Signal Generation
BUY Signal: Triggered when HL2 (average of OHLC) crosses over LMA and (optionally) RSI > 50.
SELL Signal: Triggered when HL2 crosses under HMA and (optionally) RSI < 50.
XSB (Extra Strong Buy): HL2 crosses over HMA, is above HLMA, up volume is greater than down volume, and (optionally) RSI > 50.
XBS (Extra Strong Sell): HL2 crosses under LMA, is below HLMA, down volume is greater than up volume, and (optionally) RSI < 50.
Enable/Disable XSB/XBS: You can turn these signals on or off via script inputs.
4. Take Profit (TP) and Stop Loss (SL) Levels
TP and SL are dynamically calculated based on the difference between HMA and LMA, providing contextually relevant exit levels.
5. Regression Channel and Prediction
Linear Regression Line: Plots a regression line over the lookback period to show the underlying trend.
ATR Channel: Adds an upper and lower channel around the regression line using ATR (Average True Range) for a realistic prediction envelope.
Forward Projection: Projects the regression line forward by a user-defined number of bars, visually showing where the trend could extend if current momentum persists.
6. Pattern Recognition
Higher Highs/Lows and Lower Highs/Lows: Marks bars where new higher highs/lows or lower highs/lows are set, helping you spot trend continuation or reversal points.
7. Status Table
A table shows the current price’s relationship to HMA, HLMA, and LMA, color-coded for quick visual interpretation.
User Instructions
Inputs
Number of Lookback Bars: Sets the period for all moving averages and regression calculations.
Prediction Length: (Legacy; not used in current logic.)
TURN ON OR OFF XSB/XBS Signal: Toggle extra strong buy/sell signals.
Enable RSI Filter: Only allow signals when RSI is in the correct zone.
RSI Period: Sets the sensitivity of the RSI filter.
Table Position: Choose where the status table appears on your chart.
ATR Length & Multiplier: Control the width of the regression prediction channel.
Bars Forward (Projection): Number of bars to project the regression line into the future.
How to Use
Add the script to your TradingView chart.
Adjust inputs to suit your asset and timeframe.
Interpret signals:
BUY (B) and SELL (S): Appear as green/red labels below/above bars.
XSB (blue) and XBS (orange): Indicate extra strong buy/sell conditions.
HH/HL (green triangles): New higher highs/lows.
LH/LL (red triangles): New lower highs/lows.
Watch the regression channel: The yellow regression line shows the trend; the shaded band indicates expected volatility.
Check the projection: The dashed magenta line projects the regression trend forward, giving a visual target for price continuation.
Use the table: Quickly see if price is above or below each moving average.
Interpreting the Prediction Aspects
Regression Line & Channel
Regression Line (Yellow): Represents the best-fit line of price over the lookback period, showing overall trend direction.
ATR Channel: The upper and lower bands (yellow, semi-transparent) account for typical volatility, suggesting a range where price is likely to stay if the trend continues.
Forward Projection
Dashed Magenta Line: Projects the regression line forward by the specified number of bars, using the current slope. This is a trend continuation forecast—not a guarantee, but a statistically reasonable path if current conditions persist.
How to use: If price is respecting the regression trend and within the channel, the projection provides a visual target for where price might go in the near future.
TP/SL Levels
TP (Take Profit): Suggests a price target above the current HL2, based on recent volatility.
SL (Stop Loss): Suggests a protective stop below HL2.
Best Practices & Warnings
No indicator is perfect! Always combine signals with your own analysis and risk management.
Regression projection is not a crystal ball: It simply extends the current trend, which can and will change, especially after big news or at support/resistance.
Use on liquid, trending assets for best results.
Adjust lookback and ATR settings for your market and timeframe.
Summary Table Example
Price vs HMA vs HLMA vs LMA
43000 +100 +50 -20
Green: Price is above average (bullish).
Red: Price is below average (bearish).
Yellow: Price is very close to the average (neutral).
Final Notes
This script is designed to be a multi-tool for trend trading and prediction, combining classic and modern techniques. The forward projection helps visualize possible future price action, while signals and overlays keep you informed of trend shifts and trade opportunities.
Smart Money Concepts - By TradingNexus – Pro Visual Edition📊 Smart Money Concepts by TradingNexus
This script is designed for clean and visual Smart Money analysis.
This script identifies Smart Money Concepts with a clean and powerful visual layout, focusing on high-probability zones.
It displays:
Order Blocks (OB↑ / OB↓) when there's strong bullish or bearish candle reversal.
Fair Value Gaps (FVG↑ / FVG↓) only after impulsive candles (e.g., breaking previous highs/lows).
Break of Structure (BOS↑ / BOS↓) when a real structural shift happens.
🔥 Strong Zones only when OB + FVG + BOS align — these are ideal institutional entry areas.
RJLibrary "RJ"
The library is searching the FVG
find_bull_rj(provided_RJs, low_1, high_1, time_3, bar_closed, close_2, open_2, low_2)
Parameters:
provided_RJs (array type from maksym_hayovets/POITypes/6)
low_1 (float)
high_1 (float)
time_3 (int)
bar_closed (bool)
close_2 (float)
open_2 (float)
low_2 (float)