OPEN-SOURCE SCRIPT

stockan – Oscillator Matrix

144
stockan – Oscillator Matrix
A multi-layer RSI-based momentum & trend tool with signal smoothing, short-segment regression lines, fade-style histogram, reversal markers, and a blocky heat-bar.

stockan is designed to give you a crystal-clear view of short-term momentum shifts and trend bias all in one pane. It builds upon the classic 0–100 RSI by:

  • Smoothing it with a quick SMA to generate a clean crossover signal.
  • Drawing tiny linear-regression segments on both RSI and its signal line to highlight the slope (i.e. local trend direction) over a handful of bars.
  • Filling between RSI and signal in green/red so you can instantly see when momentum flips.
  • Plotting a soft-fade histogram of (RSI – signal), where stronger moves produce more opaque bars, while smaller divergences fade into the background.
  • Marking local peaks and troughs on the RSI curve with dots—perfect for fine-tuning entries or exits.
  • Rendering a bottom “heat” strip as blocky columns that switch from red to green once RSI crosses your chosen threshold, giving you a persistent bias indicator.


🔧Inputs & Settings

You can customize every aspect of stockan in the Indicator Settings:

Price Source (default = Close)
Choose which price series (Open, High, Low, Close, or a custom series) you want the RSI to use.

Oscillator Length (RSI) (default = 14)
The look-back period for the RSI calculation. Shorter values make the oscillator more sensitive.

Signal Smoothing (default = 3)
The length of the simple moving average applied to the RSI. Higher values produce slower, cleaner signals.

Trend-LR Length (default = 20)
Number of bars used in each linear-regression segment. Longer lengths smooth trends but react more slowly.

Heat Threshold (default = 50)
The cutoff level (on the 0–100 RSI scale) above which the bottom heat-blocks turn green.

Histogram Max for Fade (default = 20)
The absolute difference (RSI – signal) that maps to 100% opacity in the histogram. Smaller differences fade out; larger ones stand out.

🚀 How to Use stockan

  1. Identify Momentum Shifts
  2. Watch for the green/red fill to flip—when the RSI line crosses above its signal, green fill indicates building bullish momentum; red indicates bearish pressure.
  3. Sense Short-Term Trend with Mini-Regression Lines
  4. The tiny sloping segments on both RSI and signal lines give an immediate visual cue: upward-tilted segments = short-term uptrend, downward = downtrend.
  5. Gauge Strength with the Fade-Style Histogram
  6. Opaque bars mean strong momentum divergence; faint bars mean weak or consolidating moves. Use these to avoid low-conviction signals.
  7. Fine-Tune Entries & Exits Using Reversal Dots
  8. Gray dots mark local RSI highs (possible short setups), green dots mark local lows (possible long entries).
  9. Confirm Bias with the Heat-Bar
  10. A steady green row at the bottom tells you RSI has been above your threshold consistently—ideal for trend-following. A red row suggests caution or counter-trend trades.


🎯 Benefits

  • All-in-One Pane: No need to juggle RSI, MA, histogram and custom script separately.
  • Clean Visuals: Soft fades and blocky heat bars reduce clutter and highlight what matters.
  • Non-Repainting: Uses only closed-bar data; once a bar is closed, nothing moves or disappears.
  • Highly Customizable: Every length, threshold, color and transparency can be adjusted in Settings.
  • Lightweight & Self-Contained: Pure Pine v5—no external libraries, no proprietary code—fully compliant with TradingView’s policies.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.