PINE LIBRARY

delta_leverage_lib

37
🚀 Delta Leverage Library - Exchange Max Leverage Data

Comprehensive Pine v6 library providing maximum leverage data for USDT perpetual contracts across major exchanges. Recently optimized with exchange-specific functions for better performance.

📊 Coverage & Stats
• 2,357 symbols across 6 exchanges
• BINANCE: 533 symbols (BTC/ETH: 125x)
• BITGET: 551 symbols (BTC: 125x, ETH: 100x)
• BYBIT: 441 symbols (BTC/ETH: 100x)
• KUCOIN: 478 symbols (ETH: 100x)
• OKX: 244 symbols (BTC/ETH: 100x)
• BITMEX: 110 symbols (BTC/ETH: 100x)

⚡ Core Functions
get_max_leverage(exchangePrefix, tvTicker) - Main lookup function
get_max_leverage_for_chart() - Current chart leverage
get_max_leverage_or_default(exchange, ticker, defaultLev) - With fallback

💡 Usage Examples
// Get leverage for current chart
leverage = get_max_leverage_for_chart()

// Get specific exchange/ticker
binanceBTC = get_max_leverage("BINANCE", "BTCUSDT.P")

// With fallback default
leverage = get_max_leverage_or_default("BYBIT", "ETHUSDT.P", 50)


🔧 Technical Details
• Auto-generated from live exchange APIs
• Exchange-specific functions for optimal performance
• Switch-based dispatcher for efficient lookups
• Supports only USDT perpetuals (.P suffix)
• Realistic leverage tiers based on market categories

📈 Data Sources
• Binance: Realistic tiers (Major coins 125x, memes 10x)
• Bybit/Bitget/KuCoin/OKX: Live API leverage filters
• BitMEX: Conservative defaults for USDT contracts

⚙️ Maintenance
Data refreshes via Python generator script with exchange API polling. Some exchanges use tiered leverage - we return maximum available at minimum notional size.

Recent Updates
• Fixed Pine Script compilation errors via function splitting
• Improved performance with exchange-specific lookup functions
• Enhanced Python generator with debug mode and statistics
</parameter>

This updated description:

1. **Reflects recent improvements**: Mentions the function splitting optimization that fixed compilation errors
2. **Provides accurate statistics**: Shows the current 2,357 symbols across 6 exchanges
3. **Better organized**: Uses clear sections with emojis for visual appeal
4. **Technical transparency**: Explains the switch-based dispatcher and exchange-specific functions
5. **Practical usage**: Shows realistic code examples
6. **TradingView compatible**: Uses only supported BBCode tags (, ) and emojis for formatting

The description now accurately represents the current state of the library after our optimization work while maintaining clarity for TradingView users.



get_max_leverage_binance(tvTicker)
  Parameters:
    tvTicker (string)

get_max_leverage_bitget(tvTicker)
  Parameters:
    tvTicker (string)

get_max_leverage_bitmex(tvTicker)
  Parameters:
    tvTicker (string)

get_max_leverage_bybit(tvTicker)
  Parameters:
    tvTicker (string)

get_max_leverage_kucoin(tvTicker)
  Parameters:
    tvTicker (string)

get_max_leverage_okx(tvTicker)
  Parameters:
    tvTicker (string)

get_max_leverage(exchangePrefix, tvTicker)
  Parameters:
    exchangePrefix (string)
    tvTicker (string)

get_max_leverage_for_chart()

get_max_leverage_or_default(exchangePrefix, tvTicker, defaultLev)
  Parameters:
    exchangePrefix (string)
    tvTicker (string)
    defaultLev (int)

Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.