OPEN-SOURCE SCRIPT
已更新 TP/SL Percentage & RR Visual Tool

This tool is designed to help traders visually and statistically assess their trade setup by calculating Stop Loss (SL), Take Profit (TP), and Risk-to-Reward (RR) based on percentage inputs from the current price.
🔧 How It Works:
Uses the current candle’s close price as your entry.
Calculates TP and SL as percentage-based levels (e.g., 1% SL, 1.5% TP).
Displays horizontal lines and labels on the chart for TP and SL (only on the latest candle to reduce clutter).
Shows a compact table in the top-right corner with all key values:
Entry Price
Current Price
TP Price (+%)
SL Price (-%)
TP Distance from current price
RR Ratio (e.g., 1:1.5)
💡 Use Cases:
Quickly validate if a trade setup meets your desired RR profile (e.g., 1:2).
Perfect for scalpers, swing traders, and position traders who rely on structured risk management.
Combine with your entry signal strategy to visualize targets and stops without manual calculations.
⚙️ Inputs:
Stop Loss % – Sets how far your SL is from the entry.
Take Profit % – Sets how far your TP is from the entry.
🔧 How It Works:
Uses the current candle’s close price as your entry.
Calculates TP and SL as percentage-based levels (e.g., 1% SL, 1.5% TP).
Displays horizontal lines and labels on the chart for TP and SL (only on the latest candle to reduce clutter).
Shows a compact table in the top-right corner with all key values:
Entry Price
Current Price
TP Price (+%)
SL Price (-%)
TP Distance from current price
RR Ratio (e.g., 1:1.5)
💡 Use Cases:
Quickly validate if a trade setup meets your desired RR profile (e.g., 1:2).
Perfect for scalpers, swing traders, and position traders who rely on structured risk management.
Combine with your entry signal strategy to visualize targets and stops without manual calculations.
⚙️ Inputs:
Stop Loss % – Sets how far your SL is from the entry.
Take Profit % – Sets how far your TP is from the entry.
版本注释
📌 TP/SL Percentage & RR Visual Tool + UT Bot + Session OverlaysThis all-in-one indicator is designed to help traders visualize risk-reward targets, confirm entry signals, and trade with greater context awareness using multi-timeframe trend analysis.
✅ Features
🔔 UT Bot Alerts
Generates Buy/Sell signals using the UT Bot algorithm, which reacts to price action and volatility shifts. Ideal for scalping or intraday swing trades.
🎯 Dynamic TP/SL Levels
Automatically calculates and plots Take Profit and Stop Loss lines based on user-defined percentages. Supports 3 TP levels and their corresponding SL zones.
📊 Volatility Meter
Uses ATR vs ATR-SMA to determine whether the market is experiencing high or low volatility conditions.
📈 Trend Strength
Detects trend direction using 20 EMA vs 50 EMA. Also includes a visual table showing trend across 5m, 15m, 1H, 4H, and Daily timeframes.
📋 Unified Trading Dashboard
A clean, fixed-position table shows entry price, TP/SL targets, trend conditions, volatility status, change since last signal, and session-based trend breakdown.
📊 EMA Overlays
Optional 20/50/100/200 EMA visualizations to support trend-based entries and exits.
🧠 Strategy Concept
This tool is designed to reduce decision fatigue by combining:
Entry Logic (UT Bot signals)
Risk Management (TP/SL lines and RR visualization)
Market Context (Trend strength, volatility)
All components work together to give traders a full-scope view of when to enter, where to place stops/targets, and how conditions vary across timeframes.
🧪 Best Timeframes & Assets
Recommended on: 5m, 15m, 1H, 4H
Works well with: BTC, ETH, EUR/USD, NASDAQ, S&P 500
📋 Credits
UT Bot Algorithm Logic: adapted from [QuantNomad]
TP/SL + RR Visual concept: built upon open-source community code, significantly restructured
⚠️ How to Use
Wait for a Buy/Sell signal from UT Bot
Check if trend conditions (EMA + table) align
Observe the volatility meter for favorable conditions
Use the plotted TP/SL lines for precise risk management
Monitor session timing boxes to avoid low-volume periods
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。