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.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.