PROTECTED SOURCE SCRIPT
Long & Short Trading Strategy

This strategy trades both long and short positions based on EMA (Exponential Moving Average) and ATR (Average True Range). The strategy uses 100% of equity per trade and displays visual entry and stop-loss lines on the chart.
Backtest Configuration
The strategy allows users to define a custom backtest period through input parameters for start and end dates (day, month, year). The default period runs from January 1, 2005, to December 31, 9999, with a time-based filter ensuring trades only execute within the specified range.
Core Strategy Parameters
Two key configurable parameters control the strategy: EMA/ATR Length ((CUSTOMIZATION ALLOWED)) and ATR Multiplier ((CUSTOMIZATION ALLOWED)). These determine the calculation of the bull and bear trigger levels around the moving average.
Stop Loss Management
The strategy implements a fixed stop loss system measured in points (CUSTOMIZATION ALLOWED). This applies to both long and short positions, with separate exit commands for each position type to manage risk.
Visual Line Customization
Users can customize the appearance of entry and stop-loss lines, including their length in candles (default 15), line width (1-4), and colors. Entry lines default to blue, while stop-loss lines default to red.
Backtest Configuration
The strategy allows users to define a custom backtest period through input parameters for start and end dates (day, month, year). The default period runs from January 1, 2005, to December 31, 9999, with a time-based filter ensuring trades only execute within the specified range.
Core Strategy Parameters
Two key configurable parameters control the strategy: EMA/ATR Length ((CUSTOMIZATION ALLOWED)) and ATR Multiplier ((CUSTOMIZATION ALLOWED)). These determine the calculation of the bull and bear trigger levels around the moving average.
Stop Loss Management
The strategy implements a fixed stop loss system measured in points (CUSTOMIZATION ALLOWED). This applies to both long and short positions, with separate exit commands for each position type to manage risk.
Visual Line Customization
Users can customize the appearance of entry and stop-loss lines, including their length in candles (default 15), line width (1-4), and colors. Entry lines default to blue, while stop-loss lines default to red.
نص برمجي محمي
تم نشر هذا النص البرمجي كمصدر مغلق. ومع ذلك، يمكنك استخدامه بحرية ودون أي قيود - تعرف على المزيد هنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي محمي
تم نشر هذا النص البرمجي كمصدر مغلق. ومع ذلك، يمكنك استخدامه بحرية ودون أي قيود - تعرف على المزيد هنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.