OPEN-SOURCE SCRIPT

AutoFractal MTF Adaptive Projection [Aaron Diaz]

316
TITLE

AutoFractal MTF Adaptive Projection [Aaron Diaz]


ENGLISH DESCRIPTION

OVERVIEW

AutoFractal MTF Adaptive Projection searches for historical price structures that resemble a user-defined current structure. The historical search timeframe is independent from the chart timeframe, so a trader can view a daily chart while searching for analogs on 4-hour, 2-hour, daily, or other supported timeframes.

The script is designed as a market-structure comparison and scenario-projection tool. It does not generate buy or sell signals, and its projected path must not be interpreted as a guaranteed forecast.

HOW IT WORKS

1. Historical search range
The user selects a start date, an end date, and a historical source timeframe. The script evaluates candidate structures only inside that selected period.

2. Current target structure
The structure to be matched can be defined using the latest N chart bars or a manual date range on the current chart.

3. Normalized comparison
Historical and current structures are compared using normalized log returns rather than absolute prices. This allows patterns from different price levels and different market regimes to be compared on a proportional basis.

4. Composite similarity score
Each historical candidate receives a score based on:
- Shape and correlation.
- Retracement and Fibonacci behavior.
- Relative amplitude.
- Directional agreement.

Inverse fractals can be enabled when the user wants to compare a bullish structure with an inverted bearish analog, or vice versa.

5. Adaptive projection
After a match is selected, the script uses the historical continuation as an analog scenario. Three adaptation methods are available:
- Percentage: adapts the historical continuation using proportional price movement.
- Fibonacci: adapts the continuation using the relationship between historical and current structural ranges.
- Smart hybrid: combines percentage and Fibonacci adaptation.

The script can automatically adapt both price amplitude and time duration to the current structure.

6. Manual drawing controls
The automatically fitted historical path and future projection can be adjusted independently. Users can change their height, width, horizontal position, and vertical position without changing the historical match itself.

VISUAL OUTPUTS

- Historical match box: marks the selected analog period.
- Fitted historical pattern: overlays the normalized historical structure on the current target.
- Future projection: displays the continuation that followed the historical analog, adapted to the current structure.
- Diagnostics table: shows the search timeframe, matched dates, total score, correlation, retracement score, amplitude scale, time scale, and number of evaluated candidates.

BASIC USE

1. Select the historical search timeframe.
2. Select the historical start and end dates.
3. Define the current target structure.
4. Set the historical pattern length and future projection length.
5. Adjust the minimum score and scoring weights if necessary.
6. Choose Percentage, Fibonacci, or Smart hybrid adaptation.
7. Use the manual drawing controls only after reviewing the automatic fit.

INTERPRETATION

The total score measures similarity under the script's selected criteria. It is not a probability of the projected path occurring. A high score means that the compared structures are mathematically similar according to the configured inputs; it does not mean that market context, liquidity, news, volatility, or order flow are identical.

LIMITATIONS

- Historical analogs can fail and should not be treated as deterministic forecasts.
- Results depend on the selected date range, timeframe, pattern length, score weights, and available historical data.
- Enabling the current unconfirmed bar can cause the selected match and projection to change intrabar.
- Lower-timeframe searches may require more data and processing resources.
- Manual resizing improves visual alignment but does not increase the statistical validity of the match.
- The indicator does not provide entries, exits, stop losses, or position sizing.

OPEN-SOURCE REUSE AND CREDITS

This script is a derivative work based in part on the open-source script "Auto Fractal [theUltimator5]" originally published by TheUltimator5.

Original author and original portions:
TheUltimator5

Substantial redesign, new logic, and additional code:
Aaron Diaz

The derivative adds independent multi-timeframe searching, date-restricted candidate selection, normalized log-return matching, composite scoring, adaptive percentage/Fibonacci projections, time and amplitude scaling, manual fit controls, and expanded diagnostics.

This publication is open-source and retains attribution to the original author under TradingView's open-source reuse rules and the Mozilla Public License 2.0.

DISCLAIMER

This indicator is provided for educational and analytical purposes only. It is not financial advice. Historical similarity does not guarantee future similarity. Users remain responsible for their own analysis, risk management, and trading decisions.


DESCRIPCION EN ESPANOL

RESUMEN

AutoFractal MTF Adaptive Projection busca estructuras historicas del precio que se parezcan a una estructura actual definida por el usuario. La temporalidad historica funciona de manera independiente a la temporalidad visible del grafico, por lo que es posible observar un grafico diario mientras se buscan analogias en 4 horas, 2 horas, diario u otras temporalidades compatibles.

El indicador funciona como una herramienta de comparacion estructural y proyeccion de escenarios. No genera senales de compra o venta y la ruta proyectada no debe interpretarse como una prediccion garantizada.

COMO FUNCIONA

1. Rango historico
El usuario selecciona una fecha inicial, una fecha final y la temporalidad historica. El script evalua candidatos solamente dentro de ese periodo.

2. Estructura actual
La estructura que se quiere comparar puede definirse mediante las ultimas N velas del grafico o mediante un rango manual de fechas.

3. Comparacion normalizada
Las estructuras se comparan mediante rendimientos logaritmicos normalizados y no mediante precios absolutos. Esto permite comparar patrones ocurridos en niveles de precio y condiciones de mercado diferentes.

4. Puntuacion compuesta
Cada candidato recibe una puntuacion basada en:
- Forma y correlacion.
- Retrocesos y comportamiento Fibonacci.
- Amplitud relativa.
- Direccion.

Tambien se pueden permitir fractales inversos.

5. Proyeccion adaptativa
El indicador utiliza la continuacion posterior del fractal historico como un escenario analogo. Existen tres metodos:
- Percentage: adapta porcentualmente el movimiento historico.
- Fibonacci: adapta la continuacion de acuerdo con la relacion entre los rangos historico y actual.
- Smart hybrid: combina ambos metodos.

La amplitud y la duracion temporal pueden adaptarse automaticamente a la estructura actual.

6. Ajuste manual
El patron historico ajustado y la proyeccion futura pueden modificarse por separado en altura, ancho y posicion, sin cambiar el fractal historico seleccionado.

INTERPRETACION Y LIMITACIONES

La puntuacion total mide similitud matematica bajo los parametros elegidos; no representa la probabilidad de que la proyeccion se cumpla. Los resultados pueden cambiar al modificar las fechas, la temporalidad, la longitud, los pesos o al incluir una vela sin cerrar. La herramienta no proporciona entradas, salidas, stop loss ni tamano de posicion.

CREDITOS

Este script es una obra derivada basada parcialmente en el script abierto "Auto Fractal [theUltimator5]", publicado originalmente por TheUltimator5.

Autor original y partes originales:
TheUltimator5

Rediseno sustancial, nueva logica y codigo adicional:
Aaron Diaz

La publicacion se realiza como codigo abierto, conserva la atribucion correspondiente y mantiene la licencia Mozilla Public License 2.0.

AVISO

Este indicador tiene fines educativos y de analisis. No constituye asesoria financiera. La similitud historica no garantiza que el mercado repita el mismo comportamiento.

免责声明

这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。