OPEN-SOURCE SCRIPT

Bitcoin Time Based Adaptive MA | Astral Vision

608
Bitcoin Time Based Adaptive MA | Astral Vision 🌠💠

Work inspired by @moneyordebt.

This indicator computes a weighted moving average on Bitcoin's low price in log space, using a lookback period that automatically expands as Bitcoin matures over time. The core principle is that Bitcoin's market cycles lengthen with each passing halving epoch: the relevant trend window for a 2-year-old asset is structurally shorter than the appropriate window for a 10-year-old asset with deep institutional participation. A fixed MA length either overreacts to noise in early history or becomes too slow in recent years.

Calculation ⚙️

The first step is computing how many years have elapsed since July 1, 2010, the reference origin of Bitcoin's tradeable price history. This elapsed time drives a piecewise linear schedule that determines the appropriate lookback in weeks:

From 0 to 2 years elapsed: the lookback is fixed at 25 weeks. From 2 to 4 years: it scales linearly from 25 to 50 weeks. From 4 to 8 years: it scales linearly from 50 to 100 weeks. From 8 to 16 years: it scales linearly from 100 to 200 weeks. Beyond 16 years: the lookback is capped at 200 weeks.

This schedule approximates Bitcoin's empirically observed cycle elongation across halving epochs without requiring any manual input. The resulting week count is then converted into bars by dividing by the number of seconds per bar and multiplying by the number of seconds per week, making the indicator fully timeframe-agnostic: it produces the correct lookback on daily, weekly, or any other chart resolution automatically.

The MA itself is computed as a weighted moving average (WMA, which weights recent bars more heavily than older ones) applied to the natural logarithm of the low price rather than to raw price. Working in log space is critical for an asset like Bitcoin that has moved across six orders of magnitude: in log space, a move from $100 to $200 and a move from $30,000 to $60,000 are treated as equivalent proportional moves, which is the correct treatment for long-term structural analysis. Once the WMA is computed in log space, the result is exponentiated back to price scale using the natural exponential function.

A scaling factor of 0.65 is then applied to the exponentiated result, positioning the base line near the historical cycle lows of each major Bitcoin correction. A second line is derived by multiplying the base line by 7.5, which approximates the historically observed ratio between Bitcoin's macro support level and its cycle top extremes.

Plots 📊
  • Base adaptive MA: log-space WMA of lows scaled to historical cycle low support, with layered glow effect
  • Top reference line: base MA multiplied by 7.5, approximating historical cycle top territory, with glow effect
  • Background color when price closes below the base MA: potential macro support zone
  • Background color when price closes above the top reference line: potential macro distribution zone


Inputs 🎛️
  • No length or period inputs: the adaptive schedule is fully automatic and time-driven


Colors 🎨
5 Astral Vision presets + custom override. Default: Futura.

Purpose 🎯
Standard moving averages use a fixed length that the user must manually adjust as market conditions evolve. This indicator automates that adaptation based on a time schedule calibrated to Bitcoin's historical cycle structure, removing parameter tuning entirely. The dual-line structure with a support base and a top reference provides a complete macro range framework within a single indicator, functional across Bitcoin's entire available price history from 2010 to present.

Disclaimer ⭕️
This indicator is for informational and educational purposes only. It does not constitute financial advice. Past performance is not indicative of future results. Always do your own research before making investment decisions.

免责声明

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