feat: add full-margin position sizing mode across four exchanges
Env POSITION_SIZING_MODE switches risk vs full-margin (available*buffer, BTC/ETH 10x). Blocks trend/roll/key auto opens in full margin, purges breakout/fib monitors with WeChat notice, keeps RR check and initial SL snapshot for records. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -106,6 +106,15 @@ def _row(cfg, row) -> dict:
|
||||
|
||||
def precheck_trend_start(cfg: dict, conn) -> tuple[bool, str]:
|
||||
m = _m(cfg)
|
||||
mode = getattr(m, "POSITION_SIZING_MODE", None) or "risk"
|
||||
try:
|
||||
from position_sizing_lib import OPEN_SOURCE_TREND, assert_open_source_allowed
|
||||
|
||||
ok_src, src_msg = assert_open_source_allowed(mode, OPEN_SOURCE_TREND)
|
||||
if not ok_src:
|
||||
return False, src_msg
|
||||
except Exception:
|
||||
pass
|
||||
now = m.app_now()
|
||||
if not m.trading_day_reset_allows_new_open(now):
|
||||
return False, f"北京时间 {cfg['reset_hour']}:00 前不允许持仓"
|
||||
|
||||
Reference in New Issue
Block a user