OPEN-SOURCE SCRIPT
CHAN CRYPTO RS

🩷 ATR RS (Crypto / High-based 2.1x, Decimal Safe v2)
This indicator is designed for crypto position sizing and stop calculation using ATR-based risk management. It helps traders automatically determine the stop price, per-unit risk, and optimal position size based on a fixed risk amount in USDT.
🔧 Core Logic
ATR Length (Daily RMA) — calculates the daily Average True Range (ATR) using RMA smoothing.
ATR Multiplier (2.1× default) — defines how far the stop is placed from the daily high.
Stop Price (for Longs) = Daily High − ATR × Multiplier
Per-Unit Risk = (Entry − Stop) × Point Value
Position Size = Risk Amount ÷ Per-Unit Risk
Automatically handles decimal precision for micro-priced crypto assets (e.g., PEPE, SHIB).
Includes safeguards for minimum size and maximum position caps.
💡 Features
Uses Daily ATR without lookahead (no repainting).
Dynamically switches between current and previous ATR for stable results when the daily bar isn’t yet confirmed.
“Snap to tick” ensures stop prices align with the symbol’s tick size.
Table display summarizes ATR, stop price, per-unit risk, total risk, size, and bet amount.
Optional stop label on the chart for visual clarity.
🧮 Output Table
Metric Description
ATR(10) Daily RMA-based ATR
ATR used Chosen ATR (current or previous)
Stop Calculated stop price
Per-unit Risk per coin/unit
Risk Total risk in USDT
Size Optimal position size
Bet Total position value (Entry × Size)
🧠 Ideal For
Crypto traders who use fixed-risk ATR strategies and need precise, decimal-safe position sizing even for ultra-low-priced tokens.
This indicator is designed for crypto position sizing and stop calculation using ATR-based risk management. It helps traders automatically determine the stop price, per-unit risk, and optimal position size based on a fixed risk amount in USDT.
🔧 Core Logic
ATR Length (Daily RMA) — calculates the daily Average True Range (ATR) using RMA smoothing.
ATR Multiplier (2.1× default) — defines how far the stop is placed from the daily high.
Stop Price (for Longs) = Daily High − ATR × Multiplier
Per-Unit Risk = (Entry − Stop) × Point Value
Position Size = Risk Amount ÷ Per-Unit Risk
Automatically handles decimal precision for micro-priced crypto assets (e.g., PEPE, SHIB).
Includes safeguards for minimum size and maximum position caps.
💡 Features
Uses Daily ATR without lookahead (no repainting).
Dynamically switches between current and previous ATR for stable results when the daily bar isn’t yet confirmed.
“Snap to tick” ensures stop prices align with the symbol’s tick size.
Table display summarizes ATR, stop price, per-unit risk, total risk, size, and bet amount.
Optional stop label on the chart for visual clarity.
🧮 Output Table
Metric Description
ATR(10) Daily RMA-based ATR
ATR used Chosen ATR (current or previous)
Stop Calculated stop price
Per-unit Risk per coin/unit
Risk Total risk in USDT
Size Optimal position size
Bet Total position value (Entry × Size)
🧠 Ideal For
Crypto traders who use fixed-risk ATR strategies and need precise, decimal-safe position sizing even for ultra-low-priced tokens.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.