OPEN-SOURCE SCRIPT
Güncellendi Adaptive Signal Oscillator (ASO)

📘 Adaptive Signal Oscillator (ASO)
A fully dynamic, self-calibrating oscillator that adapts to any asset or timeframe by optimizing for real-time signal stability and volatility structure — without relying on static parameters or hardcoded thresholds.
🔍 Overview
The Adaptive Signal Oscillator (ASO) is a next-generation technical analysis tool designed to provide context-aware long/short signals across crypto, equities, or forex markets. Unlike traditional oscillators (RSI, Stochastics, MACD), ASO requires no manual tuning of lookback periods or overbought/oversold zones — it self-optimizes based on current market behavior.
🧠 How It Works
✅ 1. Dynamic Lookback Optimization
ASO evaluates a range of lookback lengths between user-defined minLen and maxLen. For each length, it calculates the standard deviation of returns and finds the one with the least volatility change (i.e., the most stable structure). This length is dynamically assigned as bestLen, recalculated on every bar.
✅ 2. Multi-Layer Signal Composition
Four independent signal layers are computed using bestLen:
RSI Layer: Measures relative price strength via a custom dynamic RSI.
Z-Score Layer: Standardized deviation of price from its mean.
Volatility Layer: Standard deviation of log or percent returns.
Price Position Layer: Current price percentile within the lookback window.
Each of these layers is transformed into a percentile score scaled to the range [-1, 1].
✅ 3. Volatility-Based Weighting
The standard deviation (volatility) of each signal layer is computed. Less volatile layers are weighted more heavily, ensuring the final composite signal prioritizes stable, consistent inputs.
Weights are normalized and combined to form a composite score, representing a dynamically blended, noise-weighted signal across the four layers.
✅ 4. Optional Adaptive Smoothing
A boolean toggle lets users apply smoothing to the final score. The smoothing window scales proportionally to bestLen, preserving adaptiveness even during trend transitions.
✅ 5. Percentile-Based Thresholding
Rather than using arbitrary fixed thresholds, ASO converts the composite score into a ranked percentile. Long/short signals are then generated based on user-defined percentile bands, adapting naturally to each asset’s behavior.
📈 Interpreting ASO
Score > Threshold → Strong long signal (highlighted in aqua).
Score < Threshold → Strong short signal (highlighted in fuchsia).
Crossing h_thresh (e.g., 0) → Neutral-to-bias change; useful for early trend cues.
The background and label update in real time to reflect the current regime and bestLen.
⚙️ Inputs
minLen, maxLen, step: Define the search range for optimal lookback length.
retMethod: Choose between log or percent return calculations.
threshHigh, threshLow: Define signal zones using percentiles.
smooth: Enable dynamic score smoothing.
h_thresh: Midline crossover zone for directional context.
⚠️ Disclaimer
This tool is designed for exploratory and educational purposes only. It does not offer financial advice or trading recommendations. Past performance is not indicative of future results.
Always consult a licensed financial advisor before making investment decisions.
A fully dynamic, self-calibrating oscillator that adapts to any asset or timeframe by optimizing for real-time signal stability and volatility structure — without relying on static parameters or hardcoded thresholds.
🔍 Overview
The Adaptive Signal Oscillator (ASO) is a next-generation technical analysis tool designed to provide context-aware long/short signals across crypto, equities, or forex markets. Unlike traditional oscillators (RSI, Stochastics, MACD), ASO requires no manual tuning of lookback periods or overbought/oversold zones — it self-optimizes based on current market behavior.
🧠 How It Works
✅ 1. Dynamic Lookback Optimization
ASO evaluates a range of lookback lengths between user-defined minLen and maxLen. For each length, it calculates the standard deviation of returns and finds the one with the least volatility change (i.e., the most stable structure). This length is dynamically assigned as bestLen, recalculated on every bar.
✅ 2. Multi-Layer Signal Composition
Four independent signal layers are computed using bestLen:
RSI Layer: Measures relative price strength via a custom dynamic RSI.
Z-Score Layer: Standardized deviation of price from its mean.
Volatility Layer: Standard deviation of log or percent returns.
Price Position Layer: Current price percentile within the lookback window.
Each of these layers is transformed into a percentile score scaled to the range [-1, 1].
✅ 3. Volatility-Based Weighting
The standard deviation (volatility) of each signal layer is computed. Less volatile layers are weighted more heavily, ensuring the final composite signal prioritizes stable, consistent inputs.
Weights are normalized and combined to form a composite score, representing a dynamically blended, noise-weighted signal across the four layers.
✅ 4. Optional Adaptive Smoothing
A boolean toggle lets users apply smoothing to the final score. The smoothing window scales proportionally to bestLen, preserving adaptiveness even during trend transitions.
✅ 5. Percentile-Based Thresholding
Rather than using arbitrary fixed thresholds, ASO converts the composite score into a ranked percentile. Long/short signals are then generated based on user-defined percentile bands, adapting naturally to each asset’s behavior.
📈 Interpreting ASO
Score > Threshold → Strong long signal (highlighted in aqua).
Score < Threshold → Strong short signal (highlighted in fuchsia).
Crossing h_thresh (e.g., 0) → Neutral-to-bias change; useful for early trend cues.
The background and label update in real time to reflect the current regime and bestLen.
⚙️ Inputs
minLen, maxLen, step: Define the search range for optimal lookback length.
retMethod: Choose between log or percent return calculations.
threshHigh, threshLow: Define signal zones using percentiles.
smooth: Enable dynamic score smoothing.
h_thresh: Midline crossover zone for directional context.
⚠️ Disclaimer
This tool is designed for exploratory and educational purposes only. It does not offer financial advice or trading recommendations. Past performance is not indicative of future results.
Always consult a licensed financial advisor before making investment decisions.
Sürüm Notları
🔄 Adaptive Signal Oscillator (ASO) – Gradient Signal UpgradeThis upgraded version of the original ASO builds on its dynamic framework by enhancing expressiveness, precision, and interpretability.
✅ Key Upgrades
📈 Gradient Signal Output (signalSharp)
The binary long/short classification has been replaced with a continuous oscillator signal ranging from -1 to +1, allowing finer insight into signal strength and sentiment momentum.
🌀 Divergence-Aware Signal Scaling
Final signal strength is now modulated by real-time divergence between the price and the oscillator. Conviction is reduced proportionally during divergence, making the signal more resilient to false positives.
📐 Non-linear Sensitivity Boost
A √x transformation sharpens midrange values. This amplifies early momentum cues and produces a more reactive yet statistically stable signal near the zero line.
🎨 Visual Gradient Enhancement
The plot uses alpha-blended color gradients, fading from neutral gray to aqua (bullish) or fuchsia (bearish), proportionally to signal strength — making visual interpretation intuitive and actionable.
📊 Dynamic Weighting & Lookback
All components (RSI, Z-score, volatility, price position) continue to be dynamically weighted based on statistical volatility and adaptively optimized over a rolling lookback for minimal lag and maximal relevance.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.