OPEN-SOURCE SCRIPT
Updated Gann Fan Master – Selectable Base Angle & Fibonacci Angles

Gann Fan Master – Selectable Base Angle & Fibonacci Angles
This indicator plots a Gann Fan from point A1 through point B1, with full customization over:
Perfect for manual chart analysis — you select A1 and B1, the script calculates and draws the fan with labeled angles.
How It Works
-Select A1 (time & price) and B1 (time & price).
-The script calculates the base slope depending on the selected base angle:
Linear scale: slope = (B1 − A1) / Δt / base_angle_value
Logarithmic scale: slope = (ln(B1) − ln(A1)) / Δt / base_angle_value
-Each enabled angle is drawn from A1, extended by the chosen number of bars, and labeled with its value.
-Fan color is determined automatically by direction (green for upward, red for downward) or can be overridden.
Quick Start
-Add the indicator to your chart.
-In settings:
-Optionally, enable Use Custom Fan Color and set your own color.
Settings
Usage Tips
-Choosing A1 and B1:
A1 — significant starting swing high or low.
B1 — next key swing to define slope.
-Logarithmic scale:
Ideal for long-term exponential trends (crypto, growth stocks).
Prices must be > 0.
-Watch how price reacts to different angles:
1/1 as median trend, fractional for support/resistance, multiples for acceleration/slowdown.
Disclaimer
This is a technical analysis tool. It is not financial advice. Trading decisions are made at your own risk.
Gann Fan Master – Selectable Base Angle & Fibonacci Angles
Индикатор строит веер Ганна от точки A1 через точку B1 с полной кастомизацией:
Идеально подходит для ручного анализа графика — вы задаёте A1 и B1, а скрипт рассчитывает и строит веер с подписями углов.
Как это работает
-Задайте A1 (время и цена) и B1 (время и цена).
-Скрипт рассчитывает базовый наклон в зависимости от выбранного базового угла:
Линейная шкала: наклон = (B1 − A1) / Δt / base_angle_value
Логарифмическая шкала: наклон = (ln(B1) − ln(A1)) / Δt / base_angle_value
-Каждый включённый угол рисуется из точки A1, продлевается на заданное число баров и подписывается.
-Цвет линий определяется автоматически по направлению (зелёный — вверх, красный — вниз) или задаётся вручную.
Быстрый старт
1)Добавьте индикатор на график.
2)В настройках:
3)При желании активируйте Use Custom Fan Color и задайте цвет веера.
Настройки
Советы по применению
Выбор A1 и B1:
A1 — значимый экстремум начала движения.
B1 — следующий важный экстремум для задания наклона.
Логарифмическая шкала:
Подходит для долгосрочных экспоненциальных трендов (крипто, акции роста).
Цена должна быть > 0.
Следите, как цена реагирует на разные углы:
1/1 — медианный тренд.
Дробные углы — потенциальная поддержка/сопротивление.
Кратные — ускорение/замедление движения.
Дисклеймер
Это инструмент технического анализа и не является инвестиционной рекомендацией. Торговые решения вы принимаете на свой страх и риск.
This indicator plots a Gann Fan from point A1 through point B1, with full customization over:
- Base angle selection (8/1, 1/1, 1/8)
- Main angle set
- Fibonacci-based angles
- Up to 10 custom user-defined angles
- Logarithmic or linear slope calculation
- Custom fan color and extended line length
Perfect for manual chart analysis — you select A1 and B1, the script calculates and draws the fan with labeled angles.
How It Works
-Select A1 (time & price) and B1 (time & price).
-The script calculates the base slope depending on the selected base angle:
Linear scale: slope = (B1 − A1) / Δt / base_angle_value
Logarithmic scale: slope = (ln(B1) − ln(A1)) / Δt / base_angle_value
-Each enabled angle is drawn from A1, extended by the chosen number of bars, and labeled with its value.
-Fan color is determined automatically by direction (green for upward, red for downward) or can be overridden.
Quick Start
-Add the indicator to your chart.
-In settings:
- A1 Time/Price — starting point.
- B1 Time/Price — second point (defines slope).
- Base Angle — choose 8/1, 1/1, or 1/8.
- Extend Fan (Bars) — number of bars to extend lines into the future.
- Logarithmic Fan Calculation — toggle for log-scale mode.
- Enable desired angle sets: Main, Fibonacci, or Custom.
-Optionally, enable Use Custom Fan Color and set your own color.
Settings
- Enable Fan — master switch.
- A1 Time/A1 Price, B1 Time/B1 Price — anchor points.
- Base Angle — 8/1, 1/1, 1/8.
- Extend Fan (Bars) — extension length.
- Use Custom Fan Color / Fan Color — manual color override.
- Main Angles — 1/8, 1/4, 1/3, 1/2, 1/1, 2/1, 3/1, 4/1, 6/1, 8/1.
- Fibonacci Angles — 0.214, 0.35, 0.382, 0.618, 0.786, 0.886, 0.9335, 1.118, 1.236, 1.382, 1.618.
- Custom Angles — up to 10 values (dotted lines), labels from the exact value.
Usage Tips
-Choosing A1 and B1:
A1 — significant starting swing high or low.
B1 — next key swing to define slope.
-Logarithmic scale:
Ideal for long-term exponential trends (crypto, growth stocks).
Prices must be > 0.
-Watch how price reacts to different angles:
1/1 as median trend, fractional for support/resistance, multiples for acceleration/slowdown.
Disclaimer
This is a technical analysis tool. It is not financial advice. Trading decisions are made at your own risk.
Gann Fan Master – Selectable Base Angle & Fibonacci Angles
Индикатор строит веер Ганна от точки A1 через точку B1 с полной кастомизацией:
- Выбор базового угла (8/1, 1/1, 1/8)
- Набор основных углов
- Углы Фибоначчи
- До 10 пользовательских углов
- Расчёт в логарифмической или линейной шкале
- Цвет веера по направлению или заданный вручную
- Настройка длины продления линий
Идеально подходит для ручного анализа графика — вы задаёте A1 и B1, а скрипт рассчитывает и строит веер с подписями углов.
Как это работает
-Задайте A1 (время и цена) и B1 (время и цена).
-Скрипт рассчитывает базовый наклон в зависимости от выбранного базового угла:
Линейная шкала: наклон = (B1 − A1) / Δt / base_angle_value
Логарифмическая шкала: наклон = (ln(B1) − ln(A1)) / Δt / base_angle_value
-Каждый включённый угол рисуется из точки A1, продлевается на заданное число баров и подписывается.
-Цвет линий определяется автоматически по направлению (зелёный — вверх, красный — вниз) или задаётся вручную.
Быстрый старт
1)Добавьте индикатор на график.
2)В настройках:
- A1 Time/Price — начальная точка.
- B1 Time/Price — вторая точка (задаёт наклон).
- Base Angle — выберите 8/1, 1/1 или 1/8.
- Extend Fan (Bars) — длина продления линий в барах.
- Logarithmic Fan Calculation — переключатель логарифмического режима.
- Включите нужные блоки углов: Main, Fibonacci, Custom.
3)При желании активируйте Use Custom Fan Color и задайте цвет веера.
Настройки
- Enable Fan — общий выключатель.
- A1 Time/A1 Price, B1 Time/B1 Price — опорные точки.
- Base Angle — 8/1, 1/1, 1/8.
- Extend Fan (Bars) — продление линий.
- Use Custom Fan Color / Fan Color — цвет вручную.
- Main Angles — 1/8, 1/4, 1/3, 1/2, 1/1, 2/1, 3/1, 4/1, 6/1, 8/1.
- Fibonacci Angles — 0.214, 0.35, 0.382, 0.618, 0.786, 0.886, 0.9335, 1.118, 1.236, 1.382, 1.618.
- Custom Angles — до 10 значений (точечные линии) с подписями.
Советы по применению
Выбор A1 и B1:
A1 — значимый экстремум начала движения.
B1 — следующий важный экстремум для задания наклона.
Логарифмическая шкала:
Подходит для долгосрочных экспоненциальных трендов (крипто, акции роста).
Цена должна быть > 0.
Следите, как цена реагирует на разные углы:
1/1 — медианный тренд.
Дробные углы — потенциальная поддержка/сопротивление.
Кратные — ускорение/замедление движения.
Дисклеймер
Это инструмент технического анализа и не является инвестиционной рекомендацией. Торговые решения вы принимаете на свой страх и риск.
Release Notes
Что улучшилось в скрипте:Увеличена длина линий веера:
Значение параметра extend_bars по умолчанию увеличено с 33 до 100 баров, что делает линии веера длиннее.
Максимальное значение extend_bars увеличено до 1000 баров (maxval=1000) для большей гибкости.
Добавлены всплывающие подсказки:
Для всех входных параметров добавлены атрибуты tooltip, чтобы пользователи лучше понимали их назначение.
Улучшена структура кода:
Названия групп и параметров переведены на английский (по запросу), но сохраняют логичную организацию для удобной настройки.
Обработка краевых случаев:
Сохранены проверки для логарифмической шкалы, чтобы избежать ошибок с отрицательными ценами.
Проверка time_range != 0 предотвращает ошибки деления на ноль.
What has been improved in the script:
Increased fan line length:
The default value of extend_bars has been increased from 33 to 100 bars, making the fan lines longer.
The maximum value for extend_bars has been raised to 1000 bars (maxval=1000) for greater flexibility.
Added tooltips:
Tooltips (tooltip attributes) have been added to all input parameters to clarify their purpose for users.
Improved code structure:
Group and parameter names are in English (as requested), maintaining a logical organization for easier configuration.
Edge case handling:
Retained checks for logarithmic scale to prevent errors with negative prices.
Ensured time_range != 0 to avoid division-by-zero errors.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.