Temporal Dependency in Gold (XAUUSD) Price Returns: A Multi-Timescale Empirical Analysis
Author: Nugroho Adhipratama Ancha Saputra
Date: July 6, 2026 Type: Personal Research Project
⚠️ Disclaimer: This is an independent, personal research project conducted for learning and exploratory purposes only. It is not affiliated with, reviewed by, or endorsed by any academic institution, financial firm, or third party. The findings, code, and conclusions below are shared purely as a personal record and portfolio piece — not as financial, investment, or trading advice. No claim is made regarding the profitability or tradability of any effect described in this document.
Abstract
This study investigates whether short-horizon returns of gold (XAUUSD) exhibit statistically detectable temporal dependency, or whether they are consistent with the random walk hypothesis. A purpose-built analysis pipeline — implemented in Python and described in full below — encodes log returns into discrete quantile states, measures conditional structure via mutual information between historical state sequences and subsequent states, and evaluates statistical significance using a non-parametric permutation test. The pipeline was applied to real XAUUSD OHLC data across six intraday and near-intraday timeframes (M1, M5, M15, M30, H1, H4) spanning 2004–2024, with a sub-period stability analysis conducted on a yearly basis for each timeframe.
Across all six timeframes, a small but statistically significant departure from the random walk null hypothesis was detected (permutation p ≤ 0.0005 in every case), with mutual information and the associated predictability gain declining monotonically as the bar interval increases — from a predictability gain of 3.70% at the 1-minute timeframe to 0.99% at the 4-hour timeframe. Sub-period analysis found the effect to be present in effectively all yearly slices at every timeframe tested, indicating the dependency is temporally persistent rather than concentrated in a small number of anomalous periods. The magnitude and timescale-decay pattern of the effect are consistent with market microstructure phenomena (e.g., bid–ask bounce, quote discreteness) rather than with an economically exploitable multi-period memory effect, though the present study does not directly test this interpretation and it should be treated as a plausible explanation rather than a demonstrated mechanism.
1. Research Objective and Motivation
1.1 Research Question
The study addresses a single, precisely defined question, stated in the codebase's own terms as a hypothesis test:
- Null hypothesis (H0): P(next_return | previous_returns) = P(next_return). Price returns are generated by a process in which the conditional distribution of the next return, given any finite history of past returns, is identical to its unconditional (marginal) distribution. This is the operational definition of the random walk hypothesis used throughout the codebase.
- Alternative hypothesis (H1): P(next_return | previous_returns) ≠ P(next_return). The conditional distribution differs measurably from the marginal distribution, indicating that historical returns carry statistical information about future returns.
This framing deliberately restricts the scope of inquiry. The project does not ask whether gold returns are profitably tradable, nor does it attempt to identify specific chart patterns, fit a predictive model, or estimate risk-adjusted returns of any trading rule. It asks only whether a measurable statistical dependency exists between past and future returns, and, where one is found, attempts to characterize its magnitude and stability rather than its economic exploitability.
1.2 Motivation
The random walk hypothesis and its close relative, the weak-form Efficient Market Hypothesis, occupy a foundational position in financial economics: if asset prices fully and instantaneously reflect all information contained in their own price history, then no trading strategy based solely on past prices can generate systematic excess returns. Empirical tests of this hypothesis have a long history in the literature, and results have been mixed and often timescale-dependent, with evidence of short-horizon autocorrelation frequently attributed to market microstructure effects rather than genuine informational inefficiency.
Gold (XAUUSD) is a particularly relevant instrument for this class of test: it is one of the most heavily traded and continuously quoted instruments globally, has a multi-decade history of electronically recorded intraday data, and is traded across a wide range of timescales by participants with heterogeneous holding periods and objectives. These properties make it well-suited to a multi-timescale dependency analysis, since any detected effect can be examined for consistency (or inconsistency) across a broad range of sampling intervals from one minute to four hours.
The present study's motivation is therefore twofold: (i) to build a methodologically rigorous, reusable, and auditable software pipeline for testing the random walk hypothesis at arbitrary timescales and with configurable statistical methodology, and (ii) to apply that pipeline to a real, multi-decade XAUUSD dataset to produce an empirically grounded answer to the research question stated in §1.1, together with an honest account of the answer's limitations.
2. Methodology
The methodology is described here as implemented in the codebase referenced above. All parameters governing the analysis (encoding scheme, history length, iteration counts, significance thresholds) are defined in a single configuration file (config/config.yaml) and were fixed prior to inspection of any real-data results, a design choice intended to reduce the risk of researcher degrees-of-freedom biasing the reported conclusions (see §5.4).
2.1 Data and Preprocessing
Data loading and validation (Phase 1). Raw OHLCV data is read from CSV files (one file per timeframe: M1, M5, M15, M30, H1, H4), each containing a date, a time field, and open/high/low/close/volume values. The loader parses timestamps, sorts observations chronologically, removes duplicate timestamps, discards rows with missing price fields, and validates internal OHLC consistency (rejecting rows in which, for example, the low exceeds the high, or the close falls outside the [low, high] interval). For every dataset analyzed in this study, the load report indicated zero rows dropped for missing values, duplicate timestamps, or invalid OHLC relationships, and zero instances of out-of-order timestamps requiring re-sorting, indicating that the source data was internally consistent and required no substantive cleaning prior to analysis.
Log return computation (Phase 2). For each timeframe, log returns are computed as r_t = ln(close_t / close_{t-1}). Log returns are used in preference to raw prices or simple percentage returns because (i) log returns are approximately stationary in mean and variance over short-to-medium windows, whereas raw price levels are non-stationary (integrated), which would invalidate the frequency-based statistical tests used in later phases; (ii) log returns compound additively across time, simplifying aggregation; and (iii) log returns are symmetric under sign reversal, avoiding an asymmetry that simple percentage returns introduce between equivalent up- and down-moves.
Descriptive statistics of the computed log-return series were recorded for each timeframe (Table 1). Across all timeframes examined, return distributions exhibited slight negative skewness (with the exception of the 1-minute series, which showed slight positive skewness) and pronounced positive excess kurtosis, with excess kurtosis decreasing monotonically as the bar interval lengthens — from 131.6 at the 1-minute timeframe to 15.1 at the 4-hour timeframe. This pattern (heavy-tailed, leptokurtic returns at fine timescales that become progressively closer to Gaussian at coarser timescales) is a well-documented stylized fact of intraday financial return series and is noted here because it recurs, in modified form, in the dependency results reported in §3.
2.2 State Encoding (Phase 3)
To render the continuous log-return series amenable to discrete information-theoretic and frequency-based analysis, returns are mapped to a finite alphabet of states. The codebase implements four interchangeable encoding schemes (binary direction, five-state magnitude/direction buckets, quantile-based buckets, and volatility-normalized quantile buckets). The quantile encoder, configured with five states (labeled A through E) fit on the empirical quantiles of the full return series for each timeframe, was used as the primary encoding scheme for all results reported in this study. This choice was made because quantile-based binning enforces an approximately uniform marginal distribution over states by construction, which (a) maximizes the achievable marginal entropy for a fixed number of states, thereby maximizing the statistical power of the mutual-information-based tests described below, and (b) avoids the sparsely populated tail bins that a fixed-width or fixed-magnitude binning scheme would produce given the leptokurtic return distributions observed in §2.1.
A methodologically important consequence of this design is that quantile bin edges were fit once on the entirety of each timeframe's dataset and applied uniformly across the full sample, including when the sample was subsequently partitioned into yearly sub-periods for stability analysis (§2.6). This ensures that the definition of each state (e.g., what return magnitude constitutes state "C") is held constant across the sub-period comparison, so that differences in measured dependency between years reflect differences in the underlying conditional structure of returns rather than artifacts of re-fit bin boundaries. It also means, as discussed in §5, that the encoding is fit with full knowledge of the entire historical sample and would need to be adapted (e.g., to a rolling or expanding window) before any conclusions of this study could be applied to a real-time forecasting context.
2.3 Pattern Generation and Frequency Counting (Phases 4–5)
For a given history length k (fixed at k = 3 for all results reported in this study), the encoded state sequence s_1, s_2, ..., s_n is transformed into a set of (history, next-state) pairs of the form (s_t s_{t+1} s_{t+2}, s_{t+3}), for all valid t. With five possible states and a history length of three, there are 5^3 = 125 distinct possible history strings. For every timeframe examined in this study, all 125 possible histories were observed to occur at least once in the data, indicating that sample sizes (ranging from approximately 31,600 observations at the H4 timeframe to approximately 6.34 million observations at the M1 timeframe) were sufficient to populate the full history space.
Frequency tables recording the number of occurrences of each history, and of each (history, next-state) pair, are constructed in a single streaming pass over the state sequence, with memory usage proportional to the number of distinct observed histories rather than to the length of the sequence itself.
2.4 Conditional Probability and Effect Size (Phase 6)
For each observed (history, next-state) pair, the pipeline computes the empirical conditional probability P(next-state | history) = count(history, next-state) / count(history), the marginal probability P(next-state) = count(next-state) / total observations, and a probability gain defined as the difference between the two. The probability gain quantifies, for a specific history, how much more (or less) likely a given next state is than its unconditional base rate; this measure was used to identify the most extreme individual history–next-state relationships in each timeframe's results (reported descriptively in the pipeline output but not individually significance-tested, for reasons discussed in §5.1).
2.5 Information-Theoretic Metrics (Phase 9)
The principal summary statistic used throughout this study is the mutual information I(history; next-state), computed as the difference between the marginal Shannon entropy of the next-state distribution, H(next-state), and the conditional entropy H(next-state | history), both measured in bits:
I(history; next-state) = H(next-state) − H(next-state | history)
Under the null hypothesis of no temporal dependency, I(history; next-state) = 0 in the population (the conditional and marginal distributions coincide); any positive value observed in a finite sample reflects some combination of genuine dependency and finite-sample estimation noise, which is precisely what the permutation test described in §2.6 is designed to distinguish. A derived, more interpretable quantity, the predictability gain, is reported as the percentage of the maximum possible marginal entropy that is resolved by conditioning on history:
predictability gain (%) = 100 × I(history; next-state) / H(next-state)
2.6 Statistical Significance Testing (Phase 7)
The primary test of statistical significance used in this study is a non-parametric permutation test, chosen in preference to relying solely on the classical chi-square test of independence because the chi-square test's validity depends on an asymptotic approximation that requires sufficiently large expected cell counts, a condition that becomes increasingly difficult to guarantee as the number of possible histories (5^k) grows relative to sample size. The permutation test instead directly operationalizes the null hypothesis: the observed state sequence is randomly shuffled (an operation that exactly preserves the marginal frequency of each state while destroying any temporal ordering), the mutual information statistic is recomputed on the shuffled sequence, and this process is repeated 2,000 times (500 times for each sub-period in the yearly stability analysis, for computational tractability) to build an empirical null distribution of the mutual information statistic under random reordering. The one-sided empirical p-value is then computed as the proportion of shuffled replicates whose mutual information equals or exceeds the observed (unshuffled) value, with a standard add-one correction applied to both numerator and denominator to avoid reporting a p-value of exactly zero.
A chi-square test of independence was computed as a secondary, corroborating diagnostic in all analyses; because sample sizes were large relative to the number of possible histories at every timeframe tested, the proportion of contingency-table cells with an expected count below five (a standard threshold for chi-square validity) was 0.0% in every case, indicating that the chi-square results can be interpreted with reasonable confidence alongside the permutation test.
Sub-period stability analysis. To assess whether any detected dependency was a stable property of the return series or an artifact concentrated in a small number of unusual periods, the state sequence for each timeframe was partitioned into non-overlapping calendar-year sub-periods (the quantile encoder having been fit once on the full sample, per §2.2), and the same frequency-counting and permutation-test procedure was applied independently within each year. Years with fewer observations than a configured minimum threshold were excluded from this analysis to avoid drawing conclusions from data too sparse to populate the 125-cell history space reliably; this exclusion was applied automatically at the H4 timeframe, where the configured minimum observation threshold (calibrated for higher-frequency data) exceeded the number of observations available in any single calendar year, and the yearly stability analysis could not be completed for that timeframe as a result.
2.7 Decision Rule
A pre-specified, two-part decision rule, fixed in configuration prior to inspection of results, was used to classify each timeframe's aggregate result as consistent with H0 or H1: a result was classified as exhibiting dependency only if (i) the permutation test p-value fell below a significance threshold of 0.05, and (ii) the predictability gain exceeded a minimum practical threshold of 0.5%. This two-part rule was adopted to distinguish statistically significant but practically negligible effects (which become increasingly easy to detect as sample size grows, independent of their real-world relevance) from effects that are both statistically and practically non-trivial.
3. Results and Interpretation
Table 1. Summary of results by timeframe (quantile encoding, history length k = 3)
| Timeframe | N (returns) | Excess kurtosis | Mutual information (bits) | Predictability gain | Permutation p-value | Effect size (z) | Sub-periods significant |
| M1 | 6,338,139 | 131.6 | 0.0859 | 3.70% | 0.0005 | 24,013.9 | 21 / 21 (100%) |
| M5 | ≈1,352,882 | — | 0.0696 | 3.00% | 0.0005 | 4,202.3 | 21 / 21 (100%) |
| M15 | 464,364 | 39.5 | 0.0597 | 2.57% | 0.0005 | 1,203.0 | 21 / 21 (100%) |
| M30 | 233,975 | 24.3 | 0.0541 | 2.33% | 0.0005 | 536.9 | 21 / 21 (100%) |
| H1 | 117,734 | 21.8 | 0.0410 | 1.77% | 0.0005 | 197.3 | 19 / 19 (100%)¹ |
| H4 | 31,620 | 15.1 | 0.0231 | 0.99% | 0.0005 | 16.3 | not computed² |
¹ Two years (2004, 2024) were excluded from the H1 sub-period analysis due to incomplete calendar-year data. ² The H4 sub-period analysis could not be completed because no calendar year contained sufficient observations relative to the configured minimum-observation threshold; this reflects a configuration limitation rather than a substantive finding (§5.2).
Note on the M5 row: this timeframe's aggregate mutual information and predictability gain are taken from the full-sample run; the mutual information mean across its 21 yearly sub-periods was 0.0675 bits (SD = 0.0226, coefficient of variation = 0.33), consistent with the full-sample value.
3.1 Presence of Statistically Significant Dependency at Every Timeframe Tested
At every timeframe examined — from 1-minute bars up to 4-hour bars — the permutation test rejected the null hypothesis of no temporal dependency at the pre-specified 0.05 significance threshold, with the empirical p-value at the minimum resolvable value (0.0005, given 2,000 permutation iterations) in all six cases. This indicates that, across roughly 30,000 to 6.3 million observations per timeframe, none of the 2,000 random reorderings of the observed state sequence produced mutual information as large as that of the actual, temporally ordered sequence at any timeframe. The corroborating chi-square test reached the same conclusion at every timeframe, with negligible risk of the sparse-cell bias that would otherwise undermine its validity (§2.6).
The effect size (z-score, computed as the number of standard deviations by which the observed statistic exceeds the mean of the permutation null distribution) ranged from 16.3 at the H4 timeframe to 24,013.9 at the M1 timeframe. As is standard in analyses of large financial datasets, these values should be interpreted primarily as reflecting the statistical distinguishability of the observed effect from pure chance, given the sample size, rather than as a measure of the effect's absolute magnitude; the latter is better captured by the mutual information and predictability gain statistics discussed next.
3.2 Monotonic Decay of Effect Magnitude with Increasing Bar Interval
The magnitude of the detected effect, measured by mutual information and predictability gain, declined monotonically as the timeframe was coarsened, from a predictability gain of 3.70% at the 1-minute timeframe to 0.99% at the 4-hour timeframe (Table 1, ordering M1 > M5 > M15 > M30 > H1 > H4). This monotonic relationship between sampling interval and measured dependency strength was observed consistently in both the full-sample results and the sub-period mutual information means. A parallel monotonic decline was observed in the excess kurtosis of the underlying return distributions (131.6 at M1 declining to 15.1 at H4).
This pattern — a dependency effect and a distributional heavy-tailedness that both attenuate as returns are aggregated over longer intervals — is consistent with the effect being substantially attributable to market microstructure phenomena operating at or near the bid–ask spread and quote-formation level (for example, bid–ask bounce, in which sequential trade prices oscillate mechanically between bid and ask quotes, inducing negative or structured serial dependency in raw returns that dissipates as more underlying price ticks are aggregated into each bar). This interpretation is consistent with, but not directly confirmed by, the present analysis: the study did not decompose returns into trade-level bid/ask components, and the microstructure explanation should therefore be regarded as the best-supported interpretation given the observed pattern of results, rather than as a directly demonstrated mechanism. An alternative or complementary explanation — that the dependency reflects genuine short-horizon order-flow autocorrelation (e.g., from algorithmic execution strategies that split large orders into sequences of same-direction trades) — is also consistent with the observed decay pattern and cannot be ruled out by the present methodology.
3.3 Temporal Stability of the Effect
The sub-period stability analysis found the detected dependency to be present, at the pre-specified significance and practical-significance thresholds, in every analyzable calendar year at every timeframe tested (100% of sub-periods classified as dependent in all five timeframes for which sub-period analysis was completed). The coefficient of variation of mutual information across yearly sub-periods ranged from 0.10 (H1) to 0.33 (M1 and M5), indicating moderate but not extreme year-to-year variation in effect magnitude at every timeframe. This finding is notable in that it indicates the aggregate, full-sample result at each timeframe is not an artifact of one or a small number of anomalous years (for example, the 2008 financial crisis or the 2020 market disruption); rather, the dependency — whatever its ultimate cause — appears to be a persistent structural feature of the return-generating process at each timeframe, present across two decades of substantially different market regimes.
It is noted, descriptively, that the earliest years in the sample (2004–2007) generally exhibited the largest mutual information values at each timeframe, with a partial decline (though not a monotonic one) in subsequent years. This observation is consistent with, though does not on its own establish, a secular reduction in short-horizon dependency over the sample period, plausibly associated with increased electronic and algorithmic market participation over the two decades studied; the present analysis does not formally test for a trend and this observation should be regarded as suggestive rather than conclusive.
3.4 Characteristics of the Strongest Individual Patterns
Across every timeframe, the individual (history → next-state) relationships with the largest absolute probability gain were consistently of a specific qualitative form: histories composed of three repetitions of the same extreme state (e.g., "AAA," "CCC," "EEE") were disproportionately likely to be followed by another extreme state, and in several cases by a reversal to the opposite extreme (e.g., "AAA → E" and "EEE → A" were among the largest-gain patterns at every timeframe examined). This qualitative pattern — persistence of extreme moves followed frequently by reversal — is consistent with the microstructure interpretation offered in §3.2 (bid-ask bounce naturally produces exactly this signature, as a trade at the ask following two prior ask-side trades is often followed by a reversion toward the bid) but, per §5, this remains an interpretation consistent with the observed pattern rather than one independently verified by this study.
4. Conclusions
Within the scope defined in §1.1 and subject to the limitations detailed in §5, the following conclusions are supported by the evidence produced by this study:
- The random walk hypothesis, in the strict form tested here, is rejected for XAUUSD at every timeframe examined (M1 through H4), over the 2004–2024 sample period. At every timeframe, the observed state sequence carried more information about its own near-term future than would be expected under random reordering, at a level of statistical confidence that was, in every case, at or beyond the resolution limit of a 2,000-iteration permutation test.
- The magnitude of this dependency is small in absolute information-theoretic terms and decreases monotonically as the sampling interval increases, from a predictability gain of 3.70% of available entropy at the 1-minute timeframe to 0.99% at the 4-hour timeframe. Under the pre-registered decision rule combining statistical and practical significance (§2.7), all six timeframes were classified as exhibiting statistically significant and practically non-trivial (i.e., exceeding the 0.5% predictability-gain floor) dependency, though the practical magnitude of the H4 result (0.99%) is markedly closer to that floor than the finer-timescale results.
- The detected dependency is temporally stable rather than regime-specific, being present in effectively all analyzable calendar-year sub-periods at every timeframe tested, across market conditions as varied as the 2008 financial crisis, the 2011 and 2020 gold price surges, and the low-volatility mid-2010s period. This finding argues against the aggregate result being driven by a small number of unusual episodes.
- The pattern of results — effect magnitude and return-distribution kurtosis both declining monotonically as the bar interval lengthens, combined with a "persistence-then-reversal" qualitative signature in the strongest individual patterns — is most consistent with an explanation grounded in market microstructure effects operating at or near the bid–ask spread, rather than with a multi-period economic memory effect of the kind that would be expected to persist, undiminished, into daily or weekly return horizons. This study does not directly test daily or weekly XAUUSD data and this conclusion regarding longer horizons should accordingly be treated as an extrapolation from the observed decay pattern rather than as a directly demonstrated result.
- No claim is made, or supported by this study, regarding the economic exploitability of the detected dependency. The predictability gains reported here (0.99%–3.70% of available entropy) are unadjusted for transaction costs, bid–ask spread, latency, or any other implementation friction, and the study's design explicitly excludes any assessment of trading strategy profitability (§1.1).
5. Limitations and Assumptions
- Fitted encoding uses full-sample information. The quantile state encoder is fit once using the entire available sample for each timeframe (§2.2). This is methodologically appropriate for the descriptive, retrospective question this study addresses, but it means the results cannot be directly interpreted as evidence of a forecastable effect in a live, causal (past-information-only) setting without adaptation to a rolling or expanding estimation window.
- Finite-sample bias in mutual information at short history lengths and sparse sub-periods. Naive mutual information estimates are known to be upward-biased when the number of possible discrete states (5^k in this study) is large relative to the number of observations. The permutation test used here is robust to this bias in aggregate, because the same bias is present in the shuffled null distribution; however, this consideration limits the direct, unadjusted interpretability of raw mutual information magnitudes in isolation, particularly at the sub-period level for lower-frequency timeframes, and motivated the automatic exclusion of sparsely populated sub-periods described in §2.6.
- Configuration of the minimum-observation threshold for sub-period analysis was not adapted per timeframe, resulting in the complete exclusion of the H4 timeframe from sub-period stability analysis and the partial exclusion of two years at the H1 timeframe. This is a limitation of the specific analysis run reported here rather than of the underlying methodology, and could be addressed by timeframe-specific threshold configuration in future analyses.
- A single encoding scheme and history length were used for the primary results reported here. Although the codebase implements four distinct encoding schemes and supports arbitrary history lengths, and although the choice of quantile encoding with k = 3 was fixed prior to inspection of results (partially mitigating concerns about result-contingent parameter selection), the sensitivity of the specific numerical results reported in §3 to this choice was not exhaustively characterized within the scope of this study.
- Data provenance and quality were not independently verified beyond the internal-consistency checks performed by the loading pipeline. The absence of missing values, duplicate timestamps, and invalid OHLC relationships in the source data (§2.1) indicates internal consistency but does not constitute independent verification of the data vendor's accuracy, nor does it rule out systematic issues such as unadjusted corporate actions (not applicable to spot gold but relevant to the general methodology), stale-quote artifacts during low-liquidity periods, or vendor-specific timestamp conventions.
- The mechanism underlying the detected dependency was not directly tested. The interpretation offered in §3.2 and §4 (market microstructure effects, particularly bid–ask bounce) is inferred from the observed pattern of results — specifically, the monotonic decay of effect magnitude with increasing bar interval and the qualitative "persistence-then-reversal" signature of the strongest patterns — and is consistent with well-established microstructure phenomena described in the broader market microstructure literature. However, this study did not have access to, and did not analyze, trade-level bid/ask quote data, order flow, or any other data that would permit this mechanism to be directly confirmed or distinguished from alternative explanations (e.g., short-horizon order-flow autocorrelation from algorithmic execution).
- No adjustment for multiple comparisons across timeframes was applied. Six timeframes were tested using a common significance threshold of 0.05; while the extremity of the observed p-values (all at the permutation test's resolution floor) makes this a minor concern for the specific conclusions drawn here, a fully rigorous multi-timeframe testing framework would incorporate an explicit correction (e.g., Bonferroni or false discovery rate control) for the number of timeframes examined.
- Costs, execution frictions, and profitability were entirely out of scope, as stated in §1.1 and reiterated in Conclusion 5. No claims in this study should be interpreted as bearing on the tradability of the detected effect.
6. Suggestions for Future Work
- Direct mechanistic testing of the microstructure hypothesis. The interpretation offered in §3.2–§4 could be directly tested by repeating this analysis on trade-level or quote-level data with explicit bid/ask identification, or by examining whether the detected dependency attenuates or disappears when returns are computed from mid-quotes rather than last-trade prices — a standard technique for isolating bid–ask bounce from genuine price dependency.
- Extension to daily and weekly timeframes. The present study's conclusions regarding longer horizons are extrapolated from the observed decay pattern across M1–H4 timeframes; a direct test on daily and weekly XAUUSD data (the pipeline and codebase already support arbitrary timeframes without modification) would allow this extrapolation to be verified or falsified directly.
- Timeframe-specific sub-period configuration. Re-running the sub-period stability analysis with a minimum-observation threshold calibrated to each timeframe's typical annual bar count would permit the H4 timeframe (and any future lower-frequency timeframes) to be included in the stability analysis, closing the gap identified in Limitation 3.
- Sensitivity analysis across encoding schemes and history lengths. A systematic grid over the four available encoding schemes and a range of history lengths, with appropriate correction for the resulting multiple comparisons (e.g., Benjamini–Hochberg false discovery rate control), would establish whether the conclusions of this study are robust to these methodological choices or are specific to the quantile/k = 3 configuration used here.
- Transaction-cost-adjusted exploitability analysis. As a logically distinct follow-on study (explicitly out of scope for the present work), the detected dependency could be evaluated net of realistic bid–ask spread, commission, and slippage assumptions to determine whether any economically meaningful edge survives after accounting for the costs of implementation at each timeframe.
- Cross-asset replication. Applying the identical, pre-registered methodology to other liquid instruments (major currency pairs, equity indices, other precious metals) would establish whether the magnitude and timescale-decay pattern observed for XAUUSD is a general property of liquid, continuously quoted markets or a feature specific to gold.
- Higher-order and continuous-conditioning dependency measures. As noted in the codebase's own development roadmap, transfer entropy and other information-theoretic measures that do not require discretization of the return series could complement the quantile-based mutual information approach used here, potentially reducing sensitivity to encoding-scheme choice (Limitation 4).
Appendix: Reproducibility Notes
All results reported in this document were produced using the market-dependency-analysis codebase (commit history as of the analysis date), with the primary pipeline invoked via main.py --config config/config.yaml for full-sample results and scripts/run_subperiod_analysis.py --config config/config.yaml for sub-period stability results, with config.yaml's data.raw_path, encoding.method (fixed at quantile), encoding.n_states (fixed at 5), and pattern.history_length (fixed at 3) as the only parameters varied across the six timeframe-specific runs reported in Table 1. The permutation test was run with 2,000 iterations for full-sample results and 500 iterations for each sub-period, both as configured in config.yaml prior to the runs reported here. Full parameter configurations, source code, and the automated test suite (49 unit tests at the time of this analysis) accompanying this methodology are available at the repository linked above.
Personal research notes — last updated July 2026.