OPEN-SOURCE SCRIPT
Position Sizer

Position Sizer is a lightweight on-chart helper that calculates the correct lot size for your trade — instantly, across
any instrument.
Set your stop-loss level by dragging the red line to your intended SL price. The table updates in real time, showing you
the exact lot size for each of your configured risk amounts.
---
How It Works
The lot size formula is fully instrument-agnostic — it uses TradingView's built-in syminfo.pointvalue and syminfo.mintick
to automatically handle the different pip/point values across Forex pairs, Gold, Oil, indices, and more. No manual pip
value lookup needed.
Lot Size = Risk Amount / (SL Distance in Ticks × Point Value per Tick)
---
How To Use
1. Add the indicator to any chart
2. Open Settings → Stop Loss and type your SL price, or drag the red line directly on the chart to your stop level
3. Read off the lot size for your chosen risk amount from the table
---
Table Layout
The table shows an info header and 5 data rows:
- Info header — instrument, current entry price, SL level, SL distance, account size, and your risk threshold dollar
amount
- Data rows — Risk ($) · SL pts · Lot Size
- The row closest to your Risk Per Trade % threshold is highlighted in gold as a reminder of your max risk
---
Settings
- SL Price — drag the line on the chart or type a price directly
- Account Size ($) — your total account value
- Risk Per Trade (%) — your risk threshold (default 2%). The closest row is highlighted in gold
- Risk Rows 1–5 ($) — five configurable dollar risk amounts (default: $25 / $50 / $100 / $200 / $500)
- Table Position — Top Left / Top Right / Bottom Left / Bottom Right
---
Edge Cases
- No SL set → shows Set SL
- SL within 2 ticks of entry → shows SL too close
- Unsupported symbol → shows N/A symbol
- Valid position too small to display → shows < 0.01
- Works for both long and short setups
---
Tested on: EURUSD · XAUUSD · XTIUSD · USDJPY
---
This tool assists with position sizing calculations. It does not constitute financial advice. Always verify lot sizes with your broker before placing orders.
any instrument.
Set your stop-loss level by dragging the red line to your intended SL price. The table updates in real time, showing you
the exact lot size for each of your configured risk amounts.
---
How It Works
The lot size formula is fully instrument-agnostic — it uses TradingView's built-in syminfo.pointvalue and syminfo.mintick
to automatically handle the different pip/point values across Forex pairs, Gold, Oil, indices, and more. No manual pip
value lookup needed.
Lot Size = Risk Amount / (SL Distance in Ticks × Point Value per Tick)
---
How To Use
1. Add the indicator to any chart
2. Open Settings → Stop Loss and type your SL price, or drag the red line directly on the chart to your stop level
3. Read off the lot size for your chosen risk amount from the table
---
Table Layout
The table shows an info header and 5 data rows:
- Info header — instrument, current entry price, SL level, SL distance, account size, and your risk threshold dollar
amount
- Data rows — Risk ($) · SL pts · Lot Size
- The row closest to your Risk Per Trade % threshold is highlighted in gold as a reminder of your max risk
---
Settings
- SL Price — drag the line on the chart or type a price directly
- Account Size ($) — your total account value
- Risk Per Trade (%) — your risk threshold (default 2%). The closest row is highlighted in gold
- Risk Rows 1–5 ($) — five configurable dollar risk amounts (default: $25 / $50 / $100 / $200 / $500)
- Table Position — Top Left / Top Right / Bottom Left / Bottom Right
---
Edge Cases
- No SL set → shows Set SL
- SL within 2 ticks of entry → shows SL too close
- Unsupported symbol → shows N/A symbol
- Valid position too small to display → shows < 0.01
- Works for both long and short setups
---
Tested on: EURUSD · XAUUSD · XTIUSD · USDJPY
---
This tool assists with position sizing calculations. It does not constitute financial advice. Always verify lot sizes with your broker before placing orders.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.