OPEN-SOURCE SCRIPT
Calculateur de Lot Interactif

By Yassine
Maximize your trading discipline and eliminate manual math with this professional-grade, interactive risk calculator built entirely in Pine Script v6.
Stop over-leveraging or guessing your lot sizes. With just two clicks directly on your chart, this indicator instantly calculates your exact position size, projects partial take profits, factors in broker commissions, and runs real-time margin diagnostics.
Key Features
🎯 100% Interactive (2-Click Setup): Simply click your Entry Price (EP) and Stop Loss (SL) directly on the screen. Drag the anchor points to adjust your trade in real-time.
📊 Multi-Asset Smart Detection: Automatically detects whether you are trading Forex (Lots), Gold / XAUUSD (Standard MT contracts), Indices/CFDs (Contracts), or Crypto/Stocks (Units), applying the exact contract specifications for flawless math.
💸 Smart Commission Deduction: Enter your broker's commission per lot, and the script automatically downscales your position size. This ensures your maximum loss (SL + Fees) remains strictly at your defined risk percentage (e.g., exactly $500 on a $50k account).
📈 Multi-Stage Take Profits (TP1 & TP2): * TP1: Set a custom RR ratio (e.g., 1:1) and define the % of the position you want to close (e.g., 50% to secure the trade).
TP2: Define your final target.
The dashboard calculates the exact price levels and potential cash gains for each stage.
⚠️ Margin & Leverage Diagnostic: Enter your account’s maximum leverage. The script checks the nominal value of your trade and flashes a red alert (⚠️ INSUFFICIENT LEVERAGE) if the required margin exceeds your available capital.
⚡ Pine Script v6 Optimized: Clean, modern code using persistent variables to prevent chart lag, flickering, and memory leaks.
Maximize your trading discipline and eliminate manual math with this professional-grade, interactive risk calculator built entirely in Pine Script v6.
Stop over-leveraging or guessing your lot sizes. With just two clicks directly on your chart, this indicator instantly calculates your exact position size, projects partial take profits, factors in broker commissions, and runs real-time margin diagnostics.
Key Features
🎯 100% Interactive (2-Click Setup): Simply click your Entry Price (EP) and Stop Loss (SL) directly on the screen. Drag the anchor points to adjust your trade in real-time.
📊 Multi-Asset Smart Detection: Automatically detects whether you are trading Forex (Lots), Gold / XAUUSD (Standard MT contracts), Indices/CFDs (Contracts), or Crypto/Stocks (Units), applying the exact contract specifications for flawless math.
💸 Smart Commission Deduction: Enter your broker's commission per lot, and the script automatically downscales your position size. This ensures your maximum loss (SL + Fees) remains strictly at your defined risk percentage (e.g., exactly $500 on a $50k account).
📈 Multi-Stage Take Profits (TP1 & TP2): * TP1: Set a custom RR ratio (e.g., 1:1) and define the % of the position you want to close (e.g., 50% to secure the trade).
TP2: Define your final target.
The dashboard calculates the exact price levels and potential cash gains for each stage.
⚠️ Margin & Leverage Diagnostic: Enter your account’s maximum leverage. The script checks the nominal value of your trade and flashes a red alert (⚠️ INSUFFICIENT LEVERAGE) if the required margin exceeds your available capital.
⚡ Pine Script v6 Optimized: Clean, modern code using persistent variables to prevent chart lag, flickering, and memory leaks.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。