OPEN-SOURCE SCRIPT
PSAR with ATR Trailing Stop + SMA Filter

📈 Strategy Overview: PSAR + 6×ATR Trailing Stop with SMA Filter
This strategy is built around the principle of “Cut the losers, let the winners run” — a disciplined, trend-following approach that combines the Parabolic SAR indicator with dynamic risk management and a Simple Moving Average (SMA) trend filter.
🔍 Strategy Logic
Trend Filter Trades are only taken in the direction of the prevailing trend, defined by a user-selected SMA (default: 100).
✅ Long trades only when price is above the SMA
✅ Short trades only when price is below the SMA
Entry Signal: A trade is triggered when the Parabolic SAR flips to the opposite side of the price bars, signaling a potential trend reversal.
Stop Loss: The stop loss is dynamically set at 6×ATR from the entry price. This adapts to market volatility and is recalculated every bar — effectively acting as a trailing stop.
Exit Logic: There is no fixed take profit. The trade remains open until the trailing stop is hit — allowing winners to run and losers to be cut quickly.
Risk Management: Each trade risks 0.5% of total equity, ensuring consistent position sizing and capital preservation.
📊 Visual Elements
PSAR dots mark trend direction changes
SMA line shows the broader trend filter
Trailing stop crosses (with 50% opacity) indicate the current stop level without cluttering the chart
⚙️ Customizable Inputs
PSAR parameters: Start, Increment, Maximum
ATR length and multiplier
SMA length
Risk percentage per trade
This strategy is ideal for traders who want to stay aligned with the trend, automate disciplined exits, and avoid emotional decision-making. Clean, simple, and powerful.
Wishing you calm and successful trades!
This strategy is built around the principle of “Cut the losers, let the winners run” — a disciplined, trend-following approach that combines the Parabolic SAR indicator with dynamic risk management and a Simple Moving Average (SMA) trend filter.
🔍 Strategy Logic
Trend Filter Trades are only taken in the direction of the prevailing trend, defined by a user-selected SMA (default: 100).
✅ Long trades only when price is above the SMA
✅ Short trades only when price is below the SMA
Entry Signal: A trade is triggered when the Parabolic SAR flips to the opposite side of the price bars, signaling a potential trend reversal.
Stop Loss: The stop loss is dynamically set at 6×ATR from the entry price. This adapts to market volatility and is recalculated every bar — effectively acting as a trailing stop.
Exit Logic: There is no fixed take profit. The trade remains open until the trailing stop is hit — allowing winners to run and losers to be cut quickly.
Risk Management: Each trade risks 0.5% of total equity, ensuring consistent position sizing and capital preservation.
📊 Visual Elements
PSAR dots mark trend direction changes
SMA line shows the broader trend filter
Trailing stop crosses (with 50% opacity) indicate the current stop level without cluttering the chart
⚙️ Customizable Inputs
PSAR parameters: Start, Increment, Maximum
ATR length and multiplier
SMA length
Risk percentage per trade
This strategy is ideal for traders who want to stay aligned with the trend, automate disciplined exits, and avoid emotional decision-making. Clean, simple, and powerful.
Wishing you calm and successful trades!
Script open-source
Dans l'esprit de TradingView, le créateur de ce script l'a rendu open-source, afin que les traders puissent examiner et vérifier sa fonctionnalité. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais n'oubliez pas que la republication du code est soumise à nos Règles.
KONSTANTINOS TROVAS
Clause de non-responsabilité
Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit de TradingView, le créateur de ce script l'a rendu open-source, afin que les traders puissent examiner et vérifier sa fonctionnalité. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais n'oubliez pas que la republication du code est soumise à nos Règles.
KONSTANTINOS TROVAS
Clause de non-responsabilité
Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.