OPEN-SOURCE SCRIPT

SPX Open vs SMA Alert

已更新
This indicator is specifically designed to identify the first market-relevant candle of the S&P 500 (SPX) after the market opens. The opening price of the trading day is compared to a customizable simple moving average (SMA) period. A visual marker and an alert are triggered when the opening price is above the SMA. Perfect for traders seeking early market trends or integrating automated trading strategies.

Features:

Market Open: The indicator uses the New York market open time (09:30 ET), accounting for time zones and daylight saving time changes.
Flexible Time Offset: Users can set a time offset to trigger alerts after the market opens.
Customizable SMA: The SMA period is adjustable, with a default value of 10.
Visual Representation: A step-line SMA is plotted directly on the chart with subtle transparency and clean markers.
Alert Functionality: Alerts are triggered when conditions are met (opening price > SMA).

Usage:

This indicator is ideal for identifying relevant trading signals early in the session.
Alerts can also serve as triggers for automated trading, e.g., in conjunction with the Trading Automation Toolbox.
Supports both intraday and daily charts.

Alarm Settings:

Select the appropriate symbol (e.g., SPX) and the alert condition "SPX Open > SMA10".

Trigger Settings:

Choose "Once Per Bar Close" to ensure the condition is evaluated at the end of each candle.
If you prefer to evaluate the condition immediately when it becomes true, choose "Once Per Minute".
Duration:

Set the alarm to "Open-ended" if you want it to remain active indefinitely.
Alternatively, set a specific expiration date for the alarm.
版本注释
Important Note:
This script retrieves the current day's opening price in real-time for intraday charts. Due to real-time data processing, the opening price may temporarily adjust until the daily bar is finalized. This does not affect historical data or completed daily bars. For automation, consider this potential repainting behavior.
Candlestick analysisMoving AveragesTrend Analysis

开源脚本

本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?

免责声明