OPEN-SOURCE SCRIPT
更新済

Leverage Vortex @greenyyp

764
## 📊 Leverage Vortex – Script Overview

**Leverage Vortex** is a TradingView indicator for futures traders using leverage. It visualizes long and short positions with all important levels directly on the chart and automatically calculates margin, PnL, break-even and liquidation.

---

### 📈📉 Positions & Levels

- Long & short manageable simultaneously
- Entry, take profit, stop loss, break-even and liquidation as lines on the chart
- Up to **2 DCA entries** per side with automatically calculated average entry
- Up to **3 freely configurable ROI levels** per side (e.g. +5%, +15%, +30%)

### 🧪 Leverage, LIQ & Fee

- Individual leverage for long and short
- Automatic **liquidation calculation** (isolated mode) with adjustable buffer
- **LIQ early alert** – notification before price reaches liquidation
- Maker & taker fee included in break-even calculation

### 📦 Info-Box

- Compact overview with margin, entry, PnL, TP, SL, BE and LIQ
- Unrealized **PnL in % and USD** – updated live
- **Total PnL** combined across both positions
- Position, size and theme freely configurable

### 🔔 Alerts

- **One single master alert** for all levels – no multiple alerts needed
- Alerts for: LIQ, LIQ proximity, TP, SL, BE, all ROI levels and DCA entries
- Dynamic alert messages with current price

### 〽️ VWAP

- Session VWAP for **day, week, month and year**
- **ATH-VWAP** and **ATL-VWAP**
- **Swing markers** (◆) at significant highs and lows as AVWAP anchor points

### 〰️ Bollinger Bands

- Classic Bollinger Bands with configurable length, multiplier and fill

### 📐 Pivot Points

- Previous high & low for **day, week, month and year**

---

*All indicators are toggleable via master switches. More indicators coming in future updates.*
リリースノート
# Leverage Vortex 9 GreenyyP

---

### 📊 NEW: Volume Profile Visible Range (VPVR)
The biggest new feature – built directly into the indicator, no separate tool needed.

- **POC** (Point of Control) – the price row with the highest volume, displayed as a line across the entire chart
- **Value Area** (VAH / VAL) – the price range containing ~70% of total volume
- **Bull/Bear coloring** – green bars for rising candles, red for falling; or neutral mode
- **Smart auto bar count** per timeframe (0 = automatic):
- Small TFs (1min–12h): local profile, Free plan compatible (max. 1,500 bars)
- Large TFs (Day/Week/Month): ~2 years each for direct comparability
- **Freely positionable** – left or right, with adjustable offset

---

### 🎛️ Completely Redesigned Settings Panel

In V8, leverage, fees, LIQ settings and levels were all mixed into a single group. V9 brings clear separation:

- **Leverage directly in the Long/Short group** – inline next to "active", no separate leverage menu anymore
- **Fees as a dedicated group** – MMR, Maker and Taker summarized in one line
- **Liquidation as a dedicated group** – buffer, early warning and proximity thresholds clearly separated
- **Inline layout** – Entry + Coins, TP, SL, Levels (L1/L2/L3) each on one line
- **DCA directly in the Long/Short group** – no separate DCA menu anymore
- **Adjustable label size** – Small / Normal / Large (fixed in V8)
- **41 tooltips** – most fields had no explanation in V8

---

### ⚙️ New & Improved Features

**TP/SL price or % mode** *(new in V9)*
TP and SL can now be entered either as an absolute price or as a leverage-adjusted percentage. In V8, TP was always a fixed price and SL always a fixed percentage with no way to switch.

**TP/SL disabled by default** *(changed)*
In V8, TP and SL lines were always visible. In V9 both have their own checkbox – the chart stays clean until you need them.

**Adjustable LIQ proximity thresholds** *(new in V9)*
The emoji display (⚪🟡🔴💀) for LIQ proximity is now fully configurable. In V8 the thresholds were hardcoded at 10% / 25% / 75%.

**Pivot label format** *(changed)*
V8 showed "Daily High / Daily Low" as plain text. V9 uses the compact format PP-DH / PP-DL / PP-WH / PP-WL etc. – the timeframe is immediately clear at a glance.

---

### 🐛 Bugfixes

- **Alert bug fixed**: `cond_ltp` was incorrectly using `show_tp` (global toggle) in V8. In V9 it correctly checks `show_long_tp` (Long-specific checkbox).
- **Same fix for `cond_stp`**: now checks `show_short_tp` instead of the global toggle.

---

### 🧹 Code Quality

- Removed dead variables and duplicates (`color_liq`, `show_ib_sl`, `master_savwap`)
- Consistent comment structure with `════` / `────` dividers throughout
- Added `max_boxes_count=500` (required for VPVR)
- Pine Script v6 – no warnings

---

### 📋 Comparison V8 → V9

| Feature | V8 | V9 |
|---|---|---|
| Long/Short positions | ✅ | ✅ |
| DCA (2x Long, 2x Short) | ✅ | ✅ |
| Leverage-adjusted LIQ | ✅ | ✅ |
| LIQ proximity emojis | ✅ fixed | ✅ configurable |
| LIQ early warning | ✅ | ✅ |
| Break-Even | ✅ | ✅ |
| TP as price | ✅ | ✅ |
| SL as % | ✅ | ✅ |
| TP/SL switchable (% or price) | ❌ | ✅ new |
| TP/SL own checkbox | ❌ | ✅ new |
| VWAP (session) | ✅ | ✅ |
| ATH/ATL-VWAP | ✅ | ✅ |
| Swing markers | ✅ | ✅ |
| Bollinger Bands | ✅ | ✅ |
| Pivot points | ✅ | ✅ |
| Pivot label format (PP-DH) | ❌ | ✅ new |
| Volume Profile (VPVR) | ❌ | ✅ new |
| Adjustable label size | ❌ | ✅ new |
| Leverage inline with Long/Short | ❌ | ✅ new |
| Fees as dedicated group | ❌ | ✅ new |
| LIQ as dedicated group | ❌ | ✅ new |
| Alert bug fixed | ❌ | ✅ fixed |
| 41 tooltips | ❌ | ✅ new |

---

### 💬 Feedback & Feature Requests

All feedback is very welcome! 🙏

Found a bug or something behaving unexpectedly? Drop it in the comments – I'm grateful for every report and will try to fix issues as quickly as possible.

Feature requests are welcome too. If you have an idea that would make the indicator more useful for you, just write it down – I'm open to suggestions and will do my best to implement what makes sense.

---

*Leverage Vortex 9 GreenyyP – built for futures & margin trading*
リリースノート
### 🆕 New Features

**🔀 Mode Switcher**
New quick-toggle with 3 modes:
• 🔀 All → everything visible as individually configured
• 💼 Trading → trading lines & info box only, indicators hidden
• 📊 Analysis → chart indicators only, trading lines & info box hidden

**🎯 Structure Markers (replaces Swing Markers)**
Completely new TF-adaptive pivot system:
• 2-stage: Pending (early indicator) + Confirmed (validated with volume/ATR filter)
• Automatic adjustment for every timeframe (1m → 1M+)
• Custom colors for high, low & pending — all on one settings row

**🌀 Auto-Fibonacci with Extensions**
Automatic retracement & extension based on confirmed structure markers:
• Retracement: 0, 0.236, 0.382, 0.5, 0.618, 0.786, 1
• Extensions: 1.272, 1.618
• Individual colors per level, 2 rows in settings (retracement + extensions)

**⛔ SL Alerts**
Stop-loss alerts added for long & short — only fire when SL is enabled.

### 🔧 Improvements

**📏 Master Switch Consistency**
Line & label master switches now correctly control all elements:
• VPVR POC/VAH/VAL lines respect the line master
• Fib & VWAP: cleanup system prevents ghost objects when toggling
• ATH line & label independently controllable

**〰️ Bollinger Bands Independent**
BB runs on its own switch only — master lines no longer disables BB.

**🏷️ Compact Emoji Labels**
All chart labels now use emojis instead of text:
• 📈/📉 instead of Long/Short
• 〽️D/W/M/Y instead of VWAP-D/W/M/Y
• 📐 DH/WH instead of PP-DH/PP-WH
• 💰📈 / 🚨📉 instead of L-TP / LIQ Short

**📦 ATH on Daily Basis**
ATH is now calculated via request.security on daily basis → correct on all timeframes.

**🏷️ Tooltip Fixed**
Label theme: Light = light text, Dark = dark text.

### 🗑️ Cleanup
• Removed unused variables (bar tracking, _hlc3, f_d_atl)
• Merged duplicate functions (get_box_size → get_label_size)
• Merged duplicate volume SMA calculations
リリースノート
⚠️ V10.1 — Critical Hotfix
🐛 No lines in Analysis mode — Switching to 📊 Analysis made all lines invisible (VWAP, Pivot, Fib, VPVR). The 🧭 Lines toggle was incorrectly tied to Trading mode. Please reload the update!
リリースノート
═══════════════════════════════════════
📋 CHANGELOG – v10.1 → v11
═══════════════════════════════════════

🆕 NEW

⏰ Sessions
- Asia / London / NY colored background highlights
- US DST toggle (NYSE winter/summer time)
- Weekends automatically hidden

🧬 EMA
- EMA 9 / 21 / 50 / 200 (chart timeframe)
- Daily EMAs: 1D-50 / 1D-21 / 1D-200
- Individual colors per EMA

📏 Auto Trendlines (TL)
- Confirmed trendlines from last 2 confirmed pivots
- Pending trendlines from last 2 pending pivots
- Projected 50 bars to the right

📊 R:R (Risk/Reward Ratio)
- Auto-calculated when TP + SL are active
- Color-coded: 🟢 ≥3 / 🟡 ≥2 / 🔴 <1
- Toggle in Info-Box

💡 Setup Tip
- Tooltip with optimal chart settings
(canvas margins, right offset)

═══════════════════════════════════════
🔧 IMPROVEMENTS

🎯 Structure Markers
- Group renamed to "Structure Markers (SM)"
- New default colors (high: light blue, low: orange)

🌀 Fibonacci
- New color palette (higher contrast)
- Lines use extend.left for better visibility
- FIB lines now also active on barstate.isrealtime

〽️ VWAP
- Labels simplified (short tag only, no % diff)
- Month & Year ON by default
- ATH-VWAP & ATL-VWAP ON by default

📦 Info-Box
- New R:R row added
- Border style refined (sharper frame)

📐 Pivot Points
- Daily Open (🌅 DO) added as new line

📊 VPVR
- Guard against errors with very few bars
- POC line dynamically scaled

🚨 Liquidation
- SL label % display fixed in price mode

🏷️ Labels & Lines
- Label offset default: 5 → 10
- BE lines correctly linked to Long/Short state
- Pivot labels moved to dedicated array

═══════════════════════════════════════
🗑️ REMOVED / RESTRUCTURED

- VWAP labels without % diff (cleaner look)
- Redundant double-checks removed
- Helper variables consolidated
- master_* aliases removed

═══════════════════════════════════════
リリースノート
🧹 The trend line drawing logic used `xloc.bar_time` with a timestamp-based slope calculation. This caused point B to not sit exactly on the pivot price. Fixed: switched to `xloc.bar_index` with explicit bar index variables for point A and point B. The line now runs exactly from A (older pivot) through B (newer pivot) and is projected to `bar_index + 50`.

免責事項

これらの情報および投稿は、TradingViewが提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。