OPEN-SOURCE SCRIPT
Custom Position Size Calculator (v2)

Custom Position Size Calculator (v2)
Simple and accurate position size calculator for discretionary traders.
Just enter your account size, risk %, pip value, TP and SL in pips — and it instantly shows:
• Exact lot size based on your risk
• Risk/Reward ratio
• Potential profit
• How much you’re actually risking in money
• The win rate you need just to break even
Works on basically any instrument. Just set the correct pip value (most USD pairs = 10, Gold = 1, etc.).
Everything updates live as soon as you change an input. No need to leave the chart or open some external calculator.
Quick guide:
1. Put in your account size
2. Choose how much % you’re willing to risk (e.g. 0.5–1%)
3. Set the pip value of the instrument you’re trading
4. Enter your TP and SL in pips (e.g. use the TradingView position tool)
That’s it. It does the rest.
Useful whether you’re just starting out and want to size trades properly, or you’ve been trading for years and just want something fast and clean on the chart.
Simple and accurate position size calculator for discretionary traders.
Just enter your account size, risk %, pip value, TP and SL in pips — and it instantly shows:
• Exact lot size based on your risk
• Risk/Reward ratio
• Potential profit
• How much you’re actually risking in money
• The win rate you need just to break even
Works on basically any instrument. Just set the correct pip value (most USD pairs = 10, Gold = 1, etc.).
Everything updates live as soon as you change an input. No need to leave the chart or open some external calculator.
Quick guide:
1. Put in your account size
2. Choose how much % you’re willing to risk (e.g. 0.5–1%)
3. Set the pip value of the instrument you’re trading
4. Enter your TP and SL in pips (e.g. use the TradingView position tool)
That’s it. It does the rest.
Useful whether you’re just starting out and want to size trades properly, or you’ve been trading for years and just want something fast and clean on the chart.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
نص برمجي مفتوح المصدر
بروح TradingView الحقيقية، قام مبتكر هذا النص البرمجي بجعله مفتوح المصدر، بحيث يمكن للمتداولين مراجعة وظائفه والتحقق منها. شكرا للمؤلف! بينما يمكنك استخدامه مجانًا، تذكر أن إعادة نشر الكود يخضع لقواعد الموقع الخاصة بنا.
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.