Deploy Hurst/VPIN directional strategy to live + paper
Live node: - Added Hurst VPIN to STRATEGIES (BTC, 0.00024 size, 00) - Feed BTC price into dollar-bar Hurst/VPIN every 5 ticks - Signal: BUY/SELL when H>0.55 + VPIN>0.25 + direction bias Paper trader: - Added Kalman Pairs, Avellaneda-Stoikov, Hurst VPIN strategies - All 00 allocation, matching live node asset distribution - Hurst/VPIN signal from BTC mid-price dollar bars Strategy file: hurst_vpin_live.py (lightweight price-tick mode)
This commit is contained in:
@@ -122,6 +122,27 @@ STRATEGIES = {
|
||||
"signals": [], "type": "gueant", "size": 0.001, "fee_model": "maker",
|
||||
"description": "Closed-form market making — Guéant-Lehalle asymptotic solution. Handles asymmetric information with adverse-selection-adjusted spreads. Computationally efficient closed form.",
|
||||
},
|
||||
"Kalman Pairs": {
|
||||
"allocation": 100.0, "instrument": "ETH", "pnl": 0.0,
|
||||
"trades_today": 0, "wins": 0, "win_rate": 0.0, "status": "idle",
|
||||
"position": 0.0, "entry_price": 0.0, "fee_paid": 0.0,
|
||||
"signals": [], "type": "stat_arb", "size": 0.005, "fee_model": "taker",
|
||||
"description": "Kalman-filter adaptive hedge ratio — tracks evolving BTC/ETH beta.",
|
||||
},
|
||||
"Avellaneda-Stoikov": {
|
||||
"allocation": 100.0, "instrument": "BTC", "pnl": 0.0,
|
||||
"trades_today": 0, "wins": 0, "win_rate": 0.0, "status": "idle",
|
||||
"position": 0.0, "entry_price": 0.0, "fee_paid": 0.0,
|
||||
"signals": [], "type": "market_making", "size": 0.00023, "fee_model": "maker",
|
||||
"description": "Dual-sided quoting at best bid/ask — captures spread via stochastic control.",
|
||||
},
|
||||
"Hurst VPIN": {
|
||||
"allocation": 100.0, "instrument": "BTC", "pnl": 0.0,
|
||||
"trades_today": 0, "wins": 0, "win_rate": 0.0, "status": "idle",
|
||||
"position": 0.0, "entry_price": 0.0, "fee_paid": 0.0,
|
||||
"signals": [], "type": "momentum", "size": 0.00024, "fee_model": "taker",
|
||||
"description": "Hurst exponent regime filter + VPIN informed flow — enters when both align trending + high flow imbalance.",
|
||||
},
|
||||
}
|
||||
|
||||
trades_log: list[dict] = []
|
||||
@@ -324,6 +345,21 @@ def compute_signals():
|
||||
|
||||
for s in STRATEGIES.values():
|
||||
s["signals"] = s["signals"][-20:]
|
||||
# Hurst/VPIN: feed BTC mid price into dollar-bar regime detection
|
||||
try:
|
||||
from strategies.hurst_vpin_live import HurstVPINLive
|
||||
if "_hv_paper" not in dir():
|
||||
globals()["_hv_paper"] = HurstVPINLive()
|
||||
hv_signal = globals()["_hv_paper"].feed_price(btc)
|
||||
if hv_signal:
|
||||
STRATEGIES["Hurst VPIN"]["signals"].append({
|
||||
"time": time.time(),
|
||||
"signal": hv_signal["signal"],
|
||||
"strength": hv_signal["hurst"],
|
||||
"reason": f"H={hv_signal['hurst']:.2f}_V={hv_signal['vpin']:.2f}"
|
||||
})
|
||||
except:
|
||||
pass
|
||||
|
||||
# ═══════════════════════ Fill Simulation ═══════════════════════
|
||||
|
||||
|
||||
Reference in New Issue
Block a user