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. اقرأ المزيد في شروط الاستخدام.