OPEN-SOURCE SCRIPT

PSAR with ATR Trailing Stop + SMA Filter

99
📈 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!

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.