Auto Fractal [theUltimator5 feat. MrRo8ot] — DTW Edition

What it does
This tool searches the past for a price pattern that best matches your most recent price action, then maps that pattern onto today’s scale and draws:
- an orange line for the matched historical segment, and
- a fuchsia dotted line projecting how that pattern continued right after the match.
Under the hood it can use either DTW (Dynamic Time Warping) or Pearson correlation to score matches. DTW is more flexible for wobbly markets; Pearson is faster and stricter.
Be aware, this is not a buy/sell signal generator but a visual context/road-map tool to explore “what the market did last time this shape appeared.”
How to use (quick start)
- Add to chart and keep defaults.
- Watch the orange line: that’s the historical pattern remapped to today’s scale.
- The fuchsia dots show the immediate continuation from that old pattern (a projection, not a promise).
- Optional: switch 📊 Analysis Mode to explore different behaviors (see below).
- If you want to “freeze time” and check what would’ve been seen at a past moment, enable 📍 Legacy: Manual Point Selection, pick a date/time, and the tool will search from that point back in history.
Reading the on-chart table
- Best Match — DTW sim: Similarity score (0–1). Higher ≈ better shape match.
- Best Match — Corr: If using Pearson, shows correlation % (closer to 100% ≈ better).
- (Live) / (Frozen-X): Live runs on the last bar; Frozen indicates a manual selection and how many bars back the endpoint is.
Configuration options
📊 Analysis Mode
- Auto Fractal (default): Finds the best-matching past window and maps it onto today’s recent window.
- MOASS / BBBYQ: Same search engine, but the projection is exaggerated deliberately:
- MOASS: amplifies bearish impulse in the projection (downside excursion).
- BBBYQ: amplifies bullish impulse (upside excursion). Use the multipliers below to tune how “loud” the projection is.
📍 Legacy: Manual Point Selection
- Enable Manual Point Selection: When ON, choose date/time to “freeze” the endpoint. The tool then asks: Given price up to that time, what past pattern best matched it?
- Great for lightweight backtesting and validating behavior.
🔧 Core parameters
- Correlation/DTW Window Length (l): How many recent bars define the shape to match. (Typical 20–60.)
- Lookback Range (lb): How far back to search for candidates. Larger = more options, slower.
- Future Projection Length (future): How many bars of continuation to draw from the matched pattern.
🎨 Visuals
- Show Match Table / Draw Lines/Box: Turn UI and drawing on/off (disabling drawings speeds things up).
- Render every k-th point: Skip points for speed (1 = draw every point).
- Best Fit / Projection colors: Style the orange (match) and fuchsia (projection) lines.
📐 Autoscale behavior
- Autoscale pattern fit (autoscaleDraw): When ON, the matched pattern is linearly mapped to your recent window.
- Autoscale style:
- Min-Max fit: Stretch the pattern so its min/max aligns with your recent min/max. Preserves shape extremes.
- Anchor base: Keep the pattern’s first point anchored to the current endpoint; scale by ranges.
- Endpoint fit: Fit the first/last points to the recent first/last.
- Least-squares fit (default): Regression fit across the whole window; smooth and robust.
🧱 Clamp (range-cap) controls
These prevent “flat-topping” or clipping by letting you choose where clamping applies.
- Clamp mapped lines to recent range (clipToWindow): Master ON/OFF.
- Clamp future only: If ON, the orange match is free; only the fuchsia projection is range-limited.
- Clamp mode:
- None: No clamping.
- Hi/Lo recent: Clamp to the recent window’s high/low ± padding.
- Hi/Lo wide: Clamp to a wider high/low (X × window length) ± padding.
- ATR × N: Clamp around the endpoint price using ATR bands (ATR length & multiplier below).
- Clamp padding (fraction): Extra headroom above/below the clamp range (e.g., 0.12 = 12%).
- Hi/Lo wide lookback: Multiplier for the wide window.
- ATR length / ATR multiplier: For ATR × N clamping.
Tip: If you see the pattern “flat on top,” try Clamp mode = None or Clamp future only = ON, or increase Clamp padding.
📈 Matching engine (DTW / Pearson)
- Use DTW: ON = Dynamic Time Warping (flexible shape matching). OFF = Pearson correlation (fast/strict).
- DTW Warping Band: 0–0.5; higher allows more time-stretch/bend (0.10–0.20 is common).
- Normalization:
- zscore (default): Standardize level/volatility; focuses on shape.
- returns: Use percent changes; shape from returns.
- none: Raw prices (scale sensitive).
- DTW Early-Abandon Pruning: Speed optimization; stop bad rows early.
- Prune multiplier: How aggressive the pruning is (1.0 = strict; raise if you miss matches).
- (Pearson) Minimum Correlation Threshold: If using Pearson, stop early once correlation ≥ threshold.
⚙️ Compute throttles
- Compute only on bar close: Save CPU by updating only when bars close.
- Recompute every N bars: Further throttle; e.g., 5 updates every 5 bars.
- Lookback Candidate Step: Skip candidate starts (e.g., 3 = check every 3rd start) to speed up big lookbacks.
Practical tips
- Choose window sizes thoughtfully:
- Shorter l captures “micro” swings; longer l captures larger structures.
- DTW vs Pearson:
- If you want speed and clean, rigid matches → Pearson (Use DTW = OFF).
- If you want tolerant shape matching in choppy markets → DTW.
- Performance: If it feels heavy, try: lower lb, increase candidateStride, set computeOnBarClose = ON, raise computeEveryN, or disable drawings while testing.
- Manual rewind: Enable Manual Point Selection, pick a past time, and the tool shows exactly what would’ve been projected then.
- MOASS/BBBYQ multipliers: Tune MOASS projection multiplier / BBBYQ projection multiplier to adjust how strong the dotted projection swings.
What the green box means
A green, semi-transparent box highlights the historical segment that was chosen (in its original location). It’s just a visual cue showing where the orange line came from.
Disclaimer
Past patterns don’t guarantee future outcomes. Use this as a research/visualization aid, not as a standalone trading system. Always combine with risk management and your own analysis.
نص برمجي للمستخدمين المدعوين فقط
يمكن فقط للمستخدمين الذين تمت الموافقة عليهم من قبل المؤلف الوصول إلى هذا البرنامج النصي. ستحتاج إلى طلب الإذن والحصول عليه لاستخدامه. يتم منح هذا عادةً بعد الدفع. لمزيد من التفاصيل، اتبع تعليمات المؤلف أدناه أو اتصل Mr_Ro8ot مباشرة.
لا توصي TradingView بالدفع مقابل برنامج نصي أو استخدامه إلا إذا كنت تثق تمامًا في مؤلفه وتفهم كيفية عمله. يمكنك أيضًا العثور على بدائل مجانية ومفتوحة المصدر في نصوص مجتمعنا.
تعليمات المؤلف
إخلاء المسؤولية
نص برمجي للمستخدمين المدعوين فقط
يمكن فقط للمستخدمين الذين تمت الموافقة عليهم من قبل المؤلف الوصول إلى هذا البرنامج النصي. ستحتاج إلى طلب الإذن والحصول عليه لاستخدامه. يتم منح هذا عادةً بعد الدفع. لمزيد من التفاصيل، اتبع تعليمات المؤلف أدناه أو اتصل Mr_Ro8ot مباشرة.
لا توصي TradingView بالدفع مقابل برنامج نصي أو استخدامه إلا إذا كنت تثق تمامًا في مؤلفه وتفهم كيفية عمله. يمكنك أيضًا العثور على بدائل مجانية ومفتوحة المصدر في نصوص مجتمعنا.