OPEN-SOURCE SCRIPT
Cập nhật 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
Phát hành các Ghi chú
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.
Phát hành các Ghi chú
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.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.