OPEN-SOURCE SCRIPT
Dynamic ATR Long/Short Position Tool

This indicator provides a dynamic visual (R/R) projection that enables operators to systematically formulate their risk management setups. By anchoring the tool to any specific chart candle, it automatically renders take-profit and stop-loss zones tied directly to objective market volatility.
Rather than relying on arbitrary, fixed price levels, the script mathematically calibrates the stop-loss distance using the (ATR), ensuring parameters adapt accurately to changing market variance.
Key Mechanics:
- ATR-Based Risk: Stop loss is dynamically calculated using a user-defined ATR multiple (Wilder's RMA) from the anchored candle.
- Ratio-Based Reward: Take profit is strictly projected using a defined Risk/Reward ratio against the initial ATR risk distance.
- Auto-Directional Logic: Position direction can be manually set to Long/Short or set to "Auto," which determines the direction based on the anchored candle's polarity (Bullish = Long, Bearish = Short).
- Multi-Timeframe Integration: Allows extraction of higher timeframe ATR values to inform lower timeframe position structures.
Rather than relying on arbitrary, fixed price levels, the script mathematically calibrates the stop-loss distance using the (ATR), ensuring parameters adapt accurately to changing market variance.
Key Mechanics:
- ATR-Based Risk: Stop loss is dynamically calculated using a user-defined ATR multiple (Wilder's RMA) from the anchored candle.
- Ratio-Based Reward: Take profit is strictly projected using a defined Risk/Reward ratio against the initial ATR risk distance.
- Auto-Directional Logic: Position direction can be manually set to Long/Short or set to "Auto," which determines the direction based on the anchored candle's polarity (Bullish = Long, Bearish = Short).
- Multi-Timeframe Integration: Allows extraction of higher timeframe ATR values to inform lower timeframe position structures.
สคริปต์แบบโอเพนซอร์ส
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์แบบโอเพนซอร์ส
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน