Enhanced Instantaneous Cycle Period - Dr. John EhlersThis is my first public release of detector code entitled "Enhanced Instantaneous Cycle Period" for PSv4.0 I built many months ago. Be forewarned, this is not an indicator, this is a detector to be used by ADVANCED developers to build futuristic indicators in Pine. The origins of this script come from a document by Dr. John Ehlers entitled "SIGNAL ANALYSIS CONCEPTS". You may find this using the NSA's reverse search engine "goggles", as I call it. John Ehlers' MESA used this measurement to establish the data window for analysis for MESA Cycle computations. So... does any developer wish to emulate MESA Cycle now??
I decided to take instantaneous cycle period to another level of novel attainability in this public release of source code with the following methods, if you are curious how I ENHANCED it. Firstly I reduced the delay of accurate measurement from bar_index==0 by quite a few bars closer to IPO. Secondarily, I provided a limit of 6 for a minimum instantaneous cycle period. At bar_index==0, it would provide a period of 0 wrecking many algorithms from the start. I also increased the instantaneous cycle period's maximum value to 80 from 50, providing a window of 6-80 for the instantaneous cycle period value window limits. Thirdly, I replaced the internal EMA with another algorithm. It reduces the lag while extracting a floating point number, for algorithms that will accept that, compared to a sluggish ordinary EMA return. You will see the excessive EMA delay with adding plot(ema(ICP,7)) as it was originally designed. Lastly it's in one simple function for reusability in a nice little package comprising of less than 40 lines of code. I hope I explained that adequately enough and gave you the reader a glimpse of the "Power of Pine" combined with ingenuity.
Be forewarned again, that most of Pine's built-in functions will not accept a floating-point number or dynamic integers for the "length" of it's calculation. You will have to emulate the built-in functions by creating Pine based custom functions, and I assure you, this is very possible in many cases, but not all without array support. You may use int(ICP) to extract an integer from the smoothICP return variable, which may be favorable compared to the choppiness/ringing if ICP alone.
This is commonly what my dense intricate code looks like behind the veil. If you are wondering why there is barely any notation, that's because the notation is in the variable naming and this is intended primarily for ADVANCED developers too. It does contain lines of code that explore techniques in Pine that may be applicable in other Pine projects for those learning or wishing to excel with Pine.
Showcased in the chart below is my free to use "Enhanced Schaff Trend Cycle Indicator", having a common appeal to TV users frequently. If you do have any questions or comments regarding this indicator, I will consider your inquiries, thoughts, and ideas presented below in the comments section, when time provides it. As always, "Like" it if you simply just like it with a proper thumbs up, and also return to my scripts list occasionally for additional postings. Have a profitable future everyone!
NOTICE: Copy pasting bandits who may be having nefarious thoughts, DO NOT attempt this, because this may violate Tradingview's terms, conditions and/or house rules. "WE" are always watching the TV community vigilantly for mischievous behaviors and actions that exploit well intended authors for the purpose of increasing brownie points in reputation scores. Hiding behind a "protected" wall may not protect you from investigation and account penalization by TV staff. Be respectful, and don't just throw an ma() in there branding it as "your" gizmo. Fair enough? Alrighty then... I firmly believe in "innovating" future state-of-the-art indicators, and please contact me if you wish to do so.
Search in scripts for "algo"
Bold Plot-v5A non multi time frame indicator script that includes different algorithms in order to create signals. All signals are created upon new candle open. Never re-paints. When initial entry achieved, it follows the trend and creates different RE-entry/TP/Safety Exit signals depending price movement. It is a release candidate version and still under development.
Changes in v5:
- Take Profit algorithm severely enhanced.
- New Safe Exit algorithm integrated. Safety Exit signals are being created if no take profit signals achieved after an initial entry or re-entry and safety exit algorithm senses a price movement change opposite to recent position.
- Re-Entry algorithm severely enhanced.
Zentrading Trend Follower_v1.1For more information on how to use and how to subscribe please visit
www.zentrading.co
Our ZenTrend Follower is designed to get you into trends in a safe an risk averse manner. It does not only provide you with buy and sell signals forcing you to either react quickly or miss the trade. Rather, our algorithm detects when a trend setup is active and plots a breakout level where you can enter the trade. This also makes it easy for you to scan many assets quickly: All you need to do is see if the indicator has detected a setup, if not, move on!
To ensure that you capture the trend, the indicator indicator shows you where to place your stop loss as the trend progresses. We will also show you a few other simple ways to exit the trades at higher profit levels in the detailed manual you receive after purchasing the indicator.
The shaded areas on the chart indicate that a trade setup has been detected by the algorithm: Green for bullish setups, red for bearish setups. The blue dots are the breakout level, if the price breaks this level the trade is entered. (as you can see on the chart, they can sometimes move towards the price!) Red crosses are plotted as your trailing stop loss, if price breaks the stop loss the trade is closed.
Jurik Moving Average🧠 Jurik Moving Average (JMA) — Ultra-Smooth Adaptive Trend Filter
This indicator implements a precise non-repainting recreation of the Jurik Moving Average (JMA) — a high-performance smoothing algorithm known for its ability to reduce lag while preserving rapid response to price changes. It is ideal for traders seeking a responsive yet stable line for trend detection, dynamic support/resistance, or signal generation.
⚙️ Core Functionality
At its heart, this indicator replicates the JMA logic as described in the original Jurik documentation, including:
✅ Adaptive smoothing based on price volatility.
✅ Variable phase shifting for forward/backward displacement.
✅ Power curve smoothing for dynamic control over responsiveness vs. smoothness.
✅ Volatility-aware band generation (optional).
The core algorithm uses a Kalman-style recursive filter with dynamic coefficients, adjusting to market conditions in real-time. Unlike traditional MAs (EMA, WMA, etc.), this implementation uses:
A volatility-normalized momentum engine to track price deviation (Kv factor).
A recursive double-smoothing mechanism for noise suppression without lag.
📈 Inputs
Length: Controls the base smoothing period.
Phase Shift: Moves the curve forward or backward in time (−100 to +100), for signal anticipation or lag removal.
Smoothing Power: Adjusts the sensitivity to price changes. Higher = smoother, lower = faster reaction.
Source: Any input (close, hl2, etc.) to apply the filter on.
Bands (optional): Dynamically generated adaptive envelopes based on real-time volatility.
🎯 How to Use
Use the JMA line as a trend-following tool or dynamic support/resistance.
Apply crossovers with price or other indicators for entries/exits.
Enable the bands to observe overbought/oversold zones or potential breakout areas.
Adjust phase to suit leading (anticipatory) or lagging (confirmation) strategies.
This tool is particularly suitable for:
Scalpers looking for precision in fast markets.
Swing traders filtering noise from signals.
Algorithmic systems needing high-fidelity moving averages.
Cluster Reversal Zones📌 Cluster Reversal Zones – Smart Market Turning Point Detector
📌 Category : Public (Restricted/Closed-Source) Indicator
📌 Designed for : Traders looking for high-accuracy reversal zones based on price clustering & liquidity shifts.
🔍 Overview
The Cluster Reversal Zones Indicator is an advanced market reversal detection tool that helps traders identify key turning points using a combination of price clustering, order flow analysis, and liquidity tracking. Instead of relying on static support and resistance levels, this tool dynamically adjusts to live market conditions, ensuring traders get the most accurate reversal signals possible.
📊 Core Features:
✅ Real-Time Reversal Zone Mapping – Detects high-probability market turning points using price clustering & order flow imbalance.
✅ Liquidity-Based Support/Resistance Detection – Identifies strong rejection zones based on real-time liquidity shifts.
✅ Order Flow Sensitivity for Smart Filtering – Filters out weak reversals by detecting real market participation behind price movements.
✅ Momentum Divergence for Confirmation – Aligns reversal zones with momentum divergences to increase accuracy.
✅ Adaptive Risk Management System – Adjusts risk parameters dynamically based on volatility and trend state.
🔒 Justification for Mashup
The Cluster Reversal Zones Indicator contains custom-built methodologies that extend beyond traditional support/resistance indicators:
✔ Smart Price Clustering Algorithm: Instead of plotting fixed support/resistance lines, this system analyzes historical price clustering to detect active reversal areas.
✔ Order Flow Delta & Liquidity Shift Sensitivity: The tool tracks real-time order flow data, identifying price zones with the highest accumulation or distribution levels.
✔ Momentum-Based Reversal Validation: Unlike traditional indicators, this tool requires a momentum shift confirmation before validating a potential reversal.
✔ Adaptive Reversal Filtering Mechanism: Uses a combination of historical confluence detection + live market validation to improve accuracy.
🛠️ How to Use:
• Works well for reversal traders, scalpers, and swing traders seeking precise turning points.
• Best combined with VWAP, Market Profile, and Delta Volume indicators for confirmation.
• Suitable for Forex, Indices, Commodities, Crypto, and Stock markets.
🚨 Important Note:
For educational & analytical purposes only.
Liquidity Trap Zones [PhenLabs]📊 Liquidity Trap Zones
Version: PineScript™ v6
📌 Description
The goal of the Liquidity Trap Zones indicator is to try and help traders identify areas where market liquidity appears abundant but is actually thin or artificial, helping traders avoid potential fake outs and false breakouts. This advanced indicator analyzes the relationship between price wicks and volume to detect “mirage” zones where large price movements occur on low volume, indicating potential liquidity traps.
By highlighting these deceptive zones on your charts, the indicator helps traders recognize where institutional players might be creating artificial liquidity to trap retail traders. This enables more informed decision-making and better risk management when approaching key price levels.
🚀 Points of Innovation
Mirage Score Algorithm: Proprietary calculation that normalizes wick size relative to volume and average bar size
Dynamic Zone Creation: Automatically generates gradient-filled zones at trap locations with ATR-based sizing
Intelligent Zone Management: Maintains clean charts by limiting displayed zones and auto-updating existing ones
Scale-Invariant Design: Works across all assets and timeframes with intelligent normalization
Real-Time Detection: Identifies trap zones as they form, not after the fact
Volume-Adjusted Analysis: Incorporates tick volume when available for more accurate detection
🔧 Core Components
Mirage Score Calculator: Analyzes the ratio of price wicks to volume, normalized by average bar size
ATR-Based Filter: Ensures only significant price movements are considered for trap zone creation
EMA Smoothing: Reduces noise in the mirage score for clearer signals
Gradient Zone Renderer: Creates visually distinct zones with multiple opacity levels for better visibility
🔥 Key Features
Real-Time Trap Detection: Identifies liquidity mirages as they develop during live trading
Dynamic Zone Sizing: Adjusts zone height based on current market volatility (ATR)
Smart Zone Management: Automatically maintains a clean chart by limiting the number of displayed zones
Customizable Sensitivity: Fine-tune detection parameters for different market conditions
Visual Clarity: Gradient-filled zones with distinct borders for easy identification
Status Line Display: Shows current mirage score and threshold for quick reference
🎨 Visualization
Gradient Trap Zones: Purple gradient boxes with darker centers indicating trap strength
Mirage Score Line: Orange line in status area showing current liquidity quality
Threshold Reference: Gray line showing your configured detection threshold
Extended Zone Display: Zones automatically extend forward as new bars form
📖 Usage Guidelines
Detection Settings
Smoothing Length (EMA) - Default: 10 - Range: 1-50 - Description: Controls responsiveness of mirage score. Lower values make detection more sensitive to recent price action
Mirage Threshold - Default: 5.0 - Range: 0.1-20.0 - Description: Score above this level triggers trap zone creation. Higher values reduce false positives but may miss subtle traps
Filter Settings
ATR Length for Range Filter - Default: 14 - Range: 1-50 - Description: Period for volatility calculation. Standard 14 works well for most timeframes
ATR Multiplier - Default: 1.0 - Range: 0.0-5.0 - Description: Minimum bar range as multiple of ATR. Higher values filter out smaller moves
Display Settings
Zone Height Multiplier - Default: 0.5 - Range: 0.1-2.0 - Description: Controls trap zone height relative to ATR. Adjust for visual preference
Max Trap Zones - Default: 5 - Range: 1-20 - Description: Maximum zones displayed before oldest are removed. Balance clarity vs. history
✅ Best Use Cases
Identifying potential fakeout levels before entering trades
Confirming support/resistance quality by checking for liquidity traps
Avoiding stop-loss placement in trap zones where sweeps are likely
Timing entries after trap zones are cleared
Scalping opportunities when price approaches known trap zones
⚠️ Limitations
Requires volume data - less effective on instruments without reliable volume
May generate false signals during news events or genuine volume spikes
Not a standalone system - combine with price action and other indicators
Zone creation is based on historical data - future price behavior not guaranteed
💡 What Makes This Unique
First indicator to specifically target liquidity mirages using wick-to-volume analysis
Proprietary normalization ensures consistent performance across all markets
Visual gradient design makes trap zones immediately recognizable
Combines multiple volatility and volume metrics for robust detection
🔬 How It Works
1. Wick Analysis: Calculates upper and lower wicks for each bar. Normalizes by average bar size to ensure scale independence
2. Mirage Score Calculation: Divides total wick size by volume to identify thin liquidity. Applies EMA smoothing to reduce noise. Scales result for optimal visibility
3. Zone Creation: Triggers when smoothed score crosses threshold. Creates gradient boxes centered on trap bar. Sizes zones based on current ATR for market-appropriate scaling
💡 Note: Liquidity Trap Zones works best when combined with traditional support/resistance analysis and volume profile indicators. The zones highlight areas of deceptive liquidity but should not be the sole factor in trading decisions. Always use proper risk management and confirm signals with price action.
Signal Quality Validator - Lite# Signal Quality Validator Lite - Technical Documentation
## Introduction
The Signal Quality Validator (SQV) Lite represents a comprehensive approach to technical signal validation, designed to evaluate trading opportunities through multi-dimensional market analysis. This indicator provides traders with objective quality assessments for their entry signals across various market conditions and timeframes.
## Core Architecture
### Component-Based Validation System
SQV Lite employs five fundamental market components, each contributing weighted scores to produce a final quality assessment. The system analyzes multiple market dimensions simultaneously to provide comprehensive signal validation.
Each component uses proprietary algorithms to evaluate specific market conditions:
- Directional bias and strength assessment
- Market participation and flow analysis
- Price acceleration patterns
- Key technical level identification
- Optimal volatility conditions
The final score represents a weighted combination of all components, with thresholds adjusted for different market conditions and timeframes.
## Scoring Methodology
### Quality Grades
- **Grade A+ (90-100)**: Exceptional setup quality with maximum component confluence
- **Grade A (80-89)**: High-quality signals suitable for full position sizing
- **Grade B (65-79)**: Acceptable signals meeting minimum validation criteria
- **Grade C (<65)**: Substandard conditions, signal rejected
### Timeframe Profiles
Pre-configured profiles optimize component weights and thresholds:
| Profile | Typical Use Case | Min/High/Perfect Scores |
|---------|------------------|------------------------|
| 1-5 min | Scalping | 60/75/85 |
| 15-30 min | Day Trading | 65/80/90 |
| 1H-4H | Intraday Swing | 70/85/95 |
| Daily+ | Position Trading | 75/88/95 |
| Custom | User Defined | Configurable |
## Integration Guide
### Standalone Usage
1. Add SQV Lite to your chart
2. Select appropriate timeframe profile
3. Monitor real-time quality grades on signal bars
4. Use dashboard for current market assessment
### Bidirectional Strategy Integration
SQV Lite supports complete two-way communication with your custom strategies, enabling sophisticated signal validation workflows.
#### Step 1: Setting Up Your Strategy to Send Signals
In your custom strategy/indicator, export your signals as plots:
```pinescript
//@version=6
indicator("My Custom Strategy", overlay=true)
// Your signal logic
longSignal = ta.crossover(ema9, ema21) // Example
shortSignal = ta.crossunder(ema9, ema21) // Example
// CRITICAL: Export signals for SQV to read
// Use display=display.none to hide the plots
plot(longSignal ? 1 : 0, "Long Signal Output", display=display.none)
plot(shortSignal ? 1 : 0, "Short Signal Output", display=display.none)
```
#### Step 2: Configure SQV Lite to Receive Signals
1. Add SQV Lite to the same chart as your strategy
2. In SQV Lite settings, enable "Use External Signals"
3. Click on "External Long Signal Source" and select your strategy's "Long Signal Output"
4. Click on "External Short Signal Source" and select your strategy's "Short Signal Output"
#### Step 3: Import SQV Validation Back to Your Strategy
Complete the bidirectional flow by importing SQV's validation results:
```pinescript
//@version=6
strategy("My Strategy with SQV Integration", overlay=true)
// Import SQV validation results
sqvScore = input.source(close, "SQV Score Source", group="SQV Integration")
sqvLongValid = input.source(close, "SQV Long Valid Source", group="SQV Integration")
sqvShortValid = input.source(close, "SQV Short Valid Source", group="SQV Integration")
sqvTradingMode = input.source(close, "SQV Trading Mode", group="SQV Integration")
// Your original signals
longSignal = ta.crossover(ema9, ema21)
shortSignal = ta.crossunder(ema9, ema21)
// Export for SQV
plot(longSignal ? 1 : 0, "Long Signal Output", display=display.none)
plot(shortSignal ? 1 : 0, "Short Signal Output", display=display.none)
// Use SQV validation in entry logic
if longSignal and sqvLongValid > 0
strategy.entry("Long", strategy.long)
// Optional: Use sqvScore for position sizing
if shortSignal and sqvShortValid > 0
strategy.entry("Short", strategy.short)
```
#### Step 4: Complete Integration Setup
After adding both scripts to your chart:
1. In your strategy settings → SQV Integration:
- Set "SQV Score Source" → Select SQV Lite: SQV Score
- Set "SQV Long Valid Source" → Select SQV Lite: SQV Long Valid
- Set "SQV Short Valid Source" → Select SQV Lite: SQV Short Valid
2. In SQV Lite settings → Signal Import:
- Enable "Use External Signals"
- Set "External Long Signal Source" → Select Your Strategy: Long Signal Output
- Set "External Short Signal Source" → Select Your Strategy: Short Signal Output
### Available Data Exports from SQV
```pinescript
// Core validation data
plot(currentTotalScore, "SQV Score", display=display.none) // 0-100
plot(sqvLongValid ? 1 : 0, "SQV Long Valid", display=display.none) // 0 or 1
plot(sqvShortValid ? 1 : 0, "SQV Short Valid", display=display.none) // 0 or 1
// Component scores for advanced usage
plot(currentTrendScore, "SQV Trend Score", display=display.none)
plot(currentVolumeScore, "SQV Volume Score", display=display.none)
plot(currentMomentumScore, "SQV Momentum Score", display=display.none)
plot(currentStructureScore, "SQV Structure Score", display=display.none)
plot(currentVolatilityScore, "SQV Volatility Score", display=display.none)
// Additional data
plot(orderFlowDelta, "SQV Order Flow Delta", display=display.none)
plot(tradingMode == "Long" ? 1 : tradingMode == "Short" ? -1 : 0, "SQV Trading Mode", display=display.none)
```
### Advanced Integration Examples
#### Example 1: Quality-Based Position Sizing
```pinescript
// In your strategy
sqvScore = input.source(close, "SQV Score Source", group="SQV Integration")
// Dynamic position sizing based on signal quality
positionSize = sqvScore >= 90 ? 3 : // A+ quality = 3 units
sqvScore >= 80 ? 2 : // A quality = 2 units
sqvScore >= 65 ? 1 : 0 // B quality = 1 unit
if longSignal and sqvLongValid > 0 and positionSize > 0
strategy.entry("Long", strategy.long, qty=positionSize)
```
#### Example 2: Filtering by Component Scores
```pinescript
// Import individual components
sqvTrend = input.source(close, "SQV Trend Score", group="SQV Integration")
sqvVolume = input.source(close, "SQV Volume Score", group="SQV Integration")
sqvMomentum = input.source(close, "SQV Momentum Score", group="SQV Integration")
// Custom filtering logic
strongTrend = sqvTrend > 80
goodVolume = sqvVolume > 70
strongSetup = strongTrend and goodVolume
if longSignal and sqvLongValid > 0 and strongSetup
strategy.entry("Strong Long", strategy.long)
```
#### Example 3: Order Flow Integration
```pinescript
// Import order flow data
sqvOrderFlow = input.source(close, "SQV Order Flow Delta", group="SQV Integration")
// Use order flow for additional confirmation
bullishFlow = sqvOrderFlow > 100 // Significant buying pressure
bearishFlow = sqvOrderFlow < -100 // Significant selling pressure
if longSignal and sqvLongValid > 0 and bullishFlow
strategy.entry("Long+Flow", strategy.long)
```
### Visual Feedback Configuration
#### Label Display Modes
1. **Autonomous Mode** (standalone testing):
- Enable "Show Labels Without Signals"
- Labels appear on every bar where score >= minimum threshold
- Useful for initial testing without strategy integration
2. **Signal Mode** (production use):
- Disable "Show Labels Without Signals"
- Enable "Use External Signals"
- Labels appear ONLY when your strategy generates signals
- Prevents chart clutter, shows validation exactly when needed
#### Troubleshooting Integration
**Common Issues:**
1. **Labels not appearing:**
- Verify "Use External Signals" is enabled
- Check signal sources are properly connected
- Ensure your strategy is actually generating signals (add visible plots temporarily)
2. **Wrong source selection:**
- Source dropdowns should show your indicator/strategy name
- Each output plot should be visible in the dropdown
- If not visible, check plot titles in your strategy
3. **Validation always failing:**
- Check Trading Mode matches your signal types
- Verify minimum score thresholds aren't too high
- Use Autonomous Mode to test if SQV is working properly
### Best Practices
1. **Always use `display=display.none`** for communication plots to keep charts clean
2. **Name your plots clearly** for easy identification in source dropdowns
3. **Test in Autonomous Mode first** to understand SQV behavior
4. **Use consistent signal logic** - ensure signals are binary (1 or 0)
5. **Consider adding a small delay** between signal and entry for validation processing
### Complete Integration Template
Here's a full template for a strategy with complete SQV integration:
```pinescript
//@version=6
strategy("Complete SQV Integration Template", overlay=true)
// ========== SQV Integration Inputs ==========
sqvScore = input.source(close, "SQV Score Source", group="SQV Integration")
sqvLongValid = input.source(close, "SQV Long Valid Source", group="SQV Integration")
sqvShortValid = input.source(close, "SQV Short Valid Source", group="SQV Integration")
sqvOrderFlow = input.source(close, "SQV Order Flow Delta", group="SQV Integration")
// ========== Strategy Parameters ==========
emaFast = input.int(9, "Fast EMA")
emaSlow = input.int(21, "Slow EMA")
useQualitySizing = input.bool(true, "Use Quality-Based Sizing")
// ========== Indicators ==========
ema1 = ta.ema(close, emaFast)
ema2 = ta.ema(close, emaSlow)
// ========== Signal Logic ==========
longSignal = ta.crossover(ema1, ema2)
shortSignal = ta.crossunder(ema1, ema2)
// ========== Export Signals to SQV ==========
plot(longSignal ? 1 : 0, "Long Signal Output", display=display.none)
plot(shortSignal ? 1 : 0, "Short Signal Output", display=display.none)
// ========== Position Sizing ==========
baseSize = 1
qualityMultiplier = useQualitySizing ?
(sqvScore >= 90 ? 3 : sqvScore >= 80 ? 2 : 1) : 1
positionSize = baseSize * qualityMultiplier
// ========== Entry Logic with SQV Validation ==========
if longSignal and sqvLongValid > 0
strategy.entry("Long", strategy.long, qty=positionSize)
if shortSignal and sqvShortValid > 0
strategy.entry("Short", strategy.short, qty=positionSize)
// ========== Exit Logic ==========
if strategy.position_size > 0 and shortSignal
strategy.close("Long")
if strategy.position_size < 0 and longSignal
strategy.close("Short")
// ========== Visual Feedback ==========
plotshape(longSignal and sqvLongValid > 0, "Valid Long",
location=location.belowbar, color=color.green, style=shape.triangleup)
plotshape(shortSignal and sqvShortValid > 0, "Valid Short",
location=location.abovebar, color=color.red, style=shape.triangledown)
```
This template provides everything needed for professional bidirectional integration between your custom strategy and SQV Lite.
## Order Flow Analysis
The integrated Order Flow system automatically adapts to market conditions, providing intelligent analysis of buying and selling pressure. The system handles various market scenarios including low liquidity and minimal price movement conditions through advanced algorithms.
## Visual Interface
### Signal Labels
Displays three-line information blocks:
- Grade designation (A+, A, B, C)
- Numerical quality score
- Order flow direction and magnitude
### Dashboard Elements
- **Profile Display**: Active configuration and thresholds
- **Score Visualization**: Real-time quality assessment
- **Flow Indicator**: Directional bias representation
- **Status Monitor**: Ready/Wait signal state
### Customization Options
- Label distance adjustment (0.5-3.0x ATR)
- Profile selection and custom configuration
- Component weight modifications (Custom mode)
- Threshold adjustments for different market conditions
## Trading Mode Selection
Three operational modes accommodate different trading styles:
- **Long Only**: Validates bullish signals exclusively
- **Short Only**: Validates bearish signals exclusively
- **Both**: Bi-directional signal validation
## Performance Considerations
SQV Lite maintains computational efficiency through:
- Optimized calculation cycles
- Selective component updates
- Efficient data structure usage
- Minimal redundant processing
---
## Feature Comparison: SQV Lite vs Full Version
### Core Components
| Component | SQV Lite | SQV Full | Details |
|-----------|----------|----------|---------|
| **Trend Analysis** | ✅ Full | ✅ Full | Professional trend evaluation |
| **Volume Dynamics** | ✅ Full | ✅ Full | Advanced volume analysis |
| **Momentum Assessment** | ✅ Full | ✅ Full | Multi-factor momentum |
| **Market Structure** | ✅ Basic | ✅ Enhanced | Key level detection |
| **Volatility Filter** | ✅ Full | ✅ Full | Risk-adjusted filtering |
| **Performance Analytics** | ❌ | ✅ | Real-time performance tracking |
| **Impulse Detection** | ❌ | ✅ | Advanced signal filtering |
### Advanced Features
| Feature | SQV Lite | SQV Full | Benefits |
|---------|----------|----------|----------|
| **Multi-Timeframe Analysis** | ❌ | ✅ | Higher timeframe confirmation |
| **Dynamic Position Sizing** | ❌ | ✅ Automatic | Dynamic size optimization |
| **Auto Mode** | ❌ | ✅ | Self-optimizing system |
| **Advanced Profiling** | ❌ | ✅ | Market depth analysis |
| **Recovery Mode** | ❌ | ✅ | Adaptive drawdown handling |
| **Statistical Validation** | ❌ | ✅ | Confidence-based filtering |
### Profiles & Configuration
| Feature | SQV Lite | SQV Full |
|---------|----------|----------|
| **Timeframe Profiles** | 5 | 8 |
| **Available Profiles** | 1-5m, 15-30m, 1-4H, Daily+, Custom | All Lite + ES, NQ, Auto |
| **Custom Weights** | ✅ Manual | ✅ Manual + Auto-optimization |
| **Threshold Adjustment** | ✅ | ✅ Enhanced |
### Visual Interface
| Feature | SQV Lite | SQV Full |
|---------|----------|----------|
| **Dashboard Styles** | 1 (Standard) | 4 (Multiple layouts) |
| **Signal Labels** | ✅ Basic | ✅ Enhanced with sizing |
| **Advanced Visualizations** | ❌ | ✅ |
| **Component Breakdown** | ❌ | ✅ Detailed view |
| **Performance Display** | ❌ | ✅ Live statistics |
| **Debug Mode** | ❌ | ✅ |
### Integration Capabilities
| Feature | SQV Lite | SQV Full |
|---------|----------|----------|
| **Script Type** | Indicator | Strategy |
| **Signal Import** | ✅ | Via strategy conditions |
| **Data Export** | ✅ All via plots | Internal to strategy |
| **Bidirectional Flow** | ✅ Full support | One-way (strategy-based) |
### Risk Management
| Feature | SQV Lite | SQV Full |
|---------|----------|----------|
| **Position Sizing** | Manual | ✅ Automatic |
| **Quality-Based Sizing** | Via integration | ✅ Built-in |
| **Performance Adjustment** | ❌ | ✅ |
| **Risk Grade System** | ❌ | ✅ Risk grading system |
| **Statistical Filtering** | ❌ | ✅ |
### Market Analysis
| Feature | SQV Lite | SQV Full |
|---------|----------|----------|
| **Order Flow Analysis** | ✅ Automatic | ✅ Advanced |
| **Market Manipulation Detection** | ❌ | ✅ |
| **Multi-Timeframe Validation** | ❌ | ✅ |
| **Advanced Momentum Analysis** | Basic | ✅ Enhanced |
| **Market Regime Adaptation** | Basic | ✅ Full Auto Mode |
### Summary
| Aspect | SQV Lite | SQV Full |
|--------|----------|----------|
| **Best For** | Signal validation, integration with custom strategies | Complete trading system with built-in strategy |
| **Learning Curve** | Easy | Moderate |
| **Customization** | High (via integration) | Very High (all parameters) |
| **Price** | Free | $29/month |
---
## SQV Bridge System
### Overview
The SQV Bridge System allows you to connect any TradingView indicator or strategy with the Signal Quality Validator (SQV) system. This enables you to add professional-grade signal validation to your existing trading tools without modifying their code.
### System Components
1. **SQV Lite** (Required) - The core validation engine
2. **Bridge** (Choose one):
- **Indicator Bridge** - For visual signals and alerts
- **Strategy Bridge** - For automated backtesting and trading
3. **Your Trading Tool** - Any indicator or strategy that generates signals
---
## SQV Indicator Bridge
### //@version=6
### indicator("SQV Indicator Bridge", overlay=true)
### Purpose
The Indicator Bridge displays validated entry signals on your chart. It receives signals from any indicator and validation from SQV Lite, showing only high-quality trade opportunities.
### Features
- Visual labels for validated signals
- Customizable appearance (size, color, position)
- Alert capabilities
- Hidden signal exports for other tools
### Setup Instructions
1. **Add Your Indicator**
- Apply your trading indicator to the chart
- Note which plots contain long/short signals
2. **Add SQV Lite**
- Add SQV Lite indicator to the same chart
- Configure SQV settings as needed
3. **Add Indicator Bridge**
- Add "SQV Indicator Bridge" to chart
- Connect the sources:
- Long Signal Source → Your indicator's long signal
- Short Signal Source → Your indicator's short signal
- SQV Long Valid → From SQV Lite
- SQV Short Valid → From SQV Lite
- SQV Score → From SQV Lite (for alerts)
### Configuration Options
#### Visual Settings
- **Show Labels**: Toggle signal labels on/off
- **Label Offset**: Distance from candles (0-5 ATR)
- **Label Size**: Tiny, Small, or Normal
- **Colors**: Customize long/short colors
#### Alerts
- Enable/disable alert notifications
- Alerts include SQV score in message
### Example Code (Add to Your Indicator)
```pinescript
// Export signals from your indicator
plot(longCondition ? 1 : 0, "Long Signal", display=display.none)
plot(shortCondition ? 1 : 0, "Short Signal", display=display.none)
```
### Complete Indicator Bridge Code
```pinescript
//@version=6
indicator("SQV Indicator Bridge", overlay=true)
// ===================================================================
// SQV INDICATOR BRIDGE - CLEAN VERSION
// Version 1.0
//
// Simple bridge that shows validated entry signals.
// Receives signals from any indicator and validation from SQV Lite.
//
// SETUP:
// 1. Add your indicator to chart
// 2. Add SQV Lite to chart
// 3. Add this bridge
// 4. Connect sources in settings
// ===================================================================
// ===================================================================
// INPUT SOURCES
// ===================================================================
// From your indicator
longSignal = input.source(close, "Long Signal Source", group="Signal Sources",
tooltip="Select Long Signal from your indicator")
shortSignal = input.source(close, "Short Signal Source", group="Signal Sources",
tooltip="Select Short Signal from your indicator")
// From SQV Lite
sqvLongValid = input.source(close, "SQV Long Valid", group="SQV Sources",
tooltip="Select 'SQV Long Valid' from SQV Lite")
sqvShortValid = input.source(close, "SQV Short Valid", group="SQV Sources",
tooltip="Select 'SQV Short Valid' from SQV Lite")
sqvScore = input.source(close, "SQV Score", group="SQV Sources",
tooltip="Select 'SQV Score' from SQV Lite (for alerts)")
// ===================================================================
// SETTINGS
// ===================================================================
showLabels = input.bool(true, "Show Labels", group="Visual")
labelOffset = input.float(0.0, "Label Offset (ATR)", minval=0.0, maxval=5.0, step=0.5, group="Visual",
tooltip="0 = Labels at candle edges, higher = further away")
labelSize = input.string("small", "Label Size", options= , group="Visual")
longColor = input.color(color.green, "Long Color", group="Visual")
shortColor = input.color(color.red, "Short Color", group="Visual")
enableAlerts = input.bool(false, "Enable Alerts", group="Alerts")
// ===================================================================
// MAIN LOGIC
// ===================================================================
// Calculate offset
atr = ta.atr(14)
offset = labelOffset > 0 ? atr * labelOffset : 0
// Check for validated signals
hasValidLong = longSignal > 0 and sqvLongValid > 0 and barstate.isconfirmed
hasValidShort = shortSignal > 0 and sqvShortValid > 0 and barstate.isconfirmed
// Show labels
if showLabels
if hasValidLong
label.new(bar_index, low - offset, "LONG",
style=label.style_label_up,
color=longColor,
textcolor=color.white,
size=labelSize == "tiny" ? size.tiny :
labelSize == "small" ? size.small : size.normal)
if hasValidShort
label.new(bar_index, high + offset, "SHORT",
style=label.style_label_down,
color=shortColor,
textcolor=color.white,
size=labelSize == "tiny" ? size.tiny :
labelSize == "small" ? size.small : size.normal)
// Alerts
if enableAlerts
if hasValidLong
alert("Long Signal Validated | Score: " + str.tostring(sqvScore, "#"), alert.freq_once_per_bar_close)
if hasValidShort
alert("Short Signal Validated | Score: " + str.tostring(sqvScore, "#"), alert.freq_once_per_bar_close)
// Hidden exports
plot(hasValidLong ? 1 : 0, "Valid Long", display=display.none)
plot(hasValidShort ? 1 : 0, "Valid Short", display=display.none)
```
---
## SQV Strategy Bridge
### //@version=6
### strategy("SQV Strategy Bridge", overlay=true, ...)
### Purpose
The Strategy Bridge executes trades with SQV validation, enabling backtesting and live trading with quality-filtered signals. It can receive position sizing, stop loss, and take profit levels from your strategy.
### Features
- Automated trade execution with SQV validation
- Dynamic position sizing support
- Stop loss and take profit integration
- Position status display
- Alert system for trade notifications
### Setup Instructions
1. **Prepare Your Strategy**
- Export required values as plots (see examples below)
- Ensure signals are clear (1 for entry, 0 for no signal)
2. **Add SQV Lite**
- Add SQV Lite indicator to the chart
- Configure validation parameters
3. **Add Strategy Bridge**
- Add "SQV Strategy Bridge" to chart
- Connect all required sources
### Source Connections
#### Required Sources
- **Long Signal Source** → Your strategy's long signal
- **Short Signal Source** → Your strategy's short signal
- **SQV Long Valid** → From SQV Lite
- **SQV Short Valid** → From SQV Lite
- **SQV Score** → From SQV Lite
#### Optional Sources (Advanced)
- **Position Size Source** → Dynamic position sizing
- **Long/Short Stop Loss** → Stop loss prices
- **Long/Short Take Profit** → Take profit prices
### Configuration Options
#### Position Management
- **Use Position Size from Strategy**: Enable dynamic sizing
- **Default Position Size %**: Fallback size (0.1-100%)
#### Risk Management
- **Use Stop Loss from Strategy**: Enable dynamic stops
- **Use Take Profit from Strategy**: Enable dynamic targets
### Example Code (Add to Your Strategy)
```pinescript
// Basic signal export
plot(buySignal ? 1 : 0, "Long Signal", display=display.none)
plot(sellSignal ? 1 : 0, "Short Signal", display=display.none)
// Advanced exports (optional)
// Position size (0.1 = 10% of equity)
plot(myPositionSize, "Position Size Output", display=display.none)
// Stop loss prices
plot(longStopPrice, "Long Stop Price", display=display.none)
plot(shortStopPrice, "Short Stop Price", display=display.none)
// Take profit prices
plot(longTPPrice, "Long TP Price", display=display.none)
plot(shortTPPrice, "Short TP Price", display=display.none)
```
### Complete Strategy Bridge Code
```pinescript
//@version=6
strategy("SQV Strategy Bridge",
overlay=true,
initial_capital=10000,
default_qty_type=strategy.percent_of_equity,
default_qty_value=10,
commission_type=strategy.commission.percent,
commission_value=0.1)
// ===================================================================
// SQV STRATEGY BRIDGE - SIMPLE VERSION
// Version 1.0
//
// Receives everything from your strategy:
// - Signals (when to trade)
// - Position size (how much to trade)
// - Stop loss levels (optional)
// - Take profit levels (optional)
//
// Bridge only executes trades with SQV validation
// ===================================================================
// ===================================================================
// SIGNAL SOURCES
// ===================================================================
longSignal = input.source(close, "Long Signal Source", group="Signal Sources",
tooltip="Connect to Long Signal from your strategy")
shortSignal = input.source(close, "Short Signal Source", group="Signal Sources",
tooltip="Connect to Short Signal from your strategy")
// ===================================================================
// SQV SOURCES
// ===================================================================
sqvLongValid = input.source(close, "SQV Long Valid", group="SQV Sources")
sqvShortValid = input.source(close, "SQV Short Valid", group="SQV Sources")
sqvScore = input.source(close, "SQV Score", group="SQV Sources")
// ===================================================================
// POSITION SIZE SOURCES (FROM YOUR STRATEGY)
// ===================================================================
usePositionFromStrategy = input.bool(false, "Use Position Size from Strategy", group="Position")
positionSizeSource = input.source(close, "Position Size Source", group="Position",
tooltip="Your strategy should export position size (% or fixed quantity)")
defaultPositionSize = input.float(10, "Default Position Size %", minval=0.1, maxval=100, group="Position",
tooltip="Used if 'Use Position Size from Strategy' is disabled")
// ===================================================================
// STOP LOSS SOURCES (FROM YOUR STRATEGY)
// ===================================================================
useStopFromStrategy = input.bool(false, "Use Stop Loss from Strategy", group="Risk Management")
longStopSource = input.source(close, "Long Stop Loss Price", group="Risk Management",
tooltip="Your strategy should export exact stop price for longs")
shortStopSource = input.source(close, "Short Stop Loss Price", group="Risk Management",
tooltip="Your strategy should export exact stop price for shorts")
// ===================================================================
// TAKE PROFIT SOURCES (FROM YOUR STRATEGY)
// ===================================================================
useTakeProfitFromStrategy = input.bool(false, "Use Take Profit from Strategy", group="Risk Management")
longTakeProfitSource = input.source(close, "Long Take Profit Price", group="Risk Management",
tooltip="Your strategy should export exact TP price for longs")
shortTakeProfitSource = input.source(close, "Short Take Profit Price", group="Risk Management",
tooltip="Your strategy should export exact TP price for shorts")
// ===================================================================
// ALERTS
// ===================================================================
enableAlerts = input.bool(true, "Enable Alerts", group="Alerts")
// ===================================================================
// TRADING LOGIC
// ===================================================================
// Check signals with SQV validation
hasLongSignal = longSignal > 0 and sqvLongValid > 0 and barstate.isconfirmed
hasShortSignal = shortSignal > 0 and sqvShortValid > 0 and barstate.isconfirmed
// Position state
inLong = strategy.position_size > 0
inShort = strategy.position_size < 0
// Get position size
getPositionSize() =>
if usePositionFromStrategy and positionSizeSource > 0
positionSizeSource
else
defaultPositionSize / 100
// LONG ENTRY
if hasLongSignal and not inLong
if inShort
strategy.close("Short")
qty = getPositionSize()
strategy.entry("Long", strategy.long, qty=qty)
// Set exit orders if provided by strategy
if useStopFromStrategy or useTakeProfitFromStrategy
stopPrice = useStopFromStrategy and longStopSource > 0 ? longStopSource : na
tpPrice = useTakeProfitFromStrategy and longTakeProfitSource > 0 ? longTakeProfitSource : na
if not na(stopPrice) or not na(tpPrice)
strategy.exit("Long Exit", "Long", stop=stopPrice, limit=tpPrice)
if enableAlerts
alert("Long Entry | Score: " + str.tostring(sqvScore, "#"), alert.freq_once_per_bar_close)
// SHORT ENTRY
if hasShortSignal and not inShort
if inLong
strategy.close("Long")
qty = getPositionSize()
strategy.entry("Short", strategy.short, qty=qty)
// Set exit orders if provided by strategy
if useStopFromStrategy or useTakeProfitFromStrategy
stopPrice = useStopFromStrategy and shortStopSource > 0 ? shortStopSource : na
tpPrice = useTakeProfitFromStrategy and shortTakeProfitSource > 0 ? shortTakeProfitSource : na
if not na(stopPrice) or not na(tpPrice)
strategy.exit("Short Exit", "Short", stop=stopPrice, limit=tpPrice)
if enableAlerts
alert("Short Entry | Score: " + str.tostring(sqvScore, "#"), alert.freq_once_per_bar_close)
// ===================================================================
// POSITION INFO
// ===================================================================
var label infoLabel = label.new(bar_index, high, "", style=label.style_label_left)
if barstate.islast
posText = "Bridge Status\n"
posText := inLong ? posText + "Position: LONG\n" : inShort ? posText + "Position: SHORT\n" : posText + "Position: FLAT\n"
posText := "SQV Score: " + str.tostring(sqvScore, "#")
label.set_xy(infoLabel, bar_index + 1, high)
label.set_text(infoLabel, posText)
label.set_color(infoLabel, inLong ? color.new(color.green, 80) : inShort ? color.new(color.red, 80) : color.new(color.gray, 80))
label.set_textcolor(infoLabel, color.white)
// ===================================================================
// HOW TO EXPORT FROM YOUR STRATEGY:
//
// // In your strategy, export these values:
//
// // Position size (% as decimal: 0.1 = 10%, or fixed: 0.2 = 0.2 BTC)
// plot(myPositionSize, "Position Size Output", display=display.none)
//
// // Stop loss prices
// plot(longStopPrice, "Long Stop Price", display=display.none)
// plot(shortStopPrice, "Short Stop Price", display=display.none)
//
// // Take profit prices
// plot(longTPPrice, "Long TP Price", display=display.none)
// plot(shortTPPrice, "Short TP Price", display=display.none)
// ===================================================================
```
---
## Quick Start Guide
### For Indicators (Visual Signals)
1. Add these three indicators in order:
- Your trading indicator
- SQV Lite
- SQV Indicator Bridge
2. In Bridge settings, connect:
- Signal sources from your indicator
- Validation sources from SQV Lite
3. Adjust visual settings to preference
### For Strategies (Automated Trading)
1. Modify your strategy to export signals:
```pinescript
plot(longSignal ? 1 : 0, "Long Signal", display=display.none)
plot(shortSignal ? 1 : 0, "Short Signal", display=display.none)
```
2. Add to chart:
- Your modified strategy (as indicator)
- SQV Lite
- SQV Strategy Bridge
3. Connect all sources in Bridge settings
4. Run backtest or enable live trading
---
## Tips & Best Practices
### Signal Quality
- SQV validates signals based on 5 market components (7 in full version)
- Only signals with sufficient quality score pass validation
- Adjust SQV settings to match your trading style
### Position Sizing
- Default sizing uses percentage of equity
- Advanced users can export dynamic sizing from strategy
- Size based on signal quality or market conditions
### Risk Management
- Always use stop losses (manual or from strategy)
- Consider using SQV's quality score for position sizing
- Monitor win rate and Sharpe ratio in SQV dashboard (full version)
### Troubleshooting
- **No signals showing**: Check source connections
- **Too few signals**: Lower SQV minimum score
- **Too many signals**: Increase SQV requirements
- **Backtest issues**: Ensure strategy calculations match
---
## Example Setups
### Simple Moving Average Cross + SQV
```pinescript
// In your indicator
ma_fast = ta.sma(close, 20)
ma_slow = ta.sma(close, 50)
longSignal = ta.crossover(ma_fast, ma_slow)
shortSignal = ta.crossunder(ma_fast, ma_slow)
plot(longSignal ? 1 : 0, "Long Signal", display=display.none)
plot(shortSignal ? 1 : 0, "Short Signal", display=display.none)
```
### RSI Strategy with Dynamic Stops
```pinescript
// In your strategy
rsi = ta.rsi(close, 14)
longSignal = rsi < 30
shortSignal = rsi > 70
// Dynamic stops based on ATR
atr = ta.atr(14)
longStop = close - (atr * 2)
shortStop = close + (atr * 2)
// Export everything
plot(longSignal ? 1 : 0, "Long Signal", display=display.none)
plot(shortSignal ? 1 : 0, "Short Signal", display=display.none)
plot(longStop, "Long Stop Price", display=display.none)
plot(shortStop, "Short Stop Price", display=display.none)
```
---
## Advanced Features
### Multi-Timeframe Validation
SQV automatically checks higher timeframes for confluence, improving signal reliability (Full version only).
### Adaptive Profiles
Use "Auto" profile in SQV for dynamic parameter adjustment based on market conditions (Full version only).
### Performance Tracking
SQV tracks win rate, Sharpe ratio, and other metrics to ensure consistent performance (Full version only).
### Order Flow Analysis
Validates signals using volume delta and buying/selling pressure (included in Lite version).
---
## Upgrade to SQV Full Version
### Enhanced Capabilities in Full Version
The complete SQV system extends validation capabilities with advanced components:
#### 🎯 **Performance Analytics Component**
- Real-time Sharpe Ratio calculation
- Win rate tracking with confidence intervals
- Risk-adjusted performance metrics
- Adaptive threshold adjustments
#### ⚡ **Impulse Detection with Trap Analysis**
- Advanced momentum surge detection
- Market manipulation identification
- False breakout filtering
- Volume/price divergence analysis
#### 📊 **Multi-Timeframe Confluence**
- Three-timeframe trend alignment
- Higher timeframe confirmation requirements
- Confluence strength scoring
- Directional bias validation
#### 🎰 **Dynamic Position Sizing**
- Automatic position multipliers based on signal quality
- Grade A+ signals (90+) = Maximum multiplier
- Grade A signals (80-89) = Scaled multiplier
- Grade B signals (65-79) = Base position size
- Risk-adjusted position management
- Sharpe-influenced adjustments
#### 🔄 **Auto Mode**
- Market-adaptive parameter optimization
- Dynamic weight redistribution
- Volatility-based threshold adjustments
- Self-calibrating component settings
#### 📈 **Volume Profile Integration**
- Point of Control (POC) identification
- Value Area analysis (VAH/VAL)
- Profile-based support/resistance
- Volume distribution visualization
#### 🛡️ **Recovery Mode**
- Drawdown detection and adaptation
- Conservative validation during recovery
- Gradual threshold normalization
- Performance-based re-engagement
#### 📊 **Extended Visualizations**
- Multiple dashboard layouts
- Component breakdown displays
- Performance statistics panels
- Risk grade assessments
### Why Upgrade?
While SQV Lite provides robust signal validation, the Full Version transforms your trading with:
- **Automated risk management** through dynamic sizing
- **Superior signal filtering** via Impulse and MTF components
- **Performance optimization** with real-time analytics
- **Market adaptation** through Auto Mode
- **Additional dashboard layouts** for complete market insight
The Full Version includes everything in Lite plus seven additional premium components.
---
## 💰 **SQV Full Version Pricing**
### **Monthly Subscription: $29/month**
Get instant access to the complete Signal Quality Validator system with all premium features:
- ✅ All 7 additional advanced components
- ✅ Automatic position sizing optimization
- ✅ Performance analytics & Sharpe tracking
- ✅ Impulse detection with trap analysis
- ✅ Multi-timeframe confluence validation
- ✅ Auto Mode with self-optimization
- ✅ Recovery mode for drawdown management
- ✅ 4 dashboard layouts
- ✅ Lifetime updates included
- ✅ Priority support
**The automatic position sizing feature alone can pay for months of subscription with a single properly-sized winning trade.**
### 📩 **How to Subscribe**
To get access to SQV Full Version:
1. **Send me a DM** on TradingView
2. **Include your TradingView username/ID** in the message
3. Receive payment instructions and access upon confirmation
*Your TradingView ID is required to grant access to the private indicator.*
### 🔧 **Custom Integration Services**
**Need direct integration into your Pine Script strategy?**
For traders requiring seamless library-based integration without the 500-bar limitation:
- Full backtesting on complete price history
- Zero signal delay
- Custom parameter optimization
- Private library implementation
**📩 DM me for custom integration pricing and details**
---
## Support and Updates
- Both bridges are regularly updated
- SQV Lite receives regular maintenance updates
- For technical questions or feature requests, please reach out through TradingView's messaging system
- Check for new features and improvements in the script descriptions
## Disclaimer
Signal Quality Validator provides technical analysis assistance only. All trading decisions remain the sole responsibility of the user. Past performance does not guarantee future results. Trade responsibly and within your risk tolerance.
*Note: This system is designed for educational purposes. Always test thoroughly before live trading.*
TrEx H/L Trendlines [ETPINVEST]TrEx H/L Trendlines - User Guide
🎯 WHAT IS THIS INDICATOR?
TrEx H/L Trendlines is a professional indicator for automatic search and display of price extremes with trendline construction.
🔍 WHAT IS IT USED FOR?
Main tasks:
Extreme identification - automatic search for significant price highs and lows
Trend analysis - building trendlines between found extremes
Reversal point detection - identifying potential zones of direction change
Structural analysis - understanding the internal structure of price movement
Who is it suitable for:
📈 Swing traders - for identifying key turning points
⚡ Day traders - for analyzing intraday structure
🎯 Scalpers - for precise local extreme identification
📊 Analysts - for structural market analysis
⚙️ HOW DOES THE ALGORITHM WORK?
1. Extreme search
The indicator uses a complex algorithm to find significant highs and lows through strictly defined candle combinations.
Validation - verification of compliance with strict mathematical conditions
2. Filtering and alternation
Found extremes undergo additional processing:
Selection of strongest - choosing the most significant extremes in each zone
Ensuring alternation - correct sequence of highs and lows
Time sorting - chronological ordering
3. Trendline construction
Based on filtered extremes, connecting lines are built:
Sequential connection - linking all extremes in order
Trend visualization - displaying overall movement direction
Structure analysis - understanding internal movement waves
🛠️ DETAILED SETTINGS DESCRIPTION
📊 Extremes
Show Extremes
Purpose: Enable/disable extreme display
Default: Enabled
Upper Extreme Color
Purpose: Color of upper extreme markers (highs)
Default: Red
Lower Extreme Color
Purpose: Color of lower extreme markers (lows)
Default: Green
Analysis Depth
Range: 50-300 bars
Default: 200
Purpose: Depth of historical analysis for extreme search
Timeframe recommendations:
- M1-M5: 100-150 bars
- M15-H1: 150-250 bars
- H4-D1: 200-300 bars
📈 Trendline
Show Trendline
Purpose: Enable/disable trendline display
Default: Enabled
Trendline Color
Purpose: Color of trendlines connecting extremes
Default: Yellow
Trendline Width
Range: 1-5 pixels
Default: 1
Purpose: Thickness of trendlines
📈 PRACTICAL USAGE TIPS
🎯 Trading strategies
1. Trading from extremes
✅ Buy signal:
Price approaches lower extreme (green marker)
Reversal pattern forms on lower timeframe
Confirmation by volume or other indicators
✅ Sell signal:
Price approaches upper extreme (red marker)
Reversal pattern forms on lower timeframe
Confirmation by additional signals
2. Trend structure analysis
✅ Uptrend:
Sequential higher highs and lows
Trendlines directed upward
Each new extreme higher than previous
✅ Downtrend:
Sequential lower highs and lows
Trendlines directed downward
Each new extreme lower than previous
3. Trend reversal identification
⚠️ Reversal signals:
Violation of extreme sequence
Change in trendline slope
Formation of divergences with oscillators
💡 Settings optimization
For scalping (M1-M5):
Analysis Depth: 100-150
Focus on fresh extremes
For day trading (M15-H1):
Analysis Depth: 150-200
Balance between history and relevance
For swing trading (H4-D1):
Analysis Depth: 200-300
Maximum analysis depth
🔍 Additional techniques
Combining with other tools:
Oscillators - finding divergences at extremes
TrEx S/R Levels - applying support and resistance levels
⚠️ IMPORTANT FEATURES
✅ Advantages:
Automation - no manual extreme search required
Mathematical precision - strict selection algorithms
Universality - works on any assets and timeframes
Ease of use - intuitive interface
Trend analysis - automatic structure construction
Real-time updates - on each candle close
⚠️ Limitations:
Requires history - needs minimum 50 bars for operation
Lag - extremes determined after their formation
🎯 CONCLUSION
TrEx H/L Trendlines is a powerful tool for automatic analysis of extremes and trend structure of the market. The indicator is perfect for studying price behavior and can serve as a foundation for developing trading strategies.
Smarter Money Flow Divergence Detector [PhenLabs]📊 Smarter Money Flow Divergence Detector
Version: PineScript™ v6
📌 Description
SMFD was developed to help give you guys a better ability to “read” what is going on behind the scenes without directly having access to that level of data. SMFD is an enhanced divergence detection indicator that identifies money flow patterns from advanced volume analysis and price action correspondence. The detection portion of this indicator combines intelligent money flow calculations with multi timeframe volume analysis to help you see hidden accumulation and distribution phases before major price movements occur.
The indicator measures institutional trading activity by looking at volume surges, price volume dynamics, and the factors of momentum to construct an overall picture of market sentiment. It’s built to assist traders in identifying high probability entries by identifying if smart money is positioning against price action.
🚀 Points of Innovation
● Advanced Smart Money Flow algorithm with volume spike detection and large trade weighting
● Multi timeframe volume analysis for enhanced institutional activity detection
● Dynamic overbought/oversold zones that adapt to current market conditions
● Enhanced divergence detection with pivot confirmation and strength validation
● Color themes with customizable visual styling options
● Real time institutional bias tracking through accumulation/distribution analysis
🔧 Core Components
● Smart Money Flow Calculation: Combines price momentum, volume expansion, and VWAP analysis
● Institutional Bias Oscillator: Tracks accumulation/distribution patterns with volume pressure analysis
● Enhanced Divergence Engine: Detects bullish/bearish divergences with multiple confirmation factors
● Dynamic Zone Detection: Automatically adjusts overbought/oversold levels based on market volatility
● Volume Pressure Analysis: Measures buying vs selling pressure over configurable periods
● Multi factor Signal System: Generates entries with trend alignment and strength validation
🔥 Key Features
● Smart Money Flow Period: Configurable calculation period for institutional activity detection
● Volume Spike Threshold: Adjustable multiplier for detecting unusual institutional volume
● Large Trade Weight: Emphasis factor for high volume periods in flow calculations
● Pivot Detection: Customizable lookback period for accurate divergence identification
● Signal Sensitivity: Three tier system (Conservative/Medium/Aggressive) for signal generation
● Themes: Four color schemes optimized for different chart backgrounds
🎨 Visualization
● Main Oscillator: Line, Area, or Histogram display styles with dynamic color coding
● Institutional Bias Line: Real time tracking of accumulation/distribution phases
● Dynamic Zones: Adaptive overbought/oversold boundaries with gradient fills
● Divergence Lines: Automatic drawing of bullish/bearish divergence connections
● Entry Signals: Clear BUY/SELL labels with signal strength indicators
● Information Panel: Real time statistics and status updates in customizable positions
📖 Usage Guidelines
Algorithm Settings
● Smart Money Flow Period
○ Default: 20
○ Range: 5-100
○ Description: Controls the calculation period for institutional flow analysis.
Higher values provide smoother signals but reduce responsiveness to recent activity
● Volume Spike Threshold
○ Default: 1.8
○ Range: 1.0-5.0
○ Description: Multiplier for detecting unusual volume activity indicating institutional participation. Higher values require more extreme volume for detection
● Large Trade Weight
○ Default: 2.5
○ Range: 1.5-5.0
○ Description: Weight applied to high volume periods in smart money calculations. Increases emphasis on institutional sized transactions
Divergence Detection
● Pivot Detection Period
○ Default: 12
○ Range: 5-50
○ Description: Bars to analyze for pivot high/low identification.
Affects divergence accuracy and signal frequency
● Minimum Divergence Strength
○ Default: 0.25
○ Range: 0.1-1.0
○ Description: Required price change percentage for valid divergence patterns.
Higher values filter out weaker signals
✅ Best Use Cases
● Trading with intraday to daily timeframes for institutional position identification
● Confirming trend reversals when divergences align with support/resistance levels
● Entry timing in trending markets when institutional bias supports the direction
● Risk management by avoiding trades against strong institutional positioning
● Multi timeframe analysis combining short term signals with longer term bias
⚠️ Limitations
● Requires sufficient volume for accurate institutional detection in low volume markets
● Divergence signals may have false positives during highly volatile news events
● Best performance on liquid markets with consistent institutional participation
● Lagging nature of volume based calculations may delay signal generation
● Effectiveness reduced during low participation holiday periods
💡 What Makes This Unique
● Multi Factor Analysis: Combines volume, price, and momentum for comprehensive institutional detection
● Adaptive Zones: Dynamic overbought/oversold levels that adjust to market conditions
● Volume Intelligence: Advanced algorithms identify institutional sized transactions
● Professional Visualization: Multiple display styles with customizable themes
● Confirmation System: Multiple validation layers reduce false signal generation
🔬 How It Works
1. Volume Analysis Phase:
● Analyzes current volume against historical averages to identify institutional activity
● Applies multi timeframe analysis for enhanced detection accuracy
● Calculates volume pressure through buying vs selling momentum
2. Smart Money Flow Calculation:
● Combines typical price with volume weighted analysis
● Applies institutional trade weighting for high volume periods
● Generates directional flow based on price momentum and volume expansion
3. Divergence Detection Process:
● Identifies pivot highs/lows in both price and indicator values
● Validates divergence strength against minimum threshold requirements
● Confirms signals through multiple technical factors before generation
💡 Note: This indicator works best when combined with proper risk management and position sizing. The institutional bias component helps identify market sentiment shifts, while divergence signals provide specific entry opportunities. For optimal results, use on liquid markets with consistent institutional participation and combine with additional technical analysis methods.
Faster Heikin AshiFaster Heikin Ashi
The Faster Heikin Ashi improves traditional Heikin Ashi candles by introducing advanced weighting mechanisms and lag reduction techniques. While maintaining the price smoothing benefits of standard Heikin Ashi, this enhanced version delivers faster signals and responsiveness.
Key Features
Unified Responsiveness Control
Single parameter (0.1 - 1.0) controls all responsiveness aspects
Eliminates conflicting settings found in other enhanced HA indicators
Intuitive scaling from conservative (0.1) to highly responsive (1.0)
Advanced Weighted Calculations
Smart Close Weighting: Close prices receive 2-3x more influence for faster trend detection
Dynamic OHLC Processing: All price components are intelligently weighted based on responsiveness setting
Balanced High/Low Emphasis: Maintains price level accuracy while improving speed
Enhanced Open Calculation
Transition Speed: Open prices "catch up" to market movements faster
Lag Reduction Algorithm: Eliminates the typical delay in Heikin Ashi open calculations
Smooth Integration: Maintains visual continuity while improving responsiveness
Four-Color Scheme
- 🟢 **Lime**: Strong bullish momentum
- 🔴 **Red**: Strong bearish momentum
- 🟢 **Green**: Moderate bullish
- 🔴 **Maroon**: Moderate bearish
How It Works
Traditional Heikin Ashi smooths price action but often lags behind real market movements. This enhanced version:
1. Weights price components based on their predictive value
2. Accelerates trend transitions through advanced open calculations
3. Scales all enhancements through a single responsiveness parameter
4. Maintains smoothing benefits while reducing lag
Responsiveness (0.1 - 1.0)
0.1 - 0.3: Conservative, maximum smoothing
0.4 - 0.6: Balanced, good for swing trading and trend following
0.7 - 1.0: Aggressive, fast signals, suitable for scalping and active trading
Identical Candles Detector [Premium]Identical Candles Detector
Advanced pattern recognition for consecutive similar candles
Description
This professional-grade indicator detects sequences of nearly identical candles, a pattern often signaling consolidation before significant breakouts. Unlike basic similarity detectors, it employs a weighted comparison system evaluating both candle bodies and wicks with adjustable tolerance.
Key Features:
Smart Comparison Algorithm: Weighs body vs. wick importance (adjustable 0-100%)
Directional Filtering: Optional same-direction requirement for bullish/bearish consistency
Statistical Backtesting: Tracks historical pattern success rates in real-time
Future Projection: Analyzes post-pattern performance with customizable lookahead
Visual Highlighting: Clear pattern marking with optional performance statistics
How It Works:
Calculates weighted candle size (body + wicks)
Compares consecutive candles within user-defined tolerance
Verifies directional consistency when enabled
Evaluates future price action for statistical significance
Usage Guidelines:
Best used on 15m-4h timeframes for swing trading
Combine with volume confirmation for higher probability signals
Tighten tolerance (3-5%) for more precise patterns
Use minimum pattern distance to avoid over-crowding
Technical Notes:
Safe historical access prevents lookback errors
Comprehensive input validation ensures stable operation
Memory-efficient implementation supports long backtests
Why This Stands Out:
While simple candle patterns are common, this tool adds:
Quantitative similarity measurement
Configurable component weighting
Built-in performance analytics
Professional-grade alert conditions
Note: This is not a standalone trading system. Always use with proper risk management and confirmation from other indicators.
Lorentzian Classification - Advanced Trading DashboardLorentzian Classification - Relativistic Market Analysis
A Journey from Theory to Trading Reality
What began as fascination with Einstein's relativity and Lorentzian geometry has evolved into a practical trading tool that bridges theoretical physics and market dynamics. This indicator represents months of wrestling with complex mathematical concepts, debugging intricate algorithms, and transforming abstract theory into actionable trading signals.
The Theoretical Foundation
Lorentzian Distance in Market Space
Traditional Euclidean distance treats all feature differences equally, but markets don't behave uniformly. Lorentzian distance, borrowed from spacetime geometry, provides a more nuanced similarity measure:
d(x,y) = Σ ln(1 + |xi - yi|)
This logarithmic formulation naturally handles:
Scale invariance: Large price moves don't overwhelm small but significant patterns
Outlier robustness: Extreme values are dampened rather than dominating
Non-linear relationships: Captures market behavior better than linear metrics
K-Nearest Neighbors with Relativistic Weighting
The algorithm searches historical market states for patterns similar to current conditions. Each neighbor receives weight inversely proportional to its Lorentzian distance:
w = 1 / (1 + distance)
This creates a "gravitational" effect where closer patterns have stronger influence on predictions.
The Implementation Challenge
Creating meaningful market features required extensive experimentation:
Price Features: Multi-timeframe momentum (1, 2, 3, 5, 8 bar lookbacks) Volume Features: Relative volume analysis against 20-period average
Volatility Features: ATR and Bollinger Band width normalization Momentum Features: RSI deviation from neutral and MACD/price ratio
Each feature undergoes min-max normalization to ensure equal weighting in distance calculations.
The Prediction Mechanism
For each current market state:
Feature Vector Construction: 12-dimensional representation of market conditions
Historical Search: Scan lookback period for similar patterns using Lorentzian distance
Neighbor Selection: Identify K nearest historical matches
Outcome Analysis: Examine what happened N bars after each match
Weighted Prediction: Combine outcomes using distance-based weights
Confidence Calculation: Measure agreement between neighbors
Technical Hurdles Overcome
Array Management: Complex indexing to prevent look-ahead bias
Distance Calculations: Optimizing nested loops for performance
Memory Constraints: Balancing lookback depth with computational limits
Signal Filtering: Preventing clustering of identical signals
Advanced Dashboard System
Main Control Panel
The primary dashboard provides real-time market intelligence:
Signal Status: Current prediction with confidence percentage
Neighbor Analysis: How many historical patterns match current conditions
Market Regime: Trend strength, volatility, and volume analysis
Temporal Context: Real-time updates with timestamp
Performance Analytics
Comprehensive tracking system monitors:
Win Rate: Percentage of successful predictions
Signal Count: Total predictions generated
Streak Analysis: Current winning/losing sequence
Drawdown Monitoring: Maximum equity decline
Sharpe Approximation: Risk-adjusted performance estimate
Risk Assessment Panel
Multi-dimensional risk analysis:
RSI Positioning: Overbought/oversold conditions
ATR Percentage: Current volatility relative to price
Bollinger Position: Price location within volatility bands
MACD Alignment: Momentum confirmation
Confidence Heatmap
Visual representation of prediction reliability:
Historical Confidence: Last 10 periods of prediction certainty
Strength Analysis: Magnitude of prediction values over time
Pattern Recognition: Color-coded confidence levels for quick assessment
Input Parameters Deep Dive
Core Algorithm Settings
K Nearest Neighbors (1-20): More neighbors create smoother but less responsive signals. Optimal range 5-8 for most markets.
Historical Lookback (50-500): Deeper history improves pattern recognition but reduces adaptability. 100-200 bars optimal for most timeframes.
Feature Window (5-30): Longer windows capture more context but reduce sensitivity. Match to your trading timeframe.
Feature Selection
Price Changes: Essential for momentum and reversal detection Volume Profile: Critical for institutional activity recognition Volatility Measures: Key for regime change detection Momentum Indicators: Vital for trend confirmation
Signal Generation
Prediction Horizon (1-20): How far ahead to predict. Shorter horizons for scalping, longer for swing trading.
Signal Threshold (0.5-0.9): Confidence required for signal generation. Higher values reduce false signals but may miss opportunities.
Smoothing (1-10): EMA applied to raw predictions. More smoothing reduces noise but increases lag.
Visual Design Philosophy
Color Themes
Professional: Corporate blue/red for institutional environments Neon: Cyberpunk cyan/magenta for modern aesthetics
Matrix: Green/red hacker-inspired palette Classic: Traditional trading colors
Information Hierarchy
The dashboard system prioritizes information by importance:
Primary Signals: Largest, most prominent display
Confidence Metrics: Secondary but clearly visible
Supporting Data: Detailed but unobtrusive
Historical Context: Available but not distracting
Trading Applications
Signal Interpretation
Long Signals: Prediction > threshold with high confidence
Look for volume confirmation
- Check trend alignment
- Verify support levels
Short Signals: Prediction < -threshold with high confidence
Confirm with resistance levels
- Check for distribution patterns
- Verify momentum divergence
- Market Regime Adaptation
Trending Markets: Higher confidence in directional signals
Ranging Markets: Focus on reversal signals at extremes
Volatile Markets: Require higher confidence thresholds
Low Volume: Reduce position sizes, increase caution
Risk Management Integration
Confidence-Based Sizing: Larger positions for higher confidence signals
Regime-Aware Stops: Wider stops in volatile regimes
Multi-Timeframe Confirmation: Align signals across timeframes
Volume Confirmation: Require volume support for major signals
Originality and Innovation
This indicator represents genuine innovation in several areas:
Mathematical Approach
First application of Lorentzian geometry to market pattern recognition. Unlike Euclidean-based systems, this naturally handles market non-linearities.
Feature Engineering
Sophisticated multi-dimensional feature space combining price, volume, volatility, and momentum in normalized form.
Visualization System
Professional-grade dashboard system providing comprehensive market intelligence in intuitive format.
Performance Tracking
Real-time performance analytics typically found only in institutional trading systems.
Development Journey
Creating this indicator involved overcoming numerous technical challenges:
Mathematical Complexity: Translating theoretical concepts into practical code
Performance Optimization: Balancing accuracy with computational efficiency
User Interface Design: Making complex data accessible and actionable
Signal Quality: Filtering noise while maintaining responsiveness
The result is a tool that brings institutional-grade analytics to individual traders while maintaining the theoretical rigor of its mathematical foundation.
Best Practices
- Parameter Optimization
- Start with default settings and adjust based on:
Market Characteristics: Volatile vs. stable
Trading Timeframe: Scalping vs. swing trading
Risk Tolerance: Conservative vs. aggressive
Signal Confirmation
Never trade on Lorentzian signals alone:
Price Action: Confirm with support/resistance
Volume: Verify with volume analysis
Multiple Timeframes: Check higher timeframe alignment
Market Context: Consider overall market conditions
Risk Management
Position Sizing: Scale with confidence levels
Stop Losses: Adapt to market volatility
Profit Targets: Based on historical performance
Maximum Risk: Never exceed 2-3% per trade
Disclaimer
This indicator is for educational and research purposes only. It does not constitute financial advice or guarantee profitable trading results. The Lorentzian classification system reveals market patterns but cannot predict future price movements with certainty. Always use proper risk management, conduct your own analysis, and never risk more than you can afford to lose.
Market dynamics are inherently uncertain, and past performance does not guarantee future results. This tool should be used as part of a comprehensive trading strategy, not as a standalone solution.
Bringing the elegance of relativistic geometry to market analysis through sophisticated pattern recognition and intuitive visualization.
Thank you for sharing the idea. You're more than a follower, you're a leader!
@vasanthgautham1221
Trade with precision. Trade with insight.
— Dskyz , for DAFE Trading Systems
PhenLabs - Market Fluid Dynamics📊 Market Fluid Dynamics -
Version: PineScript™ v6
📌 Description
The Market Fluid Dynamics - Phen indicator is a new thinking regarding market analysis by modeling price action, volume, and volatility using a fluid system. It attempts to offer traders control over more profound market forces, such as momentum (speed), resistance (thickness), and buying/selling pressure. By visualizing such dynamics, the script allows the traders to decide on the prevailing market flow, its power, likely continuations, and zones of calmness and chaos, and thereby allows improved decision-making.
This measure avoids the usual difficulty of reconciling multiple, often contradictory, market indications by including them within a single overarching model. It moves beyond traditional binary indicators by providing a multi-dimensional view of market behavior, employing fluid dynamic analogs to describe complex interactions in an accessible manner.
🚀 Points of Innovation
Integrated Fluid Dynamics Model: Combines velocity, viscosity, pressure, and turbulence into a single indicator.
Normalized Metrics: Uses ATR and other normalization techniques for consistent readings across different assets and timeframes.
Dynamic Flow Visualization: Main flow line changes color and intensity based on direction and strength.
Turbulence Background: Visually represents market stability with a gradient background, from calm to turbulent.
Comprehensive Dashboard: Provides an at-a-glance summary of key fluid dynamic metrics.
Multi-Layer Smoothing: Employs several layers of EMA smoothing for a clearer, more responsive main flow line.
🔧 Core Components
Velocity Component: Measures price momentum (first derivative of price), normalized by ATR. It indicates the speed and direction of price changes.
Viscosity Component: Represents market resistance to price changes, derived from ATR relative to its historical average. Higher viscosity suggests it’s harder for prices to move.
Pressure Component: Quantifies the force created by volume and price range (close - open), normalized by ATR. It reflects buying or selling pressure.
Turbulence Detection: Calculates a Reynolds number equivalent to identify market stability, ranging from laminar (stable) to turbulent (chaotic).
Main Flow Indicator: Combines the above components, applying sensitivity and smoothing, to generate a primary signal of market direction and strength.
🔥 Key Features
Advanced Smoothing Algorithm: Utilizes multiple EMA layers on the raw flow calculation for a fluid and responsive main flow line, reducing noise while maintaining sensitivity.
Gradient Flow Coloring: The main flow line dynamically changes color from light to deep blue for bullish flow and light to deep red for bearish flow, with intensity reflecting flow strength. This provides an immediate visual cue of market sentiment and momentum.
Turbulence Level Background: The chart background changes color based on calculated turbulence (from calm gray to vibrant orange), offering an intuitive understanding of market stability and potential for erratic price action.
Informative Dashboard: A customizable on-screen table displays critical metrics like Flow State, Flow Strength, Market Viscosity, Turbulence, Pressure Force, Flow Acceleration, and Flow Continuity, allowing traders to quickly assess current market conditions.
Configurable Lookback and Sensitivity: Users can adjust the base lookback period for calculations and the sensitivity of the flow to viscosity, tailoring the indicator to different trading styles and market conditions.
Alert Conditions: Pre-defined alerts for flow direction changes (positive/negative crossover of zero line) and detection of high turbulence states.
🎨 Visualization
Main Flow Line: A smoothed line plotted below the main chart, colored blue for bullish flow and red for bearish flow. The intensity of the color (light to dark) indicates the strength of the flow. This line crossing the zero line can signal a change in market direction.
Zero Line: A dotted horizontal line at the zero level, serving as a baseline to gauge whether the market flow is positive (bullish) or negative (bearish).
Turbulence Background: The indicator pane’s background color changes based on the calculated turbulence level. A calm, almost transparent gray indicates low turbulence (laminar flow), while a more vibrant, semi-transparent orange signifies high turbulence. This helps traders visually assess market stability.
Dashboard Table: An optional table displayed on the chart, showing key metrics like ‘Flow State’, ‘Flow Strength’, ‘Market Viscosity’, ‘Turbulence’, ‘Pressure Force’, ‘Flow Acceleration’, and ‘Flow Continuity’ with their current values and qualitative descriptions (e.g., ‘Bullish Flow’, ‘Laminar (Stable)’).
📖 Usage Guidelines
Setting Categories
Show Dashboard - Default: true; Range: true/false; Description: Toggles the visibility of the Market Fluid Dynamics dashboard on the chart. Enable to see key metrics at a glance.
Base Lookback Period - Default: 14; Range: 5 - (no upper limit, practical limits apply); Description: Sets the primary lookback period for core calculations like velocity, ATR, and volume SMA. Shorter periods make the indicator more sensitive to recent price action, while longer periods provide a smoother, slower signal.
Flow Sensitivity - Default: 0.5; Range: 0.1 - 1.0 (step 0.1); Description: Adjusts how much the market viscosity dampens the raw flow. A lower value means viscosity has less impact (flow is more sensitive to raw velocity/pressure), while a higher value means viscosity has a greater dampening effect.
Flow Smoothing - Default: 5; Range: 1 - 20; Description: Controls the length of the EMA smoothing applied to the main flow line. Higher values result in a smoother flow line but with more lag; lower values make it more responsive but potentially noisier.
Dashboard Position - Default: ‘Top Right’; Range: ‘Top Right’, ‘Top Left’, ‘Bottom Right’, ‘Bottom Left’, ‘Middle Right’, ‘Middle Left’; Description: Determines the placement of the dashboard on the chart.
Header Size - Default: ‘Normal’; Range: ‘Tiny’, ‘Small’, ‘Normal’, ‘Large’, ‘Huge’; Description: Sets the text size for the dashboard header.
Values Size - Default: ‘Small’; Range: ‘Tiny’, ‘Small’, ‘Normal’, ‘Large’; Description: Sets the text size for the metric values in the dashboard.
✅ Best Use Cases
Trend Identification: Identifying the dominant market flow (bullish or bearish) and its strength to trade in the direction of the prevailing trend.
Momentum Confirmation: Using the flow strength and acceleration to confirm the conviction behind price movements.
Volatility Assessment: Utilizing the turbulence metric to gauge market stability, helping to adjust position sizing or avoid choppy conditions.
Reversal Spotting: Watching for divergences between price and flow, or crossovers of the main flow line above/below the zero line, as potential reversal signals, especially when combined with changes in pressure or viscosity.
Swing Trading: Leveraging the smoothed flow line to capture medium-term market swings, entering when flow aligns with the desired trade direction and exiting when flow weakens or reverses.
Intraday Scalping: Using shorter lookback periods and higher sensitivity to identify quick shifts in flow and turbulence for short-term trading opportunities, particularly in liquid markets.
⚠️ Limitations
Lagging Nature: Like many indicators based on moving averages and lookback periods, the main flow line can lag behind rapid price changes, potentially leading to delayed signals.
Whipsaws in Ranging Markets: During periods of low volatility or sideways price action (high viscosity, low flow strength), the indicator might produce frequent buy/sell signals (whipsaws) as the flow oscillates around the zero line.
Not a Standalone System: While comprehensive, it should be used in conjunction with other forms of analysis (e.g., price action, support/resistance levels, other indicators) and not as a sole basis for trading decisions.
Subjectivity in Interpretation: While the dashboard provides quantitative values, the interpretation of “strong” flow, “high” turbulence, or “significant” acceleration can still have a subjective element depending on the trader’s strategy and risk tolerance.
💡 What Makes This Unique
Fluid Dynamics Analogy: Its core strength lies in translating complex market interactions into an intuitive fluid dynamics framework, making concepts like momentum, resistance, and pressure easier to visualize and understand.
Market View: Instead of focusing on a single aspect (like just momentum or just volatility), it integrates multiple factors (velocity, viscosity, pressure, turbulence) to provide a more comprehensive picture of market conditions.
Adaptive Visualization: The dynamic coloring of the flow line and the turbulence background provide immediate, adaptive visual feedback that changes with market conditions.
🔬 How It Works
Price Velocity Calculation: The indicator first calculates price velocity by measuring the rate of change of the closing price over a given ‘lookback’ period. The raw velocity is then normalized by the Average True Range (ATR) of the same lookback period. Normalization enables comparison of momentum between assets or timeframes by scaling for volatility. This is the direction and speed of initial price movement.
Viscosity Calculation: Market ‘viscosity’ or resistance to price movement is determined by looking at the current ATR relative to its longer-term average (SMA of ATR over lookback * 2). The further the current ATR is above its average, the lower the viscosity (less resistance to price movement), and vice-versa. The script inverts this relationship and bounds it so that rising viscosity means more resistance.
Pressure Force Measurement: A ‘pressure’ variable is calculated as a function of the ratio of current volume to its simple moving average, multiplied by the price range (close - open) and normalized by ATR. This is designed to measure the force behind price movement created by volume and intraday price thrusts. This pressure is smoothed by an EMA.
Turbulence State Evaluation: A equivalent ‘Reynolds number’ is calculated by dividing the absolute normalized velocity by the viscosity. This is the proclivity of the market to move in a chaotic or orderly fashion. This ‘reynoldsValue’ is smoothed with an EMA to get the ‘turbulenceState’, which indicates if the market is laminar (stable), transitional, or turbulent.
Main Flow Derivation: The ‘rawFlow’ is calculated by taking the normalized velocity, dampening its impact based on the ‘viscosity’ and user-input ‘sensitivity’, and orienting it by the sign of the smoothed ‘pressureSmooth’. The ‘rawFlow’ is then put through multiple layers of exponential moving average (EMA) smoothing (with ‘smoothingLength’ and derived values) to reach the final ‘mainFlow’ line. The extensive smoothing is designed to give a smooth and clear visualization of the overall market direction and magnitude.
Dashboard Metrics Compilation: Additional metrics like flow acceleration (derivative of mainFlow), and flow continuity (correlation between close and volume) are calculated. All primary components (Flow State, Strength, Viscosity, Turbulence, Pressure, Acceleration, Continuity) are then presented in a user-configurable dashboard for ease of monitoring.
💡 Note:
The “Market Fluid Dynamics - Phen” indicator is designed to offer a unique perspective on market behavior by applying principles from fluid dynamics. It’s most effective when used to understand the underlying forces driving price rather than as a direct buy/sell signal generator in isolation. Experiment with the settings, particularly the ‘Base Lookback Period’, ‘Flow Sensitivity’, and ‘Flow Smoothing’, to find what best suits your trading style and the specific asset you are analyzing. Always combine its insights with robust risk management practices.
[blackcat] L1 Net Volume DifferenceOVERVIEW
The L1 Net Volume Difference indicator serves as an advanced analytical tool designed to provide traders with deep insights into market sentiment by examining the differential between buying and selling volumes over precise timeframes. By leveraging these volume dynamics, it helps identify trends and potential reversal points more accurately, thereby supporting well-informed decision-making processes. The key focus lies in dissecting intraday changes that reflect short-term market behavior, offering critical input for both swing and day traders alike. 📊
Key benefits encompass:
• Precise calculation of net volume differences grounded in real-time data.
• Interactive visualization elements enhancing interpretability effortlessly.
• Real-time generation of buy/sell signals driven by dynamic volume shifts.
TECHNICAL ANALYSIS COMPONENTS
📉 Volume Accumulation Mechanisms:
Monitors cumulative buy/sell volumes derived from comparative closing prices.
Periodically resets accumulation counters aligning with predefined intervals (e.g., 5-minute bars).
Facilitates identification of directional biases reflecting underlying market forces accurately.
🕵️♂️ Sentiment Detection Algorithms:
Employs proprietary logic distinguishing between bullish/bearish sentiments dynamically.
Ensures consistent adherence to predefined statistical protocols maintaining accuracy.
Supports adaptive thresholds adjusting sensitivities based on changing market conditions flexibly.
🎯 Dynamic Signal Generation:
Detects transitions indicating dominance shifts between buyers/sellers promptly.
Triggers timely alerts enabling swift reactions to evolving market dynamics effectively.
Integrates conditional logic reinforcing signal validity minimizing erroneous activations.
INDICATOR FUNCTIONALITY
🔢 Core Algorithms:
Utilizes moving averages along with standardized deviation formulas generating precise net volume measurements.
Implements Arithmetic Mean Line Algorithm (AMLA) smoothing techniques improving interpretability.
Ensures consistent alignment with established statistical principles preserving fidelity.
🖱️ User Interface Elements:
Dedicated plots displaying real-time net volume markers facilitating swift decision-making.
Context-sensitive color coding distinguishing positive/negative deviations intuitively.
Background shading highlighting proximity to key threshold activations enhancing visibility.
STRATEGY IMPLEMENTATION
✅ Entry Conditions:
Confirm bullish/bearish setups validated through multiple confirmatory signals.
Validate entry decisions considering concurrent market sentiment factors.
Assess alignment between net volume readings and broader trend directions ensuring coherence.
🚫 Exit Mechanisms:
Trigger exits upon hitting predetermined thresholds derived from historical analyses.
Monitor continuous breaches signifying potential trend reversals promptly executing closures.
Execute partial/total closes contingent upon cumulative loss limits preserving capital efficiently.
PARAMETER CONFIGURATIONS
🎯 Optimization Guidelines:
Reset Interval: Governs responsiveness versus stability balancing sensitivity/stability.
Price Source: Dictates primary data series driving volume calculations selecting relevant inputs accurately.
💬 Customization Recommendations:
Commence with baseline defaults; iteratively refine parameters isolating individual impacts.
Evaluate adjustments independently prior to combined modifications minimizing disruptions.
Prioritize minimizing erroneous trigger occurrences first optimizing signal fidelity.
Sustain balanced risk-reward profiles irrespective of chosen settings upholding disciplined approaches.
ADVANCED RISK MANAGEMENT
🛡️ Proactive Risk Mitigation Techniques:
Enforce strict compliance with pre-defined maximum leverage constraints adhering strictly to guidelines.
Mandatorily apply trailing stop-loss orders conforming to script outputs reinforcing discipline.
Allocate positions proportionately relative to available capital reserves managing exposures prudently.
Conduct periodic reviews gauging strategy effectiveness rigorously identifying areas needing refinement.
⚠️ Potential Pitfalls & Solutions:
Address frequent violations arising during heightened volatility phases necessitating manual interventions judiciously.
Manage false alerts warranting immediate attention avoiding adverse consequences systematically.
Prepare contingency plans mitigating margin call possibilities preparing proactive responses effectively.
Continuously assess automated system reliability amidst fluctuating conditions ensuring seamless functionality.
PERFORMANCE AUDITS & REFINEMENTS
🔍 Critical Evaluation Metrics:
Assess win percentages consistently across diverse trading instruments gauging reliability.
Calculate average profit ratios per successful execution measuring profitability efficiency accurately.
Measure peak drawdown durations alongside associated magnitudes evaluating downside risks comprehensively.
Analyze signal generation frequencies revealing hidden patterns potentially skewing outcomes uncovering systematic biases.
📈 Historical Data Analysis Tools:
Maintain comprehensive records capturing every triggered event meticulously documenting results.
Compare realized profits/losses against backtested simulations benchmarking actual vs expected performances accurately.
Identify recurrent systematic errors demanding corrective actions implementing iterative refinements steadily.
Document evolving performance metrics tracking progress dynamically addressing identified shortcomings proactively.
PROBLEM SOLVING ADVICE
🔧 Frequent Encountered Challenges:
Unpredictable behaviors emerging within thinly traded markets requiring filtration processes.
Latency issues manifesting during abrupt price fluctuations causing missed opportunities.
Overfitted models yielding suboptimal results post-extensive tuning demanding recalibrations.
Inaccuracies stemming from incomplete/inaccurate data feeds necessitating verification procedures.
💡 Effective Resolution Pathways:
Exclude low-liquidity assets prone to erratic movements enhancing signal integrity.
Introduce buffer intervals safeguarding major news/event impacts mitigating distortions effectively.
Limit ongoing optimization attempts preventing model degradation maintaining optimal performance levels consistently.
Verify reliable connections ensuring uninterrupted data flows guaranteeing accurate interpretations reliably.
USER ENGAGEMENT SEGMENT
🤝 Community Contributions Welcome
Highly encourage active participation sharing experiences & recommendations!
THANKS
Heartfelt acknowledgment extends to all developers contributing invaluable insights about volume-based trading methodologies! ✨
BollingerBands MTF | AlchimistOfCrypto🌌 Bollinger Bands – Unveiling Market Volatility Fields 🌌
"The Bollinger Bands, reimagined through quantum mechanics principles, visualizes the probabilistic distribution of price movements within a multi-dimensional volatility field. This indicator employs principles from wave function mathematics where standard deviation creates probabilistic boundaries, similar to electron cloud models in quantum physics. Our implementation features algorithmically enhanced visualization derived from extensive mathematical modeling, creating a dynamic representation of volatility compression and expansion cycles with adaptive glow effects that highlight the critical moments where volatility phase transitions occur."
📊 Professional Trading Application
The Bollinger Bands Quantum transcends traditional volatility measurement with a sophisticated gradient illumination system that reveals the underlying structure of market volatility fields. Scientifically calibrated for multiple timeframes and featuring eight distinct visual themes, it enables traders to perceive volatility contractions and expansions with unprecedented clarity.
⚙️ Indicator Configuration
- Volatility Field Parameters 📏
Python-optimized settings for specific market conditions:
- Period: 20 (default) - The quantum time window for volatility calculation
- StdDev Multiplier: 2.0 - The probabilistic boundary coefficient
- MA Type: SMA/EMA/VWMA/WMA/RMA - The quantum field smoothing algorithm
- Visual Theming 🎨
Eight scientifically designed visual palettes optimized for volatility pattern recognition:
- Neon (default): High-contrast green/red scheme enhancing volatility transition visibility
- Cyan-Magenta: Vibrant palette for maximum volatility boundary distinction
- Yellow-Purple: Complementary colors for enhanced compression/expansion detection
- Specialized themes (Green-Red, Forest Green, Blue Ocean, Orange-Red, Grayscale): Each calibrated for different market environments
- Opacity Control 🔍
- Variable transparency system (0-100) allowing seamless integration with price action
- Adaptive glow effect that intensifies during volatility phase transitions
- Quantum field visualization that reveals the probabilistic nature of price movements
🚀 How to Use
1. Select Visualization Parameters ⏰: Adjust period and standard deviation to match market conditions
2. Choose MA Type 🎚️: Select the appropriate smoothing algorithm for your trading strategy
3. Select Visual Theme 🌈: Choose a color scheme that enhances your personal pattern recognition
4. Adjust Opacity 🔎: Fine-tune visualization intensity to complement your chart analysis
5. Identify Volatility Phases ✅: Monitor band width to detect compression (pre-breakout) and expansion (trend)
6. Trade with Precision 🛡️: Enter during band contraction for breakouts, or trade mean reversion using band boundaries
7. Manage Risk Dynamically 🔐: Use band width as volatility-based position sizing parameter
Chan Theory - Chanlun UltraChan Theory -Chanlun Ultra
Overview
This script is based on the core technical framework of Chan Theory, transforming complex market fluctuations into a multi-layered, quantifiable structural analysis system. Through real-time dynamic computation, it automatically parses key components in price movements such as fractals, pens, segments, and pivot zones. Integrated with momentum analysis and trading signal alerts, it provides traders with comprehensive market insights from micro to macro perspectives. The core distinction of Chan Theory from traditional technical indicators lies in its rigorous recursive logic and human-centric market philosophy. This script faithfully restores Chan Theory's essence of "using Zen to resolve market complexity," decomposing spiral price movements into an orderly trading decision system.
Technical Principles
This indicator implements the complete recognition process from candlesticks to fractals, pens, segments, and pivot zones using pure Pine Script under Chan Theory's framework. Core technical implementations include:
1. Candlestick Containment Processing
Employs specific algorithms to handle candlestick containment relationships, eliminating random noise:
In uptrends: Select the higher high and higher low values
In downtrends: Select the lower high and lower low values
Ensure complete elimination of containment through recursive processing
2. Fractal Identification System
Performs strict fractal judgment on processed candlesticks:
Top Fractal: The middle candlestick's high is higher than both adjacent candlesticks
Bottom Fractal: The middle candlestick's low is lower than both adjacent candlesticks
Validate fractal effectiveness via the filterOperateType function
3. Pen Construction Mechanism & Type Selection
Connects valid top/bottom fractals to form pen structures, offering four pen types:
Classic Pen: Traditional Chan Theory definition, strictly following classic rules
Optimized Pen: Enhanced algorithm for short-term volatility recognition
4K Pen: Builds pens based on fractals formed by at least 4 candlesticks (improves stability)
Strict Pen: Employs the most stringent validation conditions for reliability
4. Segment Partitioning Algorithm
Applies segment rules to pen sequences with three modes:
- Dynamic Real-time Progressive Correction: Adjusts forming segments continuously with new data
- Strict Mode: Fully complies with Chan Theory definitions
- Extension Mode: Flexible handling of trend developments
5. Pivot Zone Recognition Technology
Identifies pen-level and segment-level pivot zones
Calculates pivot zone price ranges and time durations
Analyzes pivot zone evolution characteristics
Supports display of pivot zones across different levels
Trading Signal System & Filters
Trading Signal Filtering System
This indicator provides comprehensive filtering functions:
Fractal Validity Filter: Verifies fractal patterns and post-fractal developments
Basic Fractal Filter: Eliminates non-compliant fractals through basic feature checks
Type I MACD Divergence Filter: Enhances Type I signal reliability via MACD divergence analysis
Type II Signal Filter: Custom conditions for Type II signals
-False Signal Trap Avoidance: Detects and bypasses deceptive price patterns
Chan Theory Trading Signal Principles
Type I Signals (Trend Reversals)
Principle: Forms when price makes new highs/lows with weakening internal momentum (divergence)
Identification: Compares structural features of adjacent same-direction pens
Application: Early trend reversal signals for swing trading
Type II Signals (Pullback Entries)
Principle: Occurs during retracements as sub-level reversal signals
Identification: Determined by pivot zone support/resistance and fractal combinations
Application: Optimal positions for pullback trades with controlled risk
Type III Signals (Breakout Confirmations)
Principle: Confirms pivot zone breakouts
Identification: Price breaks prior pivot zone boundaries with valid fractals
Application: Trend continuation signals for trend-following strategies
Indicator Features
Multi-Level Structural Analysis
Distinguishes structures across levels via level parameters
Higher-level trends guide lower-level operations
Implements cross-level collaborative logic
Displays sub-level pivot zones
Structural Visualization
Pens: Displayed per selected pen type
Segments: Rendered according to chosen segment mode
Pivot Zones: Color gradients indicate consolidation strength
Technical Implementation
Data Structure Design
Pen Object: Stores direction, timestamps, and price attributes
Segment Object: Manages segments and constituent pens
Pivot Object: Defines pivot zone ranges and characteristics
Grade Object: Organizes analysis results across levels
User Guide
Parameter Settings
Pen Type: Classic/Optimized/4K/Strict (adapt to analysis needs)
Segment Mode: Dynamic/Strict/Extension (match trading strategies)
Signal Filters: Enable/disable specific filters
Pivot Display: Toggle sub-level pivot zones
Divergence Settings: Configure types (regular/hidden) and display styles
Strategy Settings: Set trading rules linked to signals
Strategy Configuration
Follow Segments: Trade in alignment with segment direction
Signal Participation: Enable/disable Type I/II/III signals
Signal Conditions: Require signals to appear post-pivot zone formation
Prevent Early Entries:
Type I signals require ≥1 pivot zone or 5 pens
Type II Safety Control: Participate only if Type III signals are absent
Practical Recommendations
Select pen types/segment modes per market conditions
Adjust filters for different instruments and timeframes
Enhance accuracy through multi-level analysis
Confirm Type I signals with divergence indicators
Choose strategy parameters aligned with risk tolerance
Value Proposition
Systematizes Chan Theory into computable structures
Multiple pen/segment methods adapt to diverse markets
Advanced filtering significantly improves signal quality (historically validated)
Multi-level analysis provides holistic market insights
This tool is for technical analysis only. It does not constitute investment advice. Users must exercise independent judgment based on personal risk tolerance and objectives.
概述
本脚本基于缠论核心技术框架,将复杂的市场波动转化为多层次、可量化的结构分析系统。通过实时动态演算,自动解析价格走势中的分型、笔、线段、中枢等核心组件,并融合动量分析与交易信号预警功能,为交易者提供从微观到宏观的全方位市场透视。缠论区别于传统技术指标的核心在于其严格的递归逻辑与人性化市场哲学,本脚本忠实还原缠论"以禅破缠"的思想精髓,将螺旋缠绕的价格运动分解为有序的交易决策体系。
技术原理
本指标基于缠论技术分析框架,通过纯Pine Script实现了从K线到分型、笔、线段和中枢的完整识别流程。核心技术实现包括:
1. K线包含处理
采用特定算法处理K线包含关系,消除随机波动干扰:
- 上涨趋势中取高点高值、低点高值
- 下跌趋势中取高点低值、低点低值
- 通过递归处理确保包含关系完全消除
2. 分型识别系统
在处理后的K线基础上实现严格的分型判断:
- 顶分型:中间K线高点高于两侧K线
- 底分型:中间K线低点低于两侧K线
- 通过`filterOperateType`函数实现分型有效性验证
3. 笔的构建机制与类型选择
连接有效顶底分型形成笔结构,提供四种笔类型选择:
- **老笔**:传统缠论笔定义,严格遵循经典规则
- **新笔**:优化算法,增强对短期波动的识别能力
- **4K**:基于至少4根K线形成的分型构建笔,提高稳定性
- **严笔**:采用最严格的条件验证,确保形成的笔结构可靠
4. 线段划分算法
基于笔序列应用线段划分规则,支持三种线段模式:
- **当下延伸后修正**:实时计算当前形成中的线段,并随新数据更新修正
- **严格模式**:要求线段完全符合缠论定义,减少假信号
- **延伸模式**:更灵活地处理线段延伸情况,适合趋势分析
5. 中枢识别技术
- 实现笔中枢和线段中枢识别
- 计算中枢价格区间与时间范围
- 分析中枢演变特征
- 支持显示不同级别中枢功能
买卖点系统与过滤机制
买卖点过滤系统
本指标提供全面的买卖点过滤功能:
- **买卖点分型过滤**:检验分型形态有效性,验证分型后续发展
- **买卖点分型基础过滤**:针对分型基本特征进行验证,排除不合格分型
- **1买卖macd背驰过滤**:通过MACD判断背驰情况,提高一类买卖点可靠性
- **2买卖点过滤**:专门针对二类买卖点的过滤条件
- **防狼术**:避免陷阱式买卖点,提高交易安全性
缠论买卖点原理
1. **一类买卖点**
- 原理:基于趋势背驰原理,当价格创新高/低但内部结构力度减弱时形成
- 识别方法:通过比较相邻同向笔的结构特征判断力度变化
- 应用:提供趋势可能反转的早期信号,适合波段操作
2. **二类买卖点**
- 原理:发生在回调过程中,属于次级别转折信号
- 识别方法:通过中枢支撑位与分型组合判断
- 应用:回调买入或做空的较佳位置,风险相对可控
3. **三类买卖点**
- 原理:中枢突破确认信号
- 识别方法:价格突破前中枢边界并形成有效分型
- 应用:趋势延续的确认信号,适合追踪趋势
指标特点
多级别结构分析
本指标支持多级别联动分析:
- 通过级别参数区分不同级别结构
- 高级别趋势指导低级别操作
- 实现级别间的协同判断逻辑
- 支持显示次级别中枢功能
结构可视化
- 笔结构:根据选择的笔类型显示
- 线段结构:按照选定的线段模式呈现
- 中枢区域:颜色渐变标识不同强度
技术实现说明
数据结构设计
指标设计了完整的面向对象结构:
- Pen结构:存储笔的方向、时间、价格等属性
- Segment结构:管理线段及其组成笔
- Pivot结构:表示中枢范围和特性
- Grade结构:区分不同级别的分析结果
使用指南
参数设置
- 笔的类型:选择老笔、新笔、4K或严笔以适应不同分析需求
- 线段模式:根据交易策略选择合适的线段计算方式
- 买卖点过滤:根据需要启用不同的过滤机制
- 中枢显示:选择是否显示次级别中枢
- 背离设置:选择背离类型、显示方式和样式
- 策略设置:配置与买卖点相关的交易策略选项
策略应用配置
- 跟随线段:根据线段方向进行交易
- 买卖点参与设置:可选择性参与一类、二类和三类买卖点
- 买卖点条件限制:可设置买卖点需要在中枢形成后出现
- 防止过早进场:可要求一类买卖点至少出现一个中枢后或至少5笔后才参与
- 二类买卖点安全性控制:可选择仅在未出现三类买卖点的情况下参与
实际应用建议
- 结合市场环境选择合适的笔类型和线段模式
- 针对不同品种和时间周期调整过滤设置
- 通过多级别分析提高判断准确性
- 使用背离指标确认一类买卖点的有效性
- 根据策略风格选择适合的策略配置参数
技术特点与价值
本指标通过系统化实现缠论结构分析,提供了一种客观的技术分析工具。它的核心价值在于:
1. 将复杂的缠论理论系统化为可计算的结构
2. 提供多种笔、线段判断方法以适应不同市场环境
3. 完善的买卖点过滤系统大幅提高信号质量
4. 多级别联动分析提供全面市场视角
*本指标仅提供技术分析参考,不构成投资建议。用户应根据自身风险承受能力和投资目标进行判断。*
Machine Learning RSI ║ BullVisionOverview:
Introducing the Machine Learning RSI with KNN Adaptation – a cutting-edge momentum indicator that blends the classic Relative Strength Index (RSI) with machine learning principles. By leveraging K-Nearest Neighbors (KNN), this indicator aims at identifying historical patterns that resemble current market behavior and uses this context to refine RSI readings with enhanced sensitivity and responsiveness.
Unlike traditional RSI models, which treat every market environment the same, this version adapts in real-time based on how similar past conditions evolved, offering an analytical edge without relying on predictive assumptions.
Key Features:
🔁 KNN-Based RSI Refinement
This indicator uses a machine learning algorithm (K-Nearest Neighbors) to compare current RSI and price action characteristics to similar historical conditions. The resulting RSI is weighted accordingly, producing a dynamically adjusted value that reflects historical context.
📈 Multi-Feature Similarity Analysis
Pattern similarity is calculated using up to five customizable features:
RSI level
RSI momentum
Volatility
Linear regression slope
Price momentum
Users can adjust how many features are used to tailor the behavior of the KNN logic.
🧠 Machine Learning Weight Control
The influence of the machine learning model on the final RSI output can be fine-tuned using a simple slider. This lets you blend traditional RSI and machine learning-enhanced RSI to suit your preferred level of adaptation.
🎛️ Adaptive Filtering
Additional smoothing options (Kalman Filter, ALMA, Double EMA) can be applied to the RSI, offering better visual clarity and helping to reduce noise in high-frequency environments.
🎨 Visual & Accessibility Settings
Custom color palettes, including support for color vision deficiencies, ensure that trend coloring remains readable for all users. A built-in neon mode adds high-contrast visuals to improve RSI visibility across dark or light themes.
How It Works:
Similarity Matching with KNN:
At each candle, the current RSI and optional market characteristics are compared to historical bars using a KNN search. The algorithm selects the closest matches and averages their RSI values, weighted by similarity. The more similar the pattern, the greater its influence.
Feature-Based Weighting:
Similarity is determined using normalized values of the selected features, which gives a more refined result than RSI alone. You can choose to use only 1 (RSI) or up to all 5 features for deeper analysis.
Filtering & Blending:
After the machine learning-enhanced RSI is calculated, it can be optionally smoothed using advanced filters to suppress short-term noise or sharp spikes. This makes it easier to evaluate RSI signals in different volatility regimes.
Parameters Explained:
📊 RSI Settings:
Set the base RSI length and select your preferred smoothing method from 10+ moving average types (e.g., EMA, ALMA, TEMA).
🧠 Machine Learning Controls:
Enable or disable the KNN engine
Select how many nearest neighbors to compare (K)
Choose the number of features used in similarity detection
Control how much the machine learning engine affects the RSI calculation
🔍 Filtering Options:
Enable one of several advanced smoothing techniques (Kalman Filter, ALMA, Double EMA) to adjust the indicator’s reactivity and stability.
📏 Threshold Levels:
Define static overbought/oversold boundaries or reference dynamically adjusted thresholds based on historical context identified by the KNN algorithm.
🎨 Visual Enhancements:
Select between trend-following or impulse coloring styles. Customize color palettes to accommodate different types of color blindness. Enable neon-style effects for visual clarity.
Use Cases:
Swing & Trend Traders
Can use the indicator to explore how current RSI readings compare to similar market phases, helping to assess trend strength or potential turning points.
Intraday Traders
Benefit from adjustable filters and fast-reacting smoothing to reduce noise in shorter timeframes while retaining contextual relevance.
Discretionary Analysts
Use the adaptive OB/OS thresholds and visual cues to supplement broader confluence zones or market structure analysis.
Customization Tips:
Higher Volatility Periods: Use more neighbors and enable filtering to reduce noise.
Lower Volatility Markets: Use fewer features and disable filtering for quicker RSI adaptation.
Deeper Contextual Analysis: Increase KNN lookback and raise the feature count to refine pattern recognition.
Accessibility Needs: Switch to Deuteranopia or Monochrome mode for clearer visuals in specific color vision conditions.
Final Thoughts:
The Machine Learning RSI combines familiar momentum logic with statistical context derived from historical similarity analysis. It does not attempt to predict price action but rather contextualizes RSI behavior with added nuance. This makes it a valuable tool for those looking to elevate traditional RSI workflows with adaptive, research-driven enhancements.
Stochastic and MACD HistogramStochastic-MACD Fusion Histogram (concept)
How It Works:
This indicator combines Stochastic Oscillator and MACD Histogram to create a unique momentum-tracking histogram. It blends stochastic-based overbought/oversold levels with MACD-based trend strength, helping traders identify potential reversals and trend momentum more effectively.
Stochastic Component: Measures where the price is relative to its recent range, highlighting overbought/oversold conditions.
MACD Component: Captures momentum shifts by calculating the difference between two EMAs and a signal line.
Fusion Algorithm: The MACD histogram is normalized and combined with the Stochastic %K using a weighted formula (60% Stoch, 40% MACD) to smooth fluctuations and improve signal clarity.
Usage:
Histogram Colors:
Blue / SkyBlue: Positive momentum increasing.
Red / LightRed: Negative momentum increasing.
Levels:
Overbought (>30): Potential selling pressure.
Oversold (<-30): Potential buying pressure.
Zero Line: Momentum shift zone.
Notes:
Best to combine it with others indicators for trend confirmation, like Moving Average, MACD, etc.
This indicator is good for quick entry/exit in futures market, from few seconds up to minutes.
It works well on 5 minutes candle. Regular Hours works better.
To sell wait for histogram to go OVER overbought level, once the first candle reach BELOW the overbought level hit sell. Same strategy for buy when it hits oversold level. Make sure you won't use the indicator alone.
Invictus📝 Invictus – Probabilistic Trading Indicator
🔍 1. General Introduction
Invictus is a technical trading indicator designed to support traders by identifying potential buy and sell signals through a probabilistic and adaptive analytical approach. It aims to enhance the analytical process rather than provide explicit trading recommendations. The indicator integrates multiple analytical components—price pattern detection, momentum analysis (RSI), dynamic trend lines (Kalman Line), and volatility bands (ATR)—to offer traders a structured and contextual framework for making informed decisions.
Invictus does not guarantee profitable outcomes but seeks to enhance analytical clarity and support cautious decision-making through multiple validation layers.
⚙️ 2. Main Components
🌊 2.1. Price Pattern Detection
Invictus identifies potential market shifts by analyzing specific candlestick sequences:
Bearish Patterns (Sell): Detected when consecutive candles close below their openings, indicating increased selling pressure.
Bullish Patterns (Buy): Detected when consecutive candles close above their openings, suggesting increased buying interest.
These patterns provide historical insights rather than absolute predictions for market movements.
⚡ 2.2. Momentum Confirmation (RSI)
To improve signal clarity, Invictus employs the Relative Strength Index (RSI):
Buy Signal: RSI below a predefined threshold (e.g., 30), signaling potential oversold conditions.
Sell Signal: RSI above a threshold (e.g., 70), signaling potential overbought conditions.
RSI acts exclusively as an additional validation filter to reduce, though not eliminate, false signals derived solely from price patterns.
🌀 2.3. Kalman Dynamic Line
The Kalman Dynamic Line smooths price action and dynamically tracks trends using a Kalman filter algorithm:
Noise Reduction: Minimizes minor price fluctuations.
Trend Direction Indicator: Line slope visually represents bullish or bearish market bias.
Adaptive Support/Resistance: Adjusts continuously to market conditions.
Volatility Sensitivity: Adjustments use ATR to scale proportionally with market volatility.
This adaptive dynamic line provides clear context, aiding traders by filtering short-term volatility.
📊 2.4. Volatility Bands (ATR-based)
ATR-based volatility bands define potential breakout zones and market extremes dynamically:
Upper/Lower Bands: Positioned relative to the Kalman Line based on ATR (volatility multiplier).
Volatility Zones: Highlight potential areas of trend continuation or reversal due to significant price movements.
These bands assist traders in visually assessing significant market movements and reducing the focus on minor fluctuations.
🧠 3. Component Interaction and Validation Logic
Invictus is designed to enhance analytical clarity by integrating multiple technical components, requiring independent confirmations before signals may be considered as potentially actionable
🔗 Step 1: Pattern + RSI Validation
Initial identification of price patterns.
Signal validation through RSI conditions (oversold/overbought).
🔗 Step 2: Trend Alignment (Kalman Line)
Validated signals undergo further assessment with respect to the Kalman Dynamic Line.
Buy signals require price action above the Kalman Line; sell signals require price action below.
🔗 Step 3: Volatility Confirmation (ATR Bands)
Price action must penetrate and close beyond the corresponding volatility band.
Ensures signals align with adequate market volatility and momentum.
🔄 4. Comprehensive Decision-Making Flow
Identify price patterns (initial indication).
Confirm momentum via RSI.
Verify trend alignment using the Kalman Line.
Confirm adequate volatility via ATR bands.
💡 5. Practical Example (Buy Scenario)
Invictus signals a potential buy scenario.
Trader waits for the price to cross above the Kalman Line.
Entry consideration occurs only after a confirmed close above the upper ATR volatility band.
⚠️ 6. Important Limitations
Do not rely solely on Invictus signals; always perform broader market analysis.
Invictus performs optimally in trending markets; exercise caution in sideways or range-bound markets.
Always evaluate broader market context and the dominant trend before making decisions.
📝 7. Risk Management & Responsible Trading
Invictus serves as an analytical support tool, not a guarantee of market outcomes:
Set prudent stop-loss levels.
Apply conservative leverage, especially in volatile conditions.
Conduct thorough backtesting and practice on a demo account before live trading.
⚠️ Disclaimer: Trading involves significant risks. Invictus generates signals based on historical and technical analysis. Past performance is not indicative of future results. Responsible trading practices are strongly advised.
💡 8. Final Considerations
Invictus provides an analytical framework integrating various supportive technical methodologies designed to enhance decision-making and comprehensive analysis. Its multi-layered validation process encourages disciplined analysis and informed decision-making without implying any guarantees of profitability.
Traders should incorporate Invictus within broader strategic frameworks, consistently applying disciplined risk management and thorough market analysis.
Wall Street Ai**Wall Street Ai – Advanced Technical Indicator for Market Analysis**
**Overview**
Wall Street Ai is an advanced, AI-powered technical indicator meticulously engineered to provide traders with in-depth market analysis and insight. By leveraging state-of-the-art artificial intelligence algorithms and comprehensive historical price data, Wall Street Ai is designed to identify significant market turning points and key price levels. Its sophisticated analytical framework enables traders to uncover potential shifts in market momentum, assisting in the formulation of strategic trading decisions while maintaining the highest standards of objectivity and reliability.
**Key Features**
- **Intelligent Pattern Recognition:**
Wall Street Ai employs advanced machine learning techniques to analyze historical price movements and detect recurring patterns. This capability allows it to differentiate between typical market noise and meaningful signals indicative of potential trend reversals.
- **Robust Noise Reduction:**
The indicator incorporates a refined volatility filtering system that minimizes the impact of minor price fluctuations. By isolating significant price movements, it ensures that the analytical output focuses on substantial market shifts rather than ephemeral variations.
- **Customizable Analytical Parameters:**
With a wide range of adjustable settings, Wall Street Ai can be fine-tuned to align with diverse trading strategies and risk appetites. Traders can modify sensitivity, threshold levels, and other critical parameters to optimize the indicator’s performance under various market conditions.
- **Comprehensive Data Analysis:**
By harnessing the power of artificial intelligence, Wall Street Ai performs a deep analysis of historical data, identifying statistically significant highs and lows. This analysis not only reflects past market behavior but also provides valuable insights into potential future turning points, thereby enhancing the predictive aspect of your trading strategy.
- **Adaptive Market Insights:**
The indicator’s dynamic algorithm continuously adjusts to current market conditions, adapting its analysis based on real-time data inputs. This adaptive quality ensures that the indicator remains relevant and effective across different market environments, whether the market is trending strongly, consolidating, or experiencing volatility.
- **Objective and Reliable Analysis:**
Wall Street Ai is built on a foundation of robust statistical methods and rigorous data validation. Its outputs are designed to be objective and free from any exaggerated claims, ensuring that traders receive a clear, unbiased view of market conditions.
**How It Works**
Wall Street Ai integrates advanced AI and deep learning methodologies to analyze a vast array of historical price data. Its core algorithm identifies and evaluates critical market levels by detecting patterns that have historically preceded significant market movements. By filtering out non-essential fluctuations, the indicator emphasizes key price extremes and trend changes that are likely to impact market behavior. The system’s adaptive nature allows it to recalibrate its analytical parameters in response to evolving market dynamics, providing a consistently reliable framework for market analysis.
**Usage Recommendations**
- **Optimal Timeframes:**
For the most effective application, it is recommended to utilize Wall Street Ai on higher timeframe charts, such as hourly (H1) or higher. This approach enhances the clarity of the detected patterns and provides a more comprehensive view of long-term market trends.
- **Market Versatility:**
Wall Street Ai is versatile and can be applied across a broad range of financial markets, including Forex, indices, commodities, cryptocurrencies, and equities. Its adaptable design ensures consistent performance regardless of the asset class being analyzed.
- **Complementary Analytical Tools:**
While Wall Street Ai provides profound insights into market behavior, it is best utilized in combination with other analytical tools and techniques. Integrating its analysis with additional indicators—such as trend lines, support/resistance levels, or momentum oscillators—can further refine your trading strategy and enhance decision-making.
- **Strategy Testing and Optimization:**
Traders are encouraged to test Wall Street Ai extensively in a simulated trading environment before deploying it in live markets. This allows for thorough calibration of its settings according to individual trading styles and risk management strategies, ensuring optimal performance across diverse market conditions.
**Risk Management and Best Practices**
Wall Street Ai is intended to serve as an analytical tool that supports informed trading decisions. However, as with any technical indicator, its outputs should be interpreted as part of a comprehensive trading strategy that includes robust risk management practices. Traders should continuously validate the indicator’s findings with additional analysis and maintain a disciplined approach to position sizing and risk control. Regular review and adjustment of trading strategies in response to market changes are essential to mitigate potential losses.
**Conclusion**
Wall Street Ai offers a cutting-edge, AI-driven approach to technical analysis, empowering traders with detailed market insights and the ability to identify potential turning points with precision. Its intelligent pattern recognition, adaptive analytical capabilities, and extensive noise reduction make it a valuable asset for both experienced traders and those new to market analysis. By integrating Wall Street Ai into your trading toolkit, you can enhance your understanding of market dynamics and develop a more robust, data-driven trading strategy—all while adhering to the highest standards of analytical integrity and performance.
Lowess Channel + (RSI) [ChartPrime]The Lowess Channel + (RSI) indicator applies the LOWESS (Locally Weighted Scatterplot Smoothing) algorithm to filter price fluctuations and construct a dynamic channel. LOWESS is a non-parametric regression method that smooths noisy data by fitting weighted linear regressions at localized segments. This technique is widely used in statistical analysis to reveal trends while preserving data structure.
In this indicator, the LOWESS algorithm is used to create a central trend line and deviation-based bands. The midline changes color based on trend direction, and diamonds are plotted when a trend shift occurs. Additionally, an RSI gauge is positioned at the end of the channel to display the current RSI level in relation to the price bands.
lowess_smooth(src, length, bandwidth) =>
sum_weights = 0.0
sum_weighted_y = 0.0
sum_weighted_xy = 0.0
sum_weighted_x2 = 0.0
sum_weighted_x = 0.0
for i = 0 to length - 1
x = float(i)
weight = math.exp(-0.5 * (x / bandwidth) * (x / bandwidth))
y = nz(src , 0)
sum_weights := sum_weights + weight
sum_weighted_x := sum_weighted_x + weight * x
sum_weighted_y := sum_weighted_y + weight * y
sum_weighted_xy := sum_weighted_xy + weight * x * y
sum_weighted_x2 := sum_weighted_x2 + weight * x * x
mean_x = sum_weighted_x / sum_weights
mean_y = sum_weighted_y / sum_weights
beta = (sum_weighted_xy - mean_x * mean_y * sum_weights) / (sum_weighted_x2 - mean_x * mean_x * sum_weights)
alpha = mean_y - beta * mean_x
alpha + beta * float(length / 2) // Centered smoothing
⯁ KEY FEATURES
LOWESS Price Filtering – Smooths price fluctuations to reveal the underlying trend with minimal lag.
Dynamic Trend Coloring – The midline changes color based on trend direction (e.g., bullish or bearish).
Trend Shift Diamonds – Marks points where the midline color changes, indicating a possible trend shift.
Deviation-Based Bands – Expands above and below the midline using ATR-based multipliers for volatility tracking.
RSI Gauge Display – A vertical gauge at the right side of the chart shows the current RSI level relative to the price channel.
Fully Customizable – Users can adjust LOWESS length, band width, colors, and enable or disable the RSI gauge and adjust RSIlength.
⯁ HOW TO USE
Use the LOWESS midline as a trend filter —bullish when green, bearish when purple.
Watch for trend shift diamonds as potential entry or exit signals.
Utilize the price bands to gauge overbought and oversold zones based on volatility.
Monitor the RSI gauge to confirm trend strength—high RSI near upper bands suggests overbought conditions, while low RSI near lower bands indicates oversold conditions.
⯁ CONCLUSION
The Lowess Channel + (RSI) indicator offers a powerful way to analyze market trends by applying a statistically robust smoothing algorithm. Unlike traditional moving averages, LOWESS filtering provides a flexible, responsive trendline that adapts to price movements. The integrated RSI gauge enhances decision-making by displaying momentum conditions alongside trend dynamics. Whether used for trend-following or mean reversion strategies, this indicator provides traders with a well-rounded perspective on market behavior.
*Auto Backtest & Optimize EngineFull-featured Engine for Automatic Backtesting and parameter optimization. Allows you to test millions of different combinations of stop-loss and take profit parameters, including on any connected indicators.
⭕️ Key Futures
Quickly identify the optimal parameters for your strategy.
Automatically generate and test thousands of parameter combinations.
A simple Genetic Algorithm for result selection.
Saves time on manual testing of multiple parameters.
Detailed analysis, sorting, filtering and statistics of results.
Detailed control panel with many tooltips.
Display of key metrics: Profit, Win Rate, etc..
Comprehensive Strategy Score calculation.
In-depth analysis of the performance of different types of stop-losses.
Possibility to use to calculate the best Stop-Take parameters for your position.
Ability to test your own functions and signals.
Customizable visualization of results.
Flexible Stop-Loss Settings:
• Auto ━ Allows you to test all types of Stop Losses at once(listed below).
• S.VOLATY ━ Static stop based on volatility (Fixed, ATR, STDEV).
• Trailing ━ Classic trailing stop following the price.
• Fast Trail ━ Accelerated trailing stop that reacts faster to price movements.
• Volatility ━ Dynamic stop based on volatility indicators.
• Chandelier ━ Stop based on price extremes.
• Activator ━ Dynamic stop based on SAR.
• MA ━ Stop based on moving averages (9 different types).
• SAR ━ Parabolic SAR (Stop and Reverse).
Advanced Take-Profit Options:
• R:R: Risk/Reward ━ sets TP based on SL size.
• T.VOLATY ━ Calculation based on volatility indicators (Fixed, ATR, STDEV).
Testing Modes:
• Stops ━ Cyclical stop-loss testing
• Pivot Point Example ━ Example of using pivot points
• External Example ━ Built-in example how test functions with different parameters
• External Signal ━ Using external signals
⭕️ Usage
━ First Steps:
When opening, select any point on the chart. It will not affect anything until you turn on Manual Start mode (more on this below).
The chart will immediately show the best results of the default Auto mode. You can switch Part's to try to find even better results in the table.
Now you can display any result from the table on the chart by entering its ID in the settings.
Repeat steps 3-4 until you determine which type of Stop Loss you like best. Then set it in the settings instead of Auto mode.
* Example: I flipped through 14 parts before I liked the first result and entered its ID so I could visually evaluate it on the chart.
Then select the stop loss type, choose it in place of Auto mode and repeat steps 3-4 or immediately follow the recommendations of the algorithm.
Now the Genetic Algorithm at the bottom right will prompt you to enter the Parameters you need to search for and select even better results.
Parameters must be entered All at once before they are updated. Enter recommendations strictly in fields with the same names.
Repeat steps 5-6 until there are approximately 10 Part's left or as you like. And after that, easily pour through the remaining Parts and select the best parameters.
━ Example of the finished result.
━ Example of use with Takes
You can also test at the same time along with Take Profit. In this example, I simply enabled Risk/Reward mode and immediately specified in the TP field Maximum RR, Minimum RR and Step. So in this example I can test (3-1) / 0.1 = 20 Takes of different sizes. There are additional tips in the settings.
━
* Soon you will start to understand how the system works and things will become much easier.
* If something doesn't work, just reset the engine settings and start over again.
* Use the tips I have left in the settings and on the Panel.
━ Details:
Sort ━ Sorting results by Score, Profit, Trades, etc..
Filter ━ Filtring results by Score, Profit, Trades, etc..
Trade Type ━ Ability to disable Long\Short but only from statistics.
BackWin ━ Backtest Window Number of Candle the script can test.
Manual Start ━ Enabling it will allow you to call a Stop from a selected point. which you selected when you started the engine.
* If you have a real open position then this mode can help to save good Stop\Take for it.
1 - 9 Сheckboxs ━ Allow you to disable any stop from Auto mode.
Ex Source - Allow you to test Stops/Takes from connected indicators.
Connection guide:
//@version=6
indicator("My script")
rsi = ta.rsi(close, 14)
buy = not na(rsi) and ta.crossover (rsi, 40) // OS = 40
sell = not na(rsi) and ta.crossunder(rsi, 60) // OB = 60
Signal = buy ? +1 : sell ? -1 : 0
plot(Signal, "🔌Connector🔌", display = display.none)
* Format the signal for your indicator in a similar style and then select it in Ex Source.
⭕️ How it Works
Hypothesis of Uniform Distribution of Rare Elements After Mixing.
'This hypothesis states that if an array of N elements contains K valid elements, then after mixing, these valid elements will be approximately uniformly distributed.'
'This means that in a random sample of k elements, the proportion of valid elements should closely match their proportion in the original array, with some random variation.'
'According to the central limit theorem, repeated sampling will result in an average count of valid elements following a normal distribution.'
'This supports the assumption that the valid elements are evenly spread across the array.'
'To test this hypothesis, we can conduct an experiment:'
'Create an array of 1,000,000 elements.'
'Select 1,000 random elements (1%) for validation.'
'Shuffle the array and divide it into groups of 1,000 elements.'
'If the hypothesis holds, each group should contain, on average, 1~ valid element, with minor variations.'
* I'd like to attach more details to My hypothesis but it won't be very relevant here. Since this is a whole separate topic, I will leave the minimum part for understanding the engine.
Practical Application
To apply this hypothesis, I needed a way to generate and thoroughly mix numerous possible combinations. Within Pine, generating over 100,000 combinations presents significant challenges, and storing millions of combinations requires excessive resources.
I developed an efficient mechanism that generates combinations in random order to address these limitations. While conventional methods often produce duplicates or require generating a complete list first, my approach guarantees that the first 10% of possible combinations are both unique and well-distributed. Based on my hypothesis, this sampling is sufficient to determine optimal testing parameters.
Most generators and randomizers fail to accommodate both my hypothesis and Pine's constraints. My solution utilizes a simple Linear Congruential Generator (LCG) for pseudo-randomization, enhanced with prime numbers to increase entropy during generation. I pre-generate the entire parameter range and then apply systematic mixing. This approach, combined with a hybrid combinatorial array-filling technique with linear distribution, delivers excellent generation quality.
My engine can efficiently generate and verify 300 unique combinations per batch. Based on the above, to determine optimal values, only 10-20 Parts need to be manually scrolled through to find the appropriate value or range, eliminating the need for exhaustive testing of millions of parameter combinations.
For the Score statistic I applied all the same, generated a range of Weights, distributed them randomly for each type of statistic to avoid manual distribution.
Score ━ based on Trade, Profit, WinRate, Profit Factor, Drawdown, Sharpe & Sortino & Omega & Calmar Ratio.
⭕️ Notes
For attentive users, a little tricks :)
To save time, switch parts every 3 seconds without waiting for it to load. After 10-20 parts, stop and wait for loading. If the pause is correct, you can switch between the rest of the parts without loading, as they will be cached. This used to work without having to wait for a pause, but now it does slower. This will save a lot of time if you are going to do a deeper backtest.
Sometimes you'll get the error “The scripts take too long to execute.”
For a quick fix you just need to switch the TF or Ticker back and forth and most likely everything will load.
The error appears because of problems on the side of the site because the engine is very heavy. It can also appear if you set too long a period for testing in BackWin or use a heavy indicator for testing.
Manual Start - Allow you to Start you Result from any point. Which in turn can help you choose a good stop-stick for your real position.
* It took me half a year from idea to current realization. This seems to be one of the few ways to build something automatic in backtest format and in this particular Pine environment. There are already better projects in other languages, and they are created much easier and faster because there are no limitations except for personal PC. If you see solutions to improve this system I would be glad if you share the code. At the moment I am tired and will continue him not soon.
Also You can use my previosly big Backtest project with more manual settings(updated soon)
Clustering & Divergences (RSI-Stoch-CCI) [Sam SDF-Solutions]The Clustering & Divergences (RSI-Stoch-CCI) indicator is a comprehensive technical analysis tool that consolidates three popular oscillators—Relative Strength Index (RSI), Stochastic, and Commodity Channel Index (CCI)—into one unified metric called the Score. This Score offers traders an aggregated view of market conditions, allowing them to quickly identify whether the market is oversold, balanced, or overbought.
Functionality:
Oscillator Clustering: The indicator calculates the values of RSI, Stochastic, and CCI using user-defined periods. These oscillator values are then normalized using one of three available methods: MinMax, Z-Score, or Z-Bins.
Score Calculation: Each normalized oscillator value is multiplied by its respective weight (which the user can adjust), and the weighted values are summed to generate an overall Score. This Score serves as a single, interpretable metric representing the combined oscillator behavior.
Market Clustering: The indicator performs clustering on the Score over a configurable window. By dividing the Score range into a set number of clusters (also configurable), the tool visually represents the market’s state. Each cluster is assigned a unique color so that traders can quickly see if the market is trending toward oversold, balanced, or overbought conditions.
Divergence Detection: The script automatically identifies both Regular and Hidden divergences between the price action and the Score. By using pivot detection on both price and Score data, the indicator marks potential reversal signals on the chart with labels and connecting lines. This helps in pinpointing moments when the price and the underlying oscillator dynamics diverge.
Customization Options: Users have full control over the indicator’s behavior. They can adjust:
The periods for each oscillator (RSI, Stochastic, CCI).
The weights applied to each oscillator in the Score calculation.
The normalization method and its manual boundaries.
The number of clusters and whether to invert the cluster order.
Parameters for divergence detection (such as pivot sensitivity and the minimum/maximum bar distance between pivots).
Visual Enhancements:
Depending on the user’s preference, either the Score or the Cluster Index (derived from the clustering process) is plotted on the chart. Additionally, the script changes the color of the price bars based on the identified cluster, providing an at-a-glance visual cue of the current market regime.
Logic & Methodology:
Input Parameters: The script starts by accepting user inputs for clustering settings, oscillator periods, weights, divergence detection, and manual boundary definitions for normalization.
Oscillator Calculation & Normalization: It computes RSI, Stochastic, and CCI values from the price data. These values are then normalized using either the MinMax method (scaling between a lower and upper band) or the Z-Score method (standardizing based on mean and standard deviation), or using Z-Bins for an alternative scaling approach.
Score Computation: Each normalized oscillator is multiplied by its corresponding weight. The sum of these products results in the overall Score that represents the combined oscillator behavior.
Clustering Algorithm: The Score is evaluated over a moving window to determine its minimum and maximum values. Using these values, the script calculates a cluster index that divides the Score into a predefined number of clusters. An option to invert the cluster calculation is provided to adjust the interpretation of the clustering.
Divergence Analysis: The indicator employs pivot detection (using left and right bar parameters) on both the price and the Score. It then compares recent pivot values to detect regular and hidden divergences. When a divergence is found, the script plots labels and optional connecting lines to highlight these key moments on the chart.
Plotting: Finally, based on the user’s selection, the indicator plots either the Score or the Cluster Index. It also overlays manual boundary lines (for the chosen normalization method) and adjusts the bar colors according to the cluster to provide clear visual feedback on market conditions.
_________
By integrating multiple oscillator signals into one cohesive tool, the Clustering & Divergences (RSI-Stoch-CCI) indicator helps traders minimize subjective analysis. Its dynamic clustering and automated divergence detection provide a streamlined method for assessing market conditions and potentially enhancing the accuracy of trading decisions.
For further details on using this indicator, please refer to the guide available at:
Percentage Based ZigZag█ OVERVIEW
The Percentage-Based ZigZag indicator is a custom technical analysis tool designed to highlight significant price reversals while filtering out market noise. Unlike many standard zigzag tools that rely solely on fixed price moves or generic trend-following methods, this indicator uses a configurable percentage threshold to dynamically determine meaningful pivot points. This approach not only adapts to different market conditions but also helps traders distinguish between minor fluctuations and truly significant trend shifts—whether scalping on shorter timeframes or analyzing longer-term trends.
█ KEY FEATURES & ORIGINALITY
Dynamic Pivot Detection
The indicator identifies pivot points by measuring the percentage change from the previous extreme (high or low). Only when this change exceeds a user-defined threshold is a new pivot recognized. This method ensures that only substantial moves are considered, making the indicator robust in volatile or noisy markets.
Enhanced ZigZag Visualization
By connecting significant highs and lows with a continuous line, the indicator creates a clear visual map of price swings. Each pivot point is labelled with the corresponding price and the percentage change from the previous pivot, providing immediate quantitative insight into the magnitude of the move.
Trend Reversal Projections
In addition to marking completed reversals, the script computes and displays potential future reversal points based on the current trend’s momentum. This forecasting element gives traders an advanced look at possible turning points, which can be particularly useful for short-term scalping strategies.
Customizable Visual Settings
Users can tailor the appearance by:
• Setting the percentage threshold to control sensitivity.
• Customizing colors for bullish (e.g., green) and bearish (e.g., red) reversals.
• Enabling optional background color changes that visually indicate the prevailing trend.
█ UNDERLYING METHODOLOGY & CALCULATIONS
Percentage-Based Filtering
The script continuously monitors price action and calculates the relative percentage change from the last identified pivot. A new pivot is confirmed only when the price moves a preset percentage away from this pivot, ensuring that minor fluctuations do not trigger false signals.
Pivot Point Logic
The indicator tracks the highest high and the lowest low since the last pivot. When the price reverses by the required percentage from these extremes, the algorithm:
1 — Labels the point as a significant high or low.
2 — Draws a connecting line from the previous pivot to the current one.
3 — Resets the extreme-tracking for detecting the next move.
Real-Time Reversal Estimation
Building on traditional zigzag methods, the script incorporates a projection calculation. By analyzing the current trend’s strength and recent percentage moves, it estimates where a future reversal might occur, offering traders actionable foresight.
█ HOW TO USE THE INDICATOR
1 — Apply the Indicator
• Add the Percentage-Based ZigZag indicator to your trading chart.
2 — Adjust Settings for Your Market
• Percentage Move – Set a threshold that matches your trading style:
- Lower values for sensitive, high-frequency analysis (ideal for scalping).
- Higher values for filtering out noise on longer timeframes.
• Visual Customization – Choose your preferred colors for bullish and bearish signals and enable background color changes for visual trend cues.
• Reversal Projection – Enable or disable the projection feature to display potential upcoming reversal points.
3 — Interpret the Signals
• ZigZag Lines – White lines trace significant high-to-low or low-to-high movements, visually connecting key swing points.
• Pivot Labels – Each pivot is annotated with the exact price level and percentage change, providing quantitative insight into market momentum.
• Trend Projections – When enabled, projected reversal levels offer insight into where the current trend might change.
4 — Integrate with Your Trading Strategy
• Use the indicator to identify support and resistance zones derived from significant pivots.
• Combine the quantitative data (percentage changes) with your risk management strategy to set optimal stop-loss and take-profit levels.
• Experiment with different threshold settings to adapt the indicator for various instruments or market conditions.
█ CONCLUSION
The Percentage-Based ZigZag indicator goes beyond traditional trend-following tools by filtering out market noise and providing clear, quantifiable insights into price action. With its percentage threshold for pivot detection and real-time reversal projections, this original methodology and customizable feature set offer traders a versatile edge for making informed trading decisions.