feat: 非交易时段禁开仓、移动保本与交易结果分类。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-25 13:33:17 +08:00
parent 598a1407e1
commit f31164076f
9 changed files with 387 additions and 49 deletions
+8
View File
@@ -32,6 +32,14 @@ def get_max_margin_pct(get_setting: Callable[[str, str], str]) -> float:
return 30.0
def get_trailing_be_tick_buffer(get_setting: Callable[[str, str], str]) -> int:
"""移动保本:止损移至开仓价 ± N 个最小变动价位(默认 2)。"""
try:
return max(1, min(20, int(float(get_setting("trailing_be_tick_buffer", "2") or 2))))
except (TypeError, ValueError):
return 2
def get_account_capital(conn, get_setting: Callable[[str, str], str]) -> float:
"""优先 SimNow/期货公司 CTP 权益;未连接时用设置中的参考资金。"""
del conn