PROTECTED SOURCE SCRIPT

Time-Restricted vs Normal SMA

24
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が提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。