OPEN-SOURCE SCRIPT
Turtle System 1 (20/10) + N-Stop + MTF Table V7.2

🐢 Description: Turtle System 1 (20/10) IndicatorThis indicator implements the original trading signals of the Turtle Trading System 1 based on the classic Donchian Channels. It incorporates a historically correct, volatility-based Trailing Stop (N-Stop) and a Multi-Timeframe (MTF) status dashboard. The script is written in Pine Script v6, optimized for performance and reliability.📊 Core Logic and ParametersThe system is a pure trend-following model, utilizing the more widely known, conservative parameters of the Turtle System 1:FunctionParameterValueDescriptionEntry$\text{Donchian Breakout}$$\mathbf{20}$Buy/Sell upon breaking the 20-day High/Low.Exit (Turtle)$\text{Donchian Breakout}$$\mathbf{10}$Close the position upon breaking the 10-day Low/High.Volatility$\mathbf{N}$ (ATR Period)$\mathbf{20}$Calculation of market volatility using the Average True Range (ATR).Stop-LossMultiplier$\mathbf{2.0}
SETS the initial and Trailing Stop at $\mathbf{2N}$.🛠️ Key Technical Features1. Original Turtle Trailing Stop (Section 4)The stop-loss mechanism is implemented with the historically accurate Turtle Trailing Logic. The stop is not aggressively tied to the current candle's low/high, which often causes premature exits. Instead, the stop only trails in the direction of the trend, maximizing the previous stop price against the new calculated $\text{Close} \pm 2N$:$$\text{New Trailing Stop} = \text{max}(\text{Previous Stop}, \text{Close} \pm (2 \times N))$$2. Reliable Multi-Timeframe (MTF) Status (Section 6)The indicator features a robust MTF status table.Purpose: It calculates and persistently stores the Turtle System 1 status (LONG=1, SHORT=-1, FLAT=0) for various timeframes (1H, 4H, 8H, 1D, and 1W).Method: It uses global var int variables combined with request.security(), ensuring the status is accurately maintained and updated across different bars and timeframes, providing a reliable higher-timeframe context.3. VisualizationsChannels: The 20-period (Entry) and 10-period (Exit) Donchian Channels are plotted.Stop Line: The dynamic $\mathbf{2N}$ Trailing Stop is visible as a distinct line.Signals: plotshape markers indicate Entry and Exit.MTF Table: A clean, color-coded status summary is displayed in the upper right corner.
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน