PROTECTED SOURCE SCRIPT

Long & Short Trading Strategy

22
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.

免責聲明

這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。