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.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que cualquier republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.