OPEN-SOURCE SCRIPT
Cập nhật Leverage Vortex v6 @greenyyp

The Leverage Vortex Coin-M v6 is not a traditional signal indicator; it is a high-end trade management and visualization tool. It is specifically designed for Crypto Futures traders (Inverse/Coin-M contracts) to provide full control over positions, risks, and liquidations directly on the chart.
Key Features:
Dual Position Tracking: Monitor Long and Short positions simultaneously. Simply input your entry price and position size (in coins).
Precise Calculations:
Break-Even: Calculates the exact BE price, accounting for both Maker and Taker fees.
Exchange Sync: Uses Maintenance Margin Rate (MMR) and an adjustable "LIQ Buffer" to perfectly match the liquidation price of your exchange (Binance, Bybit, etc.).
Real-Time Dashboard: An info box at the bottom-left displays your live PnL (USD & %), total combined PnL, and distance to the ATH (All-Time High).
Visual Feedback:
Traffic Light System: Emojis (🟢, 🟡, 🔴, 💀) provide instant status updates for your profit targets and risk levels.
Liquidation Heat Warning: The LIQ line dynamically changes color (turning bright red) as the price approaches your liquidation point.
Smart Alerts: Notifications for all levels (TP, SL, BE, LIQ) and a customizable Early Warning alert that triggers before liquidation occurs.
Note: Due to TradingView platform limitations, alerts must be re-created or edited after changing any input settings to remain accurate.
Key Features:
Dual Position Tracking: Monitor Long and Short positions simultaneously. Simply input your entry price and position size (in coins).
Precise Calculations:
Break-Even: Calculates the exact BE price, accounting for both Maker and Taker fees.
Exchange Sync: Uses Maintenance Margin Rate (MMR) and an adjustable "LIQ Buffer" to perfectly match the liquidation price of your exchange (Binance, Bybit, etc.).
Real-Time Dashboard: An info box at the bottom-left displays your live PnL (USD & %), total combined PnL, and distance to the ATH (All-Time High).
Visual Feedback:
Traffic Light System: Emojis (🟢, 🟡, 🔴, 💀) provide instant status updates for your profit targets and risk levels.
Liquidation Heat Warning: The LIQ line dynamically changes color (turning bright red) as the price approaches your liquidation point.
Smart Alerts: Notifications for all levels (TP, SL, BE, LIQ) and a customizable Early Warning alert that triggers before liquidation occurs.
Note: Due to TradingView platform limitations, alerts must be re-created or edited after changing any input settings to remain accurate.
Phát hành các Ghi chú
# 🌀 Leverage Vortex Coin-M v7 — Changelog---
## English
### ✅ New Features
**📈📉 Long / Short independently toggleable**
In v6, both sides were always active. In v7, Long and Short can each be enabled or disabled independently.
**🔵🟠 DCA / Cost Averaging System**
Up to 2 DCA entries per side (Long & Short). The weighted average entry and total margin are recalculated automatically. Alerts fire automatically when a DCA level is reached.
**📐 Pivot Points**
Daily and Weekly High/Low reference lines on the chart and in the info box — toggleable.
**👑 ATH Toggle**
The ATH line and info box row can now be turned on and off independently.
**🎨 Theme System (Light / Dark)**
Separate themes for chart labels and the info box. Perfect for light chart backgrounds.
**📦 Info Box: Position & Font Size**
Info box position freely selectable (9 positions). Font size is also configurable.
**💵 Margin in the Info Box**
Displays the deposited margin in USD and the coin count directly in the info box.
**⛔ SL in the Info Box**
Stop Loss can now optionally be shown as its own row in the info box — independent of the chart display toggle.
### 🔧 Improvements
**⚖️ Break-Even Calculation Fixed**
In v6, BE was calculated without leverage adjustment. Now: `Entry ± Fee / Leverage` — at x5 leverage you only need 1/5 of the price movement to be fee-neutral.
**🚨 LIQ Buffer: Negative Values Supported**
The LIQ buffer now accepts negative values for exchange-specific fine-tuning.
**🔔 Master Alert Instead of 19 Individual Alerts**
In v6, a separate alert had to be created for each condition. In v7, a single alert on `alert() function calls` covers everything — the message tells you exactly which level was hit.
**🎨 Automatic Level Color Gradients**
In v6, every level color had to be set manually. In v7, colors are calculated automatically as a gradient — from light green/red (small %) to deep green/dark red (larger %).
**📦 Info Box Row Order Optimized**
New logical order: Margin → SL → Entry → BE → PnL → Total → Levels → TP → LIQ
**🏷️ Configured % Visible in Labels and Info Box**
In v6, labels only showed the current distance from price. In v7, the configured target % is also visible directly in the label and info box.
Phát hành các Ghi chú
## 📋 Leverage Vortex – Changelog v7 → v8---
### 🏗️ Architecture
- All position lines are now drawn via `line.new()` instead of `plot()` – saves plot series and enables dynamic line management
- New central **🔧 Indicators** block with master toggles for VWAP, Bollinger Bands and Pivot Points
- Labels and lines now also update on the **current live candle** (`barstate.isrealtime`)
- Level colors changed from `color.from_gradient()` to fixed stepped colors (fixes plot limit issues)
### ✨ New
- **VWAP** completely reworked: **Day**, **Week**, **Month**, **Year**, **ATH-VWAP**, **ATL-VWAP** and **Swing Markers** (◆) as AVWAP anchor points
- **Pivot Points** extended with **Month** and **Year**
- **Bollinger Bands** added (length, multiplier, colors, fill)
- **ATH line** as a dashed line on the chart
- **Info-Box** with new toggle options: Entry, LIQ and ATH banner individually show/hide
- More indicators coming in future updates 🚀
### 🔧 Improvements
- **Stop Loss** sign logic corrected: negative value = SL against the position (more intuitive)
- **LIQ Early Alert** now fires only once when crossing the threshold (via `ta.crossunder`) instead of every bar – default raised from 5% to **10%**
- **Info-Box** position, size and theme consolidated into one inline row
### 📌 Note
This is the last update for **Leverage Vortex v6**. Since the script name cannot be changed retroactively on TradingView, all future updates and new indicators will be published exclusively in the new script **"Leverage Vortex"**.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.