SMA Selectable Timeframe Alerts

The script triggers alerts when a candle closes above or below your selected SMA on the timeframes you choose, eliminating the uncertainty associated with TradingView’s built-in SMA alert triggers.
1. Install: Replace everything in Pine Editor with the new script, then Save → Add to chart.
2. Choose the SMA: Open the indicator’s Settings → Inputs. Set SMA length to 15, 25, 50, 100, 150, or 200.
3. Choose direction: Select Both, Above only, or Below only.
4. Choose timeframes: Under Alert Timeframes, check only those you want monitored.
5. Set the chart: Use a standard candlestick chart at or below the smallest selected timeframe. If 1h and 1D are selected, use a 1-hour chart or lower.
6. Create the alert: Select Create Alert → SMA Selectable Timeframe Alerts → Any alert() function call. Enable phone/email notifications and click Create.
Example notification:
NASDAQ:TSLA | 1D | Close crossed ABOVE SMA 200 | Close: 430.00 | SMA: 425.50
One alert covers one SMA length, your selected timeframes, and one stock. Repeat for additional SMA lengths or stocks.
Once created, it runs with TradingView closed, and you can change your visible chart timeframe. Recreate an alert whenever you change the script or its settings—existing alerts retain their original setup.
1. Install: Replace everything in Pine Editor with the new script, then Save → Add to chart.
2. Choose the SMA: Open the indicator’s Settings → Inputs. Set SMA length to 15, 25, 50, 100, 150, or 200.
3. Choose direction: Select Both, Above only, or Below only.
4. Choose timeframes: Under Alert Timeframes, check only those you want monitored.
5. Set the chart: Use a standard candlestick chart at or below the smallest selected timeframe. If 1h and 1D are selected, use a 1-hour chart or lower.
6. Create the alert: Select Create Alert → SMA Selectable Timeframe Alerts → Any alert() function call. Enable phone/email notifications and click Create.
Example notification:
NASDAQ:TSLA | 1D | Close crossed ABOVE SMA 200 | Close: 430.00 | SMA: 425.50
One alert covers one SMA length, your selected timeframes, and one stock. Repeat for additional SMA lengths or stocks.
Once created, it runs with TradingView closed, and you can change your visible chart timeframe. Recreate an alert whenever you change the script or its settings—existing alerts retain their original setup.
(MoMo)
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
(MoMo)
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.