Align Continue labels with price plan outcomes

This commit is contained in:
Codex
2026-06-27 23:53:58 +08:00
parent 38a728c00b
commit 87849a66a7
4 changed files with 170 additions and 24 deletions
@@ -380,8 +380,9 @@ def _state_rows_for_age(frame: pd.DataFrame, stop_bps: float, target_bps: float,
target_price = np.where(long_mask, entry_price * (1.0 + target_bps / 10000.0), entry_price * (1.0 - target_bps / 10000.0))
distance_to_stop = np.where(long_mask, (current_price / stop_price - 1.0) * 10000.0, (stop_price / current_price - 1.0) * 10000.0)
distance_to_target = np.where(long_mask, (target_price / current_price - 1.0) * 10000.0, (current_price / target_price - 1.0) * 10000.0)
expected_edge = frame["future_return_bps"].astype(float) - cost_bps
continue_target = ((expected_edge >= min_continue_edge_bps) & (frame["mae_bps"].astype(float) < stop_bps)).astype("int8")
# Continue must score the first price-plan outcome from the current state, not the raw horizon close.
expected_edge = frame["gross_edge_bps"].astype(float) - cost_bps
continue_target = ((expected_edge >= min_continue_edge_bps) & (frame["stop_hit"].astype(int) == 0)).astype("int8")
out = frame[
[
@@ -601,6 +602,8 @@ def _source_manifest(
"uses_same_round_model_prediction_as_feature": False,
"entry_predicted_edge_bps": "baseline frozen ENTRY ONNX output selected by side",
"entry_direction_prob": "baseline frozen DIRECTION ONNX output selected by side",
"expected_continue_edge_bps": "price-plan gross edge minus cost; target/stop/timeout outcome is respected",
"continue_target": "expected_continue_edge_bps >= threshold and stop is not the first path barrier",
"path_features": "position path shape and side-adjusted market pressure at current state time",
"add_count": "synthetic first-position diagnostic, fixed to 0",
"minutes_since_last_add": "synthetic first-position diagnostic, fixed to 9999",