Indicator · Pine Script v6 · On the chart

Adaptive Spectral Forecast

by vedkanani123

A cycle-analysis indicator on the price chart.

View on GitHub

Repaints

GitHub stars1on the repository
Pine versionv6current
Lines of code605
Settings24inputs
LicenceNone stated
Last update2 months ago23 Aug 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

Adaptive Spectral Forecast analyzes a lookback window of 144 bars by default, extracts up to five dominant cycles, and projects a forecast line 55 bars ahead with confidence bands. Buy and sell signals can be limited to the direction of a smoothed trend, and reversal dots and a fitted historical curve can be shown. The forecast is redrawn as new bars arrive, so it changes over time and is only a projection.

Details

Published by

vedkanani123 on GitHub

Type

Indicator, Pine Script v6

Draws

On the price chart

Category

Trend, AI / machine learning

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • Signals can change on the live bar or after it closes (repainting)

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Analysis Lookbackint144lookbackInput
Price SourcesourceclosesourceInput
Harmonics Countint5numHarmonicsInput
Min Cycle Periodint8minPeriodInput
PresetstringDefaultpresetInput
Trend Alignment FilterbooltruetrendFilterInput
Forecast Barsint55extrapInput
Confidence Band Widthfloat1.5confidenceMultInput
Show Confidence BandsbooltrueshowBandsInput
Trend Smoothingint30trendSmoothInput
Harmonic Decay Ratefloat0.97decayInput
Min Cycle SNRfloat2.0minSnrInput
Show all 24 settings
SettingTypeDefaultVariable
Show Buy/Sell SignalsbooltrueshowSignalsInput
Show Historical FitbooltrueshowFitInput
Show Trend LineboolfalseshowTrendInput
Show Reversal DotsbooltrueshowDotsInput
Show WatermarkbooltrueshowWatermarkInput
ThemestringAutothemeInput
Show DashboardbooltrueshowDashInput
Dashboard PositionstringTop RightdashPosStr
Webhook JSON FormatboolfalsewebhookInput
Bullcolor#00E676bullColorInput
Bearcolor#FF5252bearColorInput
Band / Forecastcolor#42A5F5bandColorInput
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

257 stars

This indicator uses a Lorentzian distance k-nearest neighbors classification algorithm to predict market direction based on up to five technical features, such as RSI, WaveTrend, CCI, and ADX. It compares current feature values against historical bar patterns

Indicator v5 AI / machine learningOscillators & momentum
Updated 6 weeks ago · None stated GitHub repository of Donald - Machine Learning Options

AI Trend Navigator

by hasnocool
106 stars

This indicator calculates a trend direction and smoothed moving average using a k-nearest neighbours (k-NN) classification algorithm directly on the main price chart. Users can select input price types, target values, neighborhood size, and smoothing periods.

Indicator v5 AI / machine learningTrend
Updated 2 years ago · GPL-3.0 GitHub repository of AI Trend Navigator

Machine Learning: Lorentzian Classification

by artificial-intelligence-edge
75 stars

An overlay indicator that applies a k-nearest-neighbors machine learning classifier using Lorentzian distance to predict price movement. It evaluates historical market features, such as RSI, WaveTrend, CCI, and ADX, to identify similar price-time patterns and

Indicator v6 AI / machine learningOscillators & momentum
Updated 3 days ago · MIT GitHub repository of Machine Learning: Lorentzian Classification
46 stars

This indicator uses a Hidden Markov Model (HMM) framework combined with an adaptive dual moving average engine and Directional Movement Index (DMI) features to identify market regimes (bullish, bearish, or ranging/chop). It calculates regime probabilities on e

Indicator v5 AI / machine learningTrend
Updated 7 weeks ago · None stated GitHub repository of HMM Enhanced: Regime Probability

This overlay indicator plots a SuperTrend-style band on the price chart using ATR length, a selectable source, and a base factor. Optional settings enable an adaptive factor driven by rate of change, a volatility filter, K-means clustering, and an LSTM layer w

Indicator v6 TrendVolatility & bands
Updated 4 months ago · MIT GitHub repository of ML SuperTrend (Ultimate) - Auto-Optimized AI with LSTM

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers