fix: hide hub close/entrust controls for intraday discipline profile

Expose intraday_discipline via hub meta and block manual close/tpsl APIs; Gate instance card no longer shows 全平/平仓/委托.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-06 02:26:22 +08:00
parent a268a93027
commit 4904a86e03
8 changed files with 119 additions and 22 deletions
+11 -1
View File
@@ -6,6 +6,7 @@ from lib.trade.entry_model_lib import (
ENTRY_MODEL_SMALL_DIV,
build_trend_div_entry_reason_options,
entry_model_label,
hub_meta_entry_context,
is_intraday_trading_profile,
parse_manual_order_style_fields,
resolve_trade_record_entry_reason,
@@ -54,7 +55,16 @@ class TestEntryModelLib(unittest.TestCase):
self.assertEqual(code, ENTRY_MODEL_SMALL_DIV)
self.assertEqual(style, "swing")
def test_parse_intraday_uses_trade_style(self):
def test_hub_meta_intraday(self):
policy = load_trade_policy(
{
"TRADE_SYMBOL_RESTRICT_ENABLED": "true",
"TRADE_SYMBOL_WHITELIST": "BTC,ETH",
}
)
ctx = hub_meta_entry_context(policy)
self.assertTrue(ctx["intraday_discipline"])
self.assertEqual(ctx["order_entry_profile"], "intraday")
policy = TradePolicy(False, "both", True, ("BTC", "ETH"))
style, code, err = parse_manual_order_style_fields(policy, {"trade_style": "swing"})
self.assertIsNone(err)