OPEN-SOURCE SCRIPT
Wolf Exit Oscillator Enhanced

# Wolf Exit Oscillator Enhanced
## What it is (quick take)
**Wolf Exit Oscillator Enhanced** is a clean, rules-first **exit timing tool** built on the **True Strength Index (TSI)** with two optional safeguards:
1. **Signal-line crossover** (to avoid bailing on shallow dips), and
2. **EMA confirmation** (price-based “is the trend actually weakening/strengthening?” check).
Use it to standardize when you **take profits, cut losers, or scale out**—especially after momentum runs hot or cold.
> Works best **paired** with:
>
> * **ABS NR — Fail-Safe Confirm (v4.2.2)** for entries
> * **ABS Companion Oscillator — Trend / Exhaustion / New Trend** for trend/exhaustion context
---
## How to use it (operational workflow)
1. **Set your bands**
* `exitHigh` and `exitLow` mark “overcooked” zones on the TSI scale (default: +60 / –60).
* Above `exitHigh` = momentum stretched **up** (good place to **exit shorts** or **take long profits**).
* Below `exitLow` = momentum stretched **down** (good place to **exit longs** or **take short profits**).
2. **Choose strictness**
* **Base mode**: the moment TSI crosses out of a band, you get an exit signal.
* **Add Signal-Line Cross** (`enableSignalX = true`): require TSI to cross its signal in the same direction → **fewer, cleaner exits**.
* **Add EMA Filter** (`enableEMAFilter = true`): also require **price** to confirm (e.g., long exit only if price < EMA). This avoids bailing during healthy trends.
3. **Execute with structure**
* **Full exit** when a signal fires, or
* **Scale out** (e.g., 50% on first signal, remainder on trail/secondary signal), or
* **Move stop** to lock gains once an exit signal prints.
4. **Alerts**
* Set to **“Once per bar close”** to avoid intrabar flip-flop.
* Use the two provided alert names for automation (see “Alerts” below).
---
## Signals & visuals
* **TSI line** (solid) and **Signal line** (dashed) with optional **histogram** (TSI − Signal).
* **Horizontal bands** at `exitHigh` and `exitLow`.
* **Labels**:
* **Exit Long** appears when long-side momentum breaks down (below `exitLow`, plus any enabled filters).
* **Exit Short** appears when short-side momentum breaks down (above `exitHigh`, plus any enabled filters).
**Alerts (stable names):**
* **WolfExit — Exit Long**
* **WolfExit — Exit Short**
---
## Non-repainting behavior (what to expect)
* The oscillator is computed with **EMAs on current timeframe**—no higher-timeframe lookahead, no repaint.
* **Intrabar**: TSI/Signal can fluctuate; use **bar-close evaluation** (and alert setting “Once per bar close”) to lock signals.
* If you enable the EMA filter, that check is also evaluated at bar close.
---
## Every input explained (and how changing it alters behavior)
### Momentum engine (TSI)
* **TSI Long EMA Length (`tsiLongLen`, default 25)**
Higher = smoother, slower momentum; fewer signals. Lower = twitchier, more signals.
* **TSI Short EMA Length (`tsiShortLen`, default 13)**
Fine-tunes responsiveness on top of the long length. Lower short → snappier TSI.
* **TSI Signal Line Length (`tsisigLen`, default 7)**
Higher = slower signal line (harder to cross) → fewer signals. Lower = easier crosses → more signals.
### Thresholds (the bands)
* **Exit Threshold High (`exitHigh`, default +60)**
Raise to demand **stronger** overbought before signaling short exits / long profit-takes. Lower to trigger sooner.
* **Exit Threshold Low (`exitLow`, default −60)**
Raise (toward 0) to trigger **earlier** on longs; lower (more negative) to wait for deeper downside stretch.
### Confirmation layers
* **Require Signal Line Crossover (`enableSignalX`, default true)**
On = TSI must cross its signal (same direction as exit) → **filters out shallow wiggles**. Off = faster, more frequent exits.
* **Enable EMA Confirmation Filter (`enableEMAFilter`, default true)**
On = require **price < EMA** for **Exit Long** and **price > EMA** for **Exit Short**.
* **EMA Exit Confirmation Length (`exitEMALen`, default 50)**
Higher = **trendier** filter (harder to flip) → fewer exits; Lower = more reactive → more exits.
### Visuals
* **Show Histogram (`showHist`)**
On = quick visual for TSI–Signal spread (helps spot weakening momentum before a cross).
* **Plot Exit Signals (`showSignals`)**
Toggle labels if you only want the lines/bands with alerts.
---
## Tuning recipes (quick, practical)
* **Strong trend days (avoid premature exits)**
* Keep **`enableSignalX = true`** and **`enableEMAFilter = true`**
* Increase **`exitEMALen`** (e.g., 80)
* Consider raising **`exitHigh`** to 65–70 (and lowering **`exitLow`** to −65/−70)
* **Choppy/range days (exit faster, take the cash)**
* **`enableEMAFilter = false`** (don’t wait for price filter)
* **`enableSignalX`** optional; try off for quicker responses
* Bring bands closer to **±50** to take profits earlier
* **Scalping / lower timeframes**
* Shorten **TSI lengths** a bit (e.g., 21/9/5)
* Consider **`exitHigh=55 / exitLow=-55`**
* Keep **histogram on** to visualize momentum flip risk
* **Swing trading / higher timeframes**
* Lengthen **TSI** (e.g., 35/21/9) and **`exitEMALen`** (e.g., 100)
* Wider bands (±65 to ±75) to catch bigger moves before exiting
---
## Playbooks (how to actually trade it)
* **Entry from ABS NR FS, exit with Wolf**
* Take entries from **ABS NR — Fail-Safe Confirm** (triangle).
* Use **Wolf Exit** to scale out: 50% on first exit label, trail remainder with price/EMA or your stop logic.
* **Pyramid & protect**
* Add on re-accelerations (TSI pulls back toward zero without breaching the opposite band).
* The first **Exit** signal → take partial, raise stop to last higher low / lower high.
* **Mean-reversion fade management**
* When fading with ABS NR (KC band pokes + stretched |Z|), target the first opposite **Exit** signal as your “don’t overstay” cue.
---
## Suggested starting points
* **Day trading (5–15m):**
* TSI: **25 / 13 / 7** (default)
* Bands: **+60 / −60**
* Confirmations: **SignalX = on**, **EMA Filter = on**, **EMA Len = 50**
* Alerts: **Once per bar close**
* **Scalping (1–3m):**
* TSI: **21 / 9 / 5**
* Bands: **±55**
* Confirmations: **SignalX = on**, **EMA Filter = off** (optional for speed)
* **Swing (1h–D):**
* TSI: **35 / 21 / 9**
* Bands: **+65 / −65** (or ±70)
* Confirmations: **SignalX = on**, **EMA Filter = on**, **EMA Len = 100**
---
## Best-practice pairings
* **Entries:** **ABS NR — Fail-Safe Confirm (v4.2.2)**
* Take ABS triangles; let Wolf standardize exits so you’re not guessing.
* **Context:** **ABS Companion Oscillator**
* Prefer holding longer when the companion stays above (for longs) or below (for shorts) its neutral band and **no EXH tag** prints.
* If companion flags **EXH** against your position, tighten stops; Wolf’s next exit signal becomes high priority.
---
## Notes & disclaimers
* This is an **exit signal tool**, not a strategy or broker.
* Signals are strongest when aligned with your **entry logic** and a **risk framework** (position sizing, stops, partials).
* All evaluations are **current timeframe**; no higher-timeframe lookahead is used.
* Markets change—tune the bands and confirmations per symbol/timeframe.
---
**Tip:** Keep your alerts simple—one for **Exit Long**, one for **Exit Short**, **Once per bar close**. Use partial exits on the first signal, and let your stop/trailing logic handle the rest.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。