OPEN-SOURCE SCRIPT

SPX Open vs SMA Alert

Mis à jour
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.
Notes de version
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

Script open-source

Dans le plus pur esprit TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par nos Règles. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Vous voulez utiliser ce script sur un graphique ?

Clause de non-responsabilité