OPEN-SOURCE SCRIPT
Cycle Phase & ETA Tracker [Robust v4]

Cycle Phase & ETA Tracker [Robust v4]
Description
The Cycle Phase & ETA Tracker [Robust v4] is a powerful tool for analyzing market cycles and predicting the completion of the current cycle (Estimated Time of Arrival, or ETA). It visualizes the cycle phase (0–100%) using a smoothed signal and displays the forecasted completion date with an optional confidence band based on cycle length variability. Ideal for traders looking to time their trades based on cyclical patterns, this indicator offers flexible settings for robust cycle analysis.
Key Features
Cycle Phase Visualization: Tracks the current cycle phase (0–100%) with color-coded zones: green (0–33%), blue (33–66%), orange (66–100%).
ETA Forecast: Shows a vertical line and label indicating the estimated date of cycle completion.
Confidence Band (±σ): Displays a band around the ETA to reflect uncertainty, calculated using the standard deviation of cycle lengths.
Multiple Averaging Methods: Choose from three methods to calculate average cycle length:
Median (Robust): Uses the median for resilience against outliers.
Weighted Mean: Prioritizes recent cycles with linear or quadratic weights.
Simple Mean: Applies equal weights to all cycles.
Adaptive Cycle Length: Automatically adjusts cycle length based on the timeframe or allows a fixed length.
Debug Histogram: Optionally displays the smoothed signal for diagnostic purposes.
Setup and Usage
Add the Indicator:
Search for "Cycle Phase & ETA Tracker [Robust v4]" in TradingView’s indicator library and apply it to your chart.
Configure Parameters:
Core Settings:
Track Last N Cycles: Sets the number of recent cycles used to calculate the average cycle length (default: 20). Higher values provide stability but may lag market shifts.
Source: Selects the data source for analysis (e.g., close, open, high; default: close price).
Use Adaptive Cycle Length?: Enables automatic cycle length adjustment based on timeframe (e.g., shorter for intraday, longer for daily) or uses a fixed length if disabled.
Fixed Cycle Length: Defines the cycle length in bars when adaptive mode is off (default: 14). Smaller values increase sensitivity to short-term cycles.
Show Debug Histogram: Enables a histogram of the smoothed signal for debugging signal behavior.
Cycle Length Estimation:
Average Mode: Selects the method for calculating average cycle length: "Median (Robust)", "Weighted Mean", or "Simple Mean".
Weights (for Weighted Mean): For "Weighted Mean", chooses "linear" (moderate emphasis on recent cycles) or "quadratic" (strong emphasis on recent cycles).
ETA Visualization:
Show ETA Line & Label: Toggles the display of the ETA line and date label.
Show ETA Confidence Band (±σ): Toggles the confidence band around the ETA, showing the uncertainty range.
Band Transparency: Adjusts the transparency of the confidence band (0 = fully transparent, 100 = fully opaque; default: 85).
ETA Color: Sets the color for the ETA line, label, and confidence band (default: orange).
Interpretation:
The cycle phase (0–100%) indicates progress: green for the start, blue for the middle, and orange for the end of the cycle.
The ETA line and label show the predicted cycle completion date.
The confidence band reflects the uncertainty range (±1 standard deviation) of the ETA.
If a warning "Insufficient cycles for ETA" appears, wait for the indicator to collect at least 3 cycles.
Limitations
Requires at least 3 cycles for reliable ETA and confidence band calculations.
On low timeframes or low-volatility markets, zero-crossings may be infrequent, delaying ETA updates.
Accuracy depends on proper cycle length settings (adaptive or fixed).
Notes
Test the indicator across different assets and timeframes to optimize settings.
Use the debug histogram to troubleshoot if the ETA appears inaccurate.
For feedback or suggestions, contact the author via TradingView.
Cycle Phase & ETA Tracker [Robust v4]
Описание
Индикатор Cycle Phase & ETA Tracker [Robust v4] предназначен для анализа рыночных циклов и прогнозирования времени завершения текущего цикла (ETA — Estimated Time of Arrival). Он отслеживает фазы цикла (0–100%) на основе сглаженного сигнала и отображает предполагаемую дату завершения цикла с опциональной доверительной полосой, основанной на стандартном отклонении длин циклов. Индикатор идеально подходит для трейдеров, которые хотят выявлять циклические закономерности и планировать свои действия на основе прогнозируемого времени.
Ключевые особенности
Фазы цикла: Визуализирует текущую фазу цикла (0–100%) с цветовой кодировкой: зеленый (0–33%), синий (33–66%), оранжевый (66–100%).
Прогноз ETA: Показывает вертикальную линию и метку с предполагаемой датой завершения цикла.
Доверительная полоса (±σ): Отображает зону неопределенности вокруг ETA, основанную на стандартном отклонении длин циклов.
Гибкие методы усреднения: Поддерживает три метода расчета средней длины цикла:
Median (Robust): Медиана, устойчивая к выбросам.
Weighted Mean: Взвешенное среднее, где недавние циклы имеют больший вес (линейный или квадратичный).
Simple Mean: Простое среднее с равными весами.
Адаптивная длина цикла: Автоматически подстраивает длину цикла под таймфрейм или позволяет задать фиксированную длину.
Отладочная гистограмма: Опционально отображает сглаженный сигнал для анализа.
Настройка и использование
Добавьте индикатор:
Найдите "Cycle Phase & ETA Tracker [Robust v4]" в библиотеке индикаторов TradingView и добавьте его на график.
Настройте параметры:
Core Settings:
Track Last N Cycles: Количество последних циклов для расчета средней длины (по умолчанию 20). Большие значения дают более стабильные результаты, но могут запаздывать.
Source: Источник данных (по умолчанию цена закрытия).
Use Adaptive Cycle Length?: Включите для автоматической настройки длины цикла по таймфрейму или отключите для использования фиксированной длины.
Fixed Cycle Length: Длина цикла в барах, если адаптивная длина отключена (по умолчанию 14).
Show Debug Histogram: Включите для отображения сглаженного сигнала (полезно для отладки).
Cycle Length Estimation:
Average Mode: Выберите метод усреднения: "Median (Robust)", "Weighted Mean" или "Simple Mean".
Weights (for Weighted Mean): Для режима "Weighted Mean" выберите "linear" (умеренный вес для новых циклов) или "quadratic" (сильный вес для новых циклов).
ETA Visualization:
Show ETA Line & Label: Включите для отображения линии и метки ETA.
Show ETA Confidence Band (±σ): Включите для отображения доверительной полосы.
Band Transparency: Прозрачность полосы (0 — полностью прозрачная, 100 — полностью непрозрачная, по умолчанию 85).
ETA Color: Цвет для линии, метки и полосы (по умолчанию оранжевый).
Интерпретация:
Фаза цикла (0–100%) показывает прогресс текущего цикла: зеленый — начало, синий — середина, оранжевый — конец.
Линия и метка ETA указывают предполагаемую дату завершения цикла.
Доверительная полоса показывает диапазон неопределенности (±1 стандартное отклонение).
Если отображается предупреждение "Insufficient cycles for ETA", дождитесь, пока индикатор соберет минимум 3 цикла.
Ограничения
Требуется минимум 3 цикла для надежного расчета ETA и доверительной полосы.
На низких таймфреймах или рынках с низкой волатильностью пересечения нуля могут быть редкими, что замедляет обновление ETA.
Эффективность зависит от правильной настройки длины цикла (fixedL или адаптивной).
Примечания
Протестируйте индикатор на разных таймфреймах и активах, чтобы подобрать оптимальные параметры.
Используйте отладочную гистограмму для анализа сигнала, если ETA кажется неточным.
Для вопросов или предложений по улучшению свяжитесь через TradingView.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.