A collection of Bitcoin on-chain analytics and market-cycle indicators, with separate stock-analysis tools retained for manual use. Each tool generates publication-quality charts in Python.
The repo includes a static, GitHub Pages-friendly dashboard at index.html. The source branch is kept history-light: generated PNGs, downloaded CSV snapshots, and generated web/data/ JSON are ignored by git.
The browser experience includes four linked workspaces:
index.html— dense market overview with live metrics, a 17-row cycle timeline, and eight featured charts.charts/— full interactive Bitcoin chart terminal with ranges, overlays, sheet view, pinning, and PNG export.signals/— percentile-rank cycle scores for 28 indicators (16 on-chain, 12 repo-native), one de-duplicated Cycle Index, historical phases, momentum, and a "How scores work" panel.alerts/— device-local alert rules checked against the latest signal scores whenever the site is opened.
On smaller screens, Browse charts opens the searchable library; selecting a chart closes it and restores focus. Pinned charts keeps device-local favorites available alongside Popular and All charts. Sheet, Pin, Alert, and Download remain available in the mobile toolbar. Charts load while supporting cycle signals are prepared, and time windows survive chart redraws; selecting another chart starts from that chart's defaults.
Chart terminal links are shareable: the address keeps the chart plus any range (range=1y, or from=/to= after a drag zoom), scale, ma=1, halvings, grid=0, view=sheet, and section filter, and Copy link copies it. Choosing a chart adds a browser history entry, so Back and Forward move between charts with their options restored; option and zoom changes update the current entry. Unknown chart IDs show a notice before falling back. Library search matches every word in any order, ignores punctuation, ranks title matches first, and understands abbreviations such as STH, LTH, and S2F; section chips narrow the list. In the search box, Enter opens the first result, the arrow keys move through results, and Escape clears. With the chart focused, the left and right arrow keys step through observations in a readout above the plot. On touch screens a one-finger drag inspects values by default; switch to Zoom for drag-to-zoom. The sheet shows the visible range and exports it with Download CSV.
The scheduled Bitcoin library is the non-duplicating union of 46 repo-native charts and 149 charts adapted from BlockHorizon's chart bundle (195 total). The upstream catalog was reviewed on October 20, 2026, including the new weekly moving averages, loss percentages, old-versus-new coin loss comparison, and 2-/4-year realized prices. Imports use stable chart IDs so title changes preserve links and pins while refreshing data. Six charts removed upstream are retired locally; missing reviewed charts stop publication instead of silently reusing stale data. Source provenance remains recorded in each generated chart's metadata.
Drag horizontally across a time-series chart to zoom into the selected dates. Dashboard and terminal charts animate the transition, refit numeric Y scales to the visible observations, and label dollar axes with readable values such as $20K and $100K. Bounded metric scales, such as NUPL and percentages, keep their meaningful limits. Double-click inside the plot or use Reset zoom to restore the original view. The terminal also provides zoom, fit, and reset buttons, plus independent price-axis dragging and wheel scaling. Transitions respect the device's reduced-motion preference.
web/assets/signal-definitions.json is the single source for the signal list, the scoring method (with its version) and the Cycle Index membership. The site build scores it into one compact web/data/bitcoin/signals.json (web/signals_artifact.py), which the dashboard, chart terminal, signals and alerts pages read instead of downloading a chart payload per signal; if that file is missing or invalid the browser scores the chart payloads itself with the same algorithm.
- Scoring: each score is the percentile rank (0–100, ties at mid-rank) of a reading within that indicator's own history up to its date, so rescalings of one quantity (NUPL and MVRV) score identically and the timeline uses no hindsight. Scores start after two years of history. Phases are fixed buckets at 25/50/75.
- Cycle Index: the equal-weight average of 16 signals, one per underlying quantity. Duplicates, structurally trending series (hashprice, fees, thermocap ratio), volatility and the 20-day Bollinger position stay visible but are not counted. Dashboard and signals page show the same index; filtered table averages are labelled "Average of N shown".
- Honesty about data:
signals.jsoncarries each signal's observation date,data_through, stale flags (more than 2 days behind the newest data, 9 for weekly on-chain sources) and any definition that could not be resolved. A 7d/30d/90d/1y change isnullunless scored history covers the window, and a weekly history sample isnull(shown as "No data" on the timeline) when no observation within 14 days exists. - Deterministic output:
signals.jsoncontains no clock reading, so identical chart data always produces identical bytes. It carries asource_fingerprintof the definitions and input series; the site manifest repeats that fingerprint undersignalsand supplies the publication time (generated_at). Pages reject an artifact whose fingerprint does not match the manifest. Every published number is rounded with one rule, half away from zero on the exact value, in both the Python build and the browser fallback. - Changing the method: bump
method.version; saved alert observations from another version are re-baselined instead of firing. Regenerate the shared fixture withpython web/tests/fixtures/signals/make_fixture.py; the Python and Node suites both compare against itsexpected.json.
MVRV and NUPL use continuous lines in normal view, including NUPL's five sentiment colors. On 17 compatible imported charts, Signal view instead plots Bitcoin price as dots colored by the chart's metric, while retaining the original metric in hover details, the sidebar, and the data sheet. Links preserve this choice with ?chart=mvrv-z-score&signals=1. The dashboard's MVRV Z-Score card opens in Signal view by default. Intentional PlanB price dots, scatter plots, and OHLC candles retain their chart-specific presentation.
BlockHorizon's three cost-basis distribution/replay views are deferred: their price-bucket histograms and shared replay frames require a dedicated renderer rather than the time-series adapter. The hourly build refreshes the reviewed chart bundle with the rest of the dashboard.
Preview the site locally from the repository root with python3 -m http.server 8000, then open http://127.0.0.1:8000/.
The cron runner checks the upstream Bitcoin CSVs hourly, regenerates native reports when inputs or code change, outputs are missing, or the previous generation did not complete successfully, and builds the static dashboard data. To keep GitHub Actions artifact storage within the free-tier allowance, it only force-publishes the latest-only gh-pages branch at 00:00, 06:00, 12:00, and 18:00 UTC. Conditional HTTP requests keep unchanged large CSVs off the wire. Stock reports and the experimental ML classifier are intentionally excluded from the scheduled Raspberry Pi path; their source remains available for manual runs. This keeps chart output available on GitHub Pages without committing every hourly chart refresh to main.
Bitcoin report retries use a local Bitcoin/.successful_generation content fingerprint (source CSVs, Python code, and scheduled report selection). It is replaced atomically only after every scheduled report succeeds and expected outputs exist. Failed, interrupted, --only, and --skip-update runs cannot mark scheduled outputs current; manual generation invalidates prior success. Deleting the marker forces regeneration on the next scheduled run. The derived block metrics cache is excluded from the fingerprint.
Publishing skips unchanged sites. run.py hashes the staged site (plus the target branch) and ignores the volatile generated_at and updated_at JSON keys, so a run that only changes timestamps does not force-push gh-pages; native chart payloads use their latest observation date as updated_at. Publish state lives in the gitignored logs/publish-state.json. Outside the six-hour windows, an hourly run also publishes when a publish is pending: the last attempt failed, no successful publish is recorded, or the source HEAD differs from the commit last published (python run.py --publish-due exits 0 in that case). A successful publish, or a run whose site content is unchanged, clears the marker. Runs still never overlap because the existing lock is held first.
The block metrics cache (daily_block_metrics_cache.csv plus its .key.json sidecar) is reused only when the block CSV inventory (names, sizes, mtimes) and BLOCK_METRICS_CACHE_VERSION match; bump that constant whenever the aggregation changes. The BlockHorizon bundle is fetched with If-None-Match and a local cache in logs/, so an unchanged upstream answers 304.
Use a fine-grained GitHub personal access token restricted to this single repository with only Contents: read and write for the publish GITHUB_TOKEN, rather than a classic public_repo token that can write to every public repository you own.
GitHub HTTPS authentication is supplied only to child Git processes for GitHub remotes. The updater keeps remote URLs credential-free; SSH remotes continue using their existing authentication.
GitHub Actions runs the Python calculation/importer/report-runner suites and Node logic checks, plus the Playwright browser suite as a separate job (failure screenshots and logs are uploaded as artifacts), on pushes and pull requests. Locally, run python -m unittest discover -s web -p "test_*.py", python -m unittest Bitcoin.test_run_all_reports, and python -m unittest discover -s Bitcoin/model_price_prediction -p "test_*.py" (calculation tests require NumPy and pandas).
Run importer tests from the repository root with python -m unittest web.test_blockhorizon_data. Set FINTECH_LIVE_TESTS=1 to also verify the complete reviewed catalog against the current upstream bundle; the default tests use local fixtures.
The optional browser checks require Node.js 20 or later. From web/, run npm ci, npx playwright install chromium, then npm test and npm run test:browser. The checks use local fixtures and the site's pinned Plotly CDN script. Coverage includes OHLC hover on both price scales, multi-pane crosshairs and value badges, animated zoom and visible Y-axis fitting, resets and interrupted transitions, reduced motion, and normal-versus-Signal rendering without changing source observations. After generating web/data/, set FINTECH_LIVE_CHARTS=1 to run the Signal browser check against the imported observations. These development dependencies are separate from the Raspberry Pi's Python refresh path.
Long-term price model plotting Bitcoin on a log-log scale with Bitbo-style Power Law constants and support/resistance bands.
Halving Price Regression (HPR) model with six color-coded bands (Low → Red) calculated from prices at the three halving dates. Useful for gauging where we are in the cycle.
Measures deviation from the power law trend line, oscillating between oversold and overbought zones.
Uses the 111-day MA and 350-day MA x2 crossover to signal potential market tops. The ratio (350/111 ≈ 3.153) approximates Pi.
Extended version projecting when the next Pi Cycle crossover might occur based on current trajectory.
Concise overview chart showing spot price, Stock-to-Flow, and Power Law together, while detailed Rainbow/HPR and Power Law band views remain in their dedicated charts.
Compact cycle snapshot combining trend, drawdown, halving progress, Puell, fees, and volatility gauges.
Monthly state map showing how Bitcoin moves across trend, Mayer, Puell, drawdown, and volatility regimes over time.
Heatmap showing where BTC spent the most time by price bucket, both by calendar year and by halving epoch, using repo-local 10-minute prices.
Price performance across halving cycles normalized by block height, showing multipliers from cycle start on a log scale.
Polar chart where one full rotation equals a halving epoch and radius shows the price multiple since that halving began.
Log price on a polar clock that turns clockwise once every four calendar years (Jan 1 of 2009, '13, '17, '21, '25 at the top), so each cycle's run-up, peak and bear market line up on the same spokes. Marks closing all-time highs, confirmed cycle bottoms (≥75% drawdowns later recovered by a new ATH), the open low since the last ATH, halvings, and the current year's quadrant. Inspired by the Bitcoin Strategy Platform spiral.
Month-by-month ROI heatmap for each halving epoch, normalized from that epoch's first post-halving daily close.
Price history divided into halving epochs with multipliers showing the price increase during each period.
Stacked area chart of epochs (E1-E5) with color-coded growth percentages showing diminishing returns across cycles.
Three-panel chart showing Bitcoin with 200-day and 200-week moving averages across full history (log), 200-day window (linear), and 200-week window (linear).
BTC price divided by the 200-day moving average, with classic cycle zones for below-trend and overheated regimes.
20-period SMA with upper/lower bands at 2 standard deviations. Includes a main chart (last 2 years) and mini chart (full history).
Rolling realized volatility with percentile bands to distinguish low, high, and extreme volatility regimes.
Weekday-hour and month-hour heatmaps of annualized realized volatility from repo-local 10-minute BTC/USD returns.
Monthly regime map showing how often BTC trades at different percentage distances above or below its 200-day moving average.
Heatmap table showing monthly and yearly returns over the last 10 years, color-coded from red (losses) to green (gains).
Same concept as above but broken down by quarters instead of months.
Dual-panel chart showing Bitcoin price with CAGR lines overlaid, and CAGR evolution over network age.
Rolling Sharpe and Sortino proxies using Bitcoin daily log returns with zero risk-free rate, plus annualized return and volatility.
Monthly phase-space chart of annualized return versus realized volatility, grouped by halving epoch and overlaid with the recent path.
Return seasonality maps for the 24/7 trading week and the calendar year, using intraday mean returns and daily hit rates.
Aggregates daily data into monthly OHLC candles on a log scale.
Aggregates daily data into yearly OHLC candles on a log scale.
2x2 grid showing 1Y, 2Y, 3Y, and 4Y price windows with open/high/low/close and percentage changes.
Compares drawdown percentages from cycle highs across multiple historical cycles, overlaid for pattern comparison.
Maps ATH drawdowns against recovery duration, highlighting the deepest historical underwater periods.
Shows how long each major peak-to-recovery drawdown spent in different underwater depth buckets.
Dashboard with BTCUSD price chart and days-since-ATH counter, showing halving events and cycle peaks.
Shows how many days purchases at each price point have spent underwater, with a gradient heatmap.
Tracks the highest price Bitcoin reached and never fell below again.
Proxy chart estimating Bitcoin supply distribution by holding duration (short/medium/long term) with price overlay.
Miner revenue in USD divided by its 365-day moving average, with historical accumulation and overheated zones.
Fees, fee share of miner revenue, and block-space fee rate using repo-local block CSV data.
Heatmap of monthly block-space congestion, showing how much of each month lived in each historical fee-rate percentile bucket.
Miner revenue per PH/s/day using difficulty-implied network hashrate and repo-local miner revenue.
Visualizes Bitcoin network node counts and software version distribution over time.
Historical price trend with halving events and distribution of daily closing prices across price ranges.
Weighted average cost basis for daily Dollar-Cost Averaging over different durations vs. spot price.
Dual chart: price of 1 USD in satoshis (left) and price of 1 BTC in USD (right).
A suite of tools for equities analysis covering individual stocks, sector performance, correlations, technical indicators, and volatility. Supports custom stock lists, Dow 30, NASDAQ top 15, and S&P 500 groupings.
Comprehensive single-stock reports with price history, volume, and key metrics.
![]() |
![]() |
![]() |
Side-by-side performance comparison across different stock groups.
| Default | S&P 500 Top 10 |
|---|---|
![]() |
![]() |
Hierarchical clustering of stock correlations to identify related groups and diversification opportunities.
| Default | NASDAQ Top 15 |
|---|---|
![]() |
![]() |
RSI, MACD, and Bollinger Bands for individual stocks. Generated for all Dow 30 components.
| AAPL | NVDA | MSFT |
|---|---|---|
![]() |
![]() |
![]() |
Historical volatility metrics comparing stocks across different groups.
| Default | S&P 500 Top 10 |
|---|---|
![]() |
![]() |
- Python 3.8+
- pip
git clone https://github.com/JamesTsetsekas/Fintech.git
cd Fintechcd Bitcoin
python3 -m venv venv && source venv/bin/activate
pip install -r requirements.txt # from any subfolder
python3 run_all_reports.pyRun selected Bitcoin reports without updating data:
python3 run_all_reports.py --skip-update --only puell --only volatilityCreate a quick local contact sheet for visual QA:
python3 create_contact_sheet.py --only puell --only volatilityStock reports are manual-only and are not included in the public dashboard or hourly cron run.
cd Stock
python3 -m venv venv && source venv/bin/activate
pip install -r requirements.txt
python3 run_all_reports.pyEach tool can also be run independently from its own directory.
See Bitcoin/data/UPDATE_INSTRUCTIONS.md for keeping price and blockchain data current.
For automated deployment and scheduled reports, see SETUP_UBUNTU.md.
MIT
























































