OPEN-SOURCE SCRIPT
Market State Forecast Projection Engine

This indicator is a **forecast projection tool**. It looks at the current market environment, searches history for the most similar environments, then plots what usually happened afterward. It is not trying to predict the future with certainty. It is saying: “When the market looked like this before, what tended to happen next?”
The engine defines the current market environment using three things:
* **Trend**, based on moving averages.
* **Momentum**, based on RSI.
* **Volatility**, based on ATR.
Then it finds the closest historical matches, studies their future paths, and draws a forecast line with optional upper and lower bands.
---
## What You See on the Chart
### Forecast Midline
The main forecast line shows the **average path** of the selected historical matches.
In simple terms:
* If similar past situations usually moved higher, the line slopes up.
* If similar past situations usually moved lower, the line slopes down.
* If similar past situations were mixed, the line may be flat or choppy.
### Upper Band
The upper band shows the stronger side of historical outcomes.
It means:
* Some similar historical setups moved better than the average.
* The upper band gives you a visual idea of the upside range from those past examples.
* It is not a guaranteed target.
### Lower Band
The lower band shows the weaker side of historical outcomes.
It means:
* Some similar historical setups moved worse than the average.
* The lower band gives you a visual idea of downside risk from those past examples.
* It is not a guaranteed support level.
### Band Width
The space between the bands matters.
* Tight bands mean historical outcomes were more consistent.
* Wide bands mean historical outcomes were scattered and less reliable.
* A forecast with wide bands should be treated with more caution.
---
## Main Inputs
### Non-Repaint Mode
**Default: On**
This controls whether the forecast uses the live candle or the last completed candle.
Use **Non-Repaint Mode On** when:
* You want more stable signals.
* You want the forecast to update only after the candle closes.
* You care about cleaner historical testing.
Use **Non-Repaint Mode Off** when:
* You want the forecast to react during the current live candle.
* You accept that the forecast may change before the candle closes.
For most use cases, leave this **On**.
---
## Model Group
### Forecast Horizon
This controls how far into the future the indicator projects.
Example:
* On a daily chart, `20` means 20 trading days.
* On a 1-hour chart, `20` means 20 hours.
* On a 5-minute chart, `20` means 20 five-minute candles.
Use a lower value when:
* You are trading short-term moves.
* You want a tighter forecast window.
* You do not want the projection stretched too far.
Use a higher value when:
* You are looking for swing-trade context.
* You want to see the broader projected path.
* You are using higher timeframes.
A practical range is usually:
* `10–20` for shorter-term analysis.
* `20–50` for swing-style analysis.
---
### Search Depth
This controls how much history the engine searches.
Example:
* `1000` means the engine searches roughly 1,000 prior bars.
* `2000` means it searches more history.
* `500` means it searches less history.
Use a higher Search Depth when:
* You want a larger historical sample.
* You are on a short timeframe with lots of bars.
* You want more possible market-state comparisons.
Use a lower Search Depth when:
* You want the model to focus on more recent market behavior.
* You are on a slower chart like daily or weekly.
* You want less influence from older market regimes.
The tradeoff is simple:
* More history gives more examples.
* Less history may be more relevant to the current market regime.
---
### Pattern Matches
This controls how many of the closest historical matches are used.
This is one of the most important inputs.
If set to `30`, the engine finds the **30 closest historical market states** and builds the forecast from those.
Use fewer matches when:
* You want stricter, more specific comparisons.
* You want only the closest historical examples.
* You are okay with a forecast that may be more reactive.
Use more matches when:
* You want a smoother forecast.
* You want less noise from individual examples.
* You want a broader historical sample.
General interpretation:
* `10–20` = stricter, more selective.
* `25–40` = balanced.
* `50+` = broader, smoother, but less specific.
---
### Weight Closer Matches
This controls whether the best matches receive more influence.
When turned **On**:
* The closest historical matches matter more.
* Weaker matches still count, but less heavily.
* The forecast becomes more focused on the most similar examples.
When turned **Off**:
* Every selected match is treated equally.
* The forecast becomes more democratic.
* A very close match and a weaker match have the same influence.
For most users, leave this **On**.
---
## Advanced Model Inputs
### Forecast Model
This chooses how the engine defines the market environment.
All models use:
* EMA trend.
* RSI momentum.
* ATR volatility.
The difference is how each model emphasizes those ingredients.
---
### Conservative
Use **Conservative** when you want a slower, smoother model.
It is designed to:
* React less aggressively.
* Favor more stable market environments.
* Put more importance on trend and volatility.
* Reduce noisy forecast changes.
Best for:
* Daily charts.
* Swing trading.
* Slower-moving stocks or ETFs.
* Users who want fewer false shifts.
---
### Balanced
Use **Balanced** as the general-purpose default.
It is designed to:
* Give trend, momentum, and volatility a normal balance.
* Work across many markets.
* Avoid being too slow or too fast.
Best for:
* Most users.
* Most chart timeframes.
* General market forecasting.
* Starting point before testing other models.
---
### Aggressive
Use **Aggressive** when you want a faster model.
It is designed to:
* React more quickly to changing momentum.
* Give more influence to short-term market shifts.
* Be more sensitive to fresh moves.
Best for:
* Intraday trading.
* Fast-moving markets.
* Crypto.
* Momentum names.
* Traders who want earlier, more responsive shifts.
The downside is that it may be noisier.
---
### Trend Following
Use **Trend Following** when you want the model to emphasize persistent directional moves.
It is designed to:
* Care more about trend structure.
* Care less about short-term momentum noise.
* Favor markets that continue moving in the same direction.
Best for:
* Strong trending stocks.
* Indexes.
* Breakout environments.
* Higher-timeframe directional trading.
This model is less ideal in sideways or choppy markets.
---
### Mean Reversion
Use **Mean Reversion** when you want the model to focus on stretched conditions.
It is designed to:
* Emphasize momentum extremes.
* Look for environments where price may snap back or reverse.
* Care less about long-term trend persistence.
Best for:
* Range-bound markets.
* Overbought/oversold setups.
* Countertrend analysis.
* Shorter-term reversal ideas.
This model may fight strong trends, so use it carefully in momentum-heavy markets.
---
## Historical Lookback Inputs
### Lookback Bars
This lets you move the forecast backward in time.
Example:
* `0` means current forecast.
* `50` means show what the forecast would have looked like 50 bars ago.
* `250` means show what the forecast would have looked like 250 bars ago.
Use this for:
* Visual backtesting.
* Studying old setups.
* Checking whether the forecast was useful historically.
* Comparing forecast paths against what actually happened.
This is one of the most valuable testing features.
---
### Lock to Candle
This lets you anchor the forecast to a specific candle time instead of a simple bar offset.
Use it when:
* You want to test a specific time of day.
* You trade a regular session open.
* You want repeatable historical anchors.
Example:
* You can lock to the 13:30 UTC candle, which often corresponds to the U.S. stock market open during daylight saving time.
When this is off, the indicator uses **Lookback Bars** instead.
---
### Days Back
This works with **Lock to Candle**.
It tells the indicator how many matching anchor candles to go back.
Example:
* `0` = most recent matching candle.
* `1` = one matching session back.
* `2` = two matching sessions back.
Use this when:
* You want to test the most recent open.
* You want to test yesterday’s open.
* You want to step through past sessions one by one.
---
### Hour UTC
This is the UTC hour used for candle locking.
Use it with **Minute UTC** to identify the exact candle you want.
Example:
* `13` means 13:00 UTC.
* Combined with `30`, it means 13:30 UTC.
This is useful because TradingView symbols and sessions can vary, but UTC gives a consistent anchor.
---
### Minute UTC
This is the UTC minute used for candle locking.
Example:
* Hour UTC = `13`
* Minute UTC = `30`
Together, that means:
* Lock to the 13:30 UTC candle.
Use this for precise historical testing.
---
### Auto Previous Session
This controls what happens if today’s target candle has not printed yet.
When turned **On**:
* The indicator automatically uses the most recent previous matching candle.
* This keeps the forecast visible even before today’s target time exists.
When turned **Off**:
* If today’s target candle has not printed, the lock may show no match and fall back.
For most users, leave this **On**.
---
## Bias Logic Inputs
### Bias Threshold %
This controls how strong the bull or bear probability must be before the indicator labels the forecast bullish or bearish.
Example:
* If Bias Threshold is `60`, Bull Probability must be at least 60% before a bullish label can appear.
* If Bear Probability is at least 60%, a bearish label can appear.
Use a lower threshold when:
* You want more frequent bias labels.
* You are okay with weaker directional evidence.
Use a higher threshold when:
* You want stricter signals.
* You only want stronger historical agreement.
Practical range:
* `60%` = balanced.
* `70%+` = more conservative.
* `50–55%` = loose and more signal-heavy.
---
### Minimum Bull/Bear Edge %
This controls how large the gap must be between Bull Probability and Bear Probability.
Example:
* Bull Probability = 65%
* Bear Probability = 35%
* Edge = 30 percentage points
If the minimum edge is `15`, this would qualify.
But:
* Bull Probability = 58%
* Bear Probability = 42%
* Edge = 16 percentage points
This may still fail if Bull Probability is below the Bias Threshold.
This input prevents weak differences from being labeled as strong directional bias.
Use a higher edge when:
* You want cleaner bias labels.
* You want the model to avoid borderline calls.
Use a lower edge when:
* You want more frequent directional bias.
* You accept more uncertainty.
---
## Display Inputs
### Show Forecast Midline
This turns the main forecast line on or off.
Turn it **On** when:
* You want to see the projected average path.
Turn it **Off** when:
* You only want the info box probabilities.
* You want a cleaner chart.
---
### Show Confidence Bands
This turns the upper and lower forecast bands on or off.
Turn it **On** when:
* You want to see the historical range of outcomes.
* You care about uncertainty.
* You want to know whether the forecast is tight or messy.
Turn it **Off** when:
* You only want the central forecast.
* The chart feels too cluttered.
---
### Band Width Multiplier
This controls how wide the bands are.
Higher values make the bands wider.
Lower values make the bands tighter.
Use lower values when:
* You want a cleaner, tighter visual range.
* You want bands closer to the average forecast.
Use higher values when:
* You want to see a broader range of historical outcomes.
* You want a more conservative uncertainty envelope.
Default `1.0` is a good starting point.
---
## Forecast Midline Style Inputs
### Forecast Midline Color
Controls the color of the main projection line.
The default aqua color makes it visually distinct from price candles.
### Forecast Midline Width
Controls how thick the midline is.
Use a thicker line when:
* You want the forecast to stand out.
* You are using a busy chart.
Use a thinner line when:
* You want a cleaner chart.
* You use many overlays.
### Forecast Midline Type
Controls whether the line is:
* Solid.
* Dashed.
* Dotted.
Solid is usually best for the main forecast line.
---
## Upper Band Style Inputs
### Upper Band Color
Controls the color of the upper forecast band.
The default green tone suggests upside range.
### Upper Band Width
Controls how thick the upper band is.
A thin dashed line usually works best because it should be secondary to the midline.
### Upper Band Type
Controls whether the upper band is solid, dashed, or dotted.
Dashed is usually best because it visually communicates “range” rather than “target.”
---
## Lower Band Style Inputs
### Lower Band Color
Controls the color of the lower forecast band.
The default red tone suggests downside range.
### Lower Band Width
Controls how thick the lower band is.
A thin line keeps it useful without dominating the chart.
### Lower Band Type
Controls whether the lower band is solid, dashed, or dotted.
Dashed is usually best for the same reason as the upper band.
---
## Info Box Inputs
### Show Info Box
This turns the dashboard on or off.
Turn it **On** when:
* You want the probabilities and diagnostics visible.
* You are actively evaluating the forecast.
Turn it **Off** when:
* You only want the chart projection.
* You want a cleaner visual layout.
---
### Info Box Position
Controls where the dashboard appears.
Options:
* Top Left.
* Top Right.
* Bottom Left.
* Bottom Right.
Use the position that interferes least with price action on your chart.
---
### Text Size
Controls the dashboard text size.
Use:
* **Tiny** for compact charts.
* **Small** for normal use.
* **Normal** if you want easier reading.
* **Large** for presentations or large monitors.
---
### Background
Controls the info box background color.
A darker background usually works best on most TradingView chart themes.
### Border
Controls the info box border color.
This helps separate the dashboard from the chart.
### Header Text
Controls the title/header text color.
### Header Background
Controls the top header row background.
This gives the dashboard its polished look.
---
## Info Box Metrics
### Bull Prob %
This shows the weighted percentage of selected historical matches that ended bullish.
Simple meaning:
> Of the similar historical market states, how many tended to move up?
A high number means bullish outcomes dominated the selected historical matches.
---
### Bear Prob %
This shows the weighted percentage of selected historical matches that ended bearish.
Simple meaning:
> Of the similar historical market states, how many tended to move down?
A high number means bearish outcomes dominated the selected historical matches.
---
### Direction Bias
This shows the final label after applying the bias rules.
Possible outputs:
* Bullish.
* Bearish.
* None.
* Weak Data.
* No Matches.
A bullish or bearish label only appears when the probability and edge requirements are met.
---
### Bull/Bear/Flat
This shows how many selected matches ended:
* Bullish.
* Bearish.
* Flat.
Example:
* `18 / 9 / 3`
This means:
* 18 bullish historical outcomes.
* 9 bearish historical outcomes.
* 3 flat historical outcomes.
This gives you a quick look at the underlying distribution.
---
### Match Count
This shows how many historical matches were actually used.
If Pattern Matches is set to `30`, Match Count should usually show `30`.
If it shows less, there may not have been enough valid historical data.
---
### Fit Quality
This tells you how closely the selected historical matches resemble the current market state.
High Fit Quality means:
* The current market environment closely resembles the selected historical examples.
Low Fit Quality means:
* The engine found matches, but they were not very close.
Important:
* Fit Quality is not win rate.
* Fit Quality is not probability.
* Fit Quality is not accuracy.
* It only measures how good the historical comparisons are.
Best interpretation:
* High Fit Quality + strong Bull/Bear Probability = more compelling.
* High Fit Quality + split probabilities = similar markets existed, but outcomes were mixed.
* Low Fit Quality = be cautious.
---
### Model
This shows which Forecast Model is active.
Examples:
* Balanced.
* Conservative.
* Aggressive.
* Trend Following.
* Mean Reversion.
This is useful for screenshots and reviewing past setups.
---
### Anchor
This tells you where the forecast is anchored.
Examples:
* `0 bars · NR` means current forecast using Non-Repaint Mode.
* `50 bars · NR` means historical forecast from 50 bars ago.
* `Locked` means it is anchored to a specific UTC candle.
This helps you know whether you are looking at a current forecast or a historical replay.
---
### Search Depth
This shows the actual number of bars being searched.
It may be lower than your input if the chart does not have enough loaded history.
---
## Best Practical Way to Use It
A clean workflow would be:
* Start with **Balanced** model.
* Keep **Non-Repaint Mode On**.
* Use **Pattern Matches around 30**.
* Use **Search Depth around 1000**.
* Watch **Fit Quality**.
* Watch **Bull/Bear Probability**.
* Treat the forecast line as a scenario path, not a guaranteed prediction.
* Use **Lookback Bars** to test whether the forecast was historically useful.
* Avoid trusting any forecast where the bands are very wide and probabilities are split.
The strongest setup is usually when:
* Fit Quality is high.
* Bull or Bear Probability is clearly dominant.
* The forecast bands are not extremely wide.
* The projection agrees with price structure.
The engine defines the current market environment using three things:
* **Trend**, based on moving averages.
* **Momentum**, based on RSI.
* **Volatility**, based on ATR.
Then it finds the closest historical matches, studies their future paths, and draws a forecast line with optional upper and lower bands.
---
## What You See on the Chart
### Forecast Midline
The main forecast line shows the **average path** of the selected historical matches.
In simple terms:
* If similar past situations usually moved higher, the line slopes up.
* If similar past situations usually moved lower, the line slopes down.
* If similar past situations were mixed, the line may be flat or choppy.
### Upper Band
The upper band shows the stronger side of historical outcomes.
It means:
* Some similar historical setups moved better than the average.
* The upper band gives you a visual idea of the upside range from those past examples.
* It is not a guaranteed target.
### Lower Band
The lower band shows the weaker side of historical outcomes.
It means:
* Some similar historical setups moved worse than the average.
* The lower band gives you a visual idea of downside risk from those past examples.
* It is not a guaranteed support level.
### Band Width
The space between the bands matters.
* Tight bands mean historical outcomes were more consistent.
* Wide bands mean historical outcomes were scattered and less reliable.
* A forecast with wide bands should be treated with more caution.
---
## Main Inputs
### Non-Repaint Mode
**Default: On**
This controls whether the forecast uses the live candle or the last completed candle.
Use **Non-Repaint Mode On** when:
* You want more stable signals.
* You want the forecast to update only after the candle closes.
* You care about cleaner historical testing.
Use **Non-Repaint Mode Off** when:
* You want the forecast to react during the current live candle.
* You accept that the forecast may change before the candle closes.
For most use cases, leave this **On**.
---
## Model Group
### Forecast Horizon
This controls how far into the future the indicator projects.
Example:
* On a daily chart, `20` means 20 trading days.
* On a 1-hour chart, `20` means 20 hours.
* On a 5-minute chart, `20` means 20 five-minute candles.
Use a lower value when:
* You are trading short-term moves.
* You want a tighter forecast window.
* You do not want the projection stretched too far.
Use a higher value when:
* You are looking for swing-trade context.
* You want to see the broader projected path.
* You are using higher timeframes.
A practical range is usually:
* `10–20` for shorter-term analysis.
* `20–50` for swing-style analysis.
---
### Search Depth
This controls how much history the engine searches.
Example:
* `1000` means the engine searches roughly 1,000 prior bars.
* `2000` means it searches more history.
* `500` means it searches less history.
Use a higher Search Depth when:
* You want a larger historical sample.
* You are on a short timeframe with lots of bars.
* You want more possible market-state comparisons.
Use a lower Search Depth when:
* You want the model to focus on more recent market behavior.
* You are on a slower chart like daily or weekly.
* You want less influence from older market regimes.
The tradeoff is simple:
* More history gives more examples.
* Less history may be more relevant to the current market regime.
---
### Pattern Matches
This controls how many of the closest historical matches are used.
This is one of the most important inputs.
If set to `30`, the engine finds the **30 closest historical market states** and builds the forecast from those.
Use fewer matches when:
* You want stricter, more specific comparisons.
* You want only the closest historical examples.
* You are okay with a forecast that may be more reactive.
Use more matches when:
* You want a smoother forecast.
* You want less noise from individual examples.
* You want a broader historical sample.
General interpretation:
* `10–20` = stricter, more selective.
* `25–40` = balanced.
* `50+` = broader, smoother, but less specific.
---
### Weight Closer Matches
This controls whether the best matches receive more influence.
When turned **On**:
* The closest historical matches matter more.
* Weaker matches still count, but less heavily.
* The forecast becomes more focused on the most similar examples.
When turned **Off**:
* Every selected match is treated equally.
* The forecast becomes more democratic.
* A very close match and a weaker match have the same influence.
For most users, leave this **On**.
---
## Advanced Model Inputs
### Forecast Model
This chooses how the engine defines the market environment.
All models use:
* EMA trend.
* RSI momentum.
* ATR volatility.
The difference is how each model emphasizes those ingredients.
---
### Conservative
Use **Conservative** when you want a slower, smoother model.
It is designed to:
* React less aggressively.
* Favor more stable market environments.
* Put more importance on trend and volatility.
* Reduce noisy forecast changes.
Best for:
* Daily charts.
* Swing trading.
* Slower-moving stocks or ETFs.
* Users who want fewer false shifts.
---
### Balanced
Use **Balanced** as the general-purpose default.
It is designed to:
* Give trend, momentum, and volatility a normal balance.
* Work across many markets.
* Avoid being too slow or too fast.
Best for:
* Most users.
* Most chart timeframes.
* General market forecasting.
* Starting point before testing other models.
---
### Aggressive
Use **Aggressive** when you want a faster model.
It is designed to:
* React more quickly to changing momentum.
* Give more influence to short-term market shifts.
* Be more sensitive to fresh moves.
Best for:
* Intraday trading.
* Fast-moving markets.
* Crypto.
* Momentum names.
* Traders who want earlier, more responsive shifts.
The downside is that it may be noisier.
---
### Trend Following
Use **Trend Following** when you want the model to emphasize persistent directional moves.
It is designed to:
* Care more about trend structure.
* Care less about short-term momentum noise.
* Favor markets that continue moving in the same direction.
Best for:
* Strong trending stocks.
* Indexes.
* Breakout environments.
* Higher-timeframe directional trading.
This model is less ideal in sideways or choppy markets.
---
### Mean Reversion
Use **Mean Reversion** when you want the model to focus on stretched conditions.
It is designed to:
* Emphasize momentum extremes.
* Look for environments where price may snap back or reverse.
* Care less about long-term trend persistence.
Best for:
* Range-bound markets.
* Overbought/oversold setups.
* Countertrend analysis.
* Shorter-term reversal ideas.
This model may fight strong trends, so use it carefully in momentum-heavy markets.
---
## Historical Lookback Inputs
### Lookback Bars
This lets you move the forecast backward in time.
Example:
* `0` means current forecast.
* `50` means show what the forecast would have looked like 50 bars ago.
* `250` means show what the forecast would have looked like 250 bars ago.
Use this for:
* Visual backtesting.
* Studying old setups.
* Checking whether the forecast was useful historically.
* Comparing forecast paths against what actually happened.
This is one of the most valuable testing features.
---
### Lock to Candle
This lets you anchor the forecast to a specific candle time instead of a simple bar offset.
Use it when:
* You want to test a specific time of day.
* You trade a regular session open.
* You want repeatable historical anchors.
Example:
* You can lock to the 13:30 UTC candle, which often corresponds to the U.S. stock market open during daylight saving time.
When this is off, the indicator uses **Lookback Bars** instead.
---
### Days Back
This works with **Lock to Candle**.
It tells the indicator how many matching anchor candles to go back.
Example:
* `0` = most recent matching candle.
* `1` = one matching session back.
* `2` = two matching sessions back.
Use this when:
* You want to test the most recent open.
* You want to test yesterday’s open.
* You want to step through past sessions one by one.
---
### Hour UTC
This is the UTC hour used for candle locking.
Use it with **Minute UTC** to identify the exact candle you want.
Example:
* `13` means 13:00 UTC.
* Combined with `30`, it means 13:30 UTC.
This is useful because TradingView symbols and sessions can vary, but UTC gives a consistent anchor.
---
### Minute UTC
This is the UTC minute used for candle locking.
Example:
* Hour UTC = `13`
* Minute UTC = `30`
Together, that means:
* Lock to the 13:30 UTC candle.
Use this for precise historical testing.
---
### Auto Previous Session
This controls what happens if today’s target candle has not printed yet.
When turned **On**:
* The indicator automatically uses the most recent previous matching candle.
* This keeps the forecast visible even before today’s target time exists.
When turned **Off**:
* If today’s target candle has not printed, the lock may show no match and fall back.
For most users, leave this **On**.
---
## Bias Logic Inputs
### Bias Threshold %
This controls how strong the bull or bear probability must be before the indicator labels the forecast bullish or bearish.
Example:
* If Bias Threshold is `60`, Bull Probability must be at least 60% before a bullish label can appear.
* If Bear Probability is at least 60%, a bearish label can appear.
Use a lower threshold when:
* You want more frequent bias labels.
* You are okay with weaker directional evidence.
Use a higher threshold when:
* You want stricter signals.
* You only want stronger historical agreement.
Practical range:
* `60%` = balanced.
* `70%+` = more conservative.
* `50–55%` = loose and more signal-heavy.
---
### Minimum Bull/Bear Edge %
This controls how large the gap must be between Bull Probability and Bear Probability.
Example:
* Bull Probability = 65%
* Bear Probability = 35%
* Edge = 30 percentage points
If the minimum edge is `15`, this would qualify.
But:
* Bull Probability = 58%
* Bear Probability = 42%
* Edge = 16 percentage points
This may still fail if Bull Probability is below the Bias Threshold.
This input prevents weak differences from being labeled as strong directional bias.
Use a higher edge when:
* You want cleaner bias labels.
* You want the model to avoid borderline calls.
Use a lower edge when:
* You want more frequent directional bias.
* You accept more uncertainty.
---
## Display Inputs
### Show Forecast Midline
This turns the main forecast line on or off.
Turn it **On** when:
* You want to see the projected average path.
Turn it **Off** when:
* You only want the info box probabilities.
* You want a cleaner chart.
---
### Show Confidence Bands
This turns the upper and lower forecast bands on or off.
Turn it **On** when:
* You want to see the historical range of outcomes.
* You care about uncertainty.
* You want to know whether the forecast is tight or messy.
Turn it **Off** when:
* You only want the central forecast.
* The chart feels too cluttered.
---
### Band Width Multiplier
This controls how wide the bands are.
Higher values make the bands wider.
Lower values make the bands tighter.
Use lower values when:
* You want a cleaner, tighter visual range.
* You want bands closer to the average forecast.
Use higher values when:
* You want to see a broader range of historical outcomes.
* You want a more conservative uncertainty envelope.
Default `1.0` is a good starting point.
---
## Forecast Midline Style Inputs
### Forecast Midline Color
Controls the color of the main projection line.
The default aqua color makes it visually distinct from price candles.
### Forecast Midline Width
Controls how thick the midline is.
Use a thicker line when:
* You want the forecast to stand out.
* You are using a busy chart.
Use a thinner line when:
* You want a cleaner chart.
* You use many overlays.
### Forecast Midline Type
Controls whether the line is:
* Solid.
* Dashed.
* Dotted.
Solid is usually best for the main forecast line.
---
## Upper Band Style Inputs
### Upper Band Color
Controls the color of the upper forecast band.
The default green tone suggests upside range.
### Upper Band Width
Controls how thick the upper band is.
A thin dashed line usually works best because it should be secondary to the midline.
### Upper Band Type
Controls whether the upper band is solid, dashed, or dotted.
Dashed is usually best because it visually communicates “range” rather than “target.”
---
## Lower Band Style Inputs
### Lower Band Color
Controls the color of the lower forecast band.
The default red tone suggests downside range.
### Lower Band Width
Controls how thick the lower band is.
A thin line keeps it useful without dominating the chart.
### Lower Band Type
Controls whether the lower band is solid, dashed, or dotted.
Dashed is usually best for the same reason as the upper band.
---
## Info Box Inputs
### Show Info Box
This turns the dashboard on or off.
Turn it **On** when:
* You want the probabilities and diagnostics visible.
* You are actively evaluating the forecast.
Turn it **Off** when:
* You only want the chart projection.
* You want a cleaner visual layout.
---
### Info Box Position
Controls where the dashboard appears.
Options:
* Top Left.
* Top Right.
* Bottom Left.
* Bottom Right.
Use the position that interferes least with price action on your chart.
---
### Text Size
Controls the dashboard text size.
Use:
* **Tiny** for compact charts.
* **Small** for normal use.
* **Normal** if you want easier reading.
* **Large** for presentations or large monitors.
---
### Background
Controls the info box background color.
A darker background usually works best on most TradingView chart themes.
### Border
Controls the info box border color.
This helps separate the dashboard from the chart.
### Header Text
Controls the title/header text color.
### Header Background
Controls the top header row background.
This gives the dashboard its polished look.
---
## Info Box Metrics
### Bull Prob %
This shows the weighted percentage of selected historical matches that ended bullish.
Simple meaning:
> Of the similar historical market states, how many tended to move up?
A high number means bullish outcomes dominated the selected historical matches.
---
### Bear Prob %
This shows the weighted percentage of selected historical matches that ended bearish.
Simple meaning:
> Of the similar historical market states, how many tended to move down?
A high number means bearish outcomes dominated the selected historical matches.
---
### Direction Bias
This shows the final label after applying the bias rules.
Possible outputs:
* Bullish.
* Bearish.
* None.
* Weak Data.
* No Matches.
A bullish or bearish label only appears when the probability and edge requirements are met.
---
### Bull/Bear/Flat
This shows how many selected matches ended:
* Bullish.
* Bearish.
* Flat.
Example:
* `18 / 9 / 3`
This means:
* 18 bullish historical outcomes.
* 9 bearish historical outcomes.
* 3 flat historical outcomes.
This gives you a quick look at the underlying distribution.
---
### Match Count
This shows how many historical matches were actually used.
If Pattern Matches is set to `30`, Match Count should usually show `30`.
If it shows less, there may not have been enough valid historical data.
---
### Fit Quality
This tells you how closely the selected historical matches resemble the current market state.
High Fit Quality means:
* The current market environment closely resembles the selected historical examples.
Low Fit Quality means:
* The engine found matches, but they were not very close.
Important:
* Fit Quality is not win rate.
* Fit Quality is not probability.
* Fit Quality is not accuracy.
* It only measures how good the historical comparisons are.
Best interpretation:
* High Fit Quality + strong Bull/Bear Probability = more compelling.
* High Fit Quality + split probabilities = similar markets existed, but outcomes were mixed.
* Low Fit Quality = be cautious.
---
### Model
This shows which Forecast Model is active.
Examples:
* Balanced.
* Conservative.
* Aggressive.
* Trend Following.
* Mean Reversion.
This is useful for screenshots and reviewing past setups.
---
### Anchor
This tells you where the forecast is anchored.
Examples:
* `0 bars · NR` means current forecast using Non-Repaint Mode.
* `50 bars · NR` means historical forecast from 50 bars ago.
* `Locked` means it is anchored to a specific UTC candle.
This helps you know whether you are looking at a current forecast or a historical replay.
---
### Search Depth
This shows the actual number of bars being searched.
It may be lower than your input if the chart does not have enough loaded history.
---
## Best Practical Way to Use It
A clean workflow would be:
* Start with **Balanced** model.
* Keep **Non-Repaint Mode On**.
* Use **Pattern Matches around 30**.
* Use **Search Depth around 1000**.
* Watch **Fit Quality**.
* Watch **Bull/Bear Probability**.
* Treat the forecast line as a scenario path, not a guaranteed prediction.
* Use **Lookback Bars** to test whether the forecast was historically useful.
* Avoid trusting any forecast where the bands are very wide and probabilities are split.
The strongest setup is usually when:
* Fit Quality is high.
* Bull or Bear Probability is clearly dominant.
* The forecast bands are not extremely wide.
* The projection agrees with price structure.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.