Fix empty recommend list and CTP premarket auto-connect.
Correct main_code order in product refresh, refresh on CTP connect, and limit reconnect to trading or premarket windows. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -295,6 +295,7 @@ def list_product_recommendations(
|
||||
try:
|
||||
quote = quote_fn(ths) or {}
|
||||
price = quote.get("price")
|
||||
main_code = (quote.get("ths_code") or "").strip()
|
||||
row = assess_product_for_capital(
|
||||
product, capital, price,
|
||||
max_margin_pct=max_margin_pct,
|
||||
@@ -302,7 +303,6 @@ def list_product_recommendations(
|
||||
ctp_connected=ctp_connected,
|
||||
main_code=main_code,
|
||||
)
|
||||
main_code = (quote.get("ths_code") or "").strip()
|
||||
row["main_code"] = main_code
|
||||
if main_code:
|
||||
row.update(analyze_product_daily(main_code))
|
||||
|
||||
Reference in New Issue
Block a user