Bilateral Stochastic Oscillator - For The Sake Of EfficiencyIntroduction
The stochastic oscillator is a feature scaling method commonly used in technical analysis, this method is the same as the running min-max normalization method except that the stochastic oscillator is in a range of (0,100) while min-max normalization is in a range of (0,1). The stochastic oscillator in itself is efficient since it tell's us when the price reached its highest/lowest or crossed this average, however there could be ways to further develop the stochastic oscillator, this is why i propose this new indicator that aim to show all the information a classical stochastic oscillator would give with some additional features.
Min-Max Derivation
The min-max normalization of the price is calculated as follow : (price - min)/(max - min) , this calculation is efficient but there is alternates forms such as :
price - (max - min) - min/(max - min)
This alternate form is the one i chosen to make the indicator except that both range (max - min) are smoothed with a simple moving average, there are also additional modifications that you can see on the code.
The Indicator
The indicator return two main lines, in blue the bull line who show the buying force and in red the bear line who show the selling force.
An orange line show the signal line who represent the moving average of the max(bull,bear), this line aim to show possible exit/reversals points for the current trend.
Length control the highest/lowest period as well as the smoothing amount, signal length control the moving average period of the signal line, the pre-filtering setting indicate which smoothing method will be used to smooth the input source before applying normalization.
The default pre-filtering method is the sma.
The ema method is slightly faster as you can see above.
The triangular moving average is the moving average of another moving average, the impulse response of this filter is a triangular function hence its name. This moving average is really smooth.
The lsma or least squares moving average is the fastest moving average used in this indicator, this filter try to best fit a linear function to the data in a certain window by using the least squares method.
No filtering will use the source price without prior smoothing for the indicator calculation.
Relationship With The Stochastic Oscillator
The crosses between the bull and bear line mean that the stochastic oscillator crossed the 50 level. When the Bull line is equal to 0 this mean that the stochastic oscillator is equal to 0 while a bear line equal to 0 mean a stochastic oscillator equal to 100.
The indicator and below a stochastic oscillator of both period 100
Using Levels
Unlike a stochastic oscillator who would clip at the 0 and 100 level the proposed indicator is not heavily constrained in a range like the stochastic oscillator, this mean that you can apply levels to trigger signals
Possible levels could be 1,2,3... even if the indicator rarely go over 3.
Its then possible to create strategies using such levels as support or resistance one.
Conclusion
I've showed a modified stochastic oscillator who aim to show additional information to the user while keeping all the information a classical stochastic oscillator would give. The proposed indicator is no longer constrained in an hard range and posses more liberty to exploit its scale which in return allow to create strategies based on levels.
For pinescript users what you can learn from this is that alternates forms of specific formulas can be extremely interesting to modify, changes can be really surprising so if you are feeling stuck, modifying alternates forms of know indicators can give great results, use tools such as sympy gamma to get alternates forms of formulas.
Thanks for reading !
If you are looking for something or just want to say thanks try to pm me :)
Tìm kiếm tập lệnh với "马斯克+100万"
High/Low bandsGives good idea about trend.
In last 100 days the lowest price was this.
In last 100 days the highest price was this.
Price makes new 100 days high! (uptrend)
Chaikin MF% (CMFP) w. Alerts, Bells & Whistles [LucF]This is Chaikin’s Money Flow indicator on a 0-100 scale with buy/sell signals, alerts and other bells & whistles.
It includes:
- a fast EMA (16 periods by default),
- a slow MA (64 periods by default),
- histograms,
- 3 different sorts of crosses,
- big swings identification,
- buy/sell signals on CMFP crossing back from outside user-defined levels,
- buy/sell signals on the slow MA pivots above/below user-defined levels,
- alerts on big swings and buy/sells.
This indicator started with @LazyBear code (VAPI) at:
@cI8DH then changed the scale to 0-100, which I find very useful:
I then added the rest.
The chart above shows both clean and busy versions of the indicator.
Note that the default length is 10 rather than the commonly used 20. I use CMFP in conjunction with VFI and like the fact that it is faster than VFI. The default inputs show the way I normally use this indicator, with the slow MA shown in histogram mode. I find it gives good context to the signal line. Crosses between the two are often useful.
The buy/sell signals aren’t the main attraction of this indicator, and nothing to write home about. Like the big swing markers, I think it’s more realistic to view them as pointers to potentially interesting areas on charts. Their nature makes them more suited to identifying reversals. They certainly aren’t reliable enough to turn this study into a strategy and I normally don’t use them. The levels pre-defined for the buy/sell signals on CMFP are most useful on short intervals. The buy/sell signals on the slow MA pivots work on a more complete range of intervals. Optimization for your specific instruments and intervals will improve their reliability.
As usual when defining alerts, be sure you already have defined proper inputs and that you are on the intended interval, as they will be used when triggering alerts.
3 of SlowStochastics
스토캐스틱 3개를 한번에 볼수 있습니다. 천장과 바닥은 각 100의 위치마다 존재합니다
You can see three slow stochastics at once. The ceiling and floor are located at each 100 (0 - 100 - 200- 300)
Percentage Price Oscillator (PPO)The Percentage Price Oscillator (PPO) is a momentum oscillator that measures the difference between two moving averages as a percentage of the larger moving average. As with its cousin, MACD, the Percentage Price Oscillator is shown with a signal line, a histogram and a centerline. Signals are generated with signal line crossovers, centerline crossovers, and divergences. First, PPO readings are not subject to the price level of the security. Second, PPO readings for different securities can be compared, even when there are large differences in the price.
Calculations
PPO: {(12-day EMA - 26-day EMA)/26-day EMA} x 100
Signal Line: 9-day EMA of PPO
PPO Histogram: PPO - Signal Line
While MACD measures the absolute difference between two moving averages, PPO makes this a relative value by dividing the difference by the slower moving average (26-day EMA). PPO is simply the MACD value divided by the longer moving average. The result is multiplied by 100 to move the decimal place two spots.
Interpretation
As with MACD, the PPO reflects the convergence and divergence of two moving averages. PPO is positive when the shorter moving average is above the longer moving average. The indicator moves further into positive territory as the shorter moving average distances itself from the longer moving average. This reflects strong upside momentum. The PPO is negative when the shorter moving average is below the longer moving average. Negative readings grow when the shorter moving average distances itself from the longer moving average (goes further negative). This reflects strong downside momentum. The histogram represents the difference between PPO and its 9-day EMA, the signal line. The histogram is positive when PPO is above its 9-day EMA and negative when PPO is below its 9-day EMA. The PPO-Histogram can be used to anticipate signal line crossovers in the PPO.
MACD, PPO and Price
MACD levels are affected by the price of a security. A high-priced security will have higher or lower MACD values than a low-priced security, even if volatility is basically equal. This is because MACD is based on the absolute difference in the two moving averages. Because MACD is based on absolute levels, large price changes can affect MACD levels over an extended period of time. If a stock advances from 20 to 100, its MACD levels will be considerably smaller around 20 than around 100. The PPO solves this problem by showing MACD values in percentage terms.
Conclusions
The Percentage Price Oscillator (PPO) generates the same signals as the MACD, but provides an added dimension as a percentage version of MACD. The PPO levels of the Dow Industrials (price > 20K) can be compared against the PPO levels of IBM (price < 200) because the PPO “levels” the playing field. In addition, PPO levels in one security can be compared over extended periods of time, even if the price has doubled or tripled. This is not the case for the MACD.
Limitations
Despite its advantages, the PPO is still not the best oscillator to identify overbought or oversold conditions because movements are unlimited (in theory). Levels for RSI and the Stochastic Oscillator are limited and this makes them better suited to identify overbought and oversold levels.
Source: Stockcharts
Multiple Moving AveragesThis is really simple. But useful for me as I don't have a paid account. No-pro users can only use 3 indicators at once and because I rely heavily on simple moving averages it can be a real pain.
This one indicator features:
20 MA
50 MA
100 MA
200 MA
which I find are the most useful overall. The 20 and 50 over all time frame but in particular < 1 day, the 100 and 200 at > 4 hr time frames. In general I don't use the 100 MA that much. The daily 200 MA is a critical support for many assets like stocks and cryptos. I'm by no means a pro and if you are learning I recommend becoming familiar with moving averages right at the beginning.
If you want to deactivate some of the lines, you can do it via the indicator's settings icon.
Exponential Moving Average (Set of 3) [Krypt] + 13/34 EMAsI took Krypt's script and essentially added on to it.
the 20/50/100/200 EMAs should be used together as support and resistance as normal.
Wait for price to break 200 EMA
Wait for 50 EMA to cross 200 EMA
Wait for pullback to 50 EMA to open position
20 and 100 EMAs are for extra information about moving support and resistance
and 13/34 EMAs should be used in conjunction
When 13 EMA crosses 34 EMA, open position
When price gets far from 13/34, close position (because price will attempt to revert back to mean)
This is better for scalping and swing trades than the 20/50/100/200 setup.
Twitter: @AzorAhai06
Ichimoku Cloud Score v1.0This script calculates a simple Ichimoku Score based on the signals documented here , with a few additions. Each of the score components can be individually weighted via the script inputs . The output is a plot of the normalized Ichimoku score, in the range of -100 to 100.
This script has been heavily modified from 'Ichimoku Cloud Signal Score v2.0.0 '. Credit to user 'dashed' for the initial implementation.
This has been modified with several refinements:
Clean/Organized Code
Simplified Inputs
Improved Style
Scores normalized to a range (-100, 100)
Bugfixes and Improvements
Script Inputs: i.imgur.com
Volume RatioDefinition:
Volume ratio can be obtained in a similar way to RSI.
Volume Ratio (%) = 100 - 100/(1+vr)
The parameter "vr" is defined as
vr=(A+U/2)/(D+U/2)
A=Total volume of the periods when the price advanced
D=Total volume of the periods when the price declined
U=Total volume of the periods when the price unchanged
After substitution, following expression can be derived and the denominator represents total volume of all periods.
Volume Ratio (%) = 100 x (A+U/2)/(A+D+U)
Notes:
A similar method to interpret RSI can be employed.
1) Overbought level over 70% and oversold level under 30%. These levels need to be adjusted according to the periods, time frames and issues.
2) Bullish picture over 50% line and bearish picture under 50% line.
3) Crossing oversold level to the upside can be taken as a confirmation of bullish reversal. - and vice versa for a bearish reversal.
4) After a long-term bearish market, the increase of volume can happen in the early stage of a bullish market.
5) Buying opportunity can be suggested when the volume ratio is declining and the price is either advancing or leveling off.
CCI with Volume Weighted EMA Here is an attempt to improve on the CCI using a volume weighted ema which is then plugged into the CCI formula.
Use:
The CCI with VW EMA is an oscillator that gives readings between -100 and +100. The usual use is to 'go long' with values over +100 and short on values less than -100.
Another use of this oscillator is a countertrend indicator where one sells at crosses under +100 and buys on crosses over -100.
Multi-Functional Fisher Transform MTF with MACDL TRIGGERWhat this indicator gives you is a true signal when price is exhausted and ready for a fast turnaround. Fisher Transform is set for multi-time frame and also allows the user to change the length. This way a user can compare two or more time spans and lengths to look for these MACDL divergent triggers after a Fisher exhaustion. With so many indicators, it's probably best to merge these indicators and change the Fisher and Trigger colors so you can still have a look at price action (remember to scale right after merger). I've noticed from time to time when you have Fisher 34 100 and 300 up and running on two different time frames such as 5 and 15 min charts, with MACDL triggers on the 100/300 or 34/100 you get a high probability trade trigger. However, there are rare exceptions such as when price moves in a parabolic state up or down for a long period where this indication does not work. Ideally this indicator works best in a sideways market or slow rising/descending moving market.
This indicator was worked on by Glaz, nmike and myself
LazyBear also introduced the MACDL indicator
CCI Crossover AlertThis very simple indicator will give you a blue background where the CCI crossed from below -100 to above -100, and a red background where it crossed from above 100 to below 100.
Market Profile Dominance Analyzer# Market Profile Dominance Analyzer
## 📊 OVERVIEW
**Market Profile Dominance Analyzer** is an advanced multi-factor indicator that combines Market Profile methodology with composite dominance scoring to identify buyer and seller strength across higher timeframes. Unlike traditional volume profile indicators that only show volume distribution, or simple buyer/seller indicators that only compare candle colors, this script integrates six distinct analytical components into a unified dominance measurement system.
This indicator helps traders understand **WHO controls the market** by analyzing price position relative to Market Profile key levels (POC, Value Area) combined with volume distribution, momentum, and trend characteristics.
## 🎯 WHAT MAKES THIS ORIGINAL
### **Hybrid Analytical Approach**
This indicator uniquely combines two separate methodologies that are typically analyzed independently:
1. **Market Profile Analysis** - Calculates Point of Control (POC) and Value Area (VA) using volume distribution across price channels on higher timeframes
2. **Multi-Factor Dominance Scoring** - Weights six independent factors to produce a composite dominance index
### **Six-Factor Composite Analysis**
The dominance score integrates:
- Price position relative to POC (equilibrium assessment)
- Price position relative to Value Area boundaries (acceptance/rejection zones)
- Volume imbalance within Value Area (institutional bias detection)
- Price momentum (directional strength)
- Volume trend comparison (participation analysis)
- Normalized Value Area position (precise location within fair value zone)
### **Adaptive Higher Timeframe Integration**
The script features an intelligent auto-selection system that automatically chooses appropriate higher timeframes based on the current chart period, ensuring optimal Market Profile structure regardless of the trading timeframe being analyzed.
## 💡 HOW IT WORKS
### **Market Profile Construction**
The indicator builds a Market Profile structure on a higher timeframe by:
1. **Session Identification** - Detects new higher timeframe sessions using `request.security()` to ensure accurate period boundaries
2. **Data Accumulation** - Stores high, low, and volume data for all bars within the current higher timeframe session
3. **Channel Distribution** - Divides the session's price range into configurable channels (default: 20 rows)
4. **Volume Mapping** - Distributes each bar's volume proportionally across all price channels it touched
### **Key Level Calculation**
**Point of Control (POC)**
- Identifies the price channel with the highest accumulated volume
- Represents the price level where the most trading activity occurred
- Serves as a magnetic level where price often returns
**Value Area (VA)**
- Starts at POC and expands both upward and downward
- Includes channels until reaching the specified percentage of total volume (default: 70%)
- Expansion algorithm compares adjacent volumes and prioritizes the direction with higher activity
- Defines the "fair value" zone where most market participants agreed to trade
### **Dominance Score Formula**
```
Dominance Score = (price_vs_poc × 10) +
(price_vs_va × 5) +
(volume_imbalance × 0.5) +
(price_momentum × 100) +
(volume_trend × 5) +
(va_position × 15)
```
**Component Breakdown:**
- **price_vs_poc**: +1 if above POC, -1 if below (shows which side of equilibrium)
- **price_vs_va**: +2 if above VAH, -2 if below VAL, 0 if inside VA
- **volume_imbalance**: Percentage difference between upper and lower VA volumes
- **price_momentum**: 5-period SMA of price change (directional acceleration)
- **volume_trend**: Compares 5-period vs 20-period volume averages
- **va_position**: Normalized position within Value Area (-1 to +1)
The composite score is then smoothed using EMA with configurable sensitivity to reduce noise while maintaining responsiveness.
### **Market State Determination**
- **BUYERS Dominant**: Smooth dominance > +10 (bullish control)
- **SELLERS Dominant**: Smooth dominance < -10 (bearish control)
- **NEUTRAL**: Between -10 and +10 (balanced market)
## 📈 HOW TO USE THIS INDICATOR
### **Trend Identification**
- **Green background** indicates buyers are in control - look for long opportunities
- **Red background** indicates sellers are in control - look for short opportunities
- **Gray background** indicates neutral market - consider range-bound strategies
### **Signal Interpretation**
**Buy Signals** (green triangle) appear when:
- Dominance crosses above -10 from oversold conditions
- Previous state was not already bullish
- Suggests shift from seller to buyer control
**Sell Signals** (red triangle) appear when:
- Dominance crosses below +10 from overbought conditions
- Previous state was not already bearish
- Suggests shift from buyer to seller control
### **Value Area Context**
Monitor the information table (top-right) to understand market structure:
- **Price vs POC**: Shows if trading above/below equilibrium
- **Volume Imbalance**: Positive values favor buyers, negative favors sellers
- **Market State**: Current dominant force (BUYERS/SELLERS/NEUTRAL)
### **Multi-Timeframe Strategy**
The auto-timeframe feature analyzes higher timeframe structure:
- On 1-minute charts → analyzes 2-hour structure
- On 5-minute charts → analyzes Daily structure
- On 15-minute charts → analyzes Weekly structure
- On Daily charts → analyzes Yearly structure
This higher timeframe context helps avoid counter-trend trades against the dominant force.
### **Confluence Trading**
Strongest signals occur when multiple factors align:
1. Price above VAH + positive volume imbalance + buyers dominant = Strong bullish setup
2. Price below VAL + negative volume imbalance + sellers dominant = Strong bearish setup
3. Price at POC + neutral state = Potential breakout/breakdown pivot
## ⚙️ INPUT PARAMETERS
- **Higher Time Frame**: Select specific HTF or use 'Auto' for intelligent selection
- **Value Area %**: Percentage of volume contained in VA (default: 70%)
- **Show Buy/Sell Signals**: Toggle signal triangles visibility
- **Show Dominance Histogram**: Toggle histogram display
- **Signal Sensitivity**: EMA period for dominance smoothing (1-20, default: 5)
- **Number of Channels**: Market Profile resolution (10-50, default: 20)
- **Color Settings**: Customize buyer, seller, and neutral colors
## 🎨 VISUAL ELEMENTS
- **Histogram**: Shows smoothed dominance score (green = buyers, red = sellers)
- **Zero Line**: Neutral equilibrium reference
- **Overbought/Oversold Lines**: ±50 levels marking extreme dominance
- **Background Color**: Highlights current market state
- **Information Table**: Displays key metrics (state, dominance, POC relationship, volume imbalance, timeframe, bars in session, total volume)
- **Signal Shapes**: Triangle markers for buy/sell signals
## 🔔 ALERTS
The indicator includes three alert conditions:
1. **Buyers Dominate** - Fires on buy signal crossovers
2. **Sellers Dominate** - Fires on sell signal crossovers
3. **Dominance Shift** - Fires when dominance crosses zero line
## 📊 BEST PRACTICES
### **Timeframe Selection**
- **Scalping (1-5min)**: Focus on 2H-4H dominance shifts
- **Day Trading (15-60min)**: Monitor Daily and Weekly structure
- **Swing Trading (4H-Daily)**: Track Weekly and Monthly dominance
### **Confirmation Strategies**
1. **Trend Following**: Enter in direction of dominance above/below ±20
2. **Reversal Trading**: Fade extreme readings beyond ±50 when diverging with price
3. **Breakout Trading**: Look for dominance expansion beyond ±30 with increasing volume
### **Risk Management**
- Avoid trading during NEUTRAL states (dominance between -10 and +10)
- Use POC levels as logical stop-loss placement
- Consider VAH/VAL as profit targets for mean reversion
## ⚠️ LIMITATIONS & WARNINGS
**Data Requirements**
- Requires sufficient historical data on current chart (minimum 100 bars recommended)
- Lower timeframes may show fewer bars per HTF session initially
- More accurate results after several complete HTF sessions have formed
**Not a Standalone System**
- This indicator analyzes market structure and participant control
- Should be combined with price action, support/resistance, and risk management
- Does not guarantee profitable trades - past dominance does not predict future results
**Repainting Characteristics**
- Higher timeframe levels (POC, VAH, VAL) update as new bars form within the session
- Dominance score recalculates with each new bar
- Historical signals remain fixed, but current session data is developing
**Volume Limitations**
- Uses exchange-provided volume data which varies by instrument type
- Forex and some CFDs use tick volume (not actual transaction volume)
- Most accurate on instruments with reliable volume data (stocks, futures, crypto)
## 🔍 TECHNICAL NOTES
**Performance Optimization**
- Uses `max_bars_back=5000` for extended historical analysis
- Efficient array management prevents memory issues
- Automatic cleanup of session data on new period
**Calculation Method**
- Market Profile uses actual volume distribution, not TPO (Time Price Opportunity)
- Value Area expansion follows traditional Market Profile auction theory
- All calculations occur on the chart's current symbol and timeframe
## 📚 EDUCATIONAL VALUE
This indicator helps traders understand:
- How institutional traders use Market Profile to identify fair value
- The relationship between price, volume, and market acceptance
- Multi-factor analysis techniques for assessing market conditions
- The importance of higher timeframe structure in trade planning
## 🎓 RECOMMENDED READING
To better understand the concepts behind this indicator:
- "Mind Over Markets" by James Dalton (Market Profile foundations)
- "Markets in Profile" by James Dalton (Value Area analysis)
- Volume Profile analysis in institutional trading
## 💬 USAGE TERMS
This indicator is provided as an educational and analytical tool. It does not constitute financial advice, investment recommendations, or trading signals. Users are responsible for their own trading decisions and should conduct their own research and due diligence.
Trading involves substantial risk of loss. Past performance does not guarantee future results. Always use proper risk management and never risk more than you can afford to lose.
US Leverage Overlay — Margin Debt & Total Credit (YoY / Z-score)What this does
An overlay indicator that brings U.S. leverage proxies from FRED onto your main price chart (left axis). Choose between a proxy for investor margin debt or total credit market debt and view them as YoY %, Z-score of YoY, or an Indexed Level so they’re comparable with price without wrecking the scale.
Data sources (FRED symbols)
--- Margin (investor leverage proxy): FRED:BOGZ1FL663067003Q
Brokers & Dealers; Receivables Due from Customers ≈ margin loans (quarterly).
--- TotalCredit (economy-wide leverage): FRED:TCMDO
All sectors; Debt Securities & Loans; Liability (quarterly).
Note: These are quarterly series. The indicator samples monthly and holds values between official prints, so you’ll see step-like updates when new data drops.
Views (pick one in settings)
--- YoY % — 12-month rate of change. Above 0% = leverage expanding; below 0% = contracting.
--- Z-score (YoY) — Standardizes YoY vs. its recent history to flag unusual moves (regime shifts).
--- Indexed Level — 100 × (level / moving average), a compact “above/below trend” view.
How to read quickly
--- Rising YoY % > 0 → leverage expansion (often supportive for risk).
--- Falling YoY % < 0 → deleveraging headwind.
--- Z-score spikes (±2) → unusually fast changes; watch for volatility or policy inflections.
--- Indexed Level crossing down through 100 → slipping below trend.
Inputs
--- Data source: Margin or TotalCredit
--- YoY/Z-score lookbacks and Index baseline length
--- Overlay: overlay=true, scale=scale.left (uses its own left axis by default)
Tips
--- If it spawns in a sub-pane, right-click the label → Move to → Main chart.
--- For context, consider adding related series on separate panes:
FRED:TOTALSL (Consumer Credit), FRED:REVOLSL (Credit Cards),
FRED:BUSLOANS (C&I Loans), FRED:TDSP (Debt Service Ratio).
--- Occasionally FRED returns “Failed to fetch”; re-add or reload fixes it.
Why it’s useful
Equity drawdowns often line up with turns in leverage (households, corporates, or brokers). This overlay gives you a clean, normalized read so you can spot expansion vs. contraction alongside price action.
Compatibility
--- Pine Script® v6
--- Works on any chart timeframe (data internally sampled monthly)
Educational use only — not financial advice.
Multi EMA + Indicators + Mini-Dashboard + Reversals v6📘 Multi EMA + Indicators + Mini-Dashboard + Reversals v6
🧩 Overview
This indicator is a multi-EMA setup that combines trend, momentum, and reversal analysis in a single visual framework.
It integrates four exponential moving averages (EMAs), key oscillators (RSI, MACD, Stochastic, CCI), volatility filtering (ATR), and a dynamic mini-dashboard that summarizes all signals in real time.
Its purpose is to help traders visually confirm trend alignment, filter valid entries, and identify possible trend continuation or reversal points.
It can display buy/sell arrows, detect reversal candles, and issue alerts when trading conditions are met.
⚙️ Core Components
1. Moving Averages (EMA Setup)
EMA1 (fast) and EMA2 (medium) define the short-term trend and trigger bias.
When the price is above both EMAs → bullish bias.
When below → bearish bias.
EMA3 and EMA4 act as trend filters. Their slopes (up or down) confirm overall momentum and help validate signals.
Each EMA has customizable lengths, sources, and colors for up/down trends.
This “EMA stack” is the foundation of the setup — a structured trend-following framework that adapts to market speed and volatility.
2. Momentum and Confirmation Filters
Each indicator can be individually enabled or disabled for flexibility.
RSI: confirms direction (above/below 50).
MACD: detects momentum crossover (MACD > Signal for bullish confirmation).
Stochastic: identifies trend continuation (K > D for longs, K < D for shorts).
CCI: adds trend bias above/below a threshold.
ATR Filter: filters out small, low-volatility candles to reduce noise.
You can activate only the filters that fit your trading plan — for instance, trend traders often use RSI and MACD, while scalpers may rely on Stochastic and ATR.
3. Reversal Detection
The indicator includes an optional Reversal Section that independently detects potential turning points.
It combines multiple configurable criteria:
Candlestick patterns (Bullish Hammer, Shooting Star).
Large Candle filter — detects unusually large bars (relative to close).
Price-to-EMA distance — identifies overextended moves that might revert.
RSI Divergence — detects potential momentum shifts.
RSI Overbought/Oversold zones (70/30 by default).
Doji Candles — sign of indecision.
A bullish or bearish reversal signal appears when enough selected criteria are met.
All sub-modules can be toggled on/off individually, giving you full control over sensitivity.
4. Signal Logic
Buy and sell signals are triggered when EMA alignment and the chosen confirmations agree:
Buy Signal
→ Price above EMA1 & EMA2
→ Confirmations (RSI/MACD/Stoch/CCI/ATR) pass
→ Trend filters (EMA3/EMA4) point upward
Sell Signal
→ Price below EMA1 & EMA2
→ Confirmations align bearishly
→ Trend filters (EMA3/EMA4) slope downward
Reversal signals can appear independently, even against the current EMA trend, depending on your settings.
5. Visual Dashboard
A mini-dashboard appears near the chart showing:
Current trade bias (LONG / SHORT / NEUTRAL)
EMA3 and EMA4 trend directions (↑ / ↓)
Quick visual bars (🟩 / 🟥) for each filter: RSI, MACD, Stoch, ATR, CCI, EMA filters
Reversal criteria status (Doji, RSI divergence, candle size, etc.)
This panel gives you a compact overview of all indicator states at a glance.
The color of the panel changes dynamically — green for bullish, red for bearish, gray for neutral.
6. Alerts
Built-in alerts allow automation or notifications:
Buy Alert
Sell Alert
Reversal Buy
Reversal Sell
You can connect these alerts to TradingView notifications or external bots for semi-automated execution.
💡 How to Use
✅ Trend-Following Setup
Focus on trades in the direction of EMA1 & EMA2.
Confirm with EMA3 & EMA4 trending in the same direction.
Use RSI/MACD/Stoch filters to ensure momentum supports the trade.
Avoid entries when ATR filter indicates low volatility.
🔄 Reversal Setup
Enable the Reversal section for potential tops/bottoms.
Look for reversal buy signals near support zones or after strong downtrends.
Use RSI divergence or Doji + Hammer signals as confirmation.
Combine with key chart areas (supply/demand or previous swing levels).
⚖️ Combination Approach
Trade continuation signals when all EMAs are aligned and filters are green.
Trade reversals only when at a key area (support/resistance) and confirmed by reversal conditions.
Always check higher-timeframe bias before entering a trade.
🧭 Practical Tips
Use different EMA sets for different timeframes:
9/21/50/100 for swing or trend trades.
5/13/34/89 for intraday scalping.
Turn off filters you don’t use to reduce lag.
Always validate signals with price structure, not just indicator alignment.
Practice in replay mode before live trading.
🗺️ Key Chart Confluence (Highly Recommended)
Although the indicator provides structured signals, its best use is in confluence with:
Support and resistance levels
Supply/demand zones
Trendlines and channels
Liquidity pools
Volume clusters
Signals aligned with strong key areas on the chart tend to have greater reliability than isolated indicator triggers.
I use EMA 1 - 20 Open ; EMA 2 - 20 Close ; EMA 3 - 50 ; EMA 4 - 200 or 100 , but that's me...
⚠️ Important Disclaimer
This indicator is a technical tool, not a guarantee of results.
Trading involves risk, and no signal is ever 100% accurate.
Every trader should develop a personal strategy, use proper risk management, and adapt settings to their instrument and timeframe.
Always combine indicator signals with key chart areas, higher-timeframe context, and your own analysis before taking a trade.
Volume HeatMap Divergence [BigBeluga]🔵 OVERVIEW
The Volume HeatMap Divergence is a smart volume visualization tool that overlays normalized volume data directly on the chart. Using a color heatmap from aqua to red, it transforms raw volume into an intuitive scale — highlighting areas of weak to intense market participation. Additionally, it detects volume-based divergences from price to signal potential reversals or exhaustion zones. Combined with clear visual labeling, this tool empowers traders with actionable volume insights.
🔵 CONCEPTS
Normalized Volume Heatmap : Volume is normalized to a 0–100% scale and visually represented as candles below the chart.
float vol = volume / ta.percentile_nearest_rank(volume, 1000, 100) * 100
Bar Coloring : Price candles are dynamically colored based on volume intensity.
Volume Divergence Logic :
Bullish Divergence : Price forms a lower low, but volume forms a higher low.
Bearish Divergence : Price forms a higher high, but volume forms a lower high.
Dynamic Detection Range : Customizable range ensures divergence signals are meaningful and not random.
Volume Labels : Additional info on divergence bars shows both the actual volume and its normalized % score.
🔵 FEATURES
Volume Heatmap Plot : Normalized volume values colored using a smooth gradient from aqua (low) to red (high).
Price Bar Coloring : Candlesticks on the main chart adopt the same heatmap color based on volume.
Divergence Detection :
Bullish divergence with label and low marker
Bearish divergence with label and high marker
Dual Divergence Labels :
On the volume plot : Direction (Bull/Bear), raw volume, and normalized %
On the price chart : Shape labels showing "Bull" or "Bear" at local highs/lows
Custom Inputs :
Divergence range (min & max), pivot detection distance (left/right)
Toggle to show/hide divergence labels, volume, and % text
Clear Bull/Bear Coloring : Fully customizable label and line colors for both bullish and bearish signals.
🔵 HOW TO USE
Use the indicator as an overlay to monitor real-time volume strength using the heatmap color.
Watch for divergence markers:
Bullish divergence: Candle shows higher volume while price makes a new low
Bearish divergence: Candle shows lower volume while price makes a new high
Use the volume info labels to verify the context of divergence:
Actual volume at divergence candle
Normalized % of that volume compared to past 1000 bars
Adjust pivot sensitivity using "Pivot Left" and "Pivot Right" to tune signal frequency and lag with a right pivot length.
Use divergence zones as early warnings for potential reversals or trend shifts.
Disable or customize labels in settings depending on your charting preferences.
🔵 CONCLUSION
Volume HeatMap Divergence merges heatmap-style volume visualization with intelligent divergence detection — giving traders a clean yet powerful edge. By revealing hidden disconnections between price and participation, it helps users spot exhaustion moves or hidden accumulation zones before the market reacts. Whether you’re a scalper, swing trader, or intraday strategist, this tool offers real-time clarity on who’s in control behind the candles.
Daily MA — Higher-Timeframe Daily Moving Average OverlayThis indicator plots a clean, higher-timeframe daily moving average directly on any chart, so you can always see where price sits relative to the daily trend — even while trading on lower timeframes (1m, 5m, etc.).
It’s designed to be:
Simple – a single, configurable daily MA line
Consistent – always anchored to the 1D timeframe
Flexible – choose EMA or SMA and customize line width/color
⸻
What This Indicator Does
Pulls the 1-Day (1D) moving average of the current symbol, regardless of your chart timeframe.
Lets you choose between EMA (Exponential Moving Average) or SMA (Simple Moving Average).
Plots that daily MA as a smooth overlay on your current chart.
Keeps the line visually clean and continuous, making it easy to see daily trend and dynamic support/resistance.
This is not a signals/strategy script. It doesn’t generate buy/sell arrows or backtest logic. It’s a context tool for visualizing the daily trend while you execute your own strategy.
⸻
Why a Daily MA Overlay Is Useful
Traders commonly use a daily moving average to:
Anchor intraday trades to the higher-timeframe trend
Longs when price is holding above the Daily MA
Shorts or caution when price is rejecting from the Daily MA
Identify dynamic support/resistance
Price often reacts around well-watched daily MAs (e.g., 50, 100, 200)
Filter setups
Only take long setups when price is above the daily trend line
Avoid counter-trend trades when price is extended far from the Daily MA
Because this script forces the MA to always be computed on 1D, you don’t have to switch back and forth between intraday and daily charts to keep track of the bigger picture.
⸻
Inputs & Settings
MA Length
Default: 200
Any positive integer (min 1)
Common examples: 50, 100, 200 for trend structure
MA Type
EMA – reacts faster to recent price (default)
SMA – smoother, slower, more “classic” feel
Line Width
Default: 2
Range: 1 to 10
Increase if you want the Daily MA to stand out clearly against other indicators
Color
Default: Purple tone
Fully customizable – pick any color that works with your chart theme
⸻
How to Use It in Your Workflow
Intraday traders (scalpers/day-traders):
Apply the indicator to your 1m/5m/15m charts.
Use the Daily MA as a trend filter :
Only look for long scalps when price is above the Daily MA.
Be more cautious with longs or consider shorts when price is below it.
Swing traders :
Use it on 1H/4H charts to see where price sits relative to a longer-term daily trend.
Watch for:
Pullbacks to the Daily MA in an uptrend as potential demand zones.
Rejections at the Daily MA in a downtrend as potential supply zones.
Risk management & context :
Avoid chasing extended moves far from the Daily MA.
Mark confluence with other tools (support/resistance, volume profile, etc.) around the Daily MA.
⸻
Notes & Limitations
The moving average itself is calculated from daily candles , then displayed on your current timeframe.
This is a visual aid only . It does not guarantee future performance or provide financial advice.
Always combine this indicator with your own analysis, risk management, and trading plan.
⸻
Disclaimer :
This script is provided for educational and informational purposes only. It is not financial advice and does not constitute a recommendation to buy or sell any financial instrument. Always do your own research and trade at your own risk.
Exhaustion Reversal Signals - ENHANCEDOverview
This is a reversal detection indicator that combines multiple technical analysis components to identify potential market turning points.
Core Components
1. Range Oscillator
Measures price deviation from a moving average (EMA/SMA) normalized by ATR
Values above +100 = bullish exhaustion zone
Values below -100 = bearish exhaustion zone
Detects momentum flattening (slope deceleration)
2. Stochastic Oscillator
Standard %K and %D with customizable parameters
Crossover detection (K crossing above/below D)
Oversold (<20) and Overbought (>80) zones
Momentum calculation (rate of change in K)
3. 🚀 Advanced Features
Early Detection System:
Identifies momentum exhaustion before confirmed crossovers
Detects when oscillator slope flattens (approaching zero)
Provides "advance warning" signals with relaxed thresholds
............................................................................................
Trend Filter:
50-period EMA for trend context
Three strength modes:
Soft: Allow all signals
Medium: Prefer trend-aligned signals
Strict: Only counter-trend reversals
Confidence Scoring (0-100%):
Oscillator extremity (30 pts)
Stochastic position (25 pts)
K-D divergence strength (20 pts)
Momentum alignment (15 pts)
Trend alignment (10 pts)
Minimum confidence threshold filtering
Visual Enhancements:
Dynamic background gradient (red→green based on oscillator)
Momentum bar coloring when slope flattens
Transparency adjustments based on momentum
Top Finder & Dip Hunter [BackQuant]Top Finder & Dip Hunter
A practical tool to map where price is statistically most likely to exhaust or mean-revert. It builds objective support for dips and resistance for tops from multiple methodologies, then filters raw touches with volume, momentum, trend, and price-action context to surface higher-quality reversal opportunities.
What this does
Draws a Dip Support line and a Top Resistance line using the method you select, or a blended hybrid.
Evaluates each touch/penetration against Quality Filters and assigns a 0–100 composite score.
Prints clean DIP and TOP signals only when depth/extension and quality pass your thresholds.
Optionally annotates the chart with the computed quality score at signal time.
Why it’s useful
Objectivity: Converts vague “looks extended” into rules, reduces discretion creep.
Signal hygiene: Filters raw touches using trend, volume, momentum, and candle structure to avoid obvious traps.
Adaptable regimes: Switch methods, sensitivity, and lookbacks to match choppy vs trending conditions.
How support and resistance are built
Pick one per side, or use “Hybrid.”
Dynamic: Anchors to the extreme of a lookback window, padded by recent ATR, so buffers expand in volatile periods and contract when calm.
Fibonacci: Uses the 0.618/0.786 retracement pair inside the current swing window to target common reaction zones.
Volatility: Uses a moving-average basis with standard-deviation bands to capture statistically stretched moves.
Volume-Weighted: Centers off VWAP and penalizes deviations using dispersion of price around VWAP, helpful on intraday instruments.
Hybrid: A weighted average of the above to smooth out single-method biases.
When a touch becomes a signal
Depth/extension test:
Dips must penetrate their support by at least Min Dip Depth % .
Tops must extend above resistance by at least Min Top Rise % .
Quality Score gate: The composite must clear Min Quality Score . Components:
Trend alignment: Favor dips in bullish regimes and tops in bearish regimes using EMAs and RSI.
Volume confirmation: Reward expansion or spikes versus a 20-period baseline.
RSI context: Prefer oversold for dips, overbought for tops.
Momentum shift: Look for short-term momentum turning in the expected direction.
Candle structure: Reward hammer/shooting-star style responses at the level.
How to use it
Pick your regime:
Range/chop, small caps, mean-revert intraday → Volatility or Volume Weighted .
Cleaner swings/trends → Dynamic or Fibonacci .
Unsure or mixed conditions → Hybrid .
Set windows: Start with Lookback = 50 for both sides. Increase in higher timeframes or slow assets, decrease for fast scalps.
Tune sensitivity: Raise Dip/Top Sensitivity to widen buffers and reduce noise. Lower to be more aggressive.
Gate with quality: Begin with Min Quality Score = 60 . Push to 70–80 for cleaner swing entries, relax to 50–60 for scalps.
Act on first prints: The script only fires on new qualified events. Use the score label to prioritize A-setups.
Typical workflows
Intraday futures/crypto: Volume-Weighted or Volatility methods for both sides, higher Sensitivity , require Volume Filter and Momentum Filter on. Look for DIP during opening drive exhaustion and TOP near late-session fatigue.
Swing equities/FX: Dynamic or Fibonacci with moderate sensitivity. Keep Trend Filter on to only take dips above the 200-EMA and tops below it.
Countertrend scouts: Lower Min Dip Depth % / Min Top Rise % slightly, but raise Min Quality Score to compensate.
Reading the chart
Lines: “Dip Support” and “Top Resistance” are the current actionable rails, lightly smoothed to reduce flicker.
Signals: “DIP” prints below bars when a qualified dip appears, “TOP” prints above for qualified tops.
Scores: Optional labels show the composite at signal time. Favor higher numbers, especially when aligned with higher-timeframe trend.
Background hints: Light highlights mark raw touches meeting depth/extension, even if they fail quality. Treat these as early warnings.
Tuning tips
If you get too many false DIP signals in downtrends, raise Min Dip Depth % and keep Trend Filter on.
If tops appear late in squeezes, lower Top Sensitivity slightly or switch top side to Fibonacci .
On assets with erratic volume, prefer Volatility or Dynamic methods and down-weight the Volume Filter .
For strict systems, increase Min Quality Score and require both Volume and Momentum filters.
What this is not
It is not a blind reversal signal. It’s a structured context tool. Combine with your risk plan and higher-timeframe map.
It is not a guarantee of mean reversion. In strong trends, expect fewer, higher-score opportunities and respect invalidation quickly.
Suggested presets
Scalp preset: Lookback 30–40, Sensitivity 1.2–1.5, Quality ≥ 55, Volume & Momentum filters ON.
Swing preset: Lookback 75–100, Sensitivity 1.0–1.2, Quality ≥ 70, Trend & Volume filters ON.
Chop preset: Volatility/Volume-Weighted methods, Quality ≥ 60, Momentum filter ON, RSI emphasis.
Input quick reference
Dip/Top Method: Choose the model for each side or “Hybrid” to blend.
Lookback: Swing window the levels are built from.
Sensitivity: Scales volatility padding around levels.
Min Dip Depth % / Min Top Rise %: Minimum breach/extension to qualify.
Quality Filters: Trend, Volume, Momentum toggles, plus Min Quality Score gate.
Visuals: Colors and whether to print score labels.
Best practices
Map higher-timeframe trend first, then act on lower-timeframe DIP/TOP in the trend’s favor.
Use the score as triage. Skip mediocre prints into news or at session open unless score is exceptional.
Pre-define stop placement relative to the level you used. If a DIP fails, exit on loss of structure rather than waiting for the next print.
Bottom line: Top Finder & Dip Hunter codifies where reversals are most defensible and only flags the ones with supportive context. Tune the method and filters to your market, then let the score keep your playbook disciplined.
💎 ProfittoPath – Glass HUD//@version=5
indicator("💎 ProfittoPath – Glass HUD", overlay=true)
// === Inputs ===
entryPrice = input.float(0.0, "Entry Price", step=0.01)
qty = input.float(1.0, "Position Size", step=1.0)
isLong = input.bool(true, "Long Trade?")
offsetY = input.int(60, "Vertical Offset (ticks)", step=1)
showPercent = input.bool(true, "Show % Change")
// === Calculations ===
inTrade = entryPrice > 0
priceDiff = inTrade ? (close - entryPrice) * (isLong ? 1 : -1) : na
plUsd = inTrade ? priceDiff * qty : na
plPercent = inTrade ? (priceDiff / entryPrice) * 100 : na
isProfit = inTrade ? (plUsd >= 0) : false
// === Colors ===
gold = color.rgb(255,215,0)
lossRed = color.rgb(255,90,90)
txtColor = isProfit ? gold : lossRed
bgGlass = color.new(color.rgb(15,15,15),85)
// === Entry Line ===
var line entryLine = na
if barstate.isfirst
entryLine := line.new(bar_index, entryPrice, bar_index, entryPrice, extend=extend.both, color=color.new(gold,40), style=line.style_dotted)
if inTrade
line.set_color(entryLine, color.new(gold,40))
else
line.set_color(entryLine, color.new(color.black,100))
// === Panel Label ===
var label pnlLabel = na
if barstate.isfirst
pnlLabel := label.new(bar_index, na, "", style=label.style_label_center, textcolor=txtColor, color=bgGlass, size=size.large)
// === Update ===
if inTrade
string pnlText = "💎 ProfittoPath Glass HUD\n"
pnlText += "────────────────────────\n"
pnlText += "Trade: " + (isLong ? "LONG 📈" : "SHORT 📉") + "\n"
pnlText += "Entry: " + str.tostring(entryPrice, format.mintick) + "\n"
pnlText += "Current: " + str.tostring(close, format.mintick) + "\n"
pnlText += "P/L: " + (isProfit ? "+" : "") + str.tostring(plUsd, format.mintick) + " USD"
if showPercent
pnlText += " (" + str.tostring(plPercent, "#.##") + "%)"
pnlText += "\n"
pnlText += "────────────────────────\n"
pnlText += "Status: " + (isProfit ? "PROFIT ✅" : "LOSS ❌")
label.set_text(pnlLabel, pnlText)
label.set_x(pnlLabel, bar_index)
label.set_y(pnlLabel, entryPrice + offsetY * syminfo.mintick)
label.set_color(pnlLabel, bgGlass)
label.set_textcolor(pnlLabel, txtColor)
else
label.set_text(pnlLabel, "💎 Set Entry Price ↑")
label.set_x(pnlLabel, bar_index)
label.set_y(pnlLabel, close)
label.set_color(pnlLabel, bgGlass)
label.set_textcolor(pnlLabel, gold)
Enhanced Auto Levels & TrendlinesOverview
The Enhanced Auto Levels & Trendlines (EAL&T) is a powerful, all-in-one indicator designed to automate the detection and visualization of key market structures. It combines auto-drawn trendlines, support/resistance levels with volume-based shadows and labels, and auto-flipping Fibonacci retracements/extensions. This tool helps traders identify potential reversals, breakouts, and targets without manual drawing.
Built on Pine Script v5, it uses pivot-based calculations for accuracy and includes customizable options for repainting, extensions, and sources. It's ideal for swing traders, scalpers, and analysts who want clean, dynamic charts.
Key Features
Auto Trendlines: Detects bullish/bearish trends based on pivots, with breakout detection and optional extensions/targets.
Auto Levels: Draws horizontal S/R levels from recent pivots, with "wick shadows" (boxes) highlighting volume strength and % buy/sell labels for sentiment.
Fibonacci Levels: Auto-flips between latest pivot high/low, showing retracements (0.236–0.786) and extensions (1.272–3.0) with customizable styles.
Customization: Override price sources, adjust lengths, colors, styles, and more. Supports repainting for real-time accuracy.
Performance: Limited to 500 bars back and 500 lines for efficiency; no heavy computations.
Visual Aids: Transparent shadows, extendable lines, and small labels for uncluttered charts.
How to Use
Step-by-Step Guide
Add to Chart: Load the indicator. Start with defaults.
Interpret Visuals:
Trendlines: Green (bullish/up), Red (bearish/down). Watch for breakouts – line "breaks" and extends if enabled.
Levels: Horizontal lines with shadows (boxes) showing wick strength. Green above price (resistance), Red below (support). Labels show % buy/sell sentiment.
Fibs: From latest swing low (0.0) to high (1.0). Use 0.5/0.618 for retracements; 1.272+ for targets. Flips automatically on trend change.
Customize for Your Strategy:
Volatile Markets (e.g., Crypto): Increase tl_length to 20+ for fewer false trends. Enable repainting for real-time.
Ranging Markets (e.g., Forex): Set override_source=true, custom_source=close for wick-ignoring pivots.
Fib Focus: Increase fib_extension_bars for longer projections. Hide trendlines if cluttered.
Levels Tuning: Shorten pivot lengths (e.g., 20) for intraday; lengthen (100+) for swings. Set shadow transparency to 100 to hide boxes.
Trading Ideas:
Breakout Trade: Buy on bull trendline break + Fib 0.618 confirmation.
Reversal: Sell at resistance level with high sell% label.
Targets: Use Fib extensions or trend targets for TP; levels for SL.
Combine: Overlay with MA crossover or volume for signals.
Tips & Troubleshooting:
Clutter? Toggle sections off or increase lengths.
No Lines? Ensure show_* is true; check chart history (needs 2x pivot length bars).
Repainting: Normal for real-time; disable for backtesting.
Custom Source: Test on demo – e.g., hl2 for median prices.
Updates: If lines don't extend, verify extend_bars > 0.
Credit : Auto Trendline Lib by HoanGhetti/SimpleTrendlines
Crypto Correlation Oscillator# Crypto Correlation Oscillator
**Companion indicator for Tri-Align Crypto Trend**
## Overview
The Crypto Correlation Oscillator helps you identify **alpha opportunities** and **market regime changes** by showing how closely your coin follows Bitcoin and other assets over time. It displays rolling correlations as an oscillator in a separate pane below your price chart.
## What It Does
This indicator calculates **Pearson correlations** between different trading pairs on a rolling window (default: 100 bars). Correlations range from **-1.0** (perfect inverse relationship) to **+1.0** (perfect positive relationship), with **0** meaning no correlation.
### The 5 Correlation Lines
1. **Blue (thick line) - Coin vs BTC**: The most important metric
- **High correlation (>0.7)**: Your coin is just following BTC - no independent movement
- **Low correlation (<0.3)**: Your coin has **alpha** - it's moving independently from BTC
- **Negative correlation**: Your coin moves opposite to BTC (rare but powerful)
2. **Purple - Coin/BTC vs BTC**: Inverse relationship check
- **Negative values**: When BTC rises, your coin weakens relative to BTC
- **Positive values**: When BTC rises, your coin strengthens against BTC
3. **Orange - Coin vs Coin/BTC**: Structural consistency check
- Shows how well the Coin/USDT and Coin/BTC pairs maintain their mathematical relationship
- Unusual values can indicate liquidity issues or market inefficiencies
4. **Light Red - Coin vs USDT.D** (optional): Stablecoin dominance correlation
- Shows how your coin correlates with USDT dominance
- Useful for understanding flight-to-safety dynamics
5. **Light Green - Coin vs BTC.D** (optional): Bitcoin dominance correlation
- Shows how your coin correlates with BTC dominance
- Helps identify altcoin season vs BTC dominance cycles
## How to Read It
### Finding Alpha Opportunities
- **Low blue line (<0.3)**: Your coin is decoupled from BTC → potential alpha
- **Blue line dropping**: Coin is gaining independence from BTC
- **Blue line spiking to >0.9**: Coin is a "BTC clone" with no independent movement
### Regime Change Detection
- **Blue line crossing 0.5**: Major shift in correlation behavior
- **Purple line turning negative**: Coin starting to weaken when BTC rises (warning sign)
- **Sharp correlation changes**: Market structure is shifting - adjust strategy
### Visual Zones
- **Blue background**: High correlation zone (>0.7) - coin just following BTC
- **Red background**: Inverse correlation zone (<-0.5) - coin moving opposite to BTC
### Reference Lines
- **+1.0 / -1.0**: Perfect correlation boundaries (dotted gray)
- **+0.5 / -0.5**: Moderate correlation thresholds (dotted gray)
- **0.0**: Zero correlation line (solid gray)
## Dynamic Legend
The legend table (top-right) automatically shows the actual symbol names based on your chart:
- **Example on SOLUSDT**: Shows "SOL vs BTC", "SOL/BTC vs BTC", "SOL vs SOL/BTC", etc.
- **Color boxes**: Match the plot colors for easy identification
- **Live values**: Current correlation numbers update in real-time
- **Tooltips**: Hover over labels for interpretation guidance
## Configuration
### Key Inputs
- **Correlation Lookback** (default: 100): Number of bars for rolling correlation window
- Shorter = more reactive, noisier
- Longer = smoother, slower to detect changes
- **Correlation Smoothing** (default: 5): EMA smoothing period for raw correlations
- Reduces noise while preserving trends
- **Symbol Detection**: Auto-detects symbols from your chart, or use manual overrides
- **Dominance Pairs**: Toggle USDT.D and BTC.D correlations on/off
## Usage Tips
1. **Combine with main Tri-Align indicator**: Use correlation for context, Tri-Align for entry/exit signals
2. **Watch for divergences**: Correlation changing while price moves in sync can signal upcoming shift
3. **Adjust lookback period**: Use shorter (50-70) for day trading, longer (150-200) for position trading
4. **Focus on the blue line**: It's your primary alpha indicator
## Technical Details
- **Calculation**: Pearson correlation coefficient with EMA smoothing
- **Data source**: Close prices from `request.security()` (multi-timeframe capable)
- **Update frequency**: Every bar on your selected timeframe
- **Overlay**: False (displays in separate pane)
## Quick Interpretation Guide
| Blue Line Value | Interpretation | Action |
|----------------|----------------|--------|
| > 0.9 | Coin is a BTC clone | Avoid - no alpha opportunity |
| 0.7 - 0.9 | High correlation | Standard altcoin behavior |
| 0.3 - 0.7 | Moderate correlation | Some independence emerging |
| < 0.3 | Low correlation | **Strong alpha opportunity** |
| < 0 | Inverse correlation | Rare - potential hedge asset |
| Purple Line | Interpretation |
|-------------|----------------|
| Strongly negative | Coin weakens when BTC rises - risky |
| Near zero | Coin/BTC pair moves independently of BTC |
| Positive | Coin strengthens with BTC - ideal |
## Version History
### v1.0 (Initial Release)
- Pearson correlation calculation with configurable lookback
- 5 correlation pairs: Coin vs BTC, Coin/BTC vs BTC, Coin vs Coin/BTC, USDT.D, BTC.D
- EMA smoothing to reduce noise
- Visual zones for high/inverse correlation
- Dynamic legend with symbol name extraction
- Auto-symbol detection matching main Tri-Align indicator
[AA] - Market Valuation (Mean Based) - Market Valuation (Mean Based)
What it does
This indicator estimates whether price is overvalued, undervalued, or fairly valued relative to its structural mean across multiple lookback windows. It builds a single normalized oscillator from short-, mid-, and long-term ranges so traders can quickly see when price is stretched away from equilibrium.
This is not a mashup of existing tools. It’s a custom mean-deviation model that aggregates multi-window range positioning into one score.
How it works (concepts)
For each lookback length (13, 25, 30, 50, 100, 200):
Range & midpoint:
Highest high H and lowest low L.
Structural midpoint Mid = (H + L)/2.
Normalized deviation:
Dev = (Close − Mid) / (H − L) → location of price within its own range.
Aggregation:
The oscillator z_struct is the average of the deviations from the five windows.
Result: a smoothed, dimensionless value (roughly −1 to +1 in typical markets) showing multi-horizon displacement from the mean.
Plots & levels
Oscillator (area): z_struct
Reference lines: +0.40 (OB), 0.00 (equilibrium), −0.30 (OS)
Coloring:
Red when z_struct > OB (extended above mean)
Blue when z_struct < OS (extended below mean)
White in between
Suggested use
Mean reversion context: Fade extremes in range-bound conditions; take profits into OB/OS.
Trend awareness: In strong trends, extremes can persist—use levels as exhaustion context rather than standalone entry.
Filter/confirm: Combine with your trend filter or structure tools to time pullbacks and avoid chasing extended moves.
Inputs
Lookbacks: 13, 25, 30, 50, 100, 200
Thresholds: OB = 0.40, OS = −0.30
Notes & limitations
Works on the current symbol/timeframe only; no security() calls and no repainting beyond normal bar completion.
In very tight or flat ranges (H ≈ L), normalized deviations can become sensitive; consider longer windows or higher timeframes.
This is an indicator, not a strategy. No signals are generated; use with risk management.
Originality statement
This script implements an original, multi-window mean-deviation aggregation. It does not replicate a built-in or a public indicator; its purpose is to quantify cross-horizon valuation in a single, normalized measure.






















