OPEN-SOURCE SCRIPT
Updated EMA6 or SMA6 Touch Alert

This script monitors the market and notifies you whenever the price touches either the 6-period EMA or the 6-period SMA.
It helps identify potential pullbacks, reaction points, or entry zones, as price interaction with these moving averages often signals short-term market shifts.
What the script does:
Calculates the EMA 6 and SMA 6
Detects if price touches either moving average within the candle
Plots both lines on the chart for visibility
Allows you to set alerts to receive automatic notifications
Best suited for:
Scalping
Day Trading
Pullback Entries
Short-term trend reactions
It helps identify potential pullbacks, reaction points, or entry zones, as price interaction with these moving averages often signals short-term market shifts.
What the script does:
Calculates the EMA 6 and SMA 6
Detects if price touches either moving average within the candle
Plots both lines on the chart for visibility
Allows you to set alerts to receive automatic notifications
Best suited for:
Scalping
Day Trading
Pullback Entries
Short-term trend reactions
Release Notes
This Pine Script for TradingView is designed to help traders catch important short-term market touches on moving averages. It monitors both EMA (Exponential Moving Average) and SMA (Simple Moving Average) with fully customizable periods.Whether you are scalping, day trading, or monitoring pullbacks, this script notifies you when the price touches your selected EMA or SMA, giving you a timely opportunity to analyze or enter trades.
Key Features:
Customizable EMA & SMA lengths – adjust the periods to your trading strategy.
Alerts once per candle – avoids multiple alerts from the same price action.
Live or Close alert option – trigger alerts immediately when price touches, or wait until the candle closes for confirmation.
Pause alerts toggle – easily enable or disable alerts without removing the script.
Visual plots – EMA (red) and SMA (blue) displayed on the chart for quick reference.
This script is ideal for traders who want precise alerts on short-term movements while maintaining flexibility and control over notifications.
Release Notes
This script triggers an alert when the price touches either an Exponential Moving Average (EMA), a Simple Moving Average (SMA), or both, based on your settings.It offers full flexibility while remaining lightweight and efficient — no visual plots, just pure alert logic.
Features
⚙️ Customizable Lengths – Choose separate lengths for EMA and SMA.
⏱️ Flexible Timeframe Selection – Calculate moving averages on any timeframe (e.g., 1m, 15m, 1h, Daily).
🔔 Selective Alerts – Choose whether to trigger alerts for EMA only, SMA only, or both.
🕐 Alert Timing – Option to alert live during the candle or only after candle close.
🚫 Single Alert per Bar – Prevents multiple alerts on the same candle.
💡 Minimal & Efficient – No chart plots, designed purely for alert logic.
Usage
Add the script to your chart.
Adjust EMA/SMA lengths, timeframe, and alert mode in the settings.
Create an alert using “Any alert() function call”.
Relax — you’ll get notified only when price touches your chosen MA(s) under your selected conditions.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.