03Projects / Finance
Fifteen classical and stochastic models over market, macro and on-chain series, to ask whether the cycle bottom is in, at what level and when. Planned, directed and tested by me; the code was written with Gemini Pro.
A study of my own, planned in March 2026: has Bitcoin already touched the structural bottom of its cycle, after the peak of about $120,000 in 2025, and if not, where and when? Five questions take it apart: the market regime, the price level, the timing, leverage and the macro picture. Each gets a classical model and a non-linear or stochastic one, about fifteen in all, from Markov switching and extreme value theory to a Merton jump-diffusion simulated a million times, cointegration and a t copula.
The data are daily: Binance prices and volumes from 2020, ten FRED macro series, ten on-chain and derivatives series from a public repository. The routine ran three times: in March, with the on-chain data still stuck at 23 January, at the end of March and in June 2026. The outputs of the last two are below.
- Written with Gemini, on purpose. The code was written piece by piece with Gemini Pro. The point of the project was to learn tools I had not used yet: pulling data through APIs (FRED with a personal key, and Binance), downloading the data of a public GitHub repository with the functions that go with it, working with daily time series, and models that were new to me.
- The plan was mine. The five questions, a deterministic or classical model next to a stochastic or non-linear one for each, the data behind every model, and the tests before putting the pieces together.
- A dataset that rebuilds itself. Every run downloads the whole history again, from January 2020 to the latest day, and joins the sources on the union of their dates: nothing is lost, and new days come in by themselves. A gap takes the last value, and zeros that really mean missing data are treated as missing.
- Runs to compare. The output of every run was saved, so runs made weeks apart can be read side by side.
- A data source brought back. The on-chain feed had stopped on 23 January 2026. I opened an issue on its repository pointing to where the daily update was failing, and on 28 March the author had it running again. Data: Ercin Dedeoglu - Crypto Market Data, CC BY 4.0.
- Not every number holds. Some outputs are wrong. The Johansen test finds one cointegrating relation, but the script reads the wrong column and prints none. The Cox model answers 0.0 months in every run. The O‑GARCH volatility mixes units. The leverage VECM fixes its rank without a test and flips sign between runs. The value is in the method and in the way of working, not in the forecasts.
Loading the document
The preview could not be loaded. Download the file
Loading the document
The preview could not be loaded. Download the file
Want to know more about Markov switching, extreme value theory, jump-diffusion, cointegration, on-chain data, the FRED API, copulas?