New module src/core/predictions/kronos/ with the Kronos model files
vendored at upstream 67b630e (MIT, one import patch). Samples N
independent OHLC paths and reports the median close, p10–p90 band
and how many paths end up, with a deterministic seed by default.
Supports mini/small/base models, 1d/1h/1wk bars and any Yahoo symbol.
Kronos-small preloads in the background at startup. Adds einops.
22 days ago
fix /qr input validation and status scoping; make proxy delivery retry-safe
Dmitry Beresnev
656848b
add quant research module, fix emmr
Dmitry Beresnev
2a82376
fix - qualify emmr TradingView links by exchange
Dmitry Beresnev
e03cbc5
fix emmr scoring untradable and falling stocks to the top
Dmitry Beresnev
0ae0cdd
fix missing /fa metrics from degraded Yahoo responses
Dmitry Beresnev
61db82f
- gross margin: derive from Gross Profit/Revenue (was .info-only, blank
for every ticker when quoteSummary is blocked)
- EV/EBITDA: rebuild EBITDA as EBIT + Reconciled Depreciation when the
statement has no EBITDA row (BRK-B)
- free cash flow: never fall back to bare OCF — it fed the DCF
- capex: add PPE synonyms only; REIT property purchases are acquisitions,
not capex, and flipped O's FCF from +4.0B to -785M
- retry each statement once and name the one that didn't arrive, so a
throttled request no longer blanks a section silently
- don't cache empty peer metrics for an hour (MAG7 flicker)
- stop treating a legitimate 0.0 as missing in growth inputs
fix a cmd for the fundamental analysis
Dmitry Beresnev
8a375c8
fix a cmd for fundamental analysis
Dmitry Beresnev
64a5985
filter /emmr universe to operating companies
Dmitry Beresnev
076cbc5
Exchange listings also carry funds, trusts, REITs, SPACs and
preferred/note/warrant lines — ~22% of NASDAQ. Cross-sectional
percentiles rank whatever they are handed, and the leaderboard is
fixed-size, so each vehicle displaces a real candidate.
New instrument_filter classifies listings from nasdaq.com screener
metadata; EMMR narrows the universe before downloading, so universe=N
now means N companies. Opt out with /emmr ... all=1.
Rules are conservative — Northern Trust, Preferred Bank and ADRs stay.
Only NASDAQ/NYSE/AMEX carry the metadata; elsewhere the filter reports
itself as not applied instead of guessing.
Also includes earlier EMMR fixes: NaN-preserving normalisation,
drop-rate bias warning, half-block gauges.
Ranks an exchange by a regime-weighted blend of long-horizon momentum
and short-horizon mean reversion. The sleeves read disjoint windows —
momentum from the series with the last 30 calendar days removed — so
the blend answers "still trending, or stretched?" rather than scoring
the same recent move twice.
Reuses ticker_scanner's downloader and analyzer as pure libraries;
nothing in that package is modified. TickerAnalyzer is bypassed so we
rank the whole universe ourselves and avoid its Telegram side effect.
- src/core/momentum_reversion: types (self-validating EMMRParams),
strategy (staged pipeline, injected data source), formatter
- /emmr handler, dispatch and /help entry in telegram_bot_service
add self keepalive service
Dmitry Beresnev
6c3a0e3
fix: stop spawn workers from re-importing TensorFlow; normalize US class-share tickers
Macro risk engine (core/macroeconomics/markets/risk_engine), 30 -> 34:
- VIXTermStructureIndicator: real ^VIX/^VIX3M backwardation ratio with
stress floor 75 when inverted; old VIX-acceleration proxy kept as
fallback when ^VIX3M is unavailable
- new YieldCurve10Y3MIndicator (FRED T10Y3M, NY Fed recession spread,
inversion/re-steepening logic; complements 10Y-2Y)
- new SkewIndexIndicator (CBOE ^SKEW, forward-looking option-implied
crash-risk premium)
- new EqualWeightBreadthIndicator (RSP/SPY 20d ratio momentum; falling
ratio = narrow mega-cap leadership)
- new EMBondStressIndicator (EMB/IEF ratio momentum; isolates EM credit
spread shock from the rates move)
- symbols: +^VIX3M, ^SKEW, RSP, EMB (Yahoo), +T10Y3M (FRED) -> 31 total
- new public MarketRiskEngine.assess_with_signals() returning
(score, signals) from one data load; assess_current_risk and
get_full_report now delegate to it (removes duplicated load/aggregate)
- new telegram_formatter.py: format_telegram_summar…
fix trading/portfolio/wavelets/predictor bugs; refactor markov chains to modular pipeline
Dmitry Beresnev
5784bb6
Markov chains (refactor):
- split 600-line HMMLearnTrader god class into one-class-per-module pipeline:
types, data_loader, features, hmm_trainer, state_interpreter,
signal_generator, metrics, report_writer, plotter, backtester (facade + DI)
- behavior preserved exactly (synthetic checks reproduce identical numbers)
Trading module:
- broker_connector: stop-loss was submitted as a LIMIT order at the stop
price — instantly marketable, would close positions on entry; replaced
with Alpaca native bracket order (atomic, OCO legs). Fixed alpaca-py API
mismatches: avg_entry_price, cancel_order_by_id, GetOrdersRequest
- backtest_engine: exit PnL used a size recomputed at exit time instead of
the entry size; equity curve marked-to-market a fake 100%-capital
position; state leaked across run() calls; blocked-signal counters
inflated on signal-less bars
- risk_engine: correlated portfolio heat used sqrt(dollar risk) as
volatility (unit-dependent); now sqrt(r^T R r) on dollar ris…
fix macroeconomics risk engine: schema alignment, data loading, quant logic
Dmitry Beresnev
ea79299
Module was non-functional — every run crashed or returned the default score.
Structural:
- models.py: align IndicatorSignal/CategoryScore/GlobalRiskScore dataclasses
with the schema all 30 indicators and the aggregator actually use
(indicator_name/stress_level/interpretation, active_indicators, default
confidence); add high/low/volume to TimeSeriesData for liquidity indicators
- data_sources: implement missing fetch_multiple (concurrent, thread-offloaded,
per-symbol error isolation); rebuild FRED/Yahoo symbol maps around what
indicators require (MOVE and DXY moved to Yahoo — not on FRED); fetch SPY
with full OHLCV; normalize all indexes to tz-naive dates (yfinance is
tz-aware per exchange, FRED naive — cross-source joins produced 0 rows)
Quant/math:
- yield curve + repo spreads: percent-vs-bps unit fix; re-steepening now a
20d delta >10bps (old accel>5pp threshold could never fire)
- real rates: fix inverted sign — falling real rates scored as stress
- credit ETF / JP…
fix HF exit 139: pin tensorflow/torch/keras/transformers versions, set KERAS_BACKEND before keras import
- Add 'accumulation' regime (Hurst>0.55 + compression>0.7 + ADX<25) with 🧨 emoji
- classify_trend now accepts hurst_val and compression to gate the new regime
- _regime_weights: dedicated accumulation weights (kde 0.30, va 0.20, swing 0.25, pool 0.25)
- _regime_direction_alignment: accumulation returns 0.7 for both directions
- Fix counter-trend warning boundary: < 0.3 → <= 0.3 (catches alignment exactly 0.2)
- Raise aligned-with-regime threshold: > 0.7 → >= 0.9
- Add ⚡ rationale tag for setups inside accumulation regime
- Conflict detection in analyze(): warns when LONG and SHORT entries are within 6 ATR in range/accumulation
- get_current_price returns (price, timestamp) tuple; analyze() warns when last bar is >30 min old
- Formatter: adds ⏱ close last bar marker next to price
add levels cmd
Dmitry Beresnev
52b171b
add more filters to the growth speed analyzer of the ticker scanner
Dmitry Beresnev
0797a08
Add explicit long‑term downtrend penalty
Dmitry Beresnev
b65b58d
In growth_speed_analyzer
add a draft for monitoring, ema crossover strategy, etc
Dmitry Beresnev
dbd43f7
add advanced portfolio analyzer
Dmitry Beresnev
09cafdd
add Market Risk Engine
Dmitry Beresnev
d5036bb
add basic logic of market stress detection engine
Dmitry Beresnev
6da625b
add portfolio analyzer and recommender
Dmitry Beresnev
0ec2f80
change the max amount of tickets in the ticker
Dmitry Beresnev
50b73f8
scanner
add more valuation models
Dmitry Beresnev
80204e1
add more valuation models
Dmitry Beresnev
a10333d
add more valuation models
Dmitry Beresnev
a2b8833
add other valuation models, fix gitignore, etc
Dmitry Beresnev
82a1f62
add command in tg bot, fix git ignore
Dmitry Beresnev
fc491e4
add valuation engine
Dmitry Beresnev
2865657
add CMGR and rolling CAGR, etc
Dmitry Beresnev
2212d00
Add explicit downtrend detection for short timeframes, Penalize downtrending stocks proportionally to magnitude (1-50% penalty), Prevents bad tickers with massive drops from scoring high
Dmitry Beresnev
a4ae47b
fix volatility penalty coef
Dmitry Beresnev
b4aba6f
fix coefficients config for main formula
Dmitry Beresnev
d399eab
add RSI, price position and support distance to growth speed analyzer
Dmitry Beresnev
935224d
fix coefficients config for main formula
Dmitry Beresnev
27aa7df
fix coefficients confif for main formula
Dmitry Beresnev
25e5f60
fix GrowthSpeedAnalyzer
Dmitry Beresnev
bc9c3ff
fix GrowthSpeedAnalyzer
Dmitry Beresnev
d306ff5
fix
Dmitry Beresnev
fd5d653
fix growth speed analyzer, add different formulas based on timeframes, volatility_penalty, etc
Dmitry Beresnev
b535b31
fix tg bot
Dmitry Beresnev
fe56001
fix new tickers filtering in ticker scanner, disable live trading, etc