strategy: align model exit signal as assist-only trigger (#369)
This commit is contained in:
@@ -22,7 +22,7 @@ def test_take_profit_exit_for_backward_compatibility() -> None:
|
||||
assert out.reason == "arm_take_profit"
|
||||
|
||||
|
||||
def test_model_assist_exit_signal() -> None:
|
||||
def test_model_assist_signal_does_not_exit_directly() -> None:
|
||||
out = evaluate_exit(
|
||||
current_state=PositionState.ARMED,
|
||||
config=ExitRuleConfig(model_prob_threshold=0.62, arm_pct=10.0),
|
||||
@@ -34,5 +34,5 @@ def test_model_assist_exit_signal() -> None:
|
||||
liquidity_weak=True,
|
||||
),
|
||||
)
|
||||
assert out.should_exit is True
|
||||
assert out.reason == "model_liquidity_exit"
|
||||
assert out.should_exit is False
|
||||
assert out.reason == "hold"
|
||||
|
||||
@@ -28,3 +28,16 @@ def test_exited_has_priority_over_promotion() -> None:
|
||||
),
|
||||
)
|
||||
assert state == PositionState.EXITED
|
||||
|
||||
|
||||
def test_model_signal_is_assist_only_not_direct_exit() -> None:
|
||||
state = promote_state(
|
||||
PositionState.ARMED,
|
||||
StateTransitionInput(
|
||||
unrealized_pnl_pct=1.0,
|
||||
be_arm_pct=1.2,
|
||||
arm_pct=2.8,
|
||||
model_exit_signal=True,
|
||||
),
|
||||
)
|
||||
assert state == PositionState.ARMED
|
||||
|
||||
Reference in New Issue
Block a user