fix: 4 cycle errors — NameError _log, WHEAT/EUR/USD ticker normalization, 429 serial scoring
- auto_cycle.py: replace _log with logger (NameError at lines 484/489) - auto_cycle.py: normalize underlying via _normalize_ticker before _resolve_ticker so WHEAT→ZW=F→WEAT and EUR/USD→EURUSD=X→FXE reach the IV watchlist correctly - iv_engine.py: _resolve_ticker now strips slash-format forex (EUR/USD→EURUSD=X) before _PROXY lookup, fixing yfinance 500/404 spam from get_atm_iv - database.py: _fetch in log_trade_entries uses _normalize_ticker (not _normalize_yf_ticker) so commodity aliases like WHEAT→ZW=F are applied at price-fetch time - ai_analyzer.py: max_workers=1 for batch scorer — parallel workers both slept and retried simultaneously after 429, causing repeated bursts; sequential fixes the pattern - journal.py + JournalDeBord.tsx: add price_warning field (no_price_data/no_entry_price/ no_live_price) with visible ⚠ badge and amber color on affected ticker/price cells Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -87,10 +87,19 @@ def trade_mtm(days: int = 30):
|
||||
elif pnl_pct <= stop:
|
||||
alert_type = "stop_loss"
|
||||
|
||||
price_warning = None
|
||||
if entry_price is None and current_price is None:
|
||||
price_warning = "no_price_data"
|
||||
elif entry_price is None:
|
||||
price_warning = "no_entry_price"
|
||||
elif current_price is None:
|
||||
price_warning = "no_live_price"
|
||||
|
||||
result.append({
|
||||
**e,
|
||||
"current_price": current_price,
|
||||
"pnl_pct": pnl_pct,
|
||||
"price_warning": price_warning,
|
||||
"days_held": days_held,
|
||||
"direction": "bearish" if _is_bearish(e.get("strategy", "")) else "bullish",
|
||||
"maturity": maturity,
|
||||
|
||||
Reference in New Issue
Block a user