cfquant 0.2.43__tar.gz → 0.2.46__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cfquant-0.2.43 → cfquant-0.2.46}/LTtx/tx/LTtx_server.py +14 -8
- {cfquant-0.2.43 → cfquant-0.2.46}/LTtx/tx/tx.py +7 -4
- {cfquant-0.2.43/cfquant.egg-info → cfquant-0.2.46}/PKG-INFO +42 -5
- cfquant-0.2.43/PKG-INFO → cfquant-0.2.46/README.md +403 -388
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/batch_orders.py +10 -6
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/cli.py +8 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/log_management.py +23 -2
- cfquant-0.2.46/cfquant/management.py +452 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/normal_bridge.py +5 -3
- cfquant-0.2.46/cfquant/order_identity.py +55 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/order_meta.py +26 -2
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/qmt_bridge.py +19 -17
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/qmt_strategy_deploy.py +7 -7
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/12_/350/256/242/345/215/225/345/244/207/346/263/250/346/265/213/350/257/225.py +44 -32
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/20_/350/201/224/350/260/203/351/227/256/351/242/230/344/277/256/345/244/215/346/265/213/350/257/225.py +1100 -1095
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/test_cftrader.py +31 -11
- cfquant-0.2.46/cfquant/tests/test_lite_account_routing.py +128 -0
- cfquant-0.2.46/cfquant/tests/test_log_management.py +56 -0
- cfquant-0.2.46/cfquant/tests/test_management.py +481 -0
- cfquant-0.2.46/cfquant/tests/test_order_identity.py +212 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/test_qmt_strategy_deploy.py +76 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/test_qmt_strategy_web.py +5 -4
- cfquant-0.2.46/cfquant/tests/test_setup_qmt_prompt.py +98 -0
- cfquant-0.2.46/cfquant/tests/test_startup_recovery.py +62 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tx.py +7 -4
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tx_trade_bridge.py +48 -34
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/version.py +2 -2
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/xttrader.py +16 -10
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/xttype.py +2 -1
- cfquant-0.2.43/README.md → cfquant-0.2.46/cfquant.egg-info/PKG-INFO +235 -176
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant.egg-info/SOURCES.txt +7 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant_web_server.py +396 -210
- {cfquant-0.2.43 → cfquant-0.2.46}/pyproject.toml +1 -1
- {cfquant-0.2.43 → cfquant-0.2.46}/qmt_scripts/CFQUANT_CTYPE_ALL_LOWLAT.py +1 -1
- {cfquant-0.2.43 → cfquant-0.2.46}/qmt_scripts/CFQUANT_LITE.py +198 -74
- {cfquant-0.2.43 → cfquant-0.2.46}/qmt_scripts//345/220/214/350/264/246/345/217/267/347/213/254/347/253/213/345/270/202/345/234/272/CFQUANT_CTYPE_ALL_LOWLAT_SH.py +1 -1
- {cfquant-0.2.43 → cfquant-0.2.46}/qmt_scripts//345/220/214/350/264/246/345/217/267/347/213/254/347/253/213/345/270/202/345/234/272/CFQUANT_CTYPE_ALL_LOWLAT_SZ.py +1 -1
- {cfquant-0.2.43 → cfquant-0.2.46}/qmt_scripts//345/220/214/350/264/246/345/217/267/347/213/254/347/253/213/345/270/202/345/234/272/CFQUANT_LITE_SH.py +198 -74
- {cfquant-0.2.43 → cfquant-0.2.46}/qmt_scripts//345/220/214/350/264/246/345/217/267/347/213/254/347/253/213/345/270/202/345/234/272/CFQUANT_LITE_SZ.py +198 -74
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/app.js +36 -6
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/index.html +2 -2
- cfquant-0.2.43/cfquant/tests/test_log_management.py +0 -32
- {cfquant-0.2.43 → cfquant-0.2.46}/LICENSE +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/LTtx/__init__.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/LTtx/tx/Config.txt +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/LTtx/tx/__init__.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/MANIFEST.in +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/__init__.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/_editable_install.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/account_routing.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/build_info.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/callback_dispatcher.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/cftrader.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/channels.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/client.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/config.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/hub.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/level2.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/logging_i18n.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/pipe_bridge.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/pipe_client.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/pipe_hub.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/pipe_transport.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/protocol.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/qmt_strategy_package.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/qmt_strategy_runtime.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/runtime_report.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/stock_connect.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/10_/345/221/275/344/273/244/350/241/214/346/216/245/345/217/243/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/11_/346/231/256/351/200/232/346/241/245/346/216/245/346/264/276/345/217/221/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/13_/347/256/241/351/201/223/344/270/255/345/277/203/350/277/236/346/216/245/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/14_/350/277/220/350/241/214/346/227/266/346/212/245/345/221/212/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/15_/347/275/221/351/241/265/347/212/266/346/200/201/347/274/223/345/255/230/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/16_/345/220/257/345/212/250/345/256/211/350/243/205/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/17_/345/244/247QMT/346/216/245/345/217/243/351/200/202/351/205/215/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/18_/351/253/230/347/272/247/346/250/241/345/274/217/345/256/236/346/234/272/350/201/224/350/260/203.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/19_/345/256/236/346/234/272/350/201/224/350/260/203/345/210/244/345/256/232/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/1_/350/241/214/346/203/205/346/216/245/346/224/266/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/21_/345/215/225/350/202/241/350/241/214/346/203/205/350/256/242/351/230/205/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/22_/350/277/236/346/216/245/350/257/212/346/226/255/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/23_/347/244/272/344/276/213/351/205/215/347/275/256/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/24_/350/264/246/346/210/267/347/274/223/345/255/230/346/214/211/351/234/200/345/210/267/346/226/260/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/25_/350/264/246/346/210/267/347/274/223/345/255/230/351/241/265/351/235/242/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/26_/345/205/250/346/216/250/350/256/242/351/230/205/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/27_/345/205/250/346/216/250/350/256/242/351/230/205/351/241/265/351/235/242/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/28_Level2/346/216/245/345/217/243/351/200/202/351/205/215/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/29_Level2/350/241/214/346/203/205/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/2_/346/225/260/346/215/256/350/216/267/345/217/226/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/30_cftrader/346/211/271/351/207/217/344/270/213/345/215/225/346/200/247/350/203/275/345/237/272/345/207/206.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/31_cftrader/346/250/241/346/213/237/350/264/246/345/217/267/346/211/271/351/207/217/344/270/213/345/215/225/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/32_/345/274/202/346/255/245/344/270/213/345/215/225/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/33_/345/220/214/346/255/245/344/270/213/345/215/225/345/233/236/350/260/203/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/3_/346/225/260/346/215/256/344/270/213/350/275/275/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/4_/344/272/244/346/230/223/345/247/224/346/211/230/346/237/245/350/257/242/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/5_/347/234/237/345/256/236/344/270/213/345/215/225/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/6_/345/233/236/350/260/203/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/7_/345/220/214/346/255/245/345/274/202/346/255/245/344/270/213/345/215/225/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/8_/346/210/220/344/272/244/350/256/242/345/215/225/345/222/214/345/247/224/346/211/230/350/256/242/345/215/225/346/237/245/350/257/242/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/9_/345/217/257/346/222/244/350/256/242/345/215/225/346/265/213/350/257/225.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/_helpers.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/log/cftrader/346/250/241/346/213/237/350/264/246/345/217/267/346/211/271/351/207/217/344/270/213/345/215/225/346/265/213/350/257/225_20260911_024617.md" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/log/cftrader/346/250/241/346/213/237/350/264/246/345/217/267/346/211/271/351/207/217/344/270/213/345/215/225/346/265/213/350/257/225_20260921_175732.md" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/readme.md +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/test_api_tester_browser.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/test_api_tester_web.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/test_binding_delete_confirmation.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/test_callback_requests.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/test_cftrader_tutorial.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/test_cftrader_web.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/test_credit_compat.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/test_json_serialization.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/test_management_batch.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/test_market_data_fallback.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/test_order_time_callback.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/test_project_updater.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/test_python_api_reference.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/test_qmt_strategy_browser.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/test_stock_connect.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/test_stock_connect_browser.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/test_trading_dates.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/test_tutorial_reader.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/tests/test_tx_auto_import.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/xtconstant.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant/xtdata.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant.egg-info/dependency_links.txt +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant.egg-info/entry_points.txt +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant.egg-info/requires.txt +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant.egg-info/top_level.txt +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/cfquant_pipe_hub.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/qmt_scripts/CFQUANT.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/qmt_scripts/CFQUANT_TRADE_LOWLAT.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/qmt_scripts/__init__.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/qmt_scripts//345/220/214/350/264/246/345/217/267/347/213/254/347/253/213/345/270/202/345/234/272/CFQUANT_TRADE_LOWLAT_SH.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/qmt_scripts//345/220/214/350/264/246/345/217/267/347/213/254/347/253/213/345/270/202/345/234/272/CFQUANT_TRADE_LOWLAT_SZ.py" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/qmt_scripts//345/220/214/350/264/246/345/217/267/347/213/254/347/253/213/345/270/202/345/234/272/readme.md" +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/requirements.txt +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/setup.cfg +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/__init__.py +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/api-tester.js +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/avatars/amber-pulse.svg +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/avatars/copper-grid.svg +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/avatars/market-blue.svg +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/avatars/rose-circuit.svg +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/avatars/signal-green.svg +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/avatars/slate-wave.svg +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/avatars/teal-orbit.svg +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/avatars/violet-node.svg +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/cftrader-api-data.js +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/docs.js +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/favicon.svg +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/image/qmt_deploy/image-10.png +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/image/qmt_deploy/image-11.png +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/image/qmt_deploy/image-12.png +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/image/qmt_deploy/image-13.png +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/image/qmt_deploy/image-14.png +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/image/qmt_deploy/image-15.png +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/image/qmt_deploy/image-16.png +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/image/qmt_deploy/image-17.png +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/image/qmt_deploy/image-18.png +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/image/qmt_deploy/image-19.png +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/image/qmt_deploy/image-20.png +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/image/qmt_deploy/image-21.png +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/image/qmt_deploy/image-4.png +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/image/qmt_deploy/image-5.png +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/image/qmt_deploy/image-6.png +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/image/qmt_deploy/image-7.png +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/image/qmt_deploy/image-8.png +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/image/qmt_deploy/image-9.png +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/python-api-data.js +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/python-api.js +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/styles.css +0 -0
- {cfquant-0.2.43 → cfquant-0.2.46}/web_dashboard/vendor/mermaid.min.js +0 -0
|
@@ -87,7 +87,9 @@ def ensure_modules_with_version(modules: dict):
|
|
|
87
87
|
raise ImportError()
|
|
88
88
|
else:
|
|
89
89
|
print(f"[AutoInstall] {import_name} 已安装,版本为 {installed_version},满足要求")
|
|
90
|
-
except ImportError:
|
|
90
|
+
except ImportError:
|
|
91
|
+
if os.environ.get("CFQUANT_MANAGEMENT_TOKEN_FILE"):
|
|
92
|
+
raise RuntimeError("Managed cfquant requires %s; install it in the configured Python environment" % pip_name)
|
|
91
93
|
# 安装或升级
|
|
92
94
|
install_target = pip_name if required_version == "latest" else "%s>=%s" % (pip_name, required_version)
|
|
93
95
|
print(f"[AutoInstall] 正在安装/升级 {pip_name} → {required_version}...")
|
|
@@ -201,10 +203,13 @@ def _lttx_log_dir():
|
|
|
201
203
|
configured = os.environ.get("CFQUANT_LTTX_LOG_DIR")
|
|
202
204
|
if configured:
|
|
203
205
|
return os.path.abspath(configured)
|
|
204
|
-
log_dir = os.environ.get("CFQUANT_LOG_DIR")
|
|
205
|
-
if log_dir:
|
|
206
|
-
return os.path.abspath(os.path.join(log_dir, "lttx"))
|
|
207
|
-
|
|
206
|
+
log_dir = os.environ.get("CFQUANT_LOG_DIR")
|
|
207
|
+
if log_dir:
|
|
208
|
+
return os.path.abspath(os.path.join(log_dir, "lttx"))
|
|
209
|
+
home = os.environ.get("CFQUANT_HOME")
|
|
210
|
+
if home:
|
|
211
|
+
return os.path.abspath(os.path.join(home, "log", "lttx"))
|
|
212
|
+
return os.path.join(_project_root(), "log", "lttx")
|
|
208
213
|
|
|
209
214
|
def _cleanup_lttx_logs(log_dir):
|
|
210
215
|
try:
|
|
@@ -234,7 +239,7 @@ def main_save_log():
|
|
|
234
239
|
os.makedirs(log_dir, exist_ok=True)
|
|
235
240
|
_cleanup_lttx_logs(log_dir)
|
|
236
241
|
except:
|
|
237
|
-
log_dir = os.path.
|
|
242
|
+
log_dir = os.path.join(_project_root(), "log", "lttx")
|
|
238
243
|
try:
|
|
239
244
|
os.makedirs(log_dir, exist_ok=True)
|
|
240
245
|
except:
|
|
@@ -250,7 +255,8 @@ def main_save_log():
|
|
|
250
255
|
f.write(str(data)+'\n')
|
|
251
256
|
|
|
252
257
|
msg = '%s>>>>>>>[info] LTtx程序启动'%(time.strftime("%Y-%m-%d %H:%M:%S"))
|
|
253
|
-
threading.Thread(target =
|
|
258
|
+
log_thread = threading.Thread(target=main_save_log, name="lttx-log-writer", daemon=True)
|
|
259
|
+
log_thread.start()
|
|
254
260
|
|
|
255
261
|
def close_con(client):
|
|
256
262
|
try:
|
|
@@ -1111,7 +1117,7 @@ def main():
|
|
|
1111
1117
|
update_time = '2025-09-04'
|
|
1112
1118
|
import multiprocessing
|
|
1113
1119
|
config = load_config()
|
|
1114
|
-
port = int(config['port'])
|
|
1120
|
+
port = int(os.environ.get('CFQUANT_LTTX_PORT') or config['port'])
|
|
1115
1121
|
tocken = config['token']
|
|
1116
1122
|
ip = get_local_ip()
|
|
1117
1123
|
if tcp_port_open('127.0.0.1', port):
|
|
@@ -194,10 +194,13 @@ class txl:
|
|
|
194
194
|
tx_log_dir = os.environ.get("CFQUANT_TX_LOG_DIR")
|
|
195
195
|
if tx_log_dir:
|
|
196
196
|
return os.path.abspath(tx_log_dir)
|
|
197
|
-
log_dir = os.environ.get("CFQUANT_LOG_DIR")
|
|
198
|
-
if log_dir:
|
|
199
|
-
return os.path.abspath(os.path.join(log_dir, "
|
|
200
|
-
|
|
197
|
+
log_dir = os.environ.get("CFQUANT_LOG_DIR")
|
|
198
|
+
if log_dir:
|
|
199
|
+
return os.path.abspath(os.path.join(log_dir, "lttx"))
|
|
200
|
+
home = os.environ.get("CFQUANT_HOME")
|
|
201
|
+
if home:
|
|
202
|
+
return os.path.abspath(os.path.join(home, "log", "lttx"))
|
|
203
|
+
return os.path.abspath(os.path.join(os.getcwd(), "log", "lttx"))
|
|
201
204
|
|
|
202
205
|
def delete_file(self,file_name):
|
|
203
206
|
msg = '删除tx运行日志%s'%(file_name)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cfquant
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.46
|
|
4
4
|
Summary: QMT local bridge and xtquant-compatible Python client.
|
|
5
5
|
License: MIT
|
|
6
6
|
Requires-Python: >=3.8
|
|
@@ -153,9 +153,9 @@ set CFQUANT_PYTHON_EXE=C:\Users\用户名\anaconda3\envs\quant\python.exe
|
|
|
153
153
|
start_cfquant.bat
|
|
154
154
|
```
|
|
155
155
|
|
|
156
|
-
Web 控制台启动后,请在初始化配置中确认或修改 Python 解释器路径。后续启动会优先使用已保存的路径;启动选择结果和失败原因记录在 `log\cfquant_startup.log`。
|
|
156
|
+
Web 控制台启动后,请在初始化配置中确认或修改 Python 解释器路径。后续启动会优先使用已保存的路径;启动选择结果和失败原因记录在 `log\startup\cfquant_startup.log`。
|
|
157
157
|
|
|
158
|
-
自动安装失败时,启动窗口会保持打开,并把安装日志写入 `log\cfquant_startup.log`,修复 Python、网络或权限问题后重新启动即可。
|
|
158
|
+
自动安装失败时,启动窗口会保持打开,并把安装日志写入 `log\startup\cfquant_startup.log`,修复 Python、网络或权限问题后重新启动即可。
|
|
159
159
|
|
|
160
160
|
项目默认使用清华 PyPI 镜像安装依赖,适合中国大陆网络环境。启动脚本、网页源码更新、`requirements.txt` 安装以及 LTtx 缺失依赖自动安装都会遵循这个设置。需要切换到企业私有源或其他镜像时,可在启动前设置 `CFQUANT_PIP_INDEX_URL` 环境变量。
|
|
161
161
|
|
|
@@ -236,8 +236,8 @@ cfquant Web 每次启动时都会读取已保存的绑定:只要账号处于
|
|
|
236
236
|
|
|
237
237
|
| 现象 | 优先检查 |
|
|
238
238
|
|---|---|
|
|
239
|
-
| 双击启动窗口后立即退出 | 查看 `log\cfquant_startup.log`;确认 Python 路径存在,或设置 `CFQUANT_PYTHON_EXE`。 |
|
|
240
|
-
| 页面打不开 | 查看最新的 `log\cfquant_web_server.*.stderr.log`;确认 8765 端口没有被其他程序占用。 |
|
|
239
|
+
| 双击启动窗口后立即退出 | 查看 `log\startup\cfquant_startup.log`;确认 Python 路径存在,或设置 `CFQUANT_PYTHON_EXE`。 |
|
|
240
|
+
| 页面打不开 | 查看最新的 `log\web\cfquant_web_server.*.stderr.log`;确认 8765 端口没有被其他程序占用。 |
|
|
241
241
|
| 页面在线但 QMT 不在线 | 确认 QMT 已登录、QMT 目录正确,并按绑定页提示重新导入或启动入口策略。 |
|
|
242
242
|
| `ModuleNotFoundError: cfquant` | 在运行策略的同一个解释器中执行 `python -m pip install --upgrade cfquant`,再用 `python -c "import cfquant; print(cfquant.__file__)"` 验证。 |
|
|
243
243
|
| 行情为空 | 先用页面接口测试确认证券代码、周期和行情权限;标准行情异常时可对照 `xtdata.get_market_data_ex`。 |
|
|
@@ -245,6 +245,43 @@ cfquant Web 每次启动时都会读取已保存的绑定:只要账号处于
|
|
|
245
245
|
|
|
246
246
|
完整日志位于项目的 `log` 目录。提交问题时,请附上启动日志、页面状态和使用的 Python 版本,删除账号、密码、Token、订单和持仓等敏感信息后再提交。
|
|
247
247
|
|
|
248
|
+
## 第三方项目自动化接入
|
|
249
|
+
|
|
250
|
+
`cfquant.management.RuntimeManager` 支持隐藏启动后台服务、通过代码初始化及绑定账号、配置是否自动启动 QMT,并通过官网或 GitHub 更新服务和回滚。无需打开网页,后台服务使用独立目录,更新不会覆盖第三方进程已经导入的 SDK。
|
|
251
|
+
|
|
252
|
+
```python
|
|
253
|
+
from cfquant.management import RuntimeManager
|
|
254
|
+
|
|
255
|
+
runtime = RuntimeManager(home=r"D:\MyApp\cfquant")
|
|
256
|
+
runtime.start() # 隐藏启动;遵循各账号保存的 QMT 启动设置
|
|
257
|
+
runtime.initialize(
|
|
258
|
+
account_id="YOUR_ACCOUNT_ID", account_type="STOCK",
|
|
259
|
+
qmt_dir=r"D:\QMT", mode="ctypes",
|
|
260
|
+
auto_start_qmt=False, strategy_autorun=True, live=False,
|
|
261
|
+
)
|
|
262
|
+
# 用户自行启动并登录 QMT;首次部署前需关闭 QMT。
|
|
263
|
+
runtime.wait_ready("YOUR_ACCOUNT_ID", timeout=120)
|
|
264
|
+
runtime.configure_client()
|
|
265
|
+
|
|
266
|
+
# 用户关闭 QMT 后,可通过 runtime.updates.apply() 更新后台服务。
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
查询当前运行版本、已安装版本和远端版本,以及按需自动更新:
|
|
270
|
+
|
|
271
|
+
```python
|
|
272
|
+
versions = runtime.version_info(force=True)
|
|
273
|
+
print(versions["running_version"], versions["installed_version"], versions["latest_version"])
|
|
274
|
+
|
|
275
|
+
result = runtime.updates.ensure_latest() # 重新检查;有更新才安装并重启后台服务
|
|
276
|
+
print(result["status"], result["message"])
|
|
277
|
+
# up_to_date / 已是最新版本:不会下载、重启或关闭 QMT。
|
|
278
|
+
# updated / 已更新;check_failed / 无法确认远端版本;local_newer / 本地版本更高。
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
`version_info(include_remote=False)` 只查询本地版本;`updates.check(force=True)` 只检查更新。按需更新也识别同版本号的安装包变化,首次安装包哈希未知时会执行一次更新以建立记录。真正需要更新时,默认要求先关闭相关 QMT;也可显式传入 `auto_close_qmt=True` 允许自动关闭。`restart=False` 可留待调用方重启。部分 QMT 部署失败返回 `update_incomplete`,已安装但尚未重启返回 `restart_required`;执行更新失败会抛出 `ManagementError`。
|
|
282
|
+
|
|
283
|
+
模拟/实盘参数需与实际账号一致。完整的启动策略、更新接口、重复绑定行为与错误处理见 [第三方项目管理 SDK](docs/第三方项目管理SDK.md)。
|
|
284
|
+
|
|
248
285
|
## 从 `xtquant` 迁移到 `cfquant`
|
|
249
286
|
|
|
250
287
|
安装和初始化完成后,通常不需要重写原有策略。先把外部策略中指向 `xtquant` 的导入改成 `cfquant` 对应模块,再按下面的顺序验证。cfquant 负责外部 Python 与 QMT 之间的桥接,QMT 仍然需要登录并运行 Web 绑定页部署的入口策略。
|