PINE LIBRARY
delta_leverage_lib

🚀 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)
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)
Thư viện Pine
Theo tinh thần TradingView thực sự, tác giả đã xuất bản mã Pine này dưới dạng thư viện nguồn mở để các lập trình viên Pine khác trong cộng đồng của chúng tôi có thể sử dụng lại. Xin tri ân tác giả! Bạn có thể sử dụng thư viện này riêng tư hoặc trong các bài đăng nguồn mở khác. Tuy nhiên, bạn cần sử dụng lại mã này theo Nội quy chung.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Thư viện Pine
Theo tinh thần TradingView thực sự, tác giả đã xuất bản mã Pine này dưới dạng thư viện nguồn mở để các lập trình viên Pine khác trong cộng đồng của chúng tôi có thể sử dụng lại. Xin tri ân tác giả! Bạn có thể sử dụng thư viện này riêng tư hoặc trong các bài đăng nguồn mở khác. Tuy nhiên, bạn cần sử dụng lại mã này theo Nội quy chung.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.