OPEN-SOURCE SCRIPT
Fibonacci Time Window [forexobroker]

Fibonacci Time Window [forexobroker] projects expected reversal-time windows by taking the bar-distance between the last two confirmed swing pivots as a base cycle and extending it forward by Fibonacci ratios. The unique angle is that it works on the time axis rather than the price axis: signals only arm when price is inside a projected Fib time window and a reclaim-EMA cross aligns with the trend.
🔶 ALGORITHM
1. Detect confirmed swing pivots with ta.pivothigh / ta.pivotlow over the pivot length (lag of pivot-length bars by construction, so non-repainting).
2. Base cycle = bar-distance between the two most recent confirmed pivots.
3. Project three forward time targets from the latest pivot bar: pivot bar + round(base cycle x ratio) for Fib Ratio 1 (1.0), Fib Ratio 2 (1.618), and Fib Ratio 3 (2.618).
4. A time window is open when the current bar is within Window Tolerance bars of any of the three projected targets.
5. Directional bias inside a window comes from price vs the trend EMA (above = up, below = down).
6. Entry timing: while in a window and aligned with the trend direction, a close crossover (long) or crossunder (short) of the reclaim EMA fires the signal. Cooldown, position-lock, and bar-close confirmation apply.
🔶 SIGNAL LOGIC
- Buy: in-session AND price inside a projected Fib time window AND trend direction = up AND close crosses over the reclaim EMA AND position not already long AND cooldown elapsed AND barstate.isconfirmed (then position locks long).
- Sell: in-session AND price inside a projected Fib time window AND trend direction = down AND close crosses under the reclaim EMA AND position not already short AND cooldown elapsed AND barstate.isconfirmed (then position locks short).
- Only fires while price is inside one of the three projected Fibonacci time windows.
🔶 INPUTS
- Time Cycle group: bars each side to confirm swing pivots that set the base cycle; default Pivot Length 8.
- Fib ratios: three time-projection multipliers of the base cycle; defaults Fib Ratio 1 1.0, Fib Ratio 2 1.618, Fib Ratio 3 2.618.
- Window tolerance: bars of slack around each projected time target; default Window Tolerance 2.
- Trend EMA: defines directional bias inside a window; default Trend EMA 34.
- Volatility reference: ATR length for window-line height and dashboard; default ATR Length 14.
- Signal Logic group: entry reclaim EMA and cooldown; default Entry Reclaim EMA 9.
- Cooldown: minimum bars between signals; default Cooldown Bars 5.
- Filters group: optional session restriction and session window; default Restrict to Session off.
- Visual group: time-window lines, dashboard, 3-layer glow, buy/sell colors, dashboard background.
🔶 ALERTS
FTW Buy, FTW Sell, FTW Any Signal, FTW Window Open, FTW Window Close, FTW Window 1, FTW Window 1.618, FTW Window 2.618, FTW New Pivot Hi, FTW New Pivot Lo, FTW EMA Up, FTW EMA Down, FTW Webhook JSON.
🔶 LIMITATIONS
- Swing pivots are confirmed with a lag of Pivot Length bars, so the base cycle and projected windows update only after that confirmation delay.
- The script needs at least two confirmed pivots before any time window can be projected, so early bars are a warm-up "warming up" state.
- Fibonacci time windows quantise to integer bars via rounding, so projected targets snap to whole-bar positions.
- Time-cycle projection is a heuristic timing aid, not a forecast; a window marks elevated reversal odds, not a guaranteed turn.
- Default pivot and ratio settings are tuned for liquid instruments; entries confirm on bar close, adding one-bar lag versus intrabar price.
🔶 ALGORITHM
1. Detect confirmed swing pivots with ta.pivothigh / ta.pivotlow over the pivot length (lag of pivot-length bars by construction, so non-repainting).
2. Base cycle = bar-distance between the two most recent confirmed pivots.
3. Project three forward time targets from the latest pivot bar: pivot bar + round(base cycle x ratio) for Fib Ratio 1 (1.0), Fib Ratio 2 (1.618), and Fib Ratio 3 (2.618).
4. A time window is open when the current bar is within Window Tolerance bars of any of the three projected targets.
5. Directional bias inside a window comes from price vs the trend EMA (above = up, below = down).
6. Entry timing: while in a window and aligned with the trend direction, a close crossover (long) or crossunder (short) of the reclaim EMA fires the signal. Cooldown, position-lock, and bar-close confirmation apply.
🔶 SIGNAL LOGIC
- Buy: in-session AND price inside a projected Fib time window AND trend direction = up AND close crosses over the reclaim EMA AND position not already long AND cooldown elapsed AND barstate.isconfirmed (then position locks long).
- Sell: in-session AND price inside a projected Fib time window AND trend direction = down AND close crosses under the reclaim EMA AND position not already short AND cooldown elapsed AND barstate.isconfirmed (then position locks short).
- Only fires while price is inside one of the three projected Fibonacci time windows.
🔶 INPUTS
- Time Cycle group: bars each side to confirm swing pivots that set the base cycle; default Pivot Length 8.
- Fib ratios: three time-projection multipliers of the base cycle; defaults Fib Ratio 1 1.0, Fib Ratio 2 1.618, Fib Ratio 3 2.618.
- Window tolerance: bars of slack around each projected time target; default Window Tolerance 2.
- Trend EMA: defines directional bias inside a window; default Trend EMA 34.
- Volatility reference: ATR length for window-line height and dashboard; default ATR Length 14.
- Signal Logic group: entry reclaim EMA and cooldown; default Entry Reclaim EMA 9.
- Cooldown: minimum bars between signals; default Cooldown Bars 5.
- Filters group: optional session restriction and session window; default Restrict to Session off.
- Visual group: time-window lines, dashboard, 3-layer glow, buy/sell colors, dashboard background.
🔶 ALERTS
FTW Buy, FTW Sell, FTW Any Signal, FTW Window Open, FTW Window Close, FTW Window 1, FTW Window 1.618, FTW Window 2.618, FTW New Pivot Hi, FTW New Pivot Lo, FTW EMA Up, FTW EMA Down, FTW Webhook JSON.
🔶 LIMITATIONS
- Swing pivots are confirmed with a lag of Pivot Length bars, so the base cycle and projected windows update only after that confirmation delay.
- The script needs at least two confirmed pivots before any time window can be projected, so early bars are a warm-up "warming up" state.
- Fibonacci time windows quantise to integer bars via rounding, so projected targets snap to whole-bar positions.
- Time-cycle projection is a heuristic timing aid, not a forecast; a window marks elevated reversal odds, not a guaranteed turn.
- Default pivot and ratio settings are tuned for liquid instruments; entries confirm on bar close, adding one-bar lag versus intrabar price.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
🔵Gain access to our powerful tools : forexobroker.com/tv
🔵Join our free telegram for updates : t.me/dominicwalsfxhtrader
All scripts & content provided by Forexobroker are for informational & educational purposes only.
🔵Join our free telegram for updates : t.me/dominicwalsfxhtrader
All scripts & content provided by Forexobroker are for informational & educational purposes only.
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
🔵Gain access to our powerful tools : forexobroker.com/tv
🔵Join our free telegram for updates : t.me/dominicwalsfxhtrader
All scripts & content provided by Forexobroker are for informational & educational purposes only.
🔵Join our free telegram for updates : t.me/dominicwalsfxhtrader
All scripts & content provided by Forexobroker are for informational & educational purposes only.
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。