OPEN-SOURCE SCRIPT
Yuki Leverage RR Calculator

**YUKI LEVERAGE RR CALCULATOR**
A professional-grade risk/reward calculator for leveraged crypto or forex trades.
Instantly visualizes entry, stop loss, targets, leverage, and risk-to-reward ratios — helping you plan precise positions with confidence.
──────────────────────────────
**WHAT IT DOES**
Calculates position value, quantity, stop-loss price, liquidation estimate, and per-target profit.
Displays everything in an on-chart table with optional price tags and alerts.
──────────────────────────────
**KEY FEATURES**
• Long / Short toggle (only one active at a time)
• Leverage-aware position sizing based on Position Cost ($) and Leverage
• Dynamic Stop Loss: input % → auto price + $ risk
• Up to 3 Take-Profit Targets with scaling logic
• Instant R:R ratios per target
• Liquidation estimate (approximation only)
• ENTRY / SL / T1 / T2 / T3 / LIQ visual tags
• Dark/Light mode, adjustable table and tag size
• Built-in alerts for Targets and Stop Loss
──────────────────────────────
**INPUTS**
• Long or Short selection
• Entry Price, Stop Loss %
• Target 1 / Target 2 / Target 3 + Take Profit %
• Position Cost ($), Leverage
• Visual preferences: show/hide table, table corner, font size, tag offset, text size
──────────────────────────────
**TABLE OUTPUTS**
Position Info: Type, Entry, Position Cost, Leverage, Value
Risk Section: Stop Loss %, Stop Loss Price, Total Risk ($), Liquidation % & Price
Targets 1–3: Profit ($), R:R, Take Profit ($), Runner % or PnL
──────────────────────────────
**ALERTS**
• Target 1 Hit – when price crosses T1
• Target 2 Hit – when price crosses T2
• Target 3 Hit – when price crosses T3
• Stop Loss Hit – triggers based on direction
(Use TradingView Alerts → Condition → Indicator → select desired alert)
──────────────────────────────
**HOW TO USE**
1. Choose Long or Short
2. Enter Entry Price, Stop Loss %, Position Cost, and Leverage
3. Add Targets 1–3 with optional Take Profit %
4. Adjust visuals as desired
5. Monitor table + alerts for live trade planning
──────────────────────────────
**NOTES**
• Liquidation values are estimates only
• Fees, slippage, and funding not included
• Designed for educational and planning purposes
──────────────────────────────
⚠️ **DISCLAIMER**
For educational use only — not financial advice.
Trading leveraged products involves high risk of loss.
Always confirm calculations with your exchange and trade responsibly.
A professional-grade risk/reward calculator for leveraged crypto or forex trades.
Instantly visualizes entry, stop loss, targets, leverage, and risk-to-reward ratios — helping you plan precise positions with confidence.
──────────────────────────────
**WHAT IT DOES**
Calculates position value, quantity, stop-loss price, liquidation estimate, and per-target profit.
Displays everything in an on-chart table with optional price tags and alerts.
──────────────────────────────
**KEY FEATURES**
• Long / Short toggle (only one active at a time)
• Leverage-aware position sizing based on Position Cost ($) and Leverage
• Dynamic Stop Loss: input % → auto price + $ risk
• Up to 3 Take-Profit Targets with scaling logic
• Instant R:R ratios per target
• Liquidation estimate (approximation only)
• ENTRY / SL / T1 / T2 / T3 / LIQ visual tags
• Dark/Light mode, adjustable table and tag size
• Built-in alerts for Targets and Stop Loss
──────────────────────────────
**INPUTS**
• Long or Short selection
• Entry Price, Stop Loss %
• Target 1 / Target 2 / Target 3 + Take Profit %
• Position Cost ($), Leverage
• Visual preferences: show/hide table, table corner, font size, tag offset, text size
──────────────────────────────
**TABLE OUTPUTS**
Position Info: Type, Entry, Position Cost, Leverage, Value
Risk Section: Stop Loss %, Stop Loss Price, Total Risk ($), Liquidation % & Price
Targets 1–3: Profit ($), R:R, Take Profit ($), Runner % or PnL
──────────────────────────────
**ALERTS**
• Target 1 Hit – when price crosses T1
• Target 2 Hit – when price crosses T2
• Target 3 Hit – when price crosses T3
• Stop Loss Hit – triggers based on direction
(Use TradingView Alerts → Condition → Indicator → select desired alert)
──────────────────────────────
**HOW TO USE**
1. Choose Long or Short
2. Enter Entry Price, Stop Loss %, Position Cost, and Leverage
3. Add Targets 1–3 with optional Take Profit %
4. Adjust visuals as desired
5. Monitor table + alerts for live trade planning
──────────────────────────────
**NOTES**
• Liquidation values are estimates only
• Fees, slippage, and funding not included
• Designed for educational and planning purposes
──────────────────────────────
⚠️ **DISCLAIMER**
For educational use only — not financial advice.
Trading leveraged products involves high risk of loss.
Always confirm calculations with your exchange and trade responsibly.
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้มันเป็นโอเพ่นซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันการทำงานของสคริปต์ได้ ขอแสดงความชื่นชมผู้เขียน! แม้ว่าคุณจะสามารถใช้งานได้ฟรี แต่อย่าลืมว่าการเผยแพร่โค้ดซ้ำนั้นจะต้องเป็นไปตามกฎระเบียบการใช้งานของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้มันเป็นโอเพ่นซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันการทำงานของสคริปต์ได้ ขอแสดงความชื่นชมผู้เขียน! แม้ว่าคุณจะสามารถใช้งานได้ฟรี แต่อย่าลืมว่าการเผยแพร่โค้ดซ้ำนั้นจะต้องเป็นไปตามกฎระเบียบการใช้งานของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน