OPEN-SOURCE SCRIPT
Shadow Refinery Compound

Shadow Refinery Compound (SRC)
OVERVIEW
⚙️ CORE FEATURES & METHODOLOGY
• Median-Based Fibonacci Moving Averages:
• 💡 User Tip:
• Macro Volatility Bands (Bollinger):
• Dynamic Linear Regression Channel (LRC) & HUD:
• Fibonacci Default:
• Forward Extension Length:
• Trend Strength HUD:
⚠️ Statistical Caveat:
• Visible High/Low Tracking:
🚨 CRITICAL USAGE NOTE: LINEAR VS. LOGARITHMIC MATH
• ✅ The Standard Default (Log Math = OFF):
• ❌ The Logarithmic Trap (Log Math = ON):
🎨 CUSTOMIZATION & AESTHETICS
• Unified Color Themes:
• Line Thickness Control:
OVERVIEW
The Shadow Refinery Compound (SRC) is a multi-faceted trend analysis suite designed to give traders a deep, statistical view of market structure. Rather than relying on standard closing prices, this indicator builds its foundation on median price action, combining Fibonacci-sequenced moving averages, volatility bands, and dynamic linear regression into a single, cohesive visual environment.
Whether you are mapping out intra-day swings or plotting macro trends, the SRC adjusts to your chart's scale and provides strict mathematical context to the current price action.
⚙️ CORE FEATURES & METHODOLOGY
• Median-Based Fibonacci Moving Averages:
Instead of basic closing prices, SRC calculates its moving averages using the median of the SMA of the Highs and the SMA of the Lows. This filters out extreme wicks and noise. The indicator plots a full suite of MAs utilizing Fibonacci lookback periods (ranging from 5 up to 610), deliberately replacing the traditional 8 with a 5 and 6 pairing at the start of the sequence—a custom structural adjustment designed to catch ultra-sensitive micro-crossovers right at the foundation.
• 💡 User Tip:
If the chart feels too cluttered, you can toggle "Show Fewer Moving Averages" in the settings to display only the most critical macro and micro levels (MA 1, 2, 5, and 11). You can also change the calculation method (SMA, EMA, RMA, VWMA, etc.) to suit your exact trading style.
• Macro Volatility Bands (Bollinger):
Built exclusively around the macro 610-period median MA, these standard deviation bands provide ultimate macro support and resistance parameters to contain major price distribution.
• Dynamic Linear Regression Channel (LRC) & HUD:
The script dynamically draws a Linear Regression Channel based on either your current Visible Range or a Fixed Length.
• Fibonacci Default:
The Fixed Length setting defaults to 377 bars, a deliberate Fibonacci sequence choice chosen to effectively capture structural market cycles.
• Forward Extension Length:
Want to see where the structure is heading? The indicator includes a forward projection feature that extends the regression channel's trajectories (up to 200 bars) into the future, helping you anticipate upcoming structural boundaries and potential confluence zones.
• Trend Strength HUD:
A Heads-Up Display tracks the statistical viability of the current channel. It displays R² (Trend Power) to show how tightly price correlates to the regression line, the P-Value to confirm statistical significance, and the Channel Width as a percentage.
⚠️ Statistical Caveat:
Traders should note that on very high timeframes or extremely long regression channels, R² and P-Values can sometimes become negligible or mathematically skewed due to the non-stationary nature of long-term financial data. Use these metrics to gauge current structural alignment rather than absolute future certainty.
• Visible High/Low Tracking:
Automatically draws dynamic horizontal dashed lines at the absolute highest high and lowest low within your selected regression range, giving you instant structural boundaries.
🚨 CRITICAL USAGE NOTE: LINEAR VS. LOGARITHMIC MATH
This indicator defaults to Linear (Standard) Math for both the Bollinger Bands and the Linear Regression Channel, as standard charts are what most traders use. However, it includes a built-in toggle for Logarithmic Math for those plotting massive macro trends.
• ✅ The Standard Default (Log Math = OFF):
If your chart's Y-axis is set to standard "Regular/Auto" (Linear), leave the "Enable Logarithmic Math" setting turned OFF (which is the default). The math will perfectly match your screen.
• ❌ The Logarithmic Trap (Log Math = ON):
If your TradingView price scale is explicitly set to "Log", you must check the "Enable Logarithmic Math" box in the indicator settings to sync the math. If you mix a Linear indicator setting with a Log chart (or vice versa), the bands and channels will heavily distort and detach from reality. Always match your settings to your chart!
🎨 CUSTOMIZATION & AESTHETICS
• Unified Color Themes:
Visual clarity is vital for trading psychology. The SRC comes packed with seven color themes (TV Default, Neon, Azure Trade, Sage & Clay, Slate Pro, Twilight Modern, Monochrome Pro) that instantly sync the colors of all MAs, bands, and channels. The indicator dynamically shifts colors to indicate bullish or bearish states based on where the open price sits relative to the median averages.
• Line Thickness Control:
A dedicated global line thickness setting allows you to scale the visual weight of the primary indicator lines, ensuring maximum readability whether you are on a laptop or an ultrawide monitor.
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。