This repository contains the reproducible Python research pipeline associated with the master's dissertation:
Fractality, Multifractality and Harmonic Ratios in Financial Markets: A Falsifiable Test of Elliott Wave Theory Claims
Original French title:
Fractalité, multifractalité et ratios harmoniques dans les marchés financiers : un test falsifiable des revendications de la théorie d’Elliott
The study tests whether selected financial markets exhibit fractal, multifractal, spectral, wavelet, or Fibonacci-type structures beyond those produced by explicit stochastic benchmark models.
It does not attempt subjective Elliott wave counting. Instead, selected claims are translated into measurable statistical objects and evaluated through pre-registered parameters, algorithmic swing detection, Monte Carlo simulation, multiple-testing correction, robustness analysis, and documented analytical-status rules.
The complete dissertation is available in French in docs/manuscript/.
The French manuscript is the canonical academic reference for:
- the research question and theoretical framework;
- the literature review;
- the hypotheses and methodological argument;
- the empirical results;
- the discussion and limitations;
- the final conclusions.
The English-language Markdown files throughout docs/ serve as structured companion translations for international readers. They provide an English reading layer for the protocol, methodological choices, corrections, limitations, reproducibility controls, and interpretation of the results.
These Markdown documents are not a separate empirical study and do not replace the complete French manuscript.
If a discrepancy in wording or interpretation arises, priority is given to:
- the final French manuscript;
- the final configuration;
- the frozen empirical outputs;
- the methodological decision log;
- the SHA-256 manifests;
- the English-language companion documentation.
The results do not support a general validation of Elliott Wave Theory.
Some assets display scale dependence or multifractal heterogeneity relative to simple null models. These signatures are nevertheless heterogeneous across assets and are not robust to all admissible benchmarks, parameterisations, and subperiods.
| Hypothesis | Object tested | Final status |
|---|---|---|
| H1 | DFA-based Hurst exponent differs from 0.5 | Not supported for SPY and GLD; non-robust for USO and BTCUSD |
| H2 | MF-DFA spectrum width exceeds benchmark values | Not supported for USO; globally non-robust |
| H3 | Swing ratios are over-represented near 0.618, 1.618, and 2.618 | Inconclusive because all assets remain below the pre-registered adequacy threshold |
| H4 | Results are stable across parameters, time, assets, and benchmarks | Not supported |
H3 must not be interpreted as an empirical rejection of Fibonacci concentration.
None of the four assets reaches the pre-registered minimum of 300 usable swing ratios. The daily-data protocol therefore provides insufficient information either to support an over-representation of the selected ratios or to establish their absence.
The main conclusion is consequently negative but qualified: the study does not identify sufficiently robust evidence to validate the tested fractal, multifractal, or harmonic implications as general properties of the selected financial markets.
| Question | Focus | Empirical object |
|---|---|---|
| R1 | Do financial series exhibit fractal or multifractal properties beyond stochastic benchmarks? | Hurst exponent, multifractal spectrum width, spectral and wavelet diagnostics |
| R2 | Are swing-amplitude ratios over-represented around Fibonacci-type values? | Ratios near 0.618, 1.618, and 2.618 |
| R3 | Are the observed signatures robust across assets, benchmarks, periods, and parameters? | Temporal, parameter, benchmark, and cross-asset stability |
| Asset | Instrument | Ticker | Final number of log returns |
|---|---|---|---|
| S&P 500 | ETF proxy | SPY |
2,765 |
| Gold | ETF proxy | GLD |
2,765 |
| WTI crude oil | ETF proxy | USO |
2,765 |
| Bitcoin | Spot crypto USD | BTCUSD |
2,844 |
Frequency: Daily
Target period: 2015-01-01 to 2025-12-31
Primary source: Stooq Historical Data
Primary variable: Daily logarithmic returns
The final daily protocol replaced an initially considered intraday design because no homogeneous, complete, free, and reproducible intraday source was available for all four assets over the target period.
The empirical analysis uses daily historical market data obtained from Stooq.
The primary empirical variable is the daily logarithmic return:
r_t = log(P_t / P_{t-1})
For swing detection, the algorithm is applied to the log-price series:
X_t = log(P_t)
The final empirical run uses the Close field supplied by Stooq for all four assets.
For BTCUSD, the analysis is conducted on the dates available in the Stooq series. Missing calendar dates are documented but are not reconstructed or imputed.
The absence of complete source metadata establishing whether the ETF close field incorporates all adjustment effects is retained as a data limitation.
The empirical framework combines:
- detrended fluctuation analysis (DFA) for Hurst estimation;
- multifractal detrended fluctuation analysis (MF-DFA);
- fast Fourier transform (FFT) diagnostics;
- continuous wavelet transform (CWT) diagnostics;
- algorithmic peak-trough / ZigZag swing detection;
- Fibonacci-ratio tests around 0.618, 1.618, and 2.618;
- Monte Carlo benchmarking;
- Benjamini-Hochberg false discovery rate correction;
- parameter, temporal, benchmark, rolling, and cross-asset robustness checks.
FFT and CWT are descriptive analyses. They are not primary confirmatory tests of H1–H4.
| Benchmark | Purpose |
|---|---|
| Random Walk / i.i.d. bootstrap | Baseline without temporal dependence |
| Shuffled returns | Preserves the empirical return sample while destroying temporal order |
| GARCH(1,1) | Controls for conditional volatility clustering |
| ARFIMA-type model | Controls for fractional long-memory-like dynamics |
The same estimators and parameter rules are applied to empirical and simulated series wherever the benchmark is admissible.
The main configuration is stored in src/config/config.yaml.
| Parameter | Value |
|---|---|
| Random seed | 42 |
| Monte Carlo simulations | 10,000 per asset and benchmark |
| Significance level | 0.05 |
| FDR level | 0.05 |
| DFA / MF-DFA detrending order | 1 |
| Minimum scale | 10 observations |
| Maximum scale | floor(n / 4) |
| Number of scales | 25 |
| MF-DFA q-range | -5 to 5 |
| MF-DFA q-step | 1 |
| Swing ATR length | 14 |
| Swing threshold | 1.5 × ATRlog(14) |
| Minimum swing distance | 5 daily bars |
| Primary Fibonacci tolerance | ±5% |
| Minimum usable H3 ratios | 300 |
The authoritative empirical state is the corrected_confirmatory_summary frozen on 5 July 2026.
It combines:
- the corrected four-asset confirmatory run;
- a complete USO recalculation following correction of the source-date format;
- recalculated Benjamini-Hochberg adjustments for the merged final tables;
- exclusion of the non-admissible BTCUSD-GARCH benchmark from confirmatory inference.
The initial and superseded outputs are retained only for audit and provenance purposes.
ARFIMA(1,d,1) and rolling-window analyses are stored separately as post-hoc robustness diagnostics.
BTCUSD-GARCH outputs are preserved for traceability but excluded from inference because the fitted null model was classified as non-admissible.
The repository distinguishes the following analytical statuses:
| Status | Meaning |
|---|---|
corrected_confirmatory |
Corrected execution of the pre-registered analysis |
robustness |
Predefined sensitivity or stability analysis |
post_hoc_robustness |
Analysis introduced after the primary design |
excluded_nonadmissible |
Output preserved for audit but excluded from inference |
superseded / audit_only |
Historical artefact not used for final conclusions |
See docs/decisions/ before interpreting any generated result.
The presence of a file in results/ does not, by itself, establish confirmatory status.
.
|-- data/
| |-- metadata/ # Dictionary, QA, and stationarity metadata
| |-- processed/ # Processed daily datasets
| `-- raw/ # Versioned Stooq source files
|-- docs/
| |-- manuscript/ # Canonical French-language dissertation
| |-- protocol/ # Pre-registered hypotheses and decision rules
| |-- decisions/ # Corrections, exclusions, and analytical statuses
| |-- methodology/ # Methods, limitations, and reproducibility documentation
| `-- manifests/ # SHA-256 artefact manifests
|-- notebooks/ # Guided validation notebooks
|-- src/
| |-- analysis/
| |-- config/
| |-- methods/
| |-- pipelines/
| |-- preprocessing/
| |-- reporting/
| |-- scripts/
| |-- simulation/
| |-- stats/
| |-- utils/
| `-- visualization/
|-- results/ # Generated empirical outputs
|-- figures/ # Publication-oriented figures and tables
|-- CONTRIBUTING.md
|-- LICENSE
|-- README.md
`-- requirements.txt
| Location | Purpose |
|---|---|
docs/manuscript/ |
Complete French-language dissertation and canonical academic reference |
docs/protocol/ |
Ex ante hypotheses, parameters, and decision criteria |
docs/decisions/ |
Deviations, corrections, exclusions, reruns, and analytical statuses |
docs/methodology/ |
Methodological rationale, limitations, reproduction guidance, and English-language companion documentation |
docs/manifests/ |
SHA-256 manifests and provenance verification |
notebooks/ |
Step-by-step explanatory validation |
src/ |
Authoritative implementation |
results/ |
Empirical outputs, including confirmatory and robustness states |
figures/ |
Figures and publication-oriented tables |
| Notebook | Role |
|---|---|
00_project_overview.ipynb |
Architecture, hypotheses, and execution order |
01_data_preprocessing.ipynb |
Data parsing, USO correction, transformations, and quality assurance |
02_confirmatory_analysis.ipynb |
Confirmatory H1–H3 analyses, FFT, and CWT |
03_robustness_analysis.ipynb |
Parameter, period, rolling, and cross-asset checks |
04_arfima_1_d_1_posthoc.ipynb |
Post-hoc ARFIMA model-order sensitivity |
05_validation_pipeline.ipynb |
Symmetry checks and pipeline audit |
The notebooks import functions from src/. They are explanatory interfaces rather than independent implementations.
git clone https://github.com/baptiste-dehay/fractal-financial-markets-elliott-wave-validation.git
cd fractal-financial-markets-elliott-wave-validationpython -m venv .venv
Windows PowerShell:
.venv\Scripts\Activate.ps1
macOS or Linux:
source .venv/bin/activatepython -m pip install --upgrade pip setuptools wheel pip install -r requirements.txt
macOS or Linux:
cp .env.example .env
Windows PowerShell:
Copy-Item .env.example .envNever commit the real .env file.
python -m src.scripts.validate_reproducibility pytest
jupyter notebook notebooks/
python -m src.preprocessing.build_dataset_daily
python -m src.scripts.run_pipeline python -m src.scripts.generate_figures python -m src.scripts.generate_tables
python -m src.scripts.run_arfima_workflow
Use --resume or a supported stage option when restarting an interrupted post-hoc workflow.
| Folder | Content |
|---|---|
results/dfa/ |
Hurst estimates and Monte Carlo inference |
results/mfdfa/ |
MF-DFA metrics and benchmark comparisons |
results/statistics/ |
FFT spectra and simulated spectral references |
results/cwt/ |
CWT mean-power outputs and scalograms |
results/swing/ |
Detected swings and Fibonacci-ratio tests |
results/robustness/ |
Parametric, temporal, rolling, and model-order checks |
results/logs/ |
Run logs and configuration snapshots |
figures/ |
Publication-oriented figures and tables |
Output locations may vary according to the active configuration.
The canonical frozen state is identified through docs/decisions/ and docs/manifests/.
The project includes:
- a fixed random seed;
- a fixed Monte Carlo simulation count;
- versioned configuration snapshots;
- blocking checks on simulation dimensions;
- distinct confirmatory and post-hoc output trees;
- decision logs documenting corrections and exclusions;
- SHA-256 manifests for frozen analytical states;
- preservation of superseded outputs where required for audit;
- identical estimator rules for real and simulated series wherever admissible.
For strict reproduction, consult:
docs/methodology/computational_environment.md;docs/methodology/reproducibility_guide.md;docs/methodology/results_audit_guide.md;docs/manifests/;docs/decisions/.
This repository includes lightweight raw Stooq CSV files and the processed daily datasets used by the empirical pipeline so that readers can inspect the data layer and reproduce the public validation workflow.
The included market-data files are provided solely for academic reproducibility and remain subject to the original provider's applicable terms.
They are not covered by the repository's MIT License.
If redistribution conditions change or removal is requested, the files should be replaced by:
- acquisition instructions;
- source metadata;
- cryptographic hashes;
- data-quality reports.
Full validation of the frozen corrected run requires either the generated artefacts under results/ and figures/ or their regeneration from the committed data and final configuration.
This project tests selected operational implications associated with fractal-market analysis and Elliott/Fibonacci claims.
It does not establish:
- deterministic predictability;
- universal market laws;
- trading profitability;
- the validity of Elliott Wave Theory as a complete forecasting framework.
The main limitations are as follows:
- daily frequency restricts the number of detected swings and renders H3 inconclusive;
- swing extraction remains parameter-sensitive;
- USO is an ETF proxy with product-specific dynamics;
- BTCUSD follows the dates available in the Stooq series rather than a reconstructed 24/7 calendar;
- the adjustment status and timezone metadata of the source
Closefield are not fully documented; - MF-DFA spectrum width may reflect heavy tails, volatility clustering, structural breaks, nonlinear dependence, or finite-sample effects;
- BTCUSD-GARCH is excluded from confirmatory inference;
- ARFIMA estimation conventions condition the interpretation of long-memory robustness;
- FFT and CWT remain descriptive;
- rolling-window analyses are post hoc and use strongly overlapping windows;
- the study covers four assets and one principal daily period, which limits external generalisation.
| Resource | Link |
|---|---|
| Repository | https://github.com/baptiste-dehay/fractal-financial-markets-elliott-wave-validation |
| French-language manuscript | docs/manuscript/ |
| Stooq Historical Data | https://stooq.com/ |
| ResearchGate | https://www.researchgate.net/profile/Baptiste-Dehay |
| Wavetropy | https://www.wavetropy.com/ |
| Quantitative finance journal | https://www.wavetropy.com/fr/journal/finance-quantitative/ |
| Hipparchus | https://www.hipparchus.fr/fr/ |
@software{dehay_fractal_markets_2026, author = {Dehay, Baptiste}, title = {Fractal Financial Markets and Elliott Wave Validation}, year = {2026}, url = {https://github.com/baptiste-dehay/fractal-financial-markets-elliott-wave-validation} }
@mastersthesis{dehay_elliott_fractality_2026, author = {Dehay, Baptiste}, title = {Fractalité, multifractalité et ratios harmoniques dans les marchés financiers : un test falsifiable des revendications de la théorie d'Elliott}, school = {ESLSCA Business School Paris}, year = {2026}, type = {MBA2 Research Dissertation} }
A DOI may be added after archival deposit and release publication.
This repository is provided for academic research and reproducibility purposes only.
It does not constitute investment, financial, or trading advice, nor a recommendation to buy or sell any financial instrument.
The implemented methods are statistical research tools and are not presented as trading signals.
The project source code and original documentation are licensed under the MIT License. See LICENSE.
The included third-party market-data files are provided only to support academic reproducibility and remain subject to the applicable terms of their original provider. They are not licensed under MIT.
The French dissertation remains an academic manuscript authored by Baptiste Dehay. Its inclusion in this repository does not place the manuscript itself under the MIT License unless explicitly stated otherwise.
Baptiste Dehay
Research interests include quantitative finance, financial time series, fractal and multifractal analysis, statistical testing of technical analysis, stochastic benchmarks, reproducible empirical research, data science, and financial modelling.