mirror of
https://github.com/manifoldbt/manifoldbt.git
synced 2026-08-24 22:48:05 +00:00
release: v0.19.0
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"""Example 16: BTC-Hashrate Spread — Exogenous Data Strategy.
|
||||
"""Exogenous data — a BTC/hashrate spread as a signal.
|
||||
|
||||
Thesis: Bitcoin hashrate is a proxy for miner commitment and network
|
||||
security. When BTC price drops but hashrate holds (or rises), miners
|
||||
@@ -10,6 +10,15 @@ The strategy normalizes both BTC price and hashrate via EMA ratios
|
||||
A rolling z-score of the spread generates the signal: negative z means
|
||||
price is cheap relative to hashrate (long), positive means expensive.
|
||||
|
||||
Demonstrates:
|
||||
- an exogenous series ASOF-joined onto the bar grid
|
||||
- a spread between two EMA-normalised series as a signal
|
||||
- a rolling z-score turning that spread into a position
|
||||
|
||||
Data: shared store — real BTC bars from `data/`, plus a hashrate series
|
||||
(fetched, or generated by the sample generator below when absent).
|
||||
See examples/README.md.
|
||||
|
||||
Exogenous data flow:
|
||||
1. Fetch hashrate CSV (or use sample generator below)
|
||||
2. Register via mbt.register_exo("hashrate", df)
|
||||
@@ -18,6 +27,9 @@ Exogenous data flow:
|
||||
|
||||
Prerequisite:
|
||||
Binance BTC perp data + hashrate exo registered in data/mega/exo/
|
||||
|
||||
Usage:
|
||||
python examples/16_hashrate_exogene.py
|
||||
"""
|
||||
|
||||
import time
|
||||
|
||||
Reference in New Issue
Block a user