Pine Script® indicator
Simple Moving Average (SMA)
Flexible Moving Averages with MACD and RSI Every stock momentum can be identified either by crossing of higher EMA by lower EMA or MACD line crossing signal line and moving up or RSI value rising above 45 or 50. This indicator combines Moving averages with MACD and RSI
How to use:
Configure any or all of 5 moving averages according to your preference. It can be EMA or SMA. Configure symbols for MACD crossing or RSI rising.
By default, if RSI crosses above 50, green triangle appears below candle. If RSI crosses 50 and comes down, red inverted triangle appears above candle
By default, if MACD line crosses signal line and moves above, green dot appears below candle. If MACD line crosses signal line and moves down, red dot appears above candle
These indications can give the user how much time RSI and MACD crossing happened along with EMA crossovers. User can take calculated decision and risk
Pine Script® indicator
Custom 4 MA & Probability (KenshinC) [English]Custom 4 MA - Fast / Normal / Slow / Super Slow with Deviation Analysis
This powerful multi-timeframe moving average indicator combines four strategically chosen Simple Moving Averages with advanced deviation analysis to help traders identify extreme price levels and mean-reversion opportunities.Key Features:Flexible MA Modes: Choose between calculating All 4 MAs simultaneously or Single MA Only for cleaner charts and better performance.
Four Strategic Periods:Fast MA (16) – Short-term momentum
Normal MA (100) – Medium-term trend
Slow MA (365) – Long-term trend (approximately 1 year on daily)
Super Slow MA (1460) – Very long-term trend (approximately 4–5 years on daily)
Advanced Deviation Analysis:
Automatically detects and tracks the strongest Top and Bottom percentage deviations from each MA within a configurable lookback window.
Visual Extreme Levels: Displays dashed horizontal lines for the top 5 highest and lowest deviation levels of each active MA, making overextended zones clearly visible.
Historical Labels: Marks significant Top and Bottom deviation points directly on the chart with detailed information (price + % deviation).
Statistics Table: Real-time table showing Start Date, Candles Above/Below MA, and percentage distribution for each active MA.
Fully Customizable: Colors, label sizes, number of extreme points, and lookback period are all adjustable.
Ideal For:
Mean-reversion traders
Swing and position traders
Traders who use multiple timeframe moving averages
Identifying high-probability reversal zones when price deviates significantly from long-term averages
Whether you're trading breakouts, pullbacks, or looking for exhaustion points, this indicator provides clear visual references for both trend strength and extreme price behavior.
Pine Script® indicator
Flexible Moving AveragesThis is a simple script for Moving Averages. Total 5 MA plots available. Each MA can be either EMA or SMA. And each MA length can be chosen.
It can be used for strategies like EMA-5-8-13 or EMA-10-20-50-100-200 or any other combination
Pine Script® indicator
Pro Volatilite-v61. Hidden Trend Algorithm (Background)
The heart of the code actually beats with a SuperTrend logic. However, it differs from ready-made indicators on the market in two major ways:
Manual Calculation: Instead of the ta.supertrend function, the bands are calculated manually using ATR (Average True Range). This preserves the originality of the code.
ALMA Smoothing: Classic trend lines create sharp, angular "ladder" steps in price changes. Here we used ALMA (Arnaud Legoux Moving Average). ALMA is one of the smoothest averages on the market and makes the trendline silky smooth. This prevents an outsider from realizing it's a SuperTrend.
2. Triple Dynamic Average Set
Three different moving averages run simultaneously on the chart. These are usually set to 20, 50, and 200 periods:
Flexibility: You can change these numbers as you wish from the settings menu (e.g., 9, 21, 100).
Mode Selection: You can change the type of all three lines (SMA, EMA, or VWMA) with a single setting.
Visual Hierarchy: The lines have different thicknesses. The longest-term (200) line is drawn thickest to highlight the main support/resistance level.
3. Fully Customizable Interface
The most user-friendly part of the code is the control panel added to TradingView's "Settings" (gear) menu:
Color Control: You can choose the color tones you want for uptrends and downtrends.
Opacity: You can adjust how prominent the fill between the price and the trend line will be.
On/Off: If you think the screen is too cluttered, you can hide any of the 20-50-200 lines with a single click.
How it Works? (Strategic Use)
Trend Direction: If the main line, which is thick and sloping, is Turquoise (or your chosen color), the market is trending upwards; if it is Pink, it is trending downwards.
Signal Points: Small circles appearing just below or above the candles when the trend reverses indicate the start or end of a trend.
Support and Resistance: The 20, 50, and 200 lines show where the price will rest or rebound within the trend. For example, if the price touches the 50-period moving average (orange line) while above the main trend and receives a reaction, this can be considered a strong buying opportunity.
Pine Script® indicator
Top 40 % Above 5D SMA% of Top 40 Worldwide Stocks above their 5 day average price (by market cap as of: 4/6/2026)
Pine Script® indicator
Institutional Multi-Timeframe Dashboard Trend & Volume AlignmentStop getting chopped up by micro-trends. Institutional algorithms do not care about your 1-minute chart, they align execution across macro timeframes. I originally engineered this Multi-Timeframe (MTF) Dashboard for our prop firm traders to give them a heads-up display of algorithmic trend alignment and volume anomalies across the 15m, 1H, and 4H charts simultaneously.
When all three timeframes light up with a "Volume Surge" and align in the same direction, that is where the high-probability asymmetry lies. I decided to open-source the visual UI for the TradingView community. Use it to filter your discretionary entries. However, if you are running serious capital and need this exact logic hardcoded into a fully automated, low-latency execution bot for NinjaTrader 8 or MetaTrader 5, send me a private message (DM), my team specializes in custom algorithmic architecture and B2B systems.
Pine Script® indicator
Institutional Smart Money Footprint (Volume Anomalies) by:EduardMost retail traders rely on moving averages and lagging oscillators, completely missing the fact that the market is governed by liquidity sweeps and algorithmic volume anomalies, I developed this stripped-down version of our institutional footprint tracker to map where the "Smart Money" is aggressively stepping in.
This engine doesn't just look at price action, it cross-validates extreme spread expansions with 150%+ volume surges to plot high-probability Demand and Supply blocks directly on your chart. When a whale moves, they leave a mathematical footprint. This algorithm highlights it.
If you are a discretionary trader, use these zones as hard exhaustion/reversal levels, if you are running a prop firm or need to translate complex logic like this into a fully automated, low-latency execution bot, my team specializes in custom algorithmic architecture (Pine Script, Python, and C#), feel free to study the open-source code or reach out directly for custom B2B engineering.
Pine Script® indicator
MA + ATRHere’s a clean, professional **TradingView description** you can use when publishing your script:
---
## 📊 Multi MA + ATR Extension Dashboard
This indicator combines key moving averages with volatility analysis to provide a clear, real-time view of trend structure, extension, and momentum.
---
### 🔧 Features
**Moving Averages**
* Plots **5, 21, 50, and 200 MA**
* Supports **SMA or EMA selection per MA**
* Clean color scheme for quick visual recognition
**ATR-Based Extension**
* Measures how far price is from each MA in **ATR units**
* Helps identify:
* Overextended moves
* Mean reversion zones
* Healthy vs stretched trends
**Trend Curl (Angle)**
* Displays **angle of curl (slope)** for 21, 50, and 200 MA
* Quickly shows:
* Trend acceleration
* Flattening structure
* Early reversal signals
**Smart Table Dashboard**
* Compact table showing:
* MA type + direction (arrow)
* Distance from MA (in ATR)
* Price position (above/below)
* Curl (angle) of key MAs
* Customizable position and size
**ATR Volatility Context**
* Shows ATR % (volatility relative to price)
* Helps compare volatility across instruments
---
### 🧠 How to Use
* **Trend Identification**
* Look for alignment (21 > 50 > 200 = bullish)
* Use curl to confirm strengthening or weakening trends
* **Extension Analysis**
* 1 ATR = normal move
* 2 ATR = extended
* 3 ATR = potential exhaustion
* **Mean Reversion**
* High ATR extension + flattening curl = pullback probability
* **Momentum Insight**
* Rising curl = strengthening trend
* Falling curl = weakening trend
---
### ⚙️ Best Use Cases
* Intraday trend trading
* Swing trading pullbacks
* Identifying exhaustion moves
* Volatility-aware risk management
---
### 💡 Notes
* ATR measures **volatility, not direction**
* Works best when combined with price structure and volume
Pine Script® indicator
Double Moving Average## 📊 Double Moving Average (DMA)
**General Description:**
An indicator composed of two completely independent Moving Averages (MAs), each configured with its own parameters. Unlike a standard MA, each MA #1 and MA #2 can use a different timeframe, even if the chart displays another timeframe.
---
### **MA #1 - Parameters**
| Parameter | Default | Range | Description |
|-----------|---------|-------|-------------|
| **Enable MA #1** | ✓ | Yes/No | Activate/deactivate the first MA |
| **Length** | 50 | 1-500 | Calculation period of the MA |
| **Source** | Close | Open/High/Low/Close | Price source |
| **Offset** | 0 | 0-100 | Shift the curve to the right |
| **Type** | EMA | SMA/EMA/WMA | Type of moving average |
### **MA #2 - Parameters**
Identical to MA #1 but with default **Length: 200**
---
### **Smoothing - Per MA**
Each MA can have its own smoothing:
| Parameter | Options |
|-----------|---------|
| **Enable Smoothing** | Yes/No |
| **Type** | None / SMA / EMA / WMA |
| **Length** | 1-100 |
| **BB StdDev** | 0.1-10 (Bollinger Bands) |
---
### **Timeframe (Period) - Per MA**
Each MA calculates on an independent timeframe:
**Options:** 1min, 2min, 5min, 10min, 15min, 30min, 1hr, 2hr, 4hr, 1day
**"Wait for Close":** Waits for the timeframe candle to close before confirmation
---
### **Main Functions**
1. **`f_convert_timeframe()`** - Converts timeframe formats for Pine Script
2. **`f_calculate_ma()`** - Calculates SMA, EMA, or WMA
3. **`f_apply_smoothing()`** - Applies smoothing if enabled
---
### **Use Cases**
- Display short-term MA (5min) for scalping
- Display long-term MA (1day) for overall trend
- All on the same chart, independent of the displayed timeframe
- Compare two different trend periods simultaneously
Pine Script® indicator
SMA_20/50/100/200SMA 20/50/100/200 is a simple overlay indicator that displays four commonly used simple moving averages on the main chart.
This setup helps traders monitor short-term and long-term trend conditions at the same time. The 20 and 50 SMAs are often used for near-term trend and momentum assessment, while the 100 and 200 SMAs provide a broader view of overall market direction and key dynamic support or resistance areas.
By observing price location relative to these moving averages, as well as the order and spacing between them, users can better understand trend strength, trend transitions, and possible pullback zones.
This indicator is intentionally kept simple and lightweight. It does not include alerts, strategy logic, or automatic trade signals. Its purpose is to provide a clear visual framework that can be combined with other analysis methods.
Pine Script® indicator
EMA/SMA/ORB/OPEN/CLOUDSScript with 2 ORB's, 15 and 30 m. EMA clouds, Moving averages both exponential and Simple, open price
Pine Script® indicator
EMA and SMA Suite + ATR Table8 21 50 EMA
150 200 SMA
ATR table very useful! feel free to use dont need and massive indicators just emas smas and atr
Pine Script® indicator
Master Indicator Templatemultiple indicators in 1 spot
9, 21, 34, 50 EMA
200 and 400 SMA
open price
ORB 15m
vwap
Pine Script® indicator
Pine Script® indicator
TTT - Trend Identification Moving AveragesWhat This Indicator Does
This indicator is designed to help traders identify and stay aligned with the dominant market trend by combining multiple moving averages with volume analysis. It provides a structured framework to evaluate trend direction, momentum, and participation—without relying on news, fundamentals, or opinions.
The Philosophy Behind It
Markets move in trends—and those trends tend to persist far longer than most investors expect. The biggest mistake traders make is trying to predict reversals instead of recognizing and following the current trend.
This tool is built on a simple principle: Trade with the trend, not against it.
As outlined in Technical Trading Mastery, price action reflects all known information, often reversing well before economic data or news confirms the move . By focusing on price and trend structure, traders can position themselves on the right side of the market rather than reacting emotionally.
How It Works
1. Multi-Timeframe Trend Structure
This indicator uses a combination of short-, intermediate-, and long-term moving averages:
5 EMA → Short-term momentum
20 EMA → Near-term trend direction
50 EMA → Intermediate trend
150 SMA → Long-term market direction
These averages act as dynamic support and resistance levels while also defining trend alignment .
2. Trend Confirmation Logic
The relationship between moving averages helps define market conditions:
- When shorter-term averages are above longer-term averages → Uptrend
- When shorter-term averages fall below longer-term averages → Downtrend
- When averages compress or move sideways → Consolidation / indecision
A key concept:
- When the 50 EMA is above the 150 SMA, the market is considered in a healthy uptrend
- When the 50 EMA falls below the 150 SMA, it signals a potential shift to a bearish environment
This provides a clear, rules-based way to stay aligned with the dominant trend.
3. Entry & Pullback Context
Trends do not move in straight lines—they move in waves. Price will naturally pull back toward moving averages during trends.
These areas can act as:
- Support in uptrends
- Resistance in downtrends
This allows traders to evaluate whether price is:
- Extending (higher risk)
- Pulling back (potential opportunity)
- Breaking trend (potential warning)
4. Volume as Participation Insight
Volume is displayed to provide context behind price movement.
- Rising price with increasing volume → stronger participation
- Rising price with declining volume → weaker conviction
- Sharp volume spikes → potential emotional or institutional activity
Markets are driven by waves of capital flow and crowd psychology, not just price alone . Volume helps reveal when those waves are gaining or losing strength.
Why This Matters
Most traders struggle not because they lack indicators—but because they lack structure and discipline.
This indicator simplifies decision-making by focusing on three key elements:
- Trend direction (Are you aligned with the market?)
- Price location (Are you chasing or buying weakness?)
- Participation (Is there real conviction behind the move?)
Instead of reacting to headlines or emotions, this framework encourages a rules-based approach to understanding market behavior.
How To Use It
- Focus on trading in the direction of the dominant trend
- Use moving averages as a guide for trend alignment and structure
- Observe how price reacts near key averages for potential continuation or warning signals
- Use volume to confirm whether moves are supported by participation
Final Perspective
This tool is not about predicting tops or bottoms.
It is about recognizing trends, understanding market structure, and staying positioned with the flow of capital.
Because in the end, the market rewards those who follow it—not those who fight it.
Pine Script® indicator
SMA Full Harmony (5/10/20/60/120/240ma)To monitor and mark when 5ma/10ma/20ma/60ma/120ma/240ma all turned upward/downward.
Pine Script® indicator
4 Moving Averages (SMA/EMA)Simple way to have 4 Moving Averages in 1 indicator. Also has the feature to switch between SMA/EMA with a checkbox in the settings.
Pine Script® indicator
SPY 200SMA +4% Entry -3% Exit Strategy (QQQ/TQQQ)USE THIS CHART ONLY ON THE SPY DAILY VIEW
TLDR Summary of the Improved Strategy: When the price of SPY is +4% above the 200SMA BUY TQQQ and when the price of SPY drops to -3% under the SPY 200SMA SELL and slowly DCA into QQQ over the next 6-12 months or until price returns to +4% above the SPY 200SMA at which point you will go back into 100% TQQQ. Note: (if the price of QQQ goes 30% above the 200SMA of QQQ deleverage to QQQ or Sell to protect yourself from dot com level event)
This latest update will cover some important refining points to the latest version of the strategy I posted previously covering two major enhancements after doing more research and talking to other members of the LETF community (special thanks to u/lobsterfanatic)
There are three major changes I want to make in order to make this strategy the most optimal blend of Profit and Safety.
Change 1: Using SPY instead of QQQ as the tracked underlying 200SMA the strategy is based around
Backtest Start date of 1/1/2003 using QQQ & TQQQ (simulated) (Testfol.io)
r/TQQQ - Backtest Start Date 1/1/2003 using QQQ & TQQQ (Simulated) Testfol.io
Backtest Start Date 1/1/2003 using QQQ & TQQQ (Simulated) Testfol.io
Change 2: Under the SPY 200SMA Trigger DCA into the underlying QQQ instead of Bonds/Cash
r/TQQQ - Change 2: Under the SPY 200SMA Trigger DCA into the underlying QQQ instead of Bonds/Cash
Change 2: Under the SPY 200SMA Trigger DCA into the underlying QQQ instead of Bonds/Cash
So this one is an interesting one, above you can see the comparison of going into QQQ vs Bonds when you get a SELL signal from the strategy and exit the TQQQ position.
You really only have two times when you lose money going into the underlying (-8% in the 2022 rate hike crash and -24% in the 08 Crash) overall the average is +6.91% which leads to much greater returns.
If you want the strategy to be as easy and simple as possible just make a decision based on your risk tolerance of going into CASH/SGOV or QQQ based on the above data and your investing time horizon (if you may need to withdraw money at any point use CASH or BONDS, if you have years of time go QQQ).
However this strategy has the goal of being completely bullet proof in any market scenario so in that spirit I would say the most optimal way to handle this if you want to make the strategy better is to sell to CASH/SGOV immediately when the SELL signal for the strategy comes through and then slowly DCA with the funds into the underlying over the next 12 months every month. Block back into the underlying. Buy all the way down and all the way up and when the next BUY signal triggers sell everything and return to 100% TQQQ Exposure.
Change 3: Deleverage when too far above the QQQ 200SMA (Extremely rare but important)
This is all about setting additional safety measures to deleverage when insanely high above the 200SMA, I'll just call this what it is...dot com bubble insurance. An extremely rare dagger in the dark that could assassinate your portfolio and an Achilles heel of this trading strategy.
The 200SMA that this strategy revolves around is the mechanism that prevents mass drawdown events with a pseudo trailing stop loss, in the extremely rare event that price action skyrockets above the 200SMA too fast you become exposed to far too much risk, which necessitates this additional backstop.
For this we will actually need to use the QQQ SMA instead of SPY as in these extremely rare scenarios we need it to be as accurate and sector specific as possible.
The solution is simple, deleveraging as the price action of QQQ swings wildly upward too fast and too high above the QQQ 200SMA. You can choose whatever limits you would like but I'll be using these ones.
Bodyguard Signal 1: 30% Above the QQQ 200SMA Deleverage to QQQ
Bodyguard Signal 2: 40% Above the QQQ 200SMA SELL (This is the GTFO Level where you don't know where the top is but you don't really want to be there to find out lol)
Pine Script® strategy
160-Min Extended Hours MAs160-Min Extended Hours MA Dashboard
Designed for traders who work across the full extended hours session, where 960 minutes of daily market time — from pre-market open at 4:00 AM ET through post-market close at 8:00 PM ET — divides evenly into exactly 6 bars per day at the 160-minute timeframe. This creates a clean, session-aligned bar structure that keeps moving average lookbacks anchored to real extended hours time rather than arbitrary period counts.
This indicator plots five moving averages, each mapped to a meaningful horizon expressed in session time:
1D — 6 bars (1 full extended session)
1W — 30 bars (1 trading week)
1M — 126 bars (~1 trading month)
6M — 756 bars (~6 trading months)
1Y — 1,512 bars (~1 trading year)
Features
Toggle between EMA and SMA globally with a single input. Each MA plots with a right-edge label showing the period name, distance from current price, percentage distance, and ATR multiple — giving you immediate context on how extended or compressed price is relative to each level. A summary table displays the current MA value and slope direction (▲ ▼ →) for each period. A bottom signal row indicates whether price is in a full bull stack, bear stack, or mixed alignment across all visible MAs.
Color palette runs teal → light blue → royal blue → purple → white from shortest to longest timeframe, consistent with the broader dashboard suite.
The indicator includes a timeframe guard — all plots and labels suppress automatically if the chart is not on the 160-minute timeframe, and a warning label fires to prompt you to switch. Note that the 1Y MA requires approximately one full year of chart history to populate.
Timeframe: 160-min only
Asset class: Equities, ETFs, and index products with extended hours trading (4:00 AM – 8:00 PM ET)
Pine Script: v6
Sonnet 4.6
Pine Script® indicator
5-Min Session MAsHere's the updated description:
---
**5-Min Session MA Dashboard**
Designed for intraday traders working on the 5-minute timeframe, where 390 minutes of regular trading hours divides into exactly 78 bars per day — keeping moving average lookbacks anchored to real session time rather than arbitrary period counts.
This indicator plots three moving averages, each mapped to a meaningful intraday horizon expressed in session time:
- 1D — 78 bars (1 full session)
- 2D — 156 bars (2 sessions)
- 1W — 390 bars (1 trading week)
**Features**
Toggle between EMA and SMA globally with a single input. Each MA plots with a right-edge label showing the period name, distance from current price, percentage distance, and ATR multiple — giving you immediate context on how extended or compressed price is relative to each level. A summary table displays the current MA value and slope direction (▲ ▼ →) for each period. A bottom signal row indicates whether price is in a full bull stack, bear stack, or mixed alignment across all visible MAs.
Color palette runs teal → blue → purple from shortest to longest timeframe, consistent with the broader dashboard suite.
The indicator includes a timeframe guard — all plots and labels suppress automatically if the chart is not on the 5-minute timeframe, and a warning label fires to prompt you to switch.
**Timeframe:** 5-min only
**Asset class:** Equities, ETFs, and index products trading regular hours (9:30–4:00 ET)
**Pine Script:** v6
---
Pine Script® indicator
138-Min Session MAs138-Min Session MA Dashboard
Designed for futures traders using the 138-minute timeframe, where 1,380 minutes of daily session time divides evenly into exactly 10 bars per day — creating a clean, session-aligned bar structure unique to this timeframe.
This indicator plots six moving averages, each mapped to a meaningful trading horizon expressed in session-time rather than calendar time:
1D — 10 bars (1 session)
2D — 20 bars (2 sessions)
1W — 50 bars (1 trading week)
2W — 100 bars (2 trading weeks)
1M — 210 bars (~1 trading month)
6M — 1,260 bars (~6 trading months)
Features
Toggle between EMA and SMA globally with a single input. Each MA plots with a right-edge label showing the period name, distance from current price, percentage distance, and ATR multiple — giving you immediate context on how extended or compressed price is relative to each level. A summary table displays the current MA value and slope direction (▲ ▼ →) for each period. A bottom signal row indicates whether price is in a full bull stack, bear stack, or mixed alignment across all visible MAs.
Color palette runs teal → blue → purple → white from shortest to longest timeframe, consistent with the broader dashboard suite.
The indicator includes a timeframe guard — all plots and labels suppress automatically if the chart is not on the 138-minute timeframe, and a warning label fires to prompt you to switch.
Timeframe: 138-min only
Asset class: Futures (ES, NQ, CL, GC, or any instrument with a 1,380-min session)
Pine Script: v6
Pine Script® indicator
MA Distance Alert# MA Distance Alert - 均线偏离警报指标
## 中文说明
### 指标简介
MA Distance Alert 是一款基于均线原理的价格偏离监控指标,支持SMA/EMA双均线类型,可自定义均线周期与价格偏离阈值,实时监控价格与均线的偏离程度,当价格超出设定的偏离区间时自动触发视觉提醒与警报通知,辅助交易者快速捕捉价格极端偏离、趋势反转或加速行情信号。
### 核心功能
1. **灵活均线配置**:支持SMA(简单移动平均)、EMA(指数移动平均)两种常用均线类型,可自由调整均线计算周期
2. **精准偏离监控**:自动计算收盘价与均线的偏离百分比,基于自定义阈值生成上下偏离轨道
3. **多重视觉提醒**:高亮标注超出偏离区间的K线背景,上偏离显示红色背景,下偏离显示绿色背景
4. **智能警报通知**:支持价格向上突破、向下跌破、双向偏离三种警报条件,覆盖全场景监控需求
5. **界面友好**:指标叠加在主图显示,不遮挡价格走势,线条配色清晰易辨
### 使用方法
1. 将指标代码添加至TradingView Pine编辑器,加载至图表
2. 参数自定义:选择均线类型、设置均线周期(默认120)、调整偏离阈值(默认12%)
3. 实时观察:价格在上下轨道内运行为正常区间,超出轨道时触发背景高亮
4. 警报设置:开启指标警报,接收价格极端偏离的实时通知
### 适用场景
适用于股票、加密货币、外汇、期货等全品类交易品种,可用于趋势行情中的回调预警、震荡行情中的高低点捕捉、极端行情中的超买超卖判断,适配日线、小时线等所有时间周期。
---
# MA Distance Alert - Moving Average Distance Alert Indicator
## English Description
### Indicator Introduction
MA Distance Alert is a price deviation monitoring indicator based on the moving average principle. It supports both SMA and EMA types, allowing custom moving average periods and price deviation thresholds. It monitors the deviation between price and moving average in real time, automatically triggers visual reminders and alert notifications when the price exceeds the set deviation range, helping traders quickly capture signals of extreme price deviation, trend reversal or accelerated market trends.
### Core Features
1. **Flexible MA Configuration**: Support two commonly used moving average types: SMA (Simple Moving Average) and EMA (Exponential Moving Average), freely adjust the MA calculation period
2. **Accurate Deviation Monitoring**: Automatically calculate the deviation percentage between the closing price and the moving average, generate upper and lower deviation bands based on custom thresholds
3. **Multiple Visual Alerts**: Highlight the K-line background when exceeding the deviation range, red background for upward deviation and green background for downward deviation
4. **Smart Alert Notifications**: Support three alert conditions: price breakout upward, breakdown downward, and two-way deviation, covering full-scenario monitoring needs
5. **User-friendly Interface**: Overlaid on the main chart without blocking price movements, with clear and distinguishable line colors
### How to Use
1. Add the indicator code to TradingView Pine Editor and load it on the chart
2. Customize Parameters: Select MA type, set MA period (default 120), adjust deviation threshold (default 12%)
3. Real-time Observation: Price moving within upper and lower bands is the normal range, background highlight is triggered when exceeding the bands
4. Alert Setup: Enable indicator alerts to receive real-time notifications of extreme price deviations
### Applicable Scenarios
Suitable for all trading varieties including stocks, cryptocurrencies, forex, futures, etc. It can be used for callback early warning in trending markets, high-low point capture in ranging markets, overbought and oversold judgment in extreme markets, compatible with all time frames such as daily and hourly charts.
Pine Script® indicator






















