Add key-level auto trade, AI analysis, and trading UX improvements.

Key monitors use 5m close triggers with WeChat alerts and box/convergence auto orders; add pending-order worker, structured WeChat notify, AI settings/messages, session clock, CTP margin sizing, and dual-layer position limits.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-28 10:36:56 +08:00
parent 0109b59f27
commit 840e88daad
33 changed files with 2514 additions and 143 deletions
+8
View File
@@ -51,6 +51,14 @@ def get_max_margin_pct(get_setting: Callable[[str, str], str]) -> float:
return 30.0
def get_roll_max_margin_pct(get_setting: Callable[[str, str], str]) -> float:
"""滚仓后总保证金占权益上限(%),默认 50。"""
try:
return max(1.0, min(100.0, float(get_setting("roll_max_margin_pct", "50") or 50)))
except (TypeError, ValueError):
return 50.0
def get_trailing_be_tick_buffer(get_setting: Callable[[str, str], str]) -> int:
"""移动保本:止损移至开仓价 ± N 个最小变动价位(默认 2)。"""
try: