OPEN-SOURCE SCRIPT
SMA Stufen-TP Strategie (200/100/50/25) mit Reentry

Strategy Description for TradingView: Multi-SMA Momentum & Reentry System
This Pine Script strategy, named "SMA Stufen-TP Strategie (200/100/50/25) mit Reentry," is a Long-Only trend-following system designed to capitalize on upward momentum and capture significant gains while incorporating sophisticated logic for reentry after corrections.
The system relies on four Simple Moving Averages (SMAs): SMA 200, SMA 100, SMA 50, and SMA 25. These indicators are used to define the trend structure, trigger entries, and set dynamic, layered Take-Profit (TP) levels.
Entry Rules
The strategy has one main entry and two specific reentry triggers:
Main Entry (Standard Trend): A long position is opened when the price crosses above the SMA 200. This acts as the initial signal for a strong, long-term uptrend.
Reentry 1 (Medium Correction): This reentry is sought after an official exit (Stop Loss or Take Profit). It is permitted if the SMA 100 is above the SMA 200 and two conditions are met: the price previously dipped below the SMA 100 during the correction, and it now closes two consecutive bars above the SMA 100. This targets a confirmed bounce within an overall bullish structure.
Reentry 2 (Deep Correction/Momentum Shift): This triggers during a deep correction where all shorter SMAs (100, 50, 25) are below the SMA 200. Reentry occurs when the SMA 25 crosses above the SMA 50, signaling a powerful short-term momentum shift that precedes a larger recovery.
Exit and Take-Profit Logic
Exits are governed by a prioritized system including a fixed Stop Loss and three dynamic Take-Profit stages.
A. Stop Loss (Highest Priority)
The primary risk control is a fixed Stop Loss at -10% below the entry price. This is always the first exit condition checked.
B. Layered Take-Profits (TP)
Profits are secured using a step-wise mechanism that trails the price using the shorter SMAs, but only after specific profit thresholds are met. This ensures that the strategy provides ample room for a strong rally while securing gains as the trend matures.
TP Stage 1: Activated when the price first crosses above the SMA 100. The position is closed if the profit reaches 10% or more and the price closes two consecutive bars below the SMA 100.
TP Stage 2: Activated when the price first crosses above the SMA 50. The position is closed if the profit reaches 20% or more and the price closes two consecutive bars below the SMA 50.
TP Stage 3: Activated when the price first crosses above the SMA 25. The position is closed if the profit reaches 40% or more and the price closes two consecutive bars below the SMA 25.
The exit priority ensures that the tightest active stop is used: Stop Loss takes precedence, followed by TP 3 (the highest profit and tightest trail), then TP 2, and finally TP 1.
This Pine Script strategy, named "SMA Stufen-TP Strategie (200/100/50/25) mit Reentry," is a Long-Only trend-following system designed to capitalize on upward momentum and capture significant gains while incorporating sophisticated logic for reentry after corrections.
The system relies on four Simple Moving Averages (SMAs): SMA 200, SMA 100, SMA 50, and SMA 25. These indicators are used to define the trend structure, trigger entries, and set dynamic, layered Take-Profit (TP) levels.
Entry Rules
The strategy has one main entry and two specific reentry triggers:
Main Entry (Standard Trend): A long position is opened when the price crosses above the SMA 200. This acts as the initial signal for a strong, long-term uptrend.
Reentry 1 (Medium Correction): This reentry is sought after an official exit (Stop Loss or Take Profit). It is permitted if the SMA 100 is above the SMA 200 and two conditions are met: the price previously dipped below the SMA 100 during the correction, and it now closes two consecutive bars above the SMA 100. This targets a confirmed bounce within an overall bullish structure.
Reentry 2 (Deep Correction/Momentum Shift): This triggers during a deep correction where all shorter SMAs (100, 50, 25) are below the SMA 200. Reentry occurs when the SMA 25 crosses above the SMA 50, signaling a powerful short-term momentum shift that precedes a larger recovery.
Exit and Take-Profit Logic
Exits are governed by a prioritized system including a fixed Stop Loss and three dynamic Take-Profit stages.
A. Stop Loss (Highest Priority)
The primary risk control is a fixed Stop Loss at -10% below the entry price. This is always the first exit condition checked.
B. Layered Take-Profits (TP)
Profits are secured using a step-wise mechanism that trails the price using the shorter SMAs, but only after specific profit thresholds are met. This ensures that the strategy provides ample room for a strong rally while securing gains as the trend matures.
TP Stage 1: Activated when the price first crosses above the SMA 100. The position is closed if the profit reaches 10% or more and the price closes two consecutive bars below the SMA 100.
TP Stage 2: Activated when the price first crosses above the SMA 50. The position is closed if the profit reaches 20% or more and the price closes two consecutive bars below the SMA 50.
TP Stage 3: Activated when the price first crosses above the SMA 25. The position is closed if the profit reaches 40% or more and the price closes two consecutive bars below the SMA 25.
The exit priority ensures that the tightest active stop is used: Stop Loss takes precedence, followed by TP 3 (the highest profit and tightest trail), then TP 2, and finally TP 1.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.