OPEN-SOURCE SCRIPT
S1 - Trend Pullback DEBUG v5 (ATR SL/TP,

S1 – Trend Pullback is a momentum-based pullback strategy designed primarily for index markets such as NASDAQ (NQ / NAS100).
The core idea:
Market enters a confirmed uptrend (EMA20 > EMA50 for two consecutive bars)
Price pulls back below EMA20
The next bar closes back above EMA20 (entry trigger)
Stop loss is derived from ATR (volatility-adaptive)
Take profit is RR-based
A maximum bar-in-trade condition handles stuck positions
Long-only design (optimized for indices with long-term upward bias)
The core idea:
Market enters a confirmed uptrend (EMA20 > EMA50 for two consecutive bars)
Price pulls back below EMA20
The next bar closes back above EMA20 (entry trigger)
Stop loss is derived from ATR (volatility-adaptive)
Take profit is RR-based
A maximum bar-in-trade condition handles stuck positions
Long-only design (optimized for indices with long-term upward bias)
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.