OPEN-SOURCE SCRIPT
已更新

Fibonacci Retracement/Extension

5 073
This Pine Script code implements Fibonacci retracement and extension levels based on a ZigZag pattern. Below is a breakdown of its functionality:

Overview
The script calculates Fibonacci retracement and extension levels by identifying swing highs and swing lows using the ZigZag algorithm. It then plots these levels on the chart for trend analysis.

1. ZigZag Length Input
Defines the ZigZag length, which determines the sensitivity of peak and trough identification.

2. Fibonacci Retracement Calculation
Computes Fibonacci retracement levels using swing highs and lows.
Uses pre-defined Fibonacci ratios (0.236, 0.382, 0.5, 0.618, 0.786, 1.0).
Adjusts line positions dynamically as the trend evolves.

3. Fibonacci Extension Calculation
Identifies Fibonacci extension levels for future price targets.
Uses previous ZigZag patterns to estimate potential price movements.

4. Trend and Fibonacci Configuration
Allows the user to configure Fibonacci trend analysis.
TrendSw: Sets the trend direction (1 = Bullish, -1 = Bearish, 0 = None).
ZigZagleg: Determines the countback value for retracement calculations.
版本注释
minor correction

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。