OPEN-SOURCE SCRIPT

Lot Size Table

407
Lot Size Table Indicator – Pine Script (v5)
This TradingView script, “Lot Size Table,” creates a dynamic on-chart table that helps forex traders quickly calculate position sizes (lot sizes) for different capital and risk settings across various stop-loss (SL) pip scenarios.

🔧 Key Features:
📊 Real-time Forex Price Integration
Retrieves daily forex prices from OANDA for accurate lot size adjustments.

Instruments supported: USDJPY, USDCHF, AUDUSD, GBPUSD, NZDUSD, USDCAD, EURUSD.

🧠 Smart Lot Size Adjustments
Custom function adjustLotSize() adjusts lot sizes based on:

The currency of the instrument (e.g., JPY, GBP, AUD, etc.).

Special multiplier for symbols like US30 (e.g., ×8.5).

🧾 Flexible Capital & Risk Inputs
Supports 3 customizable capital groups, each with its own:

Capital amount

Risk percentage

📉 Multiple Stop-Loss (SL) Scenarios
Users input a comma-separated list of SL pip values (e.g., "20,25,30,...").

For each SL value, lot sizes are calculated for all 3 capital/risk combinations.

📋 Formatted On-Chart Table
Displays in a user-selected corner of the chart.

Customizable size, background color, and border.

Header row includes capital values and risk % (formatted to "k" if over 1,000).

Remaining rows show calculated lot sizes for each SL pip value.

📐 How It Works:
User Inputs: Capital, risk %, SL pip list, and table styling.

Calculation:

Lot size = (capital × risk%) / (SL pips × 10)

Adjusted based on instrument’s currency.

Display:

Table shows all SL pip scenarios and the corresponding adjusted lot sizes for each capital group.

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.