Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/hk_equity_strategies/live_enablement_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ def build_live_enablement_row(profile: str) -> dict[str, Any]:


def build_live_enablement_matrix() -> dict[str, Any]:
runtime_profiles = set(get_direct_market_history_profiles()) | set(get_snapshot_backed_profiles())
runtime_profiles = set(get_runtime_enabled_profiles())
runtime_rows = [_runtime_row(profile).as_dict() for profile in sorted(runtime_profiles)]
research_rows = [_research_only_row(profile).as_dict() for profile in sorted(get_research_backtest_only_profiles())]
snapshot_rows = [
Expand Down
10 changes: 10 additions & 0 deletions src/hk_equity_strategies/runtime_readiness.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from hk_equity_strategies.runtime_etf_product_policy import build_runtime_etf_product_policy
from hk_equity_strategies.runtime_market_data_policy import build_runtime_market_data_policy
from hk_equity_strategies.catalog import (
HK_EQUITY_COMBO_PROFILE,
HK_EQUITY_DOMAIN,
HK_GLOBAL_ETF_TACTICAL_ROTATION_PROFILE,
HK_LOW_VOL_DIVIDEND_QUALITY_SNAPSHOT_PROFILE,
Expand Down Expand Up @@ -185,6 +186,15 @@ def get_required_live_evidence_fields(profile: str) -> tuple[str, ...]:
"min_required_oos_fold_count": MIN_REQUIRED_OOS_FOLD_COUNT,
"max_single_period_return_contribution": MAX_SINGLE_PERIOD_RETURN_CONTRIBUTION,
},
HK_EQUITY_COMBO_PROFILE: {
"max_allowed_backtest_drawdown": 0.30,
"min_required_return_to_drawdown_ratio": 0.50,
"max_allowed_annualized_turnover": 1.50,
"min_required_annual_return": 0.0,
"min_required_walk_forward_years": MIN_REQUIRED_WALK_FORWARD_YEARS,
"min_required_oos_fold_count": MIN_REQUIRED_OOS_FOLD_COUNT,
"max_single_period_return_contribution": MAX_SINGLE_PERIOD_RETURN_CONTRIBUTION,
},
}

PROFILE_LIVE_OPTIMIZATION_CHECKS: dict[str, tuple[str, ...]] = {
Expand Down
3 changes: 3 additions & 0 deletions tests/test_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from hk_equity_strategies import get_strategy_definitions
from hk_equity_strategies.catalog import (
HK_EQUITY_COMBO_PROFILE,
HK_EQUITY_DOMAIN,
HK_GLOBAL_ETF_TACTICAL_ROTATION_PROFILE,
HK_LOW_VOL_DIVIDEND_QUALITY_SNAPSHOT_PROFILE,
Expand All @@ -25,6 +26,7 @@
def test_catalog_declares_runtime_enabled_hk_direct_strategies():
catalog = get_strategy_definitions()
assert set(catalog) == {
HK_EQUITY_COMBO_PROFILE,
HK_GLOBAL_ETF_TACTICAL_ROTATION_PROFILE,
HK_LOW_VOL_DIVIDEND_QUALITY_SNAPSHOT_PROFILE,
}
Expand Down Expand Up @@ -67,6 +69,7 @@ def test_profile_groups_keep_runtime_research_and_snapshot_scaffolds_separate():
assert get_research_backtest_only_profiles() == frozenset()
assert get_runtime_enabled_profiles() == frozenset(
{
HK_EQUITY_COMBO_PROFILE,
HK_GLOBAL_ETF_TACTICAL_ROTATION_PROFILE,
HK_LOW_VOL_DIVIDEND_QUALITY_SNAPSHOT_PROFILE,
}
Expand Down
7 changes: 4 additions & 3 deletions tests/test_live_enablement_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import pytest

from hk_equity_strategies.catalog import (
HK_EQUITY_COMBO_PROFILE,
HK_GLOBAL_ETF_TACTICAL_ROTATION_PROFILE,
HK_LOW_VOL_DIVIDEND_QUALITY_SNAPSHOT_PROFILE,
get_external_snapshot_scaffold_profiles,
Expand Down Expand Up @@ -40,8 +41,8 @@ def test_live_enablement_matrix_keeps_only_runtime_profiles_selectable_or_listed
matrix = build_live_enablement_matrix()

assert set(matrix["selectable_profiles"]) == get_runtime_enabled_profiles()
assert matrix["selectable_profile_count"] == 2
assert matrix["profile_count"] == 2
assert matrix["selectable_profile_count"] == 3
assert matrix["profile_count"] == 3
assert matrix["blocked_profile_count"] == 0
assert get_external_snapshot_scaffold_profiles() == frozenset()
assert get_research_backtest_only_profiles() == frozenset()
Expand Down Expand Up @@ -140,6 +141,6 @@ def test_print_hk_live_enablement_matrix_json():
completed = subprocess.run([sys.executable, str(SCRIPT), "--json"], check=True, capture_output=True, text=True)
payload = json.loads(completed.stdout)

assert payload["profile_count"] == 2
assert payload["profile_count"] == 3
assert payload["blocked_profile_count"] == 0
assert set(payload["selectable_profiles"]) == get_runtime_enabled_profiles()
Loading