Universal Gann Square & Cube LevelsUniversal Gann Square & Cube Levels - Dynamic Support/Resistance
Description:
📊 UNIVERSAL GANN LEVELS INDICATOR
This powerful indicator automatically plots Gann Square and Cube levels around the current stock price, providing dynamic support and resistance levels based on W.D. Gann's mathematical theories.
🎯 KEY FEATURES:
✅ Auto-Adaptive: Works for ANY stock price (₹20 to ₹100,000+)
✅ Real-time Detection: Uses current close price automatically
✅ Dual Level System: Square levels (black) + Cube levels (red)
✅ Customizable Range: Adjust percentage range (5% to 50%)
✅ Clean Display: Toggle square/cube lines independently
✅ Universal Compatibility: Works on all timeframes and instruments
📈 HOW IT WORKS:
Square Levels (Black Lines): Based on perfect squares (n²) around current price
Cube Levels (Red Lines): Based on perfect cubes (n³) around current price
Smart Range: Automatically calculates relevant levels within your specified percentage range
Info Display: Shows current price and level counts
⚙️ SETTINGS:
Price Range %: Control how many levels appear (default: 15%)
Show Square Levels: Toggle black square lines on/off
Show Cube Levels: Toggle red cube lines on/off
🔥 PERFECT FOR:
Day traders seeking precise entry/exit points
Swing traders identifying key support/resistance zones
Gann theory practitioners and students
Multi-timeframe analysis across all instruments
💡 USAGE TIPS:
Use 10-20% range for active day trading
Use 30-50% range for swing trading analysis
Watch for price reactions at square/cube intersections
Combine with volume analysis for confirmation
🌟 WHY THIS INDICATOR?
Unlike fixed Gann calculators, this indicator dynamically adapts to ANY price level, making it truly universal for Indian stocks, crypto, forex, and commodities.
⚠️ DISCLAIMER:
This indicator is for educational and informational purposes only. It is not financial advice and should not be considered as a recommendation to buy or sell any security. Trading involves significant risk of loss and may not be suitable for all investors. Past performance does not guarantee future results. Always conduct your own research and consult with a qualified financial advisor before making any investment decisions. The developer assumes no responsibility for any trading losses incurred through the use of this indicator.
📋 COMPATIBILITY:
All TradingView plans
All timeframes (1m to 1M)
Stocks, Crypto, Forex, Commodities
Mobile and desktop platforms
Indicadores e estratégias
StdDev Supertrend {CHIPA}StdDev Supertrend ~ C H I P A is a supertrend style trend engine that replaces ATR with standard deviation as the volatility core. It can operate on raw prices or log return volatility, with optional smoothing to control noise.
Key features include:
Supertrend trailing rails built from a stddev scaled envelope that flips the regime only when price closes through the opposite rail.
Returns-based mode that scales volatility by log returns for more consistent behavior across price regimes.
Optional smoothing on the volatility input to tune responsiveness versus stability.
Directional gap fill between price and the active trend line on the main chart; opacity adapts to the distance (vs ATR) so wide gaps read stronger and small gaps stay subtle.
Secondary pane view of the rails with the same adaptive fade, plus an optional candle overlay for context.
Clean alerts that fire once when state changes
Use cases: medium-term trend following, stop/flip systems, and visual regime confirmation when you prefer stddev-based distance over ATR.
Note: no walk-forward or robustness testing is implied; parameter choices and risk controls are on you.
MTF-RISK [Module+]Description
MTF-RISK is a futures risk management tool that calculates standardized position sizing across multiple CME micro contracts, anchored to higher-timeframe structure. By combining multi-timeframe reference levels with a contract-based dollar-per-point model, it allows traders to maintain consistent risk across different futures markets.
Example:
User has selected the 1H timeframe for the risk table. Once an hourly candle closes, the high and low of that completed hour are locked as reference boundaries.
Lower timeframe candles (e.g., 1m, 5m, 15m) reference these established 1H boundaries to calculate:
Distance in points from the current close to the HTF high or low.
Corresponding dollar risk based on the user-defined Max Risk per Trade ($) setting.
The risk table updates in real-time, showing the current stop distance, calculated contract size, and resulting risk in dollars for both upward and downward directions.
Benefit: Traders always maintain a fixed dollar risk, regardless of intraday price movement, while using HTF structure as the anchor for accurate and consistent position sizing.
1. Higher Timeframe Anchor
Always uses the last fully closed candle from the selected higher timeframe (default: 60m).
Captures the prior HTF high and low as reference boundaries.
Lower timeframe closers (e.g., 1m, 5m, 15m bars) reference these established HTF boundaries to measure stop distances and calculate risk.
Use: Ensures all position sizing is tied to completed HTF structure, providing a consistent framework for intraday trades.
2. Risk Model Engine
Traders define maximum dollar risk per trade.
The system calculates allowable micro contracts based on stop distance (current close → HTF high/low).
Supported contracts and their point values:
MNQ (Micro Nasdaq 100): $2.00 per point
MES (Micro S&P 500): $5.00 per point
MYM (Micro Dow Jones): $0.50 per point
MGC (Micro Gold): $10.00 per point
Formula:
Contracts = Max Risk ÷ (Stop Distance × TSE:VALUE per Point)
Risk ↑: Based on distance to HTF high.
Risk ↓: Based on distance to HTF low.
Use: Provides consistent dollar risk sizing across different futures contracts and multiple intraday timeframes.
3. Risk Table Overlay
Compact, real-time on-chart table with customizable styling.
Columns:
OP: Operation time (adjusted by user’s timezone offset).
Points ↑ / ↓: Stop distances in points relative to HTF boundaries.
Risk ↑ / ↓ ($): Dollar exposure at those stops.
Micros ↑ / ↓: Allowable contract count.
Asset: Displays selected futures contract in the header.
Custom features:
Independent text/background colors per column.
Highlighted latest row for clarity.
Adjustable outline, row colors, and text size.
Use: Gives traders immediate insight into position sizing without leaving the chart.
Intended Use:
This is a risk visualization module, not a trade signal generator. Traders can use it to:
Standardize risk sizing across multiple CME micro futures.
Quickly evaluate trade setups relative to HTF structure.
Measure stop distances from lower timeframe closes while referencing HTF boundaries.
Maintain consistency in risk management regardless of the instrument traded.
Limitations & Disclaimers:
Calculations assume standard CME tick values for MNQ, MES, MYM, and MGC.
Other markets may not align with these dollar-per-point values.
This indicator does not predict direction, generate entries, or guarantee outcomes.
For educational and informational purposes only.
Trading involves risk; always use proper risk management.
Closed-source (Protected): Logic is visible on charts, but source code is hidden.
TA█ TA Library
📊 OVERVIEW
TA is a Pine Script technical analysis library. This library provides 25+ moving averages and smoothing filters , from classic SMA/EMA to Kalman Filters and adaptive algorithms, implemented based on academic research.
🎯 Core Features
Academic Based - Algorithms follow original papers and formulas
Performance Optimized - Pre-calculated constants for faster response
Unified Interface - Consistent function design
Research Based - Integrates technical analysis research
🎯 CONCEPTS
Library Design Philosophy
This technical analysis library focuses on providing:
Academic Foundation
Algorithms based on published research papers and academic standards
Implementations that follow original mathematical formulations
Clear documentation with research references
Developer Experience
Unified interface design for consistent usage patterns
Pre-calculated constants for optimal performance
Comprehensive function collection to reduce development time
Single import statement for immediate access to all functions
Each indicator encapsulated as a simple function call - one line of code simplifies complexity
Technical Excellence
25+ carefully implemented moving averages and filters
Support for advanced algorithms like Kalman Filter and MAMA/FAMA
Optimized code structure for maintainability and reliability
Regular updates incorporating latest research developments
🚀 USING THIS LIBRARY
Import Library
//@version=6
import DCAUT/TA/1 as dta
indicator("Advanced Technical Analysis", overlay=true)
Basic Usage Example
// Classic moving average combination
ema20 = ta.ema(close, 20)
kama20 = dta.kama(close, 20)
plot(ema20, "EMA20", color.red, 2)
plot(kama20, "KAMA20", color.green, 2)
Advanced Trading System
// Adaptive moving average system
kama = dta.kama(close, 20, 2, 30)
= dta.mamaFama(close, 0.5, 0.05)
// Trend confirmation and entry signals
bullTrend = kama > kama and mamaValue > famaValue
bearTrend = kama < kama and mamaValue < famaValue
longSignal = ta.crossover(close, kama) and bullTrend
shortSignal = ta.crossunder(close, kama) and bearTrend
plot(kama, "KAMA", color.blue, 3)
plot(mamaValue, "MAMA", color.orange, 2)
plot(famaValue, "FAMA", color.purple, 2)
plotshape(longSignal, "Buy", shape.triangleup, location.belowbar, color.green)
plotshape(shortSignal, "Sell", shape.triangledown, location.abovebar, color.red)
📋 FUNCTIONS REFERENCE
ewma(source, alpha)
Calculates the Exponentially Weighted Moving Average with dynamic alpha parameter.
Parameters:
source (series float) : Series of values to process.
alpha (series float) : The smoothing parameter of the filter.
Returns: (float) The exponentially weighted moving average value.
dema(source, length)
Calculates the Double Exponential Moving Average (DEMA) of a given data series.
Parameters:
source (series float) : Series of values to process.
length (simple int) : Number of bars for the moving average calculation.
Returns: (float) The calculated Double Exponential Moving Average value.
tema(source, length)
Calculates the Triple Exponential Moving Average (TEMA) of a given data series.
Parameters:
source (series float) : Series of values to process.
length (simple int) : Number of bars for the moving average calculation.
Returns: (float) The calculated Triple Exponential Moving Average value.
zlema(source, length)
Calculates the Zero-Lag Exponential Moving Average (ZLEMA) of a given data series. This indicator attempts to eliminate the lag inherent in all moving averages.
Parameters:
source (series float) : Series of values to process.
length (simple int) : Number of bars for the moving average calculation.
Returns: (float) The calculated Zero-Lag Exponential Moving Average value.
tma(source, length)
Calculates the Triangular Moving Average (TMA) of a given data series. TMA is a double-smoothed simple moving average that reduces noise.
Parameters:
source (series float) : Series of values to process.
length (simple int) : Number of bars for the moving average calculation.
Returns: (float) The calculated Triangular Moving Average value.
frama(source, length)
Calculates the Fractal Adaptive Moving Average (FRAMA) of a given data series. FRAMA adapts its smoothing factor based on fractal geometry to reduce lag. Developed by John Ehlers.
Parameters:
source (series float) : Series of values to process.
length (simple int) : Number of bars for the moving average calculation.
Returns: (float) The calculated Fractal Adaptive Moving Average value.
kama(source, length, fastLength, slowLength)
Calculates Kaufman's Adaptive Moving Average (KAMA) of a given data series. KAMA adjusts its smoothing based on market efficiency ratio. Developed by Perry J. Kaufman.
Parameters:
source (series float) : Series of values to process.
length (simple int) : Number of bars for the efficiency calculation.
fastLength (simple int) : Fast EMA length for smoothing calculation. Optional. Default is 2.
slowLength (simple int) : Slow EMA length for smoothing calculation. Optional. Default is 30.
Returns: (float) The calculated Kaufman's Adaptive Moving Average value.
t3(source, length, volumeFactor)
Calculates the Tilson Moving Average (T3) of a given data series. T3 is a triple-smoothed exponential moving average with improved lag characteristics. Developed by Tim Tillson.
Parameters:
source (series float) : Series of values to process.
length (simple int) : Number of bars for the moving average calculation.
volumeFactor (simple float) : Volume factor affecting responsiveness. Optional. Default is 0.7.
Returns: (float) The calculated Tilson Moving Average value.
ultimateSmoother(source, length)
Calculates the Ultimate Smoother of a given data series. Uses advanced filtering techniques to reduce noise while maintaining responsiveness. Based on digital signal processing principles by John Ehlers.
Parameters:
source (series float) : Series of values to process.
length (simple int) : Number of bars for the smoothing calculation.
Returns: (float) The calculated Ultimate Smoother value.
kalmanFilter(source, processNoise, measurementNoise)
Calculates the Kalman Filter of a given data series. Optimal estimation algorithm that estimates true value from noisy observations. Based on the Kalman Filter algorithm developed by Rudolf Kalman (1960).
Parameters:
source (series float) : Series of values to process.
processNoise (simple float) : Process noise variance (Q). Controls adaptation speed. Optional. Default is 0.05.
measurementNoise (simple float) : Measurement noise variance (R). Controls smoothing. Optional. Default is 1.0.
Returns: (float) The calculated Kalman Filter value.
mcginleyDynamic(source, length)
Calculates the McGinley Dynamic of a given data series. McGinley Dynamic is an adaptive moving average that adjusts to market speed changes. Developed by John R. McGinley Jr.
Parameters:
source (series float) : Series of values to process.
length (simple int) : Number of bars for the dynamic calculation.
Returns: (float) The calculated McGinley Dynamic value.
mama(source, fastLimit, slowLimit)
Calculates the Mesa Adaptive Moving Average (MAMA) of a given data series. MAMA uses Hilbert Transform Discriminator to adapt to market cycles dynamically. Developed by John F. Ehlers.
Parameters:
source (series float) : Series of values to process.
fastLimit (simple float) : Maximum alpha (responsiveness). Optional. Default is 0.5.
slowLimit (simple float) : Minimum alpha (smoothing). Optional. Default is 0.05.
Returns: (float) The calculated Mesa Adaptive Moving Average value.
fama(source, fastLimit, slowLimit)
Calculates the Following Adaptive Moving Average (FAMA) of a given data series. FAMA follows MAMA with reduced responsiveness for crossover signals. Developed by John F. Ehlers.
Parameters:
source (series float) : Series of values to process.
fastLimit (simple float) : Maximum alpha (responsiveness). Optional. Default is 0.5.
slowLimit (simple float) : Minimum alpha (smoothing). Optional. Default is 0.05.
Returns: (float) The calculated Following Adaptive Moving Average value.
mamaFama(source, fastLimit, slowLimit)
Calculates Mesa Adaptive Moving Average (MAMA) and Following Adaptive Moving Average (FAMA).
Parameters:
source (series float) : Series of values to process.
fastLimit (simple float) : Maximum alpha (responsiveness). Optional. Default is 0.5.
slowLimit (simple float) : Minimum alpha (smoothing). Optional. Default is 0.05.
Returns: ( ) Tuple containing values.
laguerreFilter(source, length, gamma, order)
Calculates the standard N-order Laguerre Filter of a given data series. Standard Laguerre Filter uses uniform weighting across all polynomial terms. Developed by John F. Ehlers.
Parameters:
source (series float) : Series of values to process.
length (simple int) : Length for UltimateSmoother preprocessing.
gamma (simple float) : Feedback coefficient (0-1). Lower values reduce lag. Optional. Default is 0.8.
order (simple int) : The order of the Laguerre filter (1-10). Higher order increases lag. Optional. Default is 8.
Returns: (float) The calculated standard Laguerre Filter value.
laguerreBinomialFilter(source, length, gamma)
Calculates the Laguerre Binomial Filter of a given data series. Uses 6-pole feedback with binomial weighting coefficients. Developed by John F. Ehlers.
Parameters:
source (series float) : Series of values to process.
length (simple int) : Length for UltimateSmoother preprocessing.
gamma (simple float) : Feedback coefficient (0-1). Lower values reduce lag. Optional. Default is 0.5.
Returns: (float) The calculated Laguerre Binomial Filter value.
superSmoother(source, length)
Calculates the Super Smoother of a given data series. SuperSmoother is a second-order Butterworth filter from aerospace technology. Developed by John F. Ehlers.
Parameters:
source (series float) : Series of values to process.
length (simple int) : Period for the filter calculation.
Returns: (float) The calculated Super Smoother value.
rangeFilter(source, length, multiplier)
Calculates the Range Filter of a given data series. Range Filter reduces noise by filtering price movements within a dynamic range.
Parameters:
source (series float) : Series of values to process.
length (simple int) : Number of bars for the average range calculation.
multiplier (simple float) : Multiplier for the smooth range. Higher values increase filtering. Optional. Default is 2.618.
Returns: ( ) Tuple containing filtered value, trend direction, upper band, and lower band.
qqe(source, rsiLength, rsiSmooth, qqeFactor)
Calculates the Quantitative Qualitative Estimation (QQE) of a given data series. QQE is an improved RSI that reduces noise and provides smoother signals. Developed by Igor Livshin.
Parameters:
source (series float) : Series of values to process.
rsiLength (simple int) : Number of bars for the RSI calculation. Optional. Default is 14.
rsiSmooth (simple int) : Number of bars for smoothing the RSI. Optional. Default is 5.
qqeFactor (simple float) : QQE factor for volatility band width. Optional. Default is 4.236.
Returns: ( ) Tuple containing smoothed RSI and QQE trend line.
sslChannel(source, length)
Calculates the Semaphore Signal Level (SSL) Channel of a given data series. SSL Channel provides clear trend signals using moving averages of high and low prices.
Parameters:
source (series float) : Series of values to process.
length (simple int) : Number of bars for the moving average calculation.
Returns: ( ) Tuple containing SSL Up and SSL Down lines.
ma(source, length, maType)
Calculates a Moving Average based on the specified type. Universal interface supporting all moving average algorithms.
Parameters:
source (series float) : Series of values to process.
length (simple int) : Number of bars for the moving average calculation.
maType (simple MaType) : Type of moving average to calculate. Optional. Default is SMA.
Returns: (float) The calculated moving average value based on the specified type.
atr(length, maType)
Calculates the Average True Range (ATR) using the specified moving average type. Developed by J. Welles Wilder Jr.
Parameters:
length (simple int) : Number of bars for the ATR calculation.
maType (simple MaType) : Type of moving average to use for smoothing. Optional. Default is RMA.
Returns: (float) The calculated Average True Range value.
macd(source, fastLength, slowLength, signalLength, maType, signalMaType)
Calculates the Moving Average Convergence Divergence (MACD) with customizable MA types. Developed by Gerald Appel.
Parameters:
source (series float) : Series of values to process.
fastLength (simple int) : Period for the fast moving average.
slowLength (simple int) : Period for the slow moving average.
signalLength (simple int) : Period for the signal line moving average.
maType (simple MaType) : Type of moving average for main MACD calculation. Optional. Default is EMA.
signalMaType (simple MaType) : Type of moving average for signal line calculation. Optional. Default is EMA.
Returns: ( ) Tuple containing MACD line, signal line, and histogram values.
dmao(source, fastLength, slowLength, maType)
Calculates the Dual Moving Average Oscillator (DMAO) of a given data series. Uses the same algorithm as the Percentage Price Oscillator (PPO), but can be applied to any data series.
Parameters:
source (series float) : Series of values to process.
fastLength (simple int) : Period for the fast moving average.
slowLength (simple int) : Period for the slow moving average.
maType (simple MaType) : Type of moving average to use for both calculations. Optional. Default is EMA.
Returns: (float) The calculated Dual Moving Average Oscillator value as a percentage.
continuationIndex(source, length, gamma, order)
Calculates the Continuation Index of a given data series. The index represents the Inverse Fisher Transform of the normalized difference between an UltimateSmoother and an N-order Laguerre filter. Developed by John F. Ehlers, published in TASC 2025.09.
Parameters:
source (series float) : Series of values to process.
length (simple int) : The calculation length.
gamma (simple float) : Controls the phase response of the Laguerre filter. Optional. Default is 0.8.
order (simple int) : The order of the Laguerre filter (1-10). Optional. Default is 8.
Returns: (float) The calculated Continuation Index value.
📚 RELEASE NOTES
v1.0 (2025.09.24)
✅ 25+ technical analysis functions
✅ Complete adaptive moving average series (KAMA, FRAMA, MAMA/FAMA)
✅ Advanced signal processing filters (Kalman, Laguerre, SuperSmoother, UltimateSmoother)
✅ Performance optimized with pre-calculated constants and efficient algorithms
✅ Unified function interface design following TradingView best practices
✅ Comprehensive moving average collection (DEMA, TEMA, ZLEMA, T3, etc.)
✅ Volatility and trend detection tools (QQE, SSL Channel, Range Filter)
✅ Continuation Index - Latest research from TASC 2025.09
✅ MACD and ATR calculations supporting multiple moving average types
✅ Dual Moving Average Oscillator (DMAO) for arbitrary data series analysis
Predictive Financial Indicator# TradingView Script Description - APFI v7 Enhanced
## 📊 **Advanced Predictive Financial Indicator v7 Enhanced**
### **Overview**
This indicator combines multiple advanced technical analysis concepts to predict potential price movements and identify high-probability turning points. It uses a proprietary multi-factor scoring system that analyzes market behavior patterns, trend dynamics, and volatility characteristics to generate predictive signals.
### **Core Methodology**
#### **1. Entanglement Factor Analysis**
- **Concept**: Measures market predictability through autocorrelation analysis of price momentum
- **Purpose**: Identifies periods when price movements follow predictable patterns
- **Implementation**: Calculates correlation between current and historical price changes across multiple timeframes
- **Value**: Higher entanglement indicates more predictable market behavior, increasing signal reliability
#### **2. Trend Strength Assessment**
- **Concept**: Evaluates the relationship between current price and moving average with momentum components
- **Purpose**: Determines trend quality and persistence
- **Implementation**: Combines price-to-MA ratio with short-term momentum analysis
- **Value**: Strong trends provide better context for signal validation
#### **3. Volatility Analysis**
- **Concept**: Multi-dimensional volatility assessment using both statistical and ATR-based measures
- **Purpose**: Identifies market conditions that favor certain signal types
- **Implementation**: Combines standard deviation of returns with ATR-based volatility ratios
- **Value**: Helps distinguish between high-confidence and low-confidence market environments
#### **4. Exhaustion Detection**
- **Concept**: Identifies when trends are losing momentum across multiple timeframes
- **Purpose**: Predicts potential trend reversals before they occur
- **Implementation**: Analyzes momentum slope changes and compares short vs. long-term momentum
- **Value**: Critical for turning point identification and risk management
#### **5. Dynamic Support/Resistance Analysis**
- **Concept**: Real-time identification of key price levels with rejection confirmation
- **Purpose**: Validates signals against significant price levels
- **Implementation**: Tracks multiple touch points and calculates rejection probabilities
- **Value**: Increases signal accuracy by confirming against structural market levels
#### **6. Volume Confirmation**
- **Concept**: Validates signals using volume analysis
- **Purpose**: Ensures signals are supported by institutional activity
- **Implementation**: Compares current volume to historical averages during significant price movements
- **Value**: Filters out weak signals that lack volume support
#### **7. Pattern Correlation**
- **Concept**: Identifies recurring price patterns and their correlation with current market behavior
- **Purpose**: Leverages historical pattern recognition for signal validation
- **Implementation**: Analyzes price change patterns and correlates with historical occurrences
- **Value**: Adds statistical confidence to signal generation
### **Signal Types**
#### **Turning Point Signals (Highest Priority)**
- **Purpose**: Identify high-probability trend reversal points
- **Criteria**: Combines exhaustion detection, support/resistance validation, volume confirmation, and pattern correlation
- **Visual**: Large circles on MA line with 🎯 symbols
- **Use Case**: Major trend changes, swing trading entries
#### **Regular Directional Signals**
- **Purpose**: Identify continuation or new trend directions
- **Criteria**: Based on predictive price analysis with confidence thresholds
- **Visual**: Medium circles on MA line with ▲▼ symbols
- **Use Case**: Trend following, momentum trading
#### **Sideways Signals**
- **Purpose**: Identify range-bound market conditions
- **Criteria**: Low directional confidence with high volatility compression
- **Visual**: Small circles on MA line with ◆ symbols
- **Use Case**: Range trading, consolidation periods
### **Key Features**
#### **Multi-Factor Scoring System**
- **Exhaustion Score**: 25% weight for trend exhaustion detection
- **Levels Score**: 20% weight for support/resistance validation
- **Volatility Score**: 15% weight for market condition assessment
- **Pattern Score**: 15% weight for historical pattern correlation
- **Volume Bonus**: 10% weight for volume confirmation
- **Pattern Bonus**: 5% weight for high correlation patterns
#### **Adaptive Thresholds**
- **Dynamic Sensitivity**: Adjusts to different market conditions
- **Asset-Specific**: Optimized for different instrument types
- **Timeframe Adaptive**: Adjusts parameters based on chart timeframe
#### **Visual Display Options**
- **Bold MA Line**: MA line becomes thicker and colored at signal points
- **Circles on MA**: Precise positioning of signals on moving average
- **Combined Display**: Both methods for maximum visibility
- **Customizable Colors**: Distinct colors for each signal type
### **How to Use**
#### **Setup**
1. Apply to any timeframe (1m to 1D recommended)
2. Adjust MA period based on your trading style (default: 20)
3. Set sensitivity level (0.1-3.0, default: 1.0)
4. Choose signal strength filter (Weak/Medium/Strong)
#### **Signal Interpretation**
- **High Confidence**: Signals with score > 0.7 and strong volume confirmation
- **Medium Confidence**: Signals with score 0.5-0.7 and moderate confirmation
- **Low Confidence**: Signals with score 0.3-0.5 and weak confirmation
#### **Trading Applications**
- **Swing Trading**: Use turning point signals for major reversals
- **Day Trading**: Use regular signals for intraday momentum
- **Position Trading**: Combine with higher timeframes for trend confirmation
### **Technical Specifications**
#### **Input Parameters**
- **MA Period**: 5-200 (default: 20)
- **Sensitivity**: 0.1-3.0 (default: 1.0)
- **Confidence Threshold**: 0.1-0.9 (default: 0.3)
- **Signal Strength**: Weak/Medium/Strong (default: Medium)
#### **Display Options**
- **Signal Display Method**: Bold MA Line / Circles on MA / Both
- **Circle Size**: Small/Medium/Large
- **MA Line Thickness**: 1-5 pixels
- **Information Table**: Real-time signal data
#### **Alerts**
- **Turning Point Alerts**: High-priority reversal signals
- **Regular Signal Alerts**: Directional momentum signals
- **Exhaustion Alerts**: Trend exhaustion warnings
### **Performance Characteristics**
#### **Strengths**
- **Multi-timeframe Analysis**: Works across different chart timeframes
- **Adaptive Parameters**: Automatically adjusts to market conditions
- **High Accuracy**: Combines multiple confirmation methods
- **Clear Visual Signals**: Easy to identify and interpret
#### **Best Practices**
- **Combine with Price Action**: Use signals as confirmation, not standalone
- **Risk Management**: Always use stop losses and position sizing
- **Backtesting**: Test on historical data before live trading
- **Market Conditions**: Works best in trending and volatile markets
### **Disclaimer**
This indicator is for educational and informational purposes only. It should not be considered as financial advice. Always conduct your own research and consider your risk tolerance before making trading decisions. Past performance does not guarantee future results.
---
**Version**: 7.0 Enhanced
**Compatibility**: Pine Script v6
**Last Updated**: September 2024
**Status**: Production Ready
All Levels This script draws key price levels on your chart, including:
• Previous Day (PD): High, Low, Close
• Day Before Yesterday (DBY): High, Low, Close
• Pre-Market (PM): High and Low
• Today’s levels: High, Low, Open, Close
• Current bar levels: High, Low, Open, Close
Each level is displayed as a horizontal line with a label showing the level value.
It works on any timeframe, including 1-minute charts, and automatically updates as new bars form.
⸻
2. Features
1. Custom Colors
Each type of level has its own color, declared as a const color. For example:
• Previous Day High = red
• Today’s Close = gold
• Pre-Market High = fuchsia
2. Right-Extending Lines
All horizontal levels extend to the right, so you always see them on the chart.
3. Persistent Labels
Every line has a label at the right side showing its name and price. For example:
• PDH 422
• TODL 415.5
4. Dynamic Updates
The script updates automatically whenever a new bar forms, so levels stay accurate.
5. Session-Based Pre-Market
You can define the pre-market session (default “04:00–09:30 EST”). The script calculates the high and low of this session only.
6. Checkbox Inputs
You can enable/disable entire groups of levels:
• Previous Day
• Day Before Yesterday
• Pre-Market
• Today
• Current bar
Goldbach Time – algopathingThe Goldbach Time indicator highlights intra-day timestamps that align with curated “Goldbach” time transforms. It is a time-only study intended for timing research and session-rhythm confluence: it flags minutes where one or more simple transforms of the clock (e.g. hour + minute, hour − minute, minute ± 1) hit values from a predefined integer set. Traders use those flagged minutes as a time-based confluence input alongside price structure (PO3 / Goldbach price levels, order blocks, liquidity, etc.).
Multi-Timeframe Price Levels# Multi-Timeframe Price Levels Indicator
## What This Script Does
This Pine Script indicator displays key horizontal price levels on your TradingView chart to help you identify important support and resistance zones. Think of it as having multiple "reference lines" that show where price has been and where it might react.
## The Price Levels You'll See
**🟣 Yesterday's Levels (Purple Lines)**
- Yesterday's High, Low, and Close
- These often act as support/resistance the next trading day
- Traders watch to see if price holds above/below these levels
**🟢🔴 Premarket Levels (Green/Red Circles)**
- High and Low from premarket trading (4:00 AM - 9:30 AM)
- Shows where institutional traders were active before market open
- Only appears if there was actual premarket activity
**🔵 First 5-Minute Levels (Blue Lines)**
- High and Low from the first 5 minutes of trading (9:30-9:35 AM)
- Locks in at 9:35 AM and doesn't change for the rest of the day
- Popular "opening range" levels many day traders use
**🟠 First 15-Minute Levels (Orange Lines)**
- High and Low from the first 15 minutes of trading (9:30-9:45 AM)
- Locks in at 9:45 AM and stays fixed all day
- Broader opening range for swing traders
**🟢🔴 Today's Levels (Green/Red Thick Lines)**
- Current day's high and low
- Updates in real-time as new highs/lows are made
- The most important current support/resistance levels
## Why These Levels Matter
- **Support/Resistance**: Price often bounces off these levels
- **Breakout Signals**: When price breaks through, it can signal strong moves
- **Risk Management**: Use them to set stop losses and profit targets
- **Context**: Understand where price has been to predict where it might go
## Customization Options
- **Toggle any level on/off** - Only show what you need
- **Adjust line thickness** - Make important levels stand out more
- **Change colors** - Match your chart theme
- **Set session times** - Adjust for different time zones
## Perfect For
- Day traders looking for intraday levels
- Swing traders identifying key zones
- Anyone wanting clean, automated support/resistance lines
- Traders who like multiple timeframe analysis
The script automatically updates daily and requires no manual drawing - just apply it and get instant professional-level price level analysis!
15m-REMA Breakout [XAU + XAG] – MusDescription
This indicator is designed to capture high-conviction breakout opportunities on gold (XAUUSD) and silver (XAGUSD) using a zero-lag Recursive EMA (REMA) as the trend backbone, combined with volatility and body-strength filters.
It is tuned for the 15-minute timeframe, where metals often show sharp moves after consolidation.
How it works
Zero-Lag REMA → Smooth but responsive trend detection.
ATR-based Breakout Filter → Confirms that price clears recent highs/lows with volatility support.
Body Size & Buffer Rules → Blocks weak candles and fake breaks near range levels.
Trend Filter (optional) → Only allows signals in the dominant REMA slope direction.
De-duplication Logic → Avoids repeated signals on consecutive bars.
Signals
Green ▲ (Bull Breakout): Candle breaks above recent range with strength.
Red ▼ (Bear Breakout): Candle breaks below recent range with strength.
Optional Pivots: Micro pivot highs/lows for additional context.
REMA Line: Plotted in teal (uptrend) or orange (downtrend).
Inputs / Customisation
REMA period & sensitivity.
ATR lookback and multiplier.
Minimum candle body (%).
Buffer multiplier to reduce noise.
Trend filter on/off.
Toggle arrows & pivot markers.
Best Practice
Apply on XAUUSD / XAGUSD, 15-minute charts.
Use as a confirmation tool, not a standalone entry system.
Combine with higher-timeframe bias or your own risk management.
Alerts
Built-in alert conditions let you set automated notifications for bullish or bearish breakouts at bar close.
Disclaimer
This script is for educational purposes only. It does not constitute financial advice. Always test on demo before applying to live trading.
VWAP + 20 EMA Decision Guide Table🔍 VWAP + 20 EMA Decision Guide
This is just a guide to trade in intraday based on the Price , EMA and Vwap relative position . Its not a trading signal for Buy and Sell
Step 1: Where is Price relative to VWAP?
├── Price ABOVE VWAP → Potential bullish bias
└── Price BELOW VWAP → Potential bearish bias
Step 2: Where is 20 EMA relative to VWAP?
├── 20 EMA ABOVE VWAP
│ ├── If Price also ABOVE → Strong Bullish Trend
│ │ → Look for VWAP pullback bounce (High-probability Long)
│ └── If Price BELOW → Mixed signal
│ → Momentum bullish but under VWAP = Caution, Skip
│
└── 20 EMA BELOW VWAP
├── If Price also BELOW → Strong Bearish Trend
│ → Look for VWAP pullback rejection (High-probability Short)
└── If Price ABOVE → Mixed signal
→ Momentum bearish but above VWAP = Caution, Skip
Step 3: Is EMA slope aligned with VWAP direction?
├── Yes → Confidence increases
└── No → Market is likely in consolidation → Avoid
Step 4: Confirmation check
- Volume spike at VWAP test?
- Rejection candle pattern?
- Higher timeframe trend aligned?
If YES → take trade
If NO → stay flat
TQPX- Tru Quant Precision X🚀 TQPX™ – Tru Quant Precision X
One indicator. Infinite precision.
Forget juggling multiple tools — TQPX™ delivers 🚀 Buy & 💀 Put signals, 🎯 smart exits, a real-time HUD, and full lifecycle alerts in one streamlined system.
⚡ Optimized for 5-min & 15-min charts for pinpoint accuracy.
🔥 Also powerful on 1H & 2H timeframes for swing setups.
Works across stocks, futures, and crypto.
Beginner-friendly, pro-level power.
Access
This is a premium invite-only script.
📜 Terms of Use – TQPX™ (Tru Quant Precision X)
Access
TQPX™ is delivered through TradingView as an invite-only script.
Access is granted once you provide your TradingView username and your subscription is active.
Subscription
Subscriptions are billed monthly (or annually if selected).
You may cancel anytime. Your access will remain active until the end of your billing cycle.
Refunds
Due to the digital nature of this product, all sales are final. No refunds are provided once access is granted.
Use of TQPX™
TQPX™ is for personal use only. Sharing, copying, or reselling the script is strictly prohibited.
⚠️ Disclaimer: TQPX™ is for educational purposes only. Not financial advice. Trading carries risk — trade responsibly.
By subscribing, you agree to these Terms of Use.
TRONLibLibrary "TRONLib"
TODO: Combines the effects of the WMA and MacD
BlueBuy()
GreenBuy()
YellowBuy()
BlueSell()
GreenSell()
YellowSell()
BRN Advanced DCA Bot V 1.0 Of course. Here is the step-by-step configuration guide written in English.
1. Entry Trigger (QQE)
This section controls the signal that initiates a new DCA round.
RSI Period (QQE): Controls the period of the RSI used in the indicator. Lower values make it faster and more sensitive (more signals); higher values make it slower (fewer signals).
RSI Smoothing (SF): A smoothing factor. Increasing this value filters out more noise, resulting in more confirmed but later signals.
QQE Factor: The multiplier that creates the indicator's bands. You should only change this if you have advanced knowledge of the QQE indicator.
Recommendation: Start with the default values and adjust the RSI Period and Smoothing to find the signal frequency you desire.
2. Trend Filter (Supertrend)
This section defines the main trend to guide the trades.
Use Trend Filter?: If checked, the strategy will only open orders (including DCA orders) if they are in the direction of the Supertrend. This is an important safety filter.
ATR Period & ATR Multiplier: These two parameters define the Supertrend's sensitivity.
Higher Period/Multiplier: Makes the Supertrend less sensitive, ideal for following long-term trends.
Lower Period/Multiplier: Makes it more sensitive to price changes, ideal for smaller timeframes.
Supertrend Timeframe (MTF): Allows you to use a Supertrend from a higher timeframe (e.g., 4h) to filter signals on a lower timeframe (e.g., 15m). Leave it blank to use the current chart's timeframe.
Close DCA on Trend Reversal?: If enabled, it will immediately close a DCA round if the Supertrend flips against your position. An excellent risk management tool.
TRADE SETUP
Here you define the financial management and the DCA structure.
Base Order Value ($): The dollar value of your first order.
DCA Order Value ($): The base value for the subsequent orders (the DCA orders).
Step between DCAs (%): The percentage distance between each DCA order, calculated from the initial entry price. E.g., 1.0 means DCA orders will be placed at -1%, -2%, -3%, etc., from the initial price.
Max Orders in Round: The total number of orders allowed (Base Order + DCA Orders). If the value is 5, it means 1 base order and 4 DCA orders.
DCA Value Multiplier: Increases the value of each subsequent DCA order (known as Martingale). A value of 2.0 means each new order will be double the value of the previous one. Use with extreme caution, as it exponentially increases risk.
3. Backtest & Execution
Settings for testing the strategy.
Test Start/End Date: Defines the time period that the backtest will analyze.
Cooldown between Rounds (bars): Sets a number of "waiting" candles after a round closes before the strategy can open a new one. This helps prevent immediate re-entries in choppy markets.
4. Direction & Activation
Controls the overall direction of the trades.
Strategy Direction:
Buy (Long): The strategy will only execute buy trades.
Sell (Short): The strategy will only execute sell trades.
Automatic: The strategy uses the Supertrend to decide whether to look for buy or sell signals. This is the main setting for automation.
5. Take Profit & Stop Loss
Defines your profit targets and your loss limits.
Take Profit Mode:
Fixed: Closes the position when it reaches a fixed percentage profit target.
Trailing: The profit target moves along with the price, helping to capture more gains in a strong trend.
Take Profit (%) on AVERAGE price: The desired profit percentage, calculated from the average price of all your open orders.
Trailing TP Callback (%): Used only in "Trailing" mode. It's the percentage the price can pull back from its peak before the order is closed.
Round Stop-Loss (%): The maximum percentage loss you are willing to accept for the entire round. This is your primary safety net.
SL Based on: Defines how the Stop Loss is calculated.
Initial Price: The SL is fixed based on the first entry. This is safer.
Average Price: The SL moves as new DCA orders are added. This is riskier.
Final Recommendation: Always start by configuring the strategy in Backtest mode over a relevant period. There is no "perfect" setting; it must be optimized for each specific asset and timeframe.
50%er(HA)HA 50% Levels by Tren10x (Heikin Ashi)
This script shows the 50% level (the halfway point) of the previous Heikin Ashi candle on your chart. The 50% level is often used as a spot where price may bounce, reverse, or find support/resistance.
How it works:
It calculates the open, high, low, and close of Heikin Ashi candles.
Finds the midpoint (50%) of the previous candle.
Plots those levels for Daily, Weekly, Monthly, Quarterly, Yearly, and your current chart timeframe.
Can show the 50% levels of Heikin Ashi candles on Japanese candlesticks for more precise price accuracy.
Custom timeframe support is included for flexible, multi-timeframe analysis.
Lower timeframe levels are hidden when looking at bigger charts (so your screen doesn’t get messy).
How to use it:
Add the script to your chart (works best with Japanese candlesticks for accurate price levels).
You’ll see lines showing where the 50% levels of past Heikin Ashi candles are.
Use these levels as possible zones where price may react, reverse, or stall.
Why it’s different:
Uses Heikin Ashi math, but shows the lines on Japanese candles for better accuracy.
Works across multiple timeframes at once.
Includes a custom timeframe option.
Keeps charts clean by only showing levels that make sense for your view.
Uses a calculation that converts price into ticks for futures, then back into dollars or cents for regular market tickers.
This makes it easy for traders of any level to see important Heikin Ashi midpoints without extra clutter.
TQPX- Tru Quant Precision XDescription:
TQPX™ (Tru Quant Precision X) is an all-in-one premium trading system designed for traders who demand clarity and precision.
Forget juggling multiple indicators — TQPX™ combines institutional-grade entry signals, smart exit management, and a real-time HUD into one streamlined tool.
✅ Key Features
🚀 Clear Entry Signals → Buy/Put signals appear directly on your chart.
📈 Full Lifecycle Alerts → From entry to every take-profit to stop loss. Never miss a move.
🎯 Smart Exit Styles → Equal Split, Pyramid scaling, or Trail Stop. Adapt to your trading style.
🖥️ On-Chart HUD → Live dashboard showing entries, targets, stop loss, and status.
🔔 Alerts & Labels → Visual markers on the chart + customizable alerts in TradingView.
💡 Why TQPX™?
Other tools give you noise.
TQPX™ gives you precision.
Works across stocks, futures, and crypto.
Request access below to unlock TQPX™.
Beginner-friendly out of the box.
Powerful enough for advanced traders.
Works on stocks, futures, and crypto.
💵 Access
This is a premium invite-only script.
📜 Terms of Use – TQPX™ (Tru Quant Precision X)
Access
TQPX™ is delivered through TradingView as an invite-only script.
Access is granted once you provide your TradingView username and your subscription is active.
Subscription
Subscriptions are billed monthly (or annually if selected).
You may cancel anytime. Your access will remain active until the end of your billing cycle.
Refunds
Due to the digital nature of this product, all sales are final. No refunds are provided once access is granted.
Use of TQPX™
TQPX™ is for personal use only. Sharing, copying, or reselling the script is strictly prohibited.
TQPX™ does not provide financial advice. All trades are at your own risk. Educational purpose only.
Termination
If your subscription ends or is canceled, your TradingView account will be removed from the whitelist, and you will lose access to TQPX™.
We reserve the right to revoke access if misuse or unauthorized distribution is detected.
By subscribing, you agree to these Terms of Use.
Zone [black]The Zone Trading Indicator is a comprehensive technical analysis tool designed for advanced traders. It combines multiple strategies into a single overlay to help identify high-probability trade setups.
Key Features:
Classic – Highlights potential reversal zones. Higher timeframes increase probability. Can be combined with other features to assess reliability. Provides an early signal.
Professional – Identifies potential reversal points and gives early signals. In extreme bullish or bearish markets, can detect pullback zones (blue indicators). Can be combined with other features to assess reliability.
Zone – Indicates areas where extreme bullish or bearish conditions may occur. Bullish scenarios carry higher reliability.
Area A & S – Uses color and layout to visually indicate potential support and resistance levels. Can help identify likely highs and lows based on wave patterns.
Desire – Shows areas where strong market interest accumulates, highlighting potential future support and resistance.
Sight – Assists in identifying optimal entry points by visualizing key zones.
Volume – Marks high-confidence volume spikes, indicating reliable breakouts, future support/resistance, or trend exhaustion.
Crash – Highlights destructive candles, signaling trend endings or breakout reliability.
Price Prediction – Estimates potential reachable price levels.
Lag – Identifies trend start and end points, as well as pullback zones.
For black mode
ICT SMC — OB & FVG (Enhanced v6)ICT SMC — OB & FVG (Enhanced v6) Indicator Update Guide
Introduction
This document summarizes the latest updates to the ICT SMC — OB & FVG (Enhanced v6) indicator for TradingView. It includes new session toggles, updated signal logic, scoring system, individual session backtest results, and optimization recommendations.
Session Toggles.
The indicator now includes individual toggles for the following Forex sessions, allowing traders to enable or disable signal generation during specific time windows:
- Sydney Session: 6 PM – 2 AM EST
- Tokyo Session: 7 PM – 4 AM EST
- London Session: 3 AM – 11 AM EST
- New York Session: 8 AM – 5 PM EST
These toggles can be configured in the indicator settings panel on TradingView.
Updated Signal Logic
Signals are now filtered based on session toggles and a trade quality scoring system. Only signals occurring during enabled sessions are considered valid.
Trade Quality Scoring System
Each potential signal is evaluated using a 4-point scoring system. A signal must score at least 3 points to be considered high quality:
- Trend Strength (EMA Slope)
- Confirmation Candle (Bullish/Bearish)
- Market Structure Break (Swing High/Low)
- Volume Confirmation (Above Average Volume)
Back-Test Results by Session
Session Total Trades Win Rate Profit Factor Max Drawdown Final Balance
Sydney 67 57.09% 1.52 49.96% $13,681.68
Tokyo 100 43.00% 1.02 19.78% $10,105.00
London 143 72.03% 2.58 $500 $16,300.00
New York 59 25.42% 0.16 1.30 $9,998.68
XAU/USD Day Trading Alarm 15M (v6) • EMA-RSI-MACD + ATR TP/SLDay Trading Alarm for XAU/USD – 15M (EMA-RSI-MACD + ATR TP/SL)
This indicator is specifically designed for gold (XAU/USD) trading on the 15-minute timeframe.
It combines EMA trend filtering, RSI overbought/oversold signals, and MACD momentum confirmation to generate reliable entry points.
Additionally, it automatically calculates ATR-based Stop Loss (SL) and Take Profit (TP) levels according to your chosen Risk/Reward ratio, displaying them directly on the chart.
Day Trading Alarm 15M (v6) • EMA-RSI-MACD + ATR TP/SLSuggested Description:
Day Trading Alarm 15M (EMA-RSI-MACD + ATR TP/SL)
This indicator is designed for day traders operating on the 15-minute timeframe.
It combines EMA trend filtering, RSI overbought/oversold signals, and MACD momentum confirmation to generate reliable entry points.
Additionally, it automatically calculates ATR-based Stop Loss (SL) and Take Profit (TP) levels based on your custom Risk/Reward ratio, displaying them clearly on the chart.
INFLECTION NEXUS - SPAINFLECTION NEXUS - SPA (Shadow Portfolio Adaptive)
Foreword: The Living Algorithm
For decades, technical analysis has been a conversation between a trader and a static chart. We apply our indicators with their fixed-length inputs, and we hope that our rigid tools can somehow capture the essence of a market that is fluid, chaotic, and perpetually evolving. When our tools fail, we are told to "adapt." But what if the tools themselves could learn that lesson? What if our indicators could adapt not just for us, but with us?
This script, INFLECTION NEXUS - SPA, is the realization of that vision. It is an advanced analytical framework built around a revolutionary core: the Shadow Portfolio Adaptive (SPA) Engine . The buy and sell signals you see on the chart are an evolution of the logic from my previous work, "Turning Point." However, this is not a simple combination of two scripts. The SPA engine so fundamentally transforms the nature of the analysis that it creates an entirely new class of indicator. This publication is a showcase of that groundbreaking, self-learning engine.
This system is undeniably complex. When you first load it, the sheer volume of information may feel overwhelming. That is a testament to the depth of its analysis. This guide is designed to be your comprehensive manual, to break down every single component, every color, every number, into simple, understandable concepts. By the end of this document, you will not only master its functions but will also possess a deeper understanding of the market dynamics it is designed to reveal.
Chapter 1: The Paradigm Shift - Why the SPA Engine is a Leap Forward
To grasp the innovation here, we must first deconstruct the severe limitations of traditional "adaptive" indicators.
Part A: The Traditional Model - Driving by the Rear-View Mirror
Conventional "adaptive" systems are fundamentally reactive. They operate on a slow, inefficient loop: they wait for their own specific, biased signal to fire, wait for that trade to close, and only after a long and statistically significant "warm-up" period of 50-100 trades do they finally make a small, retrospective adjustment. They are always adapting to a market that no longer exists.
Part B: The SPA Model - The Proactive Co-Pilot
The Shadow Portfolio Adaptive (SPA) engine is a complete re-imagining of this process. It is not reactive; it is proactive, data-saturated, and instantly aware.
Continuous, Unbiased Learning: The SPA engine does not wait for a signal to learn. Its Shadow Portfolio is constantly running 5-bar long and short trades in the background. It learns from every single 5-bar slice of market action , giving it a continuous, unbiased stream of performance data. It is the difference between reading a textbook chapter and having a live sparring partner in the ring 24/7.
Instantaneous Market Awareness - The End of the "Warm-Up": This is the critical innovation. The SPA engine does not require a 100-trade warm-up period. The learning does not start after 50 trades; it begins on the 6th bar of the chart when the first shadow trade closes. From that moment on, the system is market-aware, analyzing data, and capable of making intelligent adjustments. The SPA engine is not adapting to old wins and losses. It is adapting, in near real-time, to the market's ever-shifting character, volatility, and personality.
Chapter 2: The Anatomy of the SPA Engine - A Granular Deep Dive
The engine is composed of three primary systems that work in a sophisticated, interconnected symphony.
Section 1: The Shadow Portfolio (The Information Harvester)
What it is, Simply: Think of this as the script's eyes and ears. It's a team of 10 virtual traders (5 long, 5 short) who are constantly taking small, quick trades to feel out the market.
How it Works, Simply: On every new bar, a new "long" trader and a new "short" trader enter the market. Exactly 5 bars later, they close their positions. This cycle is perpetual and relentless.
The Critical 'Why': Because these virtual traders enter and exit based on a fixed time (5 bars), not on a "good" or "bad" signal, their results are completely unbiased . They are simply measuring: "What happened to price over the last 5 bars?" This provides the raw, untainted truth about the market's behavior that the rest of the system needs to learn effectively.
The Golden Metric (ATR Normalization): The engine doesn't just look at dollar P&L. It's smarter than that. It asks a more intelligent question: "How much did this trade make relative to the current volatility?"
Analogy: Imagine a flea and an elephant. If they both jump 1 inch, who is more impressive? The flea. The SPA engine understands this. A $10 profit when the market is dead quiet is far more significant than a $10 profit during a wild, volatile swing.
The Formula: realized_atr = (close - trade.entry) / trade.atr_entry. It takes the raw profit and divides it by the Average True Range (a measure of volatility) at the moment of entry. This gives a pure, "apples-to-apples" score for every single trade, which is the foundational data point for all learning.
Section 2: The Cognitive Map (The Long-Term Brain)
What it is, Simply: This is the engine's deep memory, its library of experiences. Imagine a giant, 64-square chessboard (8x8 grid). Each square on the board represents a very specific type of market environment.
The Two Dimensions of Thought (The 'How'): How does it know which square we are on? It looks at two things:
The Market's Personality (X-Axis): Is the market behaving like a disciplined soldier, marching in a clear trend? Or is it like a chaotic, unpredictable child, running all over the place? The engine calculates a "Regime" score to figure this out.
The Market's Energy Level (Y-Axis): Is the market sleepy and quiet, or is it wide-awake and hyperactive? The engine measures "Normalized Volatility" to determine this.
The Power of Generalization (The 'Why'): When a Shadow Portfolio trade closes, its result is recorded in the corresponding square on the chessboard. But here's the clever part: it also shares a little bit of that lesson with the squares immediately next to it (using a Gaussian Kernel).
Analogy: If you touch a hot stove and learn "don't touch," your brain is smart enough to know you probably shouldn't touch the hot oven door next to it either, even if you haven't touched it directly. The Cognitive Map does the same thing, allowing it to make intelligent inferences even in market conditions it has seen less frequently. Each square remembers what indicator settings worked best in that specific environment.
Section 3: The Adaptive Engine (The Central Nervous System)
What it is, Simply: This is the conductor of the orchestra. It takes information from all other parts of the system and decides exactly what to do.
The Symphony of Inputs: It listens to three distinct sources of information before making a decision:
The Short-Term Memory (Rolling Stats): It looks at the performance of the last rollN shadow trades. This is its immediate, recent experience.
The Long-Term Wisdom (Cognitive Map): It consults the grand library of the Cognitive Map to see what has worked best in the current market type over the long haul.
The Gut Instinct (Bin Learning): It keeps a small "mini-batch" of the most recent trades. If this batch shows a very strong, sudden pattern, it can trigger a rapid, reflexive adjustment, like pulling your hand away from a flame.
The Fusion Process: It then blends these three opinions together in a sophisticated way. It gives more weight to the opinions it's more confident in (e.g., a Cognitive Map square with hundreds of trades of experience) and uses your Adaptation Intensity (dialK) input to decide how much to listen to its "gut instinct." The final decision is then smoothed to ensure the indicator's parameters change in a stable, intelligent way.
Chapter 3: The Control Panel - A Novice's Guide to Every Input
This is the most important chapter. Let's break down what these confusing settings actually do in the simplest terms possible.
--- SECTION 1: THE DRIVER'S SEAT (SIGNAL ENGINE & BASE SETTINGS) ---
🧾 Signal Engine (Turning Point):
What it is: These are the rules for the final BUY and SELL signs.
Think of it like this: The SPA engine is the smart robot that tunes your race car. These settings are you, the driver, telling the robot what kind of race you're in.
Enable Reversal Mode: You tell the robot, "I want to race on a curvy track with lots of turns." The robot will tune the car to be agile for catching tops and bottoms.
Enable Breakout Mode: You tell the robot, "I want to race on a long, straight track." The robot will tune the car for pure speed to follow the trend.
Require New Extreme: This is a quality filter. It tells the driver, "Don't look for a turn unless we've just hit a new top speed on the straightaway." It makes sure the reversal is from a real extreme.
Min Bars Between Signals: This is the "pit stop" rule. You're telling the robot, "After you show me a sign, wait at least 10 bars before showing another one, so I don't get confused."
⚡ ATR Bands (Base Inputs):
What they are: These are the starting settings for your car before the robot starts tuning it. These are your factory defaults.
Sensitivity: This is the "Bump Detector." A low number means the car feels every tiny pebble on the road. A high number means it only notices the big speed bumps. You want to set it so it notices the important bumps (real market structure) but ignores the pebbles (noise).
ATR Period & Multiplier: These set the starting size of the "safety lane" (the green and blue bands) around your car. The robot's main job is to constantly adjust the size of this safety lane to perfectly fit the current road conditions.
📊 & 📈 Filter Settings (RSI & Volume):
What they are: These are your co-pilot's confirmation checks.
Enable RSI Filter: Your co-pilot will check the "Engine Temperature" (RSI). He won't let you hit the gas (BUY) if the engine is already overheating (overbought).
RSI Length & Lookbacks: These tune how your co-pilot's temperature gauge works. The defaults are standard.
Require Volume Spike: Your co-pilot will check the "Crowd Noise" (Volume). He won't give you a signal unless he hears the crowd roar, confirming that a lot of people are interested in this move.
🎯 Signal Quality Control:
Enable Major Levels Only: This tells your co-pilot to be extra picky. He will only confirm signals that happen after a huge, powerful move, ignoring all the small stuff.
--- SECTION 2: THE ROBOT'S BRAIN (ENGINE & LEARNING CONTROLS) ---
🎛️ Master Control:
Adaptation Intensity (dialK): THIS IS THE ROBOT'S PERSONALITY DIAL.
Turn it DOWN (1-5): The robot becomes a "Wise Old Professor." It thinks very slowly and carefully, gathers lots of data, and only makes a change when it is 100% sure. Its advice is very reliable but might come a little late.
Turn it UP (15-20): The robot becomes a "Hyper-Reactive Teenager." It has a short attention span, reacts instantly to everything it sees, and changes its mind constantly. It's super-fast to new information but might get faked out a lot.
The Default (10): A "Skilled Professional." The perfect balance of thoughtful and responsive. Start here.
🧠 Adaptive Engine:
Enable Adaptive System: This is the main power button for your robot. Turn it off, and you're driving a normal, non-smart car. Turn it on, and the robot takes over the tuning.
Use Shadow Cycle: This turns on the robot's "practice laps." The robot can't learn without practicing. This must be on for the robot to work.
Lock ATR Bands: This is a visual choice. "Locked" means the safety lanes on your screen stay where your factory defaults put them (the robot still makes changes to the signals in the background). "Unlocked" means you see the safety lanes moving and changing shape in real-time as the robot tunes them.
🎯 Learning (Global + Risk):
What they are: These are the deep-level settings for how your robot's brain processes information.
Rolling Window Size: This is the robot's "Short-Term Memory." How many of the last few practice laps should it remember? A small number means it only cares about what just happened. A big number means it remembers the last hour of practice.
Learn Rate & Smooth Alpha: This is "How big of a change should the robot make?" and "How smoothly should it make the change?" Think of it as turning the steering wheel. A high learn rate is like yanking the wheel; a low one is like a gentle turn. The smoothing makes sure the turn is graceful.
WinRate Thresholds & PnL Cap: These are rules for the robot's learning. They tell it what a "good" or "bad" outcome looks like and tell it to ignore crazy, once-in-a-lifetime events so its memory doesn't get corrupted.
--- SECTION 3: THE GARAGE (RISK, MEMORY & VISUALS) ---
⚠️ Risk Management:
What they are: These are safety rules you can give to your co-pilot for your own awareness. They appear on the dashboard.
The settings: You can set a max number of trades, a max loss for the day, and a "time out" period after a few losses.
Apply Risk to Shadow: This is an important switch. If you turn this ON, your safety rules also apply to the robot's practice laps. If you hit your max loss, the robot stops practicing and learning. It's recommended to leave this OFF so the robot can learn 24/7, even if you have stopped trading.
🗺️ Cognitive Map, STM & Checkpoints:
What it is: The robot's "Long-Term Memory" or its entire library of racing experience.
Use Cognitive Map & STM: These switches turn on the long-term and short-term memory banks. You want these on for the smartest robot.
Map Settings (Grid, Sigma, Half-Life): These are very advanced settings for neuroscientists. They control how the robot's brain is structured and how it forgets old information. The defaults are expertly tuned.
The Checkpoint System: This is the "Save Your Game" button for the robot.
To Save: Check Emit Checkpoint Now. Go to your alert log, and you will see a very long password. Copy this password.
To Load: Paste that password into the Memory Checkpoint box. Then, check Apply Checkpoint On Next Bar. The robot will instantly download all of its saved memories and experience.
🎨 Visuals & 🧩 Display Params:
What they are: These are all about how your screen looks.
You can control everything: The size and shape of the little diamonds (Entry Orbs), whether you see the purple Adapt Pulse, and where the Dashboards appear on your screen. You can change the Theme to Dark, Light, or Neon. These settings don't change how the robot thinks, only how it presents its information to you.
Chapter 4: The Command Center - Decoding the Dashboard
PANEL A (INFLECTION NEXUS): Your high-level mission control, showing the engine's classification of the current Market Context and the performance summary of the Shadow Portfolio.
PANEL B (SHADOW PORTFOLIO ADAPTIVE): Your deep diagnostic screen.
Performance Metrics: View advanced risk-adjusted stats like the Sharpe Ratio to understand the quality of the market movements the engine is learning from.
Adaptive Parameters (Live vs Base): THIS IS THE MOST CRITICAL SECTION. It shows the engine's Live parameters right next to your (Base) inputs. When the Live values deviate, the engine is communicating its learned wisdom to you. For example, a Live ATR Multiplier of 2.5 versus your Base of 1.4 is the engine telling you: "Caution. The market is currently experiencing high fake-outs and requires giving positions more room to breathe." This section is a direct translation of the engine's learning into actionable insight.
Chapter 5: Reading the Canvas - On-Chart Visuals
The Bands (Green/Blue Lines): These are not static Supertrend lines. They are the physical manifestation of the engine's current thinking. As the engine learns and adapts its ATR Period and Multiplier, you will see these bands widen, tighten, and adjust their distance from price. They are alive.
The Labels (BUY/SELL): These are the final output of the "Turning Point" logic, now supercharged and informed by the fully adaptive SPA engine.
The Purple Pulse (Dot and Background Glow): This is your visual cue that the engine is "thinking." Every time you see this pulse, it means the SPA has just completed a learning cycle and updated its parameters. It is actively recalibrating itself to the market.
Chapter 6: A Manifesto on Innovation and Community
I want to conclude with a personal note on why I dedicate countless hours to building systems like this and sharing them openly.
My purpose is to drive innovation, period. I am not in this space to follow the crowd or to re-package old ideas. The world does not need a 100th version of a slightly modified MACD. Real progress, real breakthroughs, come from venturing into the wilderness, from asking "what if?" and from pursuing concepts that lie at the very edge of possibility.
I am not afraid of being wrong. I am not afraid of being bested by my peers. In fact, I welcome it. If another developer takes an idea from this engine, improves it, and builds something even more magnificent, that is a profound win for our entire community. The only failure I recognize is the failure to try. The only trap I fear is the creative complacency of producing sterile, recycled work just to appease the status quo.
I love this community, and I believe with every fiber of my being that we have barely scratched the surface of what can be discovered and created. This script is my contribution to that shared journey. It is a tool, an idea, and a challenge to all of us: let's keep pushing.
DISCLAIMER: This script is an advanced analytical tool provided for educational and research purposes ONLY. It does not constitute financial advice. All trading involves substantial risk of loss. Past performance is not indicative of future results. Please use this tool responsibly and as part of a comprehensive trading plan.
As the great computer scientist Herbert A. Simon, a pioneer of artificial intelligence, famously said:
"Learning is any process by which a system improves performance from experience."
*Tooltips were updated with a comprehensive guide
May this engine enhance your experience.
— Dskyz, for DAFE Trading Systems
LaCucaracha100x StrategyFirst Script
Green and red arrows to take an entry.
1. buy/sell on 2nd or 3rd arrow.
2. stoploss on the nearest fvg.
3. Exit trade after last arrow so you can capture the whole trend.
WORKS BEST ON XAUUSD AND ON 5MIN CHARTS ANY PAIRS.