Skip to content

Commit a864cc6

Browse files
v4.0.4
Signed-off-by: Dinger <quantdinger@gmail.com>
1 parent 888f79e commit a864cc6

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎backend_api_python/app/services/trading_executor.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3117,6 +3117,14 @@ def _fetch_current_price(
31173117
) -> Optional[float]:
31183118
"""Fetch current price from the market data source selected by market_category."""
31193119
mt_key = (kline_market_type or market_type or "").strip().lower()
3120+
ex_key = (exchange_id or "").strip().lower()
3121+
if not ex_key and (market_category or "").strip() == "Crypto":
3122+
try:
3123+
from app.config.data_sources import CCXTConfig
3124+
3125+
ex_key = (CCXTConfig.DEFAULT_EXCHANGE or "binance").strip().lower()
3126+
except Exception:
3127+
ex_key = "binance"
31203128
# Local in-memory cache first
31213129
cache_key = f"{market_category}:{ex_key}:{mt_key}:{(symbol or '').strip().upper()}"
31223130
if cache_key and self._price_cache_ttl_sec > 0:

0 commit comments

Comments
 (0)