PROTECTED SOURCE SCRIPT
Updated Risk Manager Pro – Position Size Calculator

Description (설명문)
ENGLISH DESCRIPTION (required)
Risk Manager Pro is a professional-grade risk and position management tool designed for crypto traders who need precise control over position sizing, TP/SL targets, and partial take-profit scenarios.
Simply enter your desired Risk ($), Entry, TP, and SL, and the script automatically calculates:
Position size (Qty)
Position value ($)
Full take-profit profit
Risk/Reward ratio (R:R)
Partial TP1 & TP2 profits (optional)
Combined partial profit
Auto-adjusted decimal precision based on each symbol’s syminfo.mintick
This indicator also dynamically builds a clean table on the chart, showing only the values relevant to your setup (TP1/TP2 rows appear only when used).
Works for both long and short trades, and supports any symbol (BTC, altcoins, futures, spot, etc.)
Features
Automatic position size calculation based on Risk$
Auto TP/SL → Profit/R:R calculation
Partial Take-Profit (TP1 / TP2) with percentage control
Auto decimal formatting using format.mintick
Works on all symbols: BTC / alt / futures / spot
Clean dynamic table (no empty rows)
Perfect for traders who use position sizing and risk-based entries
🇰🇷 한국어 설명 (선택 사항)
Risk Manager Pro는 트레이더가 가장 많이 사용하는 핵심 기능들을 통합한
프로페셔널 리스크 관리 도구입니다.
리스크 금액(Risk$), 진입가(Entry), 익절(TP), 손절(SL)을 입력하면
자동으로 다음 값이 계산됩니다:
포지션 수량(코인)
포지션 크기($)
전체 익절 시 수익
손익비(R:R)
부분익절(TP1 / TP2) 수익
부분익절 합계
종목별 소수점 자리 자동 최적화(syminfo.mintick 기반)
TP1/TP2가 입력된 경우에만 해당 줄이 표시되어
표가 깔끔하게 유지됩니다.
비트코인/알트/선물/현물 모두 지원합니다.
ENGLISH DESCRIPTION (required)
Risk Manager Pro is a professional-grade risk and position management tool designed for crypto traders who need precise control over position sizing, TP/SL targets, and partial take-profit scenarios.
Simply enter your desired Risk ($), Entry, TP, and SL, and the script automatically calculates:
Position size (Qty)
Position value ($)
Full take-profit profit
Risk/Reward ratio (R:R)
Partial TP1 & TP2 profits (optional)
Combined partial profit
Auto-adjusted decimal precision based on each symbol’s syminfo.mintick
This indicator also dynamically builds a clean table on the chart, showing only the values relevant to your setup (TP1/TP2 rows appear only when used).
Works for both long and short trades, and supports any symbol (BTC, altcoins, futures, spot, etc.)
Features
Automatic position size calculation based on Risk$
Auto TP/SL → Profit/R:R calculation
Partial Take-Profit (TP1 / TP2) with percentage control
Auto decimal formatting using format.mintick
Works on all symbols: BTC / alt / futures / spot
Clean dynamic table (no empty rows)
Perfect for traders who use position sizing and risk-based entries
🇰🇷 한국어 설명 (선택 사항)
Risk Manager Pro는 트레이더가 가장 많이 사용하는 핵심 기능들을 통합한
프로페셔널 리스크 관리 도구입니다.
리스크 금액(Risk$), 진입가(Entry), 익절(TP), 손절(SL)을 입력하면
자동으로 다음 값이 계산됩니다:
포지션 수량(코인)
포지션 크기($)
전체 익절 시 수익
손익비(R:R)
부분익절(TP1 / TP2) 수익
부분익절 합계
종목별 소수점 자리 자동 최적화(syminfo.mintick 기반)
TP1/TP2가 입력된 경우에만 해당 줄이 표시되어
표가 깔끔하게 유지됩니다.
비트코인/알트/선물/현물 모두 지원합니다.
Release Notes
✅ 영문 설명 (English Description)Risk Calculator (3-Scale Entries / Weighted Average / Partial Take Profit / Position Size / R:R)
This tool is an advanced risk management calculator designed for futures and spot traders.
It allows you to easily calculate position size, weighted average entry, risk–reward ratio, and partial take-profit profits.
✨ Features
📌 1. Single Entry or 3-Scale Entry Mode
Single entry mode uses one entry price.
3-scale mode allows up to 3 different entry prices.
Weight percentages automatically normalize and calculate the correct average entry.
Invalid or zero entries are ignored automatically.
📌 2. Position Size Based on Risk ($)
Enter how much you are willing to lose.
Script calculates position size automatically.
Works for both long and short positions (auto-detected).
📌 3. Weighted Average Entry
In scale-in mode, each entry contributes to the average based on its weight.
Entry1/Entry2/Entry3 weights are dynamically normalized.
📌 4. TP1 / TP2 Partial Take Profit
Supports TP1 and TP2 partial exits.
Enter partial % and TP price → script calculates expected profit.
Shows combined partial profit.
📌 5. Clean & Dynamic Table Display
Table automatically hides empty or invalid rows.
Shows only meaningful data such as:
Total quantity
Position value
Entry prices
Average entry
TP/SL
Full take-profit
Partial take-profit
Risk–Reward ratio
📌 6. Automatic Tick Precision
Uses syminfo.mintick to format numbers according to symbol decimals
🇰🇷 한국어 설명 (Korean Description)
리스크 계산기 (3분할 / 비율 가중 / 부분 익절 / 포지션 크기 / 손익비)
선물·현물 트레이더를 위한 고급 리스크 계산 도구입니다.
리스크 기반 수량 계산, 가중 평균 진입가, 부분익절 수익, 손익비(R:R)를 자동으로 계산해줍니다.
✨ 기능 소개
📌 1. 단일 진입 또는 3분할 진입 선택 가능
단일 진입 시 엔트리 1개만 사용
3분할 모드에서는 최대 3개의 진입가 입력
비율 입력 시 자동 가중치 계산
0 또는 잘못된 진입가/비율은 자동 제외
📌 2. 리스크($) 기반 수량 계산
허용 가능한 손실 금액만 입력하면
→ 자동으로 수량이 계산됩니다.
롱·숏 방향도 익절가/진입가로 자동 판단
📌 3. 가중 평균 진입가 자동계산
1차/2차/3차 진입 비중에 따라 정확한 평균 진입가 계산
비중이 100%가 아니어도 상대 비율 유지
📌 4. 부분익절(TP1 / TP2) 지원
TP1/TP2 각각 %와 가격 입력 가능
각 부분익절 수익 + 전체 합계 표시
📌 5. 깔끔한 동적 테이블 UI
의미 없는 값은 자동으로 숨김 처리
표시 항목 예시:
총 수량
포지션 크기
1/2/3차 수량
평균 진입가
TP/SL
전체 익절 수익
부분 익절 수익
손익비(R:R)
📌 6. 코인마다 소수점 자리 자동 적용
syminfo.mintick 기반으로 티커별 자동 소수점 처리
Release Notes
Update v1.1 – Stability Fixes & Calculation ImprovementsThis update includes multiple stability fixes and improved calculation logic for the Risk Calculator indicator:
✔ Improved Long/Short Direction Detection
The direction is now correctly determined using TP > SL.
Prevented invalid direction assignment that caused NaN values in previous versions.
✔ Fixed “Average Entry Price = NaN” Issue
When using 3-scale entries with some steps disabled (0%), average entry now calculates correctly.
Fully removed cases where average entry becomes NaN even if valid entries exist.
✔ Safer Scale-In Logic
Scale-in entries with 0 price or 0% weight are now ignored properly.
Auto-normalizes weights only for active scale-in legs.
Prevents division-by-zero issues and wrong position size.
✔ Cleaner Table Rendering
Hidden rows for entries or quantities that are zero.
Prevents “ghost rows” appearing in table UI.
Ensures consistent formatting across all values.
✔ General Code Cleanup
Unified value sanitization using nz().
More stable weighting logic.
Compatible with all symbols (uses format.mintick).
This update improves reliability, precision, and UI consistency for all users who actively use scale-in trading and multi-TP setups.
🇰🇷 업데이트 내용 (한국어)
업데이트 v1.1 – 안정성 개선 & 계산 로직 개선
이번 업데이트에서는 리스크 계산기 지표의 안정성과 계산 정확도를 대폭 향상시켰습니다.
✔ 롱/숏 방향 계산 방식 개선
이제 TP > SL 기준으로 정확하게 방향을 판별합니다.
기존 버전에서 방향 계산 오류로 인해 NaN이 발생하던 문제를 해결했습니다.
✔ 평균 진입가 NaN 문제 해결
3분할 진입을 사용할 때 일부 진입가 또는 비율이 0%여도 정상적으로 평균 진입가가 계산됩니다.
유효한 진입값이 있을 때는 절대 NaN이 나오지 않도록 조치했습니다.
✔ 3분할 계산 로직 안정화
입력값이 0일 때 자동으로 제외되며, 활성화된 진입 비율만 정상적으로 가중치 계산합니다.
비율 합산이 100%가 아니어도 상대 비율로 자동 정규화됩니다.
위험 단위(risk per unit) 잘못 계산되던 이슈 제거.
✔ 테이블 UI 정리
값이 0인 항목(수량, 진입가 등)은 자동으로 숨김 처리됩니다.
화면에 불필요한 빈 줄이 나타나던 버그 제거.
모든 값이 일관된 포맷(format.mintick)으로 표시됩니다.
✔ 전체 코드 안정성 향상
nz() 기반 값 정리 일관화
가중치 및 수량 계산 구조 개선
모든 심볼에서 정상 동작하도록 최적화
Protected script
This script is published as closed-source. However, you can use it freely and without any limitations – learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Protected script
This script is published as closed-source. However, you can use it freely and without any limitations – learn more here.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.