PROTECTED SOURCE SCRIPT

Time-Restricted vs Normal SMA

22
This script plots two Simple Moving Averages (SMAs):

Restricted SMA (Orange): A moving average that only uses data within a defined intraday session (default: 09:15 – 16:30). It ignores all price data outside this session and does not draw a line during off-hours.

Normal SMA (Blue): A standard rolling SMA that runs continuously using all bars, without time restrictions.

The restricted SMA is useful for traders who only want to analyze moving averages during active market hours, such as stock exchange sessions or custom trading windows. By filtering out after-hours and pre-market activity, this indicator helps align signals more closely with official trading sessions.

Customization:
Adjust the lengths of both SMAs.
Modify the session hours to match your market or strategy.
This tool is designed for intraday traders who want greater control over how moving averages respond to session-specific data.

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。