Commit History
19 days ago
-
add /kronos: Kronos foundation-model candlestick forecast Running
Dmitry BeresnevNew 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.8c661dd
22 days ago
-
fix /qr input validation and status scoping; make proxy delivery retry-safe
Dmitry Beresnev656848b -
add quant research module, fix emmr
Dmitry Beresnev2a82376
-
fix - qualify emmr TradingView links by exchange
Dmitry Beresneve03cbc5 -
fix emmr scoring untradable and falling stocks to the top
Dmitry Beresnev0ae0cdd
-
fix missing /fa metrics from degraded Yahoo responses
Dmitry Beresnev- 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 inputs61db82f
-
fix a cmd for the fundamental analysis
Dmitry Beresnev8a375c8 -
fix a cmd for fundamental analysis
Dmitry Beresnev64a5985
-
filter /emmr universe to operating companies
Dmitry BeresnevExchange 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.076cbc5
-
add extended momentum + mean-reversion ranking (/emmr)
Dmitry BeresnevRanks 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_service22705be
-
fix: stop spawn workers from re-importing TensorFlow; normalize US class-share tickers
Dmitry Beresnevde6cfe0
-
add advanced strategies
Dmitry Beresnev9a5d4cb -
add /macro, /popt, /hmm bot commands; expand macro risk engine to 34 indicators
Dmitry BeresnevMacro 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…9f34d16
-
fix trading/portfolio/wavelets/predictor bugs; refactor markov chains to modular pipeline
Dmitry BeresnevMarkov 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…5784bb6
-
fix macroeconomics risk engine: schema alignment, data loading, quant logic
Dmitry BeresnevModule 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…ea79299
-
fix fundamental analysis module
Dmitry Beresnev0114ac0 -
fix valuation module, etc
Dmitry Beresneve4ed34c
-
patch pack v1 — accumulation regime, counter-trend warnings, conflict detection, data delay marker
Dmitry Beresnev- 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 price3447c07 -
add levels cmd
Dmitry Beresnev52b171b
-
add more filters to the growth speed analyzer of the ticker scanner
Dmitry Beresnev0797a08 -
Add explicit long‑term downtrend penalty
Dmitry BeresnevIn growth_speed_analyzerb65b58d -
add a draft for monitoring, ema crossover strategy, etc
Dmitry Beresnevdbd43f7
-
add advanced portfolio analyzer
Dmitry Beresnev09cafdd -
add Market Risk Engine
Dmitry Beresnevd5036bb
-
add basic logic of market stress detection engine
Dmitry Beresnev6da625b -
add portfolio analyzer and recommender
Dmitry Beresnev0ec2f80
-
add more valuation models
Dmitry Beresnev80204e1 -
add more valuation models
Dmitry Beresneva10333d
-
add more valuation models
Dmitry Beresneva2b8833
-
add other valuation models, fix gitignore, etc
Dmitry Beresnev82a1f62 -
add valuation engine
Dmitry Beresnev2865657
-
add CMGR and rolling CAGR, etc
Dmitry Beresnev2212d00 -
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 Beresneva4ae47b -
fix volatility penalty coef
Dmitry Beresnevb4aba6f -
fix coefficients config for main formula
Dmitry Beresnevd399eab
-
add RSI, price position and support distance to growth speed analyzer
Dmitry Beresnev935224d
-
fix coefficients config for main formula
Dmitry Beresnev27aa7df -
fix coefficients confif for main formula
Dmitry Beresnev25e5f60 -
fix GrowthSpeedAnalyzer
Dmitry Beresnevbc9c3ff -
fix GrowthSpeedAnalyzer
Dmitry Beresnevd306ff5 -
fix
Dmitry Beresnevfd5d653 -
fix growth speed analyzer, add different formulas based on timeframes, volatility_penalty, etc
Dmitry Beresnevb535b31 -
fix new tickers filtering in ticker scanner, disable live trading, etc
Dmitry Beresnev46b838c -
Implement comprehensive trade notification system for Telegram bot
Dmitry Beresnev +1: Claude Haiku 4.5Features: - Enhanced entry notifications with detailed trade parameters (risk/reward, position size) - Separate rejection notifications with clear reasons for trade blocks - Exit notifications distinguishing between stop-loss and take-profit fills - Position P&L update notifications (±2% threshold) to track significant moves - Real-time position opened/closed notifications - Periodic portfolio summary every 5 minutes with equity breakdown - Intelligent position tracking to avoid spam while staying informed - Support for both approval-mode and automatic trading notifications New Methods: - _format_entry_message(): Detailed entry confirmation with risk/reward - _format_rejection_message(): Rejection reason + trade details - _format_exit_message(): P&L confirmation with exit type (🎯/🛑) - _format_position_opened_message(): Position tracking notification - _format_position_update_message(): P&L milestone notifications - _find_exit_report(): Query execution history for exit details - _get…47ee674 -
Remove trading docs from git tracking and update gitignore
Dmitry Beresnev +1: Claude Haiku 4.5- Remove all src/core/trading/docs/* from git index - Add src/core/trading/docs/ to .gitignore to prevent future tracking - Add trades.db and *.db to .gitignore (SQLite databases) - Keep critical improvements (MACD, risk engine, order manager, etc.) The documentation is local reference only and not needed in version control. Critical code improvements remain in the repo. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>5e39582 -
Implement critical trading system improvements from mathematical analysis
Dmitry Beresnev +1: Claude Haiku 4.5This commit implements all critical improvements identified in the comprehensive mathematical analysis from scientific and trader perspectives: 1. VOLATILITY FILTER PARADOX (CRITICAL FIX) - Replace simple mean-based filter with percentile bands (20th/80th) - Now captures both compression (setup) and expansion (breakout) - Expected +15-20% improvement in trend capture in low-volatility markets - File: src/core/trading/macd_strategy.py:308-319 2. STATE PERSISTENCE WITH SQLITE (PRODUCTION-CRITICAL FIX) - Add SQLite database for position persistence across restarts - Implement automatic state recovery and broker reconciliation - Prevent orphaned/duplicate positions on system restart - File: src/core/trading/order_manager.py (major refactor) 3. SLIPPAGE MODELING FOR REALISTIC BACKTESTS - Add configurable slippage parameters (entry/stop/profit) - Apply 1bp on entries, 5bp on stops, 1bp on take-profits - Reduces overstatement of returns by 20-30% (realistic…3e26349
-
fix ticker analyzer, fix nasdaq tickers, etc
Dmitry Beresneva39ac99
-
fix downloading intevals for smaller timeframes
Dmitry Beresnev8b4ac2c
-
fix downloading and analyzing processes for smaller timeframes
Dmitry Beresnev1d77246 -
del data points checking in the growth speed analyzer
Dmitry Beresnev86dad3e