OPEN-SOURCE SCRIPT
Zaktualizowano Rebound V-Fib Log

Rebound V-Fib Log
A log-scale variant of Rebound V-Fib. Trend geometry - V-shape detection, slanted Fibonacci levels, support lines - is computed in log price space, so on log-scale charts the bands and trend lines render straight, representing constant %/day rates of change. Intended for log-scale charts only.
For US equities on intraday/daily timeframes. Adjust 'Trading hours per day' for other markets (default 6.5).
The built-in back-test verifies entries and trailing-stop hits on lower-timeframe bars within each chart bar. It ignores slippage, commissions, liquidity and compounding - reference use only.
DIFFERENCES FROM Rebound V-Fib
OUTPUTS
Overlay:
Sub-pane:
Background color (both panes): blue/purple on entry bars (trend/support), red/gray on close bars (loss/gain).
Status line + Data Window + Screener:
Data Window + Screener:
Data Window only:
INPUTS
General:
Trend detection:
Entry conditions:
Exit conditions:
Back-test:
Display:
DISCLAIMER
This script is provided "AS IS" without warranty of any kind. It is for informational purposes only and does not constitute financial advice. Past performance is not indicative of future results. The author is not liable for any losses arising from the use of this script. Trade at your own risk.
A log-scale variant of Rebound V-Fib. Trend geometry - V-shape detection, slanted Fibonacci levels, support lines - is computed in log price space, so on log-scale charts the bands and trend lines render straight, representing constant %/day rates of change. Intended for log-scale charts only.
For US equities on intraday/daily timeframes. Adjust 'Trading hours per day' for other markets (default 6.5).
The built-in back-test verifies entries and trailing-stop hits on lower-timeframe bars within each chart bar. It ignores slippage, commissions, liquidity and compounding - reference use only.
DIFFERENCES FROM Rebound V-Fib
- Trend slopes, Fib levels and support lines are computed in log(price) space
- Rate outputs (Up%/d, Down%/d, Sup%/d) use log-space slopes. Numerically interchangeable with the linear version's %/day at typical trend speeds
- V-Fib Ratio: position on the slanted Fib band, computed as a log-distance ratio. The value equals the Fib level number - e.g. V-Fib = 0.236 means price is on the 0.236 line (the downtrend's middle top), V-Fib = 1.0 means price is on the 1.0 line
- Trail anchored as % of trail high (scales with price), not absolute price width
OUTPUTS
Overlay:
- Slanted Fib band (multi-colored levels), blue uptrend line, purple support diagonal - all log-straight on log charts
- V-Fib Ratio label on the last bar
- Dotted stop guides: blue/purple = active trend/support entry, orange = current support trail
Sub-pane:
- Capital - equity curve from the back-test start
- LONG label on entry - entry price, rate, V-Fib, lead, trail level, gap %
- EXIT label on close - exit price, exit reason (Trail / Trend / V-Fib) and P/L
- IF label - last-bar support-entry forecast, shown when V-Fib has overshot the entry window and a pullback-rebound is confirmed
Background color (both panes): blue/purple on entry bars (trend/support), red/gray on close bars (loss/gain).
Status line + Data Window + Screener:
- V-Fib - current V-Fib Ratio
- V-Trend - net rate (Up + Down), %/day
- Sup%/d - support slope, %/day
- SupTrail% - max drawdown since support start (floored by Min support trail), used as trail gap
- Capital - current equity value
- Risk - worst open-trade drawdown across the back-test (<= 0)
- Gain/d - average gain per day spent in completed trades
Data Window + Screener:
- 3M% / M% / W% / D% - change from 3M / 1M / 1W / day close
- Age - bars held in the current trade (= days on daily timeframe)
- SupAge - days since the current support line was established
- SupLead% - close above support, as % of close
- Lead% - leading days x uptrend rate. Leading days = days the current price is ahead of / behind the uptrend baseline (positive when above, negative when below)
- Up%/d, Down%/d - trend slopes, %/day
Data Window only:
- ActiveTrail, SupportTrail - current stop prices
INPUTS
General:
- Lookback bars - V-shape detection window
- Support last bar only - compute support only on the last bar (faster, disables historical support back-test)
- Trading hours per day - intraday day-to-bar conversion (6.5 = US equities)
Trend detection:
- Min downtrend bars / Min uptrend bars - minimum bars from top to V-bottom / from V-bottom to now
- Min uptrend rate - reject if uptrend slope below this (%/day)
- Max downtrend rate - reject if downtrend slope exceeds this (typically <= 0)
- Min V-Trend - reject if Up + Down rate is below this
Entry conditions:
- Min / Max entry V-Fib ratio - lower / upper bound of the entry window on the slanted Fib band
- Min entry leading gain - minimum Lead% required at entry
- Max trend trail - cap on the trail gap for trend entries, % of entry price
- Min support pullback - V-Fib must drop from its peak by (peak x this ratio) before trough tracking starts
- Min support rebound - V-Fib must then rise by this amount from the post-peak trough to arm the support entry
- Min support trail - floor on the support trail gap (%)
- Max support trail - cap on the trail gap for support entries, % of entry price
Exit conditions:
- Only exit by trailing stop - disable the V-Fib-based exit only; rate-based exit and trailing stop remain active
- Exit uptrend diff / Keep uptrend rate - rate-based exit fires when uptrend rate falls below both Keep uptrend rate AND (entry rate + Exit uptrend diff). Exit uptrend diff is typically negative
- Exit V-Fib ratio - V-Fib-based exit triggers when V-Fib reaches this
- Unlock V-Fib ratio - release the trend-entry lock when V-Fib reaches this (should be > Exit V-Fib ratio). The lock is set on each trend entry and is also released by the rate-based exit
Back-test:
- Enable backtest - run the simulation
- Start capital - starting capital (default 1000)
- Capital risk - fraction of capital risked per trade (default 0.2 = 20%). Back-test outputs (Risk, Gain/d, Capital deltas) scale with Start capital x Capital risk
- Backtest bars - recent bars included
- Min trade bars - hide Gain/d until this many bars have been spent in trades
Display:
- Show entry / support entry / exit label - toggle LONG / IF / EXIT
- Show labels on capital - place labels on the capital curve instead of by rate value
DISCLAIMER
This script is provided "AS IS" without warranty of any kind. It is for informational purposes only and does not constitute financial advice. Past performance is not indicative of future results. The author is not liable for any losses arising from the use of this script. Trade at your own risk.
Informacje o Wersji
v2.1.0- Added Min support entry rating input to gate support entries (and the IF forecast label) by TradingView Technical Rating, reducing noisy weak entries that fire against broader technicals. Trend entries are not gated.
- Added Enable support entry input (Backtest group) to skip support rebound entries in the backtest while keeping detection, IF labels, and support guides visible.
Tip: support entries can fire frequently and may have a lower win rate than trend entries. To focus alerts, backtest results, and Pine Screener filtering on trend entries only, set Enable support entry = off.
Informacje o Wersji
v2.1.1- Min support entry rating has been renamed to Min entry rating and now gates trend entries as well as support entries.
- Its default has been raised from 0.0 to 0.3 — a forward-tested level strong enough to attract follow-through buying.
Informacje o Wersji
v2.2.0- Added the V-Ladder — key Fib levels (0.236, 0.5, 1.0, 1.618, 2.272, 3.0) rendered as a ladder between the previous and current support lines, complementing the trend-line-based Slanted V-Fib with extension targets aligned to the active support direction.
Informacje o Wersji
v2.3.0- Added a Show baseball runner toggle that puts an emoji on each V-Ladder Fib level reached, so you can see at a glance how far price has run up the ladder.
- Support is now computed only inside the backtest window instead of the whole chart, so long histories load faster. Backtest results and support lines look the same as before.
Informacje o Wersji
v2.3.1- Fixed a runtime error that could stop the script on newly listed symbols (e.g. recent IPOs).
Informacje o Wersji
v2.3.2- Reverted V-bottom detection to native ta.lowestbars to cut the per-bar scan cost. Since ta.lowestbars can error on very short histories (recent IPOs), use Rebound V-Fib RT there instead.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Skrypt open-source
W zgodzie z duchem TradingView twórca tego skryptu udostępnił go jako open-source, aby użytkownicy mogli przejrzeć i zweryfikować jego działanie. Ukłony dla autora. Korzystanie jest bezpłatne, jednak ponowna publikacja kodu podlega naszym Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.