Initial public release

This commit is contained in:
sinmb79
2026-03-30 13:19:11 +09:00
commit 92a692b63c
116 changed files with 5822 additions and 0 deletions

17
hydra/regime/detector.py Normal file
View File

@@ -0,0 +1,17 @@
# hydra/regime/detector.py
_VOLATILE_BBB_THRESHOLD = 0.08
_TRENDING_ADX_THRESHOLD = 25.0
class RegimeDetector:
def detect(self, indicators: dict, close: float) -> str:
bbb = indicators.get("BBB_5_2.0_2.0")
adx = indicators.get("ADX_14")
ema50 = indicators.get("EMA_50")
if bbb is not None and bbb > _VOLATILE_BBB_THRESHOLD:
return "volatile"
if adx is not None and adx > _TRENDING_ADX_THRESHOLD:
if ema50 is not None:
return "trending_up" if close > ema50 else "trending_down"
return "ranging"