OPEN-SOURCE SCRIPT
Long Only - Double EMA + Session

Overview
This is a high-probability Long-Only trend-following strategy designed primarily for the 65-minute and 4-hour timeframes. It utilizes a dual-layered filter system to align trades with both macro and mid-term market momentum, ensuring entries only occur during healthy uptrends. The strategy is optimized for volatile, high-growth assets like TSLA and MSFT.
How It Works
The strategy relies on three primary pillars of technical analysis to confirm an "A+" setup:
Macro Trend Filter (200 EMA): We only look for long opportunities when the price is above the 200-period Exponential Moving Average. This keeps the strategy on the right side of the long-term trend and avoids "buying the dip" during major bear markets.
Momentum Filter (50 EMA): The 50 EMA acts as a local trend filter. By requiring price to be above both EMAs, we ensure the medium-term momentum is also bullish.
The Trigger (Stochastic RSI): We enter when the Stochastic RSI K-line crosses above the 20 level (Oversold). This identifies local "oversold" pullbacks within a larger uptrend.
Risk Management & Exit Plan
This strategy is built with professional-grade capital preservation in mind:
Trailing Stop-Loss: A 5% trailing stop follows the price as it moves in our favor. This protects unrealized profits and helps mitigate the drawdown during sudden reversals.
Dynamic Profit Target: The strategy exits automatically if the Stochastic RSI K-line reaches the 97 level, capturing gains at the peak of momentum.
Session Filter: To avoid the "noise" of pre-market and low-volume afternoon trading, the strategy is restricted to the Market Open (9:30 AM EST) window where institutional volume is highest.
Backtesting Notes
Realistic Simulation: This strategy includes a 0.05% commission and 2 ticks of slippage to reflect real-world execution costs.
Recommended Assets: Optimized for Nasdaq-100 components and high-volume growth stocks.
Timeframe: Best performance found on 65m or 4h intervals.
This is a high-probability Long-Only trend-following strategy designed primarily for the 65-minute and 4-hour timeframes. It utilizes a dual-layered filter system to align trades with both macro and mid-term market momentum, ensuring entries only occur during healthy uptrends. The strategy is optimized for volatile, high-growth assets like TSLA and MSFT.
How It Works
The strategy relies on three primary pillars of technical analysis to confirm an "A+" setup:
Macro Trend Filter (200 EMA): We only look for long opportunities when the price is above the 200-period Exponential Moving Average. This keeps the strategy on the right side of the long-term trend and avoids "buying the dip" during major bear markets.
Momentum Filter (50 EMA): The 50 EMA acts as a local trend filter. By requiring price to be above both EMAs, we ensure the medium-term momentum is also bullish.
The Trigger (Stochastic RSI): We enter when the Stochastic RSI K-line crosses above the 20 level (Oversold). This identifies local "oversold" pullbacks within a larger uptrend.
Risk Management & Exit Plan
This strategy is built with professional-grade capital preservation in mind:
Trailing Stop-Loss: A 5% trailing stop follows the price as it moves in our favor. This protects unrealized profits and helps mitigate the drawdown during sudden reversals.
Dynamic Profit Target: The strategy exits automatically if the Stochastic RSI K-line reaches the 97 level, capturing gains at the peak of momentum.
Session Filter: To avoid the "noise" of pre-market and low-volume afternoon trading, the strategy is restricted to the Market Open (9:30 AM EST) window where institutional volume is highest.
Backtesting Notes
Realistic Simulation: This strategy includes a 0.05% commission and 2 ticks of slippage to reflect real-world execution costs.
Recommended Assets: Optimized for Nasdaq-100 components and high-volume growth stocks.
Timeframe: Best performance found on 65m or 4h intervals.
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน