diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index b9239a7..1db81e9 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -59,10 +59,12 @@ jobs: python3 python/scripts/build_config.py --check python3 python/scripts/build_config.py python3 python/scripts/sync_strategy_switch_page_asset.py - git diff --exit-code -- web/strategy-switch-console/page_asset.js web/strategy-switch-console/strategy_profiles_asset.js + git diff --exit-code -- web/strategy-switch-console/page_asset.js web/strategy-switch-console/strategy_profiles_asset.js web/strategy-switch-console/app_css.js web/strategy-switch-console/app_js.js jq empty web/strategy-switch-console/strategy-profiles.example.json node --experimental-default-type=module tests/strategy_switch_worker_validation.mjs sed -n '/\n\n\n
\n
\n

策略切换

\n

选平台、目标账号和策略,一次执行完成切换。

\n
\n
\n \n \n \n \n
\n
\n\n
\n
\n 初始化控制台\n

读取策略配置

\n

正在读取登录状态、账号配置和当前状态。

\n
\n
\n
\n\n
\n \n\n
\n
\n
\n 当前平台\n

LongBridge

\n
\n\n \n\n \n\n
\n \n\n \n\n
\n 模式\n
\n \n \n
\n \n
\n\n
\n \n\n \n\n \n
\n\n
\n \n\n \n\n \n
\n\n
\n \n
\n\n
\n

现金与融资

\n

允许融资与预留现金覆盖不能同时生效。

\n \n
\n \n\n \n\n \n\n \n
\n
\n\n
\n \n\n \n
\n
\n\n
\n \n

登录后才可执行切换。

\n

\n
\n
\n\n \n
\n
\n\n \n\n\n"; diff --git a/web/strategy-switch-console/strategy_profiles_asset.js b/web/strategy-switch-console/strategy_profiles_asset.js index 9196271..b5816ea 100644 --- a/web/strategy-switch-console/strategy_profiles_asset.js +++ b/web/strategy-switch-console/strategy_profiles_asset.js @@ -1,283 +1,2 @@ -// Generated by scripts/build_platform_config.py from platform-config.json -export const DEFAULT_STRATEGY_PROFILES = [ - { - "profile": "tqqq_growth_income", - "label": "纳斯达克增长收益", - "label_en": "NASDAQ Growth Income", - "label_zh": "纳斯达克增长收益", - "domain": "us_equity", - "runtime_enabled": true, - "income_layer_enabled": true, - "option_overlay_enabled": true, - "combo_enabled": false, - "income_layer_start_usd": "250000", - "income_layer_max_ratio": "0.55", - "income_layer_allocations": { - "SCHD": 0.3, - "DGRO": 0.2, - "SGOV": 0.4, - "SPYI": 0.08, - "QQQI": 0.02 - }, - "option_overlay_live_gate": "promotion_required", - "option_overlay_live_status": "research_only", - "option_growth_overlay_enabled": true, - "option_growth_overlay_recipe": "tqqq_leaps_growth_v1", - "option_growth_overlay_start_usd": "250000", - "option_growth_overlay_nav_budget_ratio": "0.03" - }, - { - "profile": "soxl_soxx_trend_income", - "label": "半导体趋势收益", - "label_en": "Semiconductor Trend Income", - "label_zh": "半导体趋势收益", - "domain": "us_equity", - "runtime_enabled": true, - "income_layer_enabled": true, - "option_overlay_enabled": true, - "combo_enabled": false, - "income_layer_start_usd": "150000", - "income_layer_max_ratio": "0.95", - "income_layer_allocations": { - "SCHD": 0.15, - "DGRO": 0.1, - "SGOV": 0.7, - "SPYI": 0.04, - "QQQI": 0.01 - }, - "option_overlay_live_gate": "promotion_required", - "option_overlay_live_status": "research_only" - }, - { - "profile": "nasdaq_sp500_smart_dca", - "label": "纳指标普定投", - "label_en": "NASDAQ/S&P 500 DCA", - "label_zh": "纳指标普定投", - "domain": "us_equity", - "runtime_enabled": true, - "income_layer_enabled": false, - "option_overlay_enabled": false, - "combo_enabled": false, - "dca_enabled": true, - "dca_default_mode": "fixed", - "dca_default_base_investment_usd": "1000" - }, - { - "profile": "ibit_smart_dca", - "label": "IBIT比特币定投", - "label_en": "IBIT Bitcoin DCA", - "label_zh": "IBIT比特币定投", - "domain": "us_equity", - "runtime_enabled": true, - "income_layer_enabled": false, - "option_overlay_enabled": false, - "combo_enabled": false, - "dca_enabled": true, - "dca_default_mode": "fixed", - "dca_default_base_investment_usd": "1000" - }, - { - "profile": "global_etf_rotation", - "label": "全球ETF轮动", - "label_en": "Global ETF Rotation", - "label_zh": "全球ETF轮动", - "domain": "us_equity", - "runtime_enabled": true, - "income_layer_enabled": true, - "option_overlay_enabled": true, - "combo_enabled": false, - "income_layer_start_usd": "500000", - "income_layer_max_ratio": "0.15", - "income_layer_allocations": { - "SCHD": 0.4, - "DGRO": 0.25, - "SGOV": 0.3, - "SPYI": 0.05 - }, - "option_overlay_live_gate": "promotion_required", - "option_overlay_live_status": "research_only", - "option_growth_overlay_enabled": true, - "option_growth_overlay_recipe": "spy_leaps_growth_v1", - "option_growth_overlay_start_usd": "500000", - "option_growth_overlay_nav_budget_ratio": "0.015" - }, - { - "profile": "russell_top50_leader_rotation", - "label": "罗素Top50领涨", - "label_en": "Russell Top50 Leaders", - "label_zh": "罗素Top50领涨", - "domain": "us_equity", - "runtime_enabled": true, - "income_layer_enabled": true, - "option_overlay_enabled": true, - "combo_enabled": false, - "income_layer_start_usd": "300000", - "income_layer_max_ratio": "0.25", - "income_layer_allocations": { - "SCHD": 0.45, - "DGRO": 0.3, - "SGOV": 0.25 - }, - "option_overlay_live_gate": "promotion_required", - "option_overlay_live_status": "research_only", - "option_growth_overlay_enabled": true, - "option_growth_overlay_recipe": "spy_leaps_growth_v1", - "option_growth_overlay_start_usd": "300000", - "option_growth_overlay_nav_budget_ratio": "0.015" - }, - { - "profile": "us_equity_combo", - "label": "美股核心组合", - "label_en": "US Core Combo", - "label_zh": "美股核心组合", - "domain": "us_equity", - "runtime_enabled": true, - "income_layer_enabled": true, - "option_overlay_enabled": true, - "combo_enabled": true, - "combo_mode": "dynamic", - "income_layer_start_usd": "300000", - "income_layer_max_ratio": "0.25", - "income_layer_allocations": { - "SCHD": 0.25, - "DGRO": 0.25, - "SGOV": 0.2, - "SPYI": 0.15, - "QQQI": 0.15 - }, - "option_overlay_live_gate": "promotion_required", - "option_overlay_live_status": "research_only", - "option_growth_overlay_enabled": true, - "option_growth_overlay_recipe": "spy_leaps_growth_v1", - "option_growth_overlay_start_usd": "300000", - "option_growth_overlay_nav_budget_ratio": "0.015" - }, - { - "profile": "us_equity_combo_leveraged", - "label": "美股加速组合", - "label_en": "US Alpha Combo", - "label_zh": "美股加速组合", - "domain": "us_equity", - "runtime_enabled": true, - "income_layer_enabled": false, - "option_overlay_enabled": false, - "combo_enabled": true, - "combo_mode": "dynamic" - }, - { - "profile": "hk_global_etf_tactical_rotation", - "label": "港股ETF战术轮动", - "label_en": "HK ETF Tactical Rotation", - "label_zh": "港股ETF战术轮动", - "domain": "hk_equity", - "runtime_enabled": true, - "income_layer_enabled": false, - "option_overlay_enabled": false, - "combo_enabled": false - }, - { - "profile": "hk_low_vol_dividend_quality_snapshot", - "label": "港股红利质量", - "label_en": "HK Dividend Quality", - "label_zh": "港股红利质量", - "domain": "hk_equity", - "runtime_enabled": true, - "income_layer_enabled": false, - "option_overlay_enabled": false, - "combo_enabled": false - }, - { - "profile": "hk_equity_combo", - "label": "港股恒生组合", - "label_en": "HK Core Combo", - "label_zh": "港股恒生组合", - "domain": "hk_equity", - "runtime_enabled": true, - "income_layer_enabled": false, - "option_overlay_enabled": false, - "combo_enabled": true, - "combo_mode": "dynamic" - }, - { - "profile": "cn_industry_etf_rotation_aggressive", - "label": "A股ETF轮动", - "label_en": "CN ETF Rotation", - "label_zh": "A股ETF轮动", - "domain": "cn_equity", - "runtime_enabled": true, - "income_layer_enabled": false, - "option_overlay_enabled": false, - "combo_enabled": false - }, - { - "profile": "cn_stock_momentum_rotation", - "label": "A股个股动量", - "label_en": "CN Stock Momentum", - "label_zh": "A股个股动量", - "domain": "cn_equity", - "runtime_enabled": true, - "income_layer_enabled": false, - "option_overlay_enabled": false, - "combo_enabled": false - }, - { - "profile": "cn_dividend_quality_snapshot", - "label": "A股红利质量", - "label_en": "CN Dividend Quality", - "label_zh": "A股红利质量", - "domain": "cn_equity", - "runtime_enabled": true, - "income_layer_enabled": false, - "option_overlay_enabled": false, - "combo_enabled": false - }, - { - "profile": "cn_equity_combo", - "label": "A股进取组合", - "label_en": "CN Alpha Combo", - "label_zh": "A股进取组合", - "domain": "cn_equity", - "runtime_enabled": true, - "income_layer_enabled": false, - "option_overlay_enabled": false, - "combo_enabled": true, - "combo_mode": "dynamic" - }, - { - "profile": "crypto_btc_dca", - "label": "BTC定投", - "label_en": "BTC DCA", - "label_zh": "BTC定投", - "domain": "crypto", - "runtime_enabled": true, - "income_layer_enabled": false, - "option_overlay_enabled": false, - "combo_enabled": false, - "dca_enabled": true, - "dca_default_mode": "fixed", - "dca_default_base_investment_usd": "100" - }, - { - "profile": "crypto_trend_rotation", - "label": "山寨趋势轮动", - "label_en": "Altcoin Trend", - "label_zh": "山寨趋势轮动", - "domain": "crypto", - "runtime_enabled": true, - "income_layer_enabled": false, - "option_overlay_enabled": false, - "combo_enabled": false - }, - { - "profile": "crypto_equity_combo", - "label": "加密动量组合", - "label_en": "Crypto Core Combo", - "label_zh": "加密动量组合", - "domain": "crypto", - "runtime_enabled": true, - "income_layer_enabled": false, - "option_overlay_enabled": false, - "combo_enabled": true, - "combo_mode": "dynamic" - } -]; +// Generated by scripts/sync_strategy_switch_page_asset.py; do not edit by hand. +export const DEFAULT_STRATEGY_PROFILES = [{"profile": "ibit_smart_dca", "label": "IBIT Bitcoin DCA", "label_en": "IBIT Bitcoin DCA", "label_zh": "IBIT比特币定投", "domain": "us_equity", "runtime_enabled": true, "dca_enabled": true, "dca_default_mode": "fixed", "dca_default_base_investment_usd": "1000"}, {"profile": "global_etf_rotation", "label": "Global ETF Rotation", "label_en": "Global ETF Rotation", "label_zh": "全球ETF轮动", "domain": "us_equity", "runtime_enabled": true, "income_layer_enabled": true, "income_layer_start_usd": "500000", "income_layer_max_ratio": "0.15", "income_layer_allocations": {"SCHD": 0.4, "DGRO": 0.25, "SGOV": 0.3, "SPYI": 0.05}, "option_overlay_enabled": true, "option_overlay_live_gate": "promotion_required", "option_overlay_live_status": "research_only", "option_growth_overlay_enabled": true, "option_growth_overlay_recipe": "spy_leaps_growth_v1", "option_growth_overlay_start_usd": "500000", "option_growth_overlay_nav_budget_ratio": 0.015}, {"profile": "soxl_soxx_trend_income", "label": "Semiconductor Trend Income", "label_en": "Semiconductor Trend Income", "label_zh": "半导体趋势收益", "domain": "us_equity", "runtime_enabled": true, "income_layer_enabled": true, "income_layer_start_usd": "150000", "income_layer_max_ratio": "0.95", "income_layer_allocations": {"SCHD": 0.15, "DGRO": 0.1, "SGOV": 0.7, "SPYI": 0.04, "QQQI": 0.01}, "option_overlay_enabled": true, "option_overlay_live_gate": "promotion_required", "option_overlay_live_status": "research_only", "option_income_overlay_enabled": true, "option_income_overlay_recipe": "soxx_put_credit_spread_income_v1", "option_income_overlay_start_usd": "150000", "option_income_overlay_nav_risk_ratio": 0.01}, {"profile": "nasdaq_sp500_smart_dca", "label": "NASDAQ/S&P 500 DCA", "label_en": "NASDAQ/S&P 500 DCA", "label_zh": "纳指标普定投", "domain": "us_equity", "runtime_enabled": true, "dca_enabled": true, "dca_default_mode": "fixed", "dca_default_base_investment_usd": "1000"}, {"profile": "tqqq_growth_income", "label": "NASDAQ Growth Income", "label_en": "NASDAQ Growth Income", "label_zh": "纳斯达克增长收益", "domain": "us_equity", "runtime_enabled": true, "income_layer_enabled": true, "income_layer_start_usd": "250000", "income_layer_max_ratio": "0.55", "income_layer_allocations": {"SCHD": 0.3, "DGRO": 0.2, "SGOV": 0.4, "SPYI": 0.08, "QQQI": 0.02}, "option_overlay_enabled": true, "option_overlay_live_gate": "promotion_required", "option_overlay_live_status": "research_only", "option_growth_overlay_enabled": true, "option_growth_overlay_recipe": "tqqq_leaps_growth_v1", "option_growth_overlay_start_usd": "250000", "option_growth_overlay_nav_budget_ratio": 0.03}, {"profile": "russell_top50_leader_rotation", "label": "Russell Top50 Leaders", "label_en": "Russell Top50 Leaders", "label_zh": "罗素Top50领涨", "domain": "us_equity", "runtime_enabled": true, "income_layer_enabled": true, "income_layer_start_usd": "300000", "income_layer_max_ratio": "0.25", "income_layer_allocations": {"SCHD": 0.45, "DGRO": 0.3, "SGOV": 0.25}, "option_overlay_enabled": true, "option_overlay_live_gate": "promotion_required", "option_overlay_live_status": "research_only", "option_growth_overlay_enabled": true, "option_growth_overlay_recipe": "spy_leaps_growth_v1", "option_growth_overlay_start_usd": "300000", "option_growth_overlay_nav_budget_ratio": 0.015}, {"profile": "us_equity_combo_leveraged", "label": "US Alpha Combo", "label_en": "US Alpha Combo", "label_zh": "美股加速组合", "domain": "us_equity", "runtime_enabled": true, "combo_enabled": true, "combo_mode": "dynamic"}, {"profile": "us_equity_combo", "label": "US Core Combo", "label_en": "US Core Combo", "label_zh": "美股核心组合", "domain": "us_equity", "runtime_enabled": true, "income_layer_enabled": true, "income_layer_start_usd": "300000", "income_layer_max_ratio": "0.25", "income_layer_allocations": {"SCHD": 0.25, "DGRO": 0.25, "SGOV": 0.2, "SPYI": 0.15, "QQQI": 0.15}, "option_overlay_enabled": true, "option_overlay_live_gate": "promotion_required", "option_overlay_live_status": "research_only", "option_growth_overlay_enabled": true, "option_growth_overlay_recipe": "spy_leaps_growth_v1", "option_growth_overlay_start_usd": "300000", "option_growth_overlay_nav_budget_ratio": 0.015, "combo_enabled": true, "combo_mode": "dynamic"}, {"profile": "hk_global_etf_tactical_rotation", "label": "HK ETF Tactical Rotation", "label_en": "HK ETF Tactical Rotation", "label_zh": "港股ETF战术轮动", "domain": "hk_equity", "runtime_enabled": true}, {"profile": "hk_equity_combo", "label": "HK Core Combo", "label_en": "HK Core Combo", "label_zh": "港股恒生组合", "domain": "hk_equity", "runtime_enabled": true, "combo_enabled": true, "combo_mode": "dynamic"}, {"profile": "hk_low_vol_dividend_quality_snapshot", "label": "HK Dividend Quality", "label_en": "HK Dividend Quality", "label_zh": "港股红利质量", "domain": "hk_equity", "runtime_enabled": true}, {"profile": "cn_industry_etf_rotation_aggressive", "label": "CN ETF Rotation", "label_en": "CN ETF Rotation", "label_zh": "A股ETF轮动", "domain": "cn_equity", "runtime_enabled": true}, {"profile": "cn_stock_momentum_rotation", "label": "CN Stock Momentum", "label_en": "CN Stock Momentum", "label_zh": "A股个股动量", "domain": "cn_equity", "runtime_enabled": true}, {"profile": "cn_dividend_quality_snapshot", "label": "CN Dividend Quality", "label_en": "CN Dividend Quality", "label_zh": "A股红利质量", "domain": "cn_equity", "runtime_enabled": true}, {"profile": "cn_equity_combo", "label": "CN Alpha Combo", "label_en": "CN Alpha Combo", "label_zh": "A股进取组合", "domain": "cn_equity", "runtime_enabled": true, "combo_enabled": true, "combo_mode": "dynamic"}, {"profile": "crypto_btc_dca", "label": "BTC DCA", "label_en": "BTC DCA", "label_zh": "BTC定投", "domain": "crypto", "runtime_enabled": true, "dca_enabled": true, "dca_default_mode": "fixed", "dca_default_base_investment_usd": "100"}, {"profile": "crypto_equity_combo", "label": "Crypto Core Combo", "label_en": "Crypto Core Combo", "label_zh": "加密动量组合", "domain": "crypto", "runtime_enabled": true, "combo_enabled": true, "combo_mode": "dynamic"}, {"profile": "crypto_trend_rotation", "label": "Altcoin Trend", "label_en": "Altcoin Trend", "label_zh": "山寨趋势轮动", "domain": "crypto", "runtime_enabled": true}];