Label night-session products and hide day-only symbols at night.

Mark tradable varieties with a night tag; during 21:00-02:30 filter out index futures and other products without night sessions from symbol picker and recommend list.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-26 22:27:47 +08:00
parent f2940d41e9
commit 7f8b4cfefd
11 changed files with 193 additions and 13 deletions
+4 -1
View File
@@ -14,7 +14,7 @@ from typing import Callable, Optional
from contract_specs import get_contract_spec
from fee_specs import calc_fee_breakdown
from recommend_trend import analyze_product_daily, sort_recommend_by_trend
from symbols import PRODUCTS, product_category
from symbols import PRODUCTS, product_category, product_has_night_session
logger = logging.getLogger(__name__)
@@ -74,6 +74,7 @@ def assess_product_for_capital(
"margin_one_lot": None,
"max_lots": 0,
"risk_one_lot_1pct": None,
"has_night_session": product_has_night_session(product),
}
margin_one = p * mult * margin_rate
@@ -125,6 +126,7 @@ def assess_product_for_capital(
"roundtrip_fee_one_lot": fee_info["total_fee"],
"status": status,
"status_label": label,
"has_night_session": product_has_night_session(product),
}
@@ -167,6 +169,7 @@ def list_product_recommendations(
"status_label": "计算失败",
"main_code": "",
"max_lots": 0,
"has_night_session": product_has_night_session(product),
}
with ThreadPoolExecutor(max_workers=10) as pool: