OPEN-SOURCE SCRIPT

Calculateur de Lot Interactif

140
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.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.