OPEN-SOURCE SCRIPT
Aggiornato 20SMA Reversal - Peak/Trough Trendlines

Title: 20SMA Reversal with Peak/Trough Trendlines
Description (English): This indicator detects pivot points where the 20-period SMA reverses direction (forming a V-shape or an Arch-shape). Upon detection, it automatically identifies the local peak/trough from a lookback period and connects them with an extended trendline if they show a "Lower High" or "Higher Low" pattern. Useful for identifying trend structural changes and potential breakout levels.
概要(日本語): このインジケーターは、20期間SMAが反転(V字回復や山なり反転)するポイントを検出します。反転確定時に、指定した遡り期間内の高値・安値を自動的に特定し、それらが「高値切り下がり」または「安値切り上がり」の条件を満たす場合に、右側に延長されたトレンドラインを描画します。トレンドの構造変化やブレイクアウトの目安として活用いただけます。
Description (English): This indicator detects pivot points where the 20-period SMA reverses direction (forming a V-shape or an Arch-shape). Upon detection, it automatically identifies the local peak/trough from a lookback period and connects them with an extended trendline if they show a "Lower High" or "Higher Low" pattern. Useful for identifying trend structural changes and potential breakout levels.
概要(日本語): このインジケーターは、20期間SMAが反転(V字回復や山なり反転)するポイントを検出します。反転確定時に、指定した遡り期間内の高値・安値を自動的に特定し、それらが「高値切り下がり」または「安値切り上がり」の条件を満たす場合に、右側に延長されたトレンドラインを描画します。トレンドの構造変化やブレイクアウトの目安として活用いただけます。
Note di rilascio
[Update: Enhanced with Trendline Breakout Alerts!] This script identifies V-shape and inverted V-shape reversals based on the 20SMA (Simple Moving Average) and automatically plots trendlines connecting recent swing lows and highs.New in this version: We have implemented a sophisticated "Alert Function" that triggers when the price breaks out of the plotted trendlines.
Key Features:
Automated Trendlines: Automatically draws and extends trendlines connecting significant pivot points triggered by SMA reversals.
Reliable Alerts: To prevent false signals, alerts are suppressed on the initial bar where the line is formed (2nd point). The notification is triggered only when a subsequent bar closes across the extended line.
Optional Background Highlighting: You can visualize SMA reversal points with background colors via the settings (Disabled by default).
【バージョンアップ:アラート機能を追加!】 このインジケーターは、20SMA(単純移動平均線)の反転(V字・逆V字)を検知し、直近の重要な安値・高値を結んだトレンドラインを自動で描画します。
今回のアップデート内容: トレンドラインを外側にブレイクアウトした際に通知する「アラート機能」を実装しました。
特徴:
自動ライン描画: SMAの反転をトリガーに、直近の押し安値・戻り高値を結ぶラインを延長表示します。
高精度アラート: ラインが確定した瞬間の誤報を防ぐため、2点目が決まった足(反転足)では鳴らず、その後の足で明確にラインを跨いだ(確定足)タイミングで通知されます。
背景色表示(オプション): 設定により、SMAの反転ポイントを背景色で視覚化できます(デフォルトはOFF)。
Note di rilascio
OverviewThis indicator is designed to capture high-precision trend reversal points by combining 20SMA slope changes with market structure (pivots).
Latest Updates
The latest version includes significant improvements for real-world trading:
Confirmed Breakout Alerts: Alerts are now triggered precisely when the price breaks the trendline on a "Confirmed Close" basis.
Breakout Dot Markers: Automatically plots a "●" mark on the breakout bar to clearly visualize entry points.
Key Features
SMA Reversal Detection: Identifies the origin of market structure changes based on V-shaped SMA reversals.
Auto-Trendline Projection: Automatically draws objective trendlines once two pivot points (1, 2) are confirmed.
Flexible Parameters: Highly customizable to suit various styles, from scalping to swing trading.
Trading Strategy
Long: When the price breaks above the red descending trendline and a Blue ● appears.
Short: When the price breaks below the blue ascending trendline and a Red ● appears.
概要
このインジケーターは、20SMAの傾きの変化と価格構造(ピボット)を組み合わせて、精度の高いトレンド転換点を捉えるツールです。
バージョンアップ内容
最新のアップデートにより、実戦での使い勝手が大幅に向上しました。
確定足ブレイクアウト・アラート: トレンドラインを「終値」でブレイクしたタイミングで正確にアラートを鳴らします。
ブレイクアウト・ドット表示: ラインをブレイクした足に「●」マークを自動表示し、エントリーポイントを可視化しました。
主な機能
SMA反転検知: 20SMAがV字・逆V字に反転したポイントを構造の起点として捉えます。
自動トレンドライン: 2つの支点(1, 2)が確定すると、客観的なトレンドラインを自動描写します。
マルチ設定: 設定次第でスキャルピングからスイングまで幅広く対応可能です。
トレード戦略
買い(Long): 赤色の下降トレンドラインを終値で上抜け、**青色の●**が表示された時。
売り(Short): 青色の上昇トレンドラインを終値で下抜け、**赤色の●**が表示された時。
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.