OPEN-SOURCE SCRIPT
Cập nhật

Simple Trend & Breakout System v6

786
Key Features of the Strategy:

Multi-Timeframe (MTF) Trend Filter: The strategy uses a 240-period Exponential Moving Average (EMA) to determine the overall trend. Thanks to the MTF feature, the EMA is always anchored to the Daily (1D) chart by default, even if you switch your viewing chart to a Weekly timeframe. You can easily adjust the EMA length in steps of 5 within the settings.

Breakout Entry Logic: Instead of buying blindly, the script waits for bullish or bearish momentum (consecutive higher/lower closes). It then places a stop order 0.1% above the high (for longs) or below the low (for shorts) of the signal candle to catch the actual breakout.

Dynamic Percentage Trailing Stop: Exits are handled by a dynamic trailing stop set to 2.5% by default. It trails your position automatically, locking in profits and cutting losses, and is visualized directly on the chart (green line for longs, red line for shorts).

Realistic Backtesting Conditions: It includes a realistic trading commission of 0.01% per trade and allows you to set a custom Backtest Date Range (defaulting to 1998 - 2099).

Smart Data Handling (No Empty Drag): If you set the start year to 1922, but the asset data only begins in 1973, the script automatically detects the real start date. It calculates the CAGR accurately based only on the available data, preventing distorted, watered-down performance metrics.

Comprehensive StatTab: A dashboard in the bottom right corner gives you a direct comparison between your Strategy's performance and a pure Buy & Hold approach. It tracks Win Rate, Profit Factor, CAGR, Maximum Drawdowns, and the exact dates those drawdowns occurred.

Relative Equity Curve: An optional purple line that plots your strategy's equity growth directly onto the price chart. It anchors your starting capital to the asset's initial opening price, allowing you to visually see if your strategy is outperforming the underlying asset in real-time.
Phát hành các Ghi chú
v12 Update:
// - Removed the continuous "Active Entry Line" that cluttered the chart during a trade.
// - Now strictly shows ONLY the pending trigger levels before entry and a 1-bar historical marker.
// v11 Update:
// - Overhauled "Pending Entry" visualization (live dashed line + historical 1-bar dash).
// v10/9/8/7 Updates:
// - Pro Dashboard, Time in Market, Calmar/Sortino Ratios, Trail plotting, Stop Year Bugfix.

Thông báo miễn trừ trách nhiệm

Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.