rqalpha 5.6.5__tar.gz → 6.1.1__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.
- rqalpha-6.1.1/.coveragerc +9 -0
- rqalpha-6.1.1/.gitattributes +1 -0
- rqalpha-6.1.1/.github/ISSUE_TEMPLATE/issue_template.md +26 -0
- rqalpha-6.1.1/.github/workflows/release.yml +34 -0
- rqalpha-6.1.1/.github/workflows/test.yml +86 -0
- rqalpha-6.1.1/.gitignore +25 -0
- rqalpha-6.1.1/.readthedocs.yml +23 -0
- rqalpha-6.1.1/.travis.yml +46 -0
- rqalpha-6.1.1/AGENTS.md +41 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/CHANGELOG.rst +135 -1
- rqalpha-6.1.1/PKG-INFO +234 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/README.rst +3 -3
- rqalpha-6.1.1/babel.cfg +11 -0
- rqalpha-6.1.1/docs/Makefile +207 -0
- rqalpha-6.1.1/docs/README.rst +32 -0
- rqalpha-6.1.1/docs/make.bat +281 -0
- rqalpha-6.1.1/docs/requirements.txt +26 -0
- rqalpha-6.1.1/docs/source/_static/RQAlpha_structure.png +0 -0
- rqalpha-6.1.1/docs/source/_static/buy_and_hold.png +0 -0
- rqalpha-6.1.1/docs/source/_static/golden_cross.png +0 -0
- rqalpha-6.1.1/docs/source/_static/logo.jpg +0 -0
- rqalpha-6.1.1/docs/source/_static/progress_bar.png +0 -0
- rqalpha-6.1.1/docs/source/_static/pycharm_1.png +0 -0
- rqalpha-6.1.1/docs/source/_static/rqalpha_plus.png +0 -0
- rqalpha-6.1.1/docs/source/_static/virtualBox_1.png +0 -0
- rqalpha-6.1.1/docs/source/_templates/layout.html +8 -0
- rqalpha-6.1.1/docs/source/api/base_api.rst +1053 -0
- rqalpha-6.1.1/docs/source/api/extend_api.rst +160 -0
- rqalpha-6.1.1/docs/source/conf.py +290 -0
- rqalpha-6.1.1/docs/source/development/basic_concept.rst +89 -0
- rqalpha-6.1.1/docs/source/development/collecting_logs.rst +71 -0
- rqalpha-6.1.1/docs/source/development/data_source.rst +513 -0
- rqalpha-6.1.1/docs/source/development/event_source.rst +286 -0
- rqalpha-6.1.1/docs/source/development/make_contribute.rst +84 -0
- rqalpha-6.1.1/docs/source/development/mod.rst +275 -0
- rqalpha-6.1.1/docs/source/history.rst +5 -0
- rqalpha-6.1.1/docs/source/index.rst +176 -0
- rqalpha-6.1.1/docs/source/intro/detail_install.rst +112 -0
- rqalpha-6.1.1/docs/source/intro/examples.rst +540 -0
- rqalpha-6.1.1/docs/source/intro/install.rst +182 -0
- rqalpha-6.1.1/docs/source/intro/optimizing_parameters.rst +169 -0
- rqalpha-6.1.1/docs/source/intro/overview.rst +202 -0
- rqalpha-6.1.1/docs/source/intro/run_algorithm.rst +482 -0
- rqalpha-6.1.1/docs/source/intro/tutorial.rst +258 -0
- rqalpha-6.1.1/docs/source/intro/under_ide.rst +97 -0
- rqalpha-6.1.1/docs/source/notebooks/run-rqalpha-in-ipython.ipynb +861 -0
- rqalpha-6.1.1/messages.pot +1182 -0
- rqalpha-6.1.1/performance/000905_tracking.py +55 -0
- rqalpha-6.1.1/performance/buy_and_hold_hs300.py +89 -0
- rqalpha-6.1.1/performance/daily_adjust_hs300.py +99 -0
- rqalpha-6.1.1/pyproject.toml +83 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/__init__.py +1 -3
- rqalpha-6.1.1/rqalpha/_version.py +34 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/apis/__init__.py +3 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/apis/api_abstract.py +110 -33
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/apis/api_base.py +148 -37
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/apis/api_rqdatac.py +1 -1
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/const.py +10 -1
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/core/strategy_context.py +2 -15
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/data/bar_dict_price_board.py +2 -2
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/data/base_data_source/__init__.py +1 -1
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/data/base_data_source/data_source.py +190 -130
- rqalpha-6.1.1/rqalpha/data/base_data_source/deprecated.py +47 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/data/base_data_source/storage_interface.py +2 -20
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/data/base_data_source/storages.py +26 -42
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/data/bundle.py +146 -84
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/data/data_proxy.py +89 -95
- rqalpha-6.1.1/rqalpha/data/instruments_mixin.py +153 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/data/trading_dates_mixin.py +23 -29
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/environment.py +43 -41
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/interface.py +124 -55
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/main.py +31 -11
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/__init__.py +11 -3
- rqalpha-6.1.1/rqalpha/mod/rqalpha_mod_sys_accounts/README.rst +46 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_accounts/__init__.py +2 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_accounts/api/api_future.py +66 -29
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_accounts/api/api_stock.py +138 -89
- rqalpha-6.1.1/rqalpha/mod/rqalpha_mod_sys_accounts/api/order_target_portfolio.py +337 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_accounts/mod.py +1 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_accounts/position_model.py +139 -62
- rqalpha-6.1.1/rqalpha/mod/rqalpha_mod_sys_analyser/README.rst +93 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_analyser/__init__.py +1 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_analyser/mod.py +168 -50
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_analyser/plot/consts.py +1 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_analyser/report/report.py +15 -53
- rqalpha-6.1.1/rqalpha/mod/rqalpha_mod_sys_progress/README.rst +67 -0
- rqalpha-6.1.1/rqalpha/mod/rqalpha_mod_sys_risk/README.rst +37 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_risk/validators/cash_validator.py +4 -3
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_risk/validators/is_trading_validator.py +7 -7
- rqalpha-6.1.1/rqalpha/mod/rqalpha_mod_sys_simulation/README.rst +96 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_simulation/matcher.py +0 -6
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_simulation/signal_broker.py +0 -2
- rqalpha-6.1.1/rqalpha/mod/rqalpha_mod_sys_transaction_cost/README.rst +37 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_transaction_cost/__init__.py +4 -4
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_transaction_cost/deciders.py +55 -76
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_transaction_cost/mod.py +14 -14
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/model/__init__.py +1 -1
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/model/instrument.py +108 -95
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/model/order.py +81 -33
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/model/trade.py +38 -18
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/portfolio/__init__.py +23 -21
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/portfolio/account.py +54 -37
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/portfolio/position.py +40 -11
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/utils/__init__.py +13 -1
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/utils/arg_checker.py +189 -97
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/utils/class_helper.py +18 -7
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/utils/datetime_func.py +7 -3
- rqalpha-6.1.1/rqalpha/utils/exception.py +270 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/utils/functools.py +23 -10
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/utils/repr.py +4 -4
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/utils/testing/__init__.py +1 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/utils/testing/fixtures.py +11 -19
- rqalpha-6.1.1/rqalpha/utils/testing/integration.py +352 -0
- rqalpha-6.1.1/rqalpha/utils/translations/zh_Hans_CN/LC_MESSAGES/messages.mo +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/utils/translations/zh_Hans_CN/LC_MESSAGES/messages.po +397 -209
- rqalpha-6.1.1/rqalpha.egg-info/PKG-INFO +234 -0
- rqalpha-6.1.1/rqalpha.egg-info/SOURCES.txt +280 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha.egg-info/requires.txt +3 -2
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha.egg-info/top_level.txt +0 -1
- rqalpha-6.1.1/setup.cfg +4 -0
- rqalpha-6.1.1/setup.py +16 -0
- rqalpha-6.1.1/tests/integration_tests/conftest.py +20 -0
- {rqalpha-5.6.5/tests/api_tests → rqalpha-6.1.1/tests/integration_tests/test_api}/mod/sys_accounts/test_account_model.py +22 -12
- {rqalpha-5.6.5/tests/api_tests → rqalpha-6.1.1/tests/integration_tests/test_api}/mod/sys_accounts/test_futures_settlement_price_type.py +16 -4
- {rqalpha-5.6.5/tests/api_tests → rqalpha-6.1.1/tests/integration_tests/test_api}/mod/sys_accounts/test_margin_stocks.py +12 -2
- {rqalpha-5.6.5/tests/api_tests → rqalpha-6.1.1/tests/integration_tests/test_api}/mod/sys_accounts/test_position_models.py +14 -4
- rqalpha-6.1.1/tests/integration_tests/test_api/mod/sys_analyser/test_negative_benchmark.py +64 -0
- {rqalpha-5.6.5/tests/api_tests → rqalpha-6.1.1/tests/integration_tests/test_api}/mod/sys_scheduler/test_physical_time.py +12 -1
- {rqalpha-5.6.5/tests/api_tests → rqalpha-6.1.1/tests/integration_tests/test_api}/mod/sys_scheduler/test_scheduler.py +12 -1
- {rqalpha-5.6.5/tests/api_tests → rqalpha-6.1.1/tests/integration_tests/test_api}/mod/sys_simulation/test_management_fee.py +14 -2
- {rqalpha-5.6.5/tests/api_tests → rqalpha-6.1.1/tests/integration_tests/test_api}/mod/sys_simulation/test_signal_broker.py +14 -2
- {rqalpha-5.6.5/tests/api_tests → rqalpha-6.1.1/tests/integration_tests/test_api}/mod/sys_simulation/test_simulation_broker.py +17 -6
- rqalpha-5.6.5/tests/api_tests/mod/sys_simulation/test_simulation_event_source.py → rqalpha-6.1.1/tests/integration_tests/test_api/mod/sys_simulation/test_simulation_event_source_integration.py +11 -46
- {rqalpha-5.6.5/tests/api_tests → rqalpha-6.1.1/tests/integration_tests/test_api}/mod/sys_transaction_cost/test_commission_multiplier.py +11 -1
- {rqalpha-5.6.5/tests/api_tests → rqalpha-6.1.1/tests/integration_tests/test_api}/test_api_base.py +172 -35
- {rqalpha-5.6.5/tests/api_tests → rqalpha-6.1.1/tests/integration_tests/test_api}/test_api_future.py +12 -10
- {rqalpha-5.6.5/tests/api_tests → rqalpha-6.1.1/tests/integration_tests/test_api}/test_api_stock.py +44 -39
- {rqalpha-5.6.5/tests/api_tests → rqalpha-6.1.1/tests/integration_tests/test_api}/test_config.py +22 -16
- rqalpha-6.1.1/tests/integration_tests/test_api/test_order_target_portfolio_smart_api.py +112 -0
- {rqalpha-5.6.5/tests/api_tests → rqalpha-6.1.1/tests/integration_tests/test_api}/test_position_queue.py +27 -25
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/conftest.py +43 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/outs/test_f_buy_and_hold#test_f_buy_and_hold.txt +167 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/outs/test_f_delivery#test_f_delivery.txt +71 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/outs/test_f_macd#test_f_macd.txt +1577 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/outs/test_f_macd_signal#test_f_macd_signal.txt +1577 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/outs/test_f_mean_reverting#test_f_mean_reverting.txt +875 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/outs/test_f_tick_size#test_f_tick_size.txt +128 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/outs/test_order_target_portfolio_smart#test_order_target_portfolio_smart.txt +2872 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/outs/test_s_buy_and_hold#test_s_buy_and_hold.txt +856 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/outs/test_s_dual_thrust#test_s_dual_thrust.txt +2047 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/outs/test_s_pit_tax#test_s_pit_tax.txt +141 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/outs/test_s_scheduler#test_s_scheduler.txt +5568 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/outs/test_s_split#test_s_split.txt +71 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/outs/test_s_tick_size#test_s_tick_size.txt +842 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/outs/test_s_turtle#test_s_turtle.txt +4140 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/outs/test_s_turtle_signal#test_s_turtle_signal.txt +4140 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/outs/test_sf_buy_and_hold#test_sf_buy_and_hold.txt +479 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/resources/future_info.json +61913 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/resources/test_order_target_portfolio_smart#test_order_target_portfolio_smart/2024-11-04.csv +154 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/resources/test_order_target_portfolio_smart#test_order_target_portfolio_smart/2024-11-08.csv +154 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/resources/test_order_target_portfolio_smart#test_order_target_portfolio_smart/2024-11-11.csv +152 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/resources/test_order_target_portfolio_smart#test_order_target_portfolio_smart/2024-11-18.csv +144 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/test_f_buy_and_hold.py +29 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/test_f_delivery.py +48 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/test_f_macd.py +76 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/test_f_macd_signal.py +75 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/test_f_mean_reverting.py +149 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/test_f_tick_size.py +71 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/test_order_target_portfolio_smart.py +58 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/test_s_buy_and_hold.py +27 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/test_s_dual_thrust.py +90 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/test_s_pit_tax.py +40 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/test_s_scheduler.py +43 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/test_s_split.py +32 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/test_s_tick_size.py +56 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/test_s_turtle.py +140 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/test_s_turtle_signal.py +144 -0
- rqalpha-6.1.1/tests/integration_tests/test_backtest_results/test_sf_buy_and_hold.py +34 -0
- rqalpha-6.1.1/tests/unittest/test_data/test_auto_update_bundle/mock_data/mock_open_auction_info.pkl +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/tests/unittest/test_data/test_auto_update_bundle/test_auto_update_bundle_mixin.py +1 -1
- rqalpha-6.1.1/tests/unittest/test_mod/test_sys_accounts/test_api/test_order_target_portfolio_smart_api_unittest.py +334 -0
- rqalpha-6.1.1/tests/unittest/test_mod/test_sys_simulation/mock_data/mock_ticks.pkl +0 -0
- rqalpha-6.1.1/tests/unittest/test_models/resources/test_instruments.pkl +0 -0
- rqalpha-6.1.1/tests/unittest/test_models/test_instruments.py +370 -0
- rqalpha-5.6.5/PKG-INFO +0 -50
- rqalpha-5.6.5/rqalpha/_version.py +0 -21
- rqalpha-5.6.5/rqalpha/utils/exception.py +0 -137
- rqalpha-5.6.5/rqalpha/utils/translations/zh_Hans_CN/LC_MESSAGES/messages.mo +0 -0
- rqalpha-5.6.5/rqalpha.egg-info/PKG-INFO +0 -50
- rqalpha-5.6.5/rqalpha.egg-info/SOURCES.txt +0 -206
- rqalpha-5.6.5/setup.cfg +0 -16
- rqalpha-5.6.5/setup.py +0 -91
- rqalpha-5.6.5/tests/__init__.py +0 -13
- rqalpha-5.6.5/tests/api_tests/__init__.py +0 -59
- rqalpha-5.6.5/tests/api_tests/mod/__init__.py +0 -13
- rqalpha-5.6.5/tests/api_tests/mod/sys_accounts/__init__.py +0 -16
- rqalpha-5.6.5/tests/api_tests/mod/sys_simulation/__init__.py +0 -13
- rqalpha-5.6.5/tests/api_tests/mod/sys_simulation/test_match.py +0 -76
- rqalpha-5.6.5/tests/api_tests/mod/sys_transaction_cost/__init__.py +0 -0
- rqalpha-5.6.5/tests/api_tests/utils.py +0 -6
- rqalpha-5.6.5/tests/test_f_buy_and_hold.py +0 -31
- rqalpha-5.6.5/tests/test_f_delivery.py +0 -42
- rqalpha-5.6.5/tests/test_f_macd.py +0 -68
- rqalpha-5.6.5/tests/test_f_macd_signal.py +0 -71
- rqalpha-5.6.5/tests/test_f_mean_reverting.py +0 -143
- rqalpha-5.6.5/tests/test_f_tick_size.py +0 -67
- rqalpha-5.6.5/tests/test_s_buy_and_hold.py +0 -38
- rqalpha-5.6.5/tests/test_s_dual_thrust.py +0 -85
- rqalpha-5.6.5/tests/test_s_pit_tax.py +0 -42
- rqalpha-5.6.5/tests/test_s_scheduler.py +0 -41
- rqalpha-5.6.5/tests/test_s_tick_size.py +0 -59
- rqalpha-5.6.5/tests/test_s_turtle.py +0 -136
- rqalpha-5.6.5/tests/test_s_turtle_signal.py +0 -139
- rqalpha-5.6.5/tests/test_sf_buy_and_hold.py +0 -61
- rqalpha-5.6.5/tests/unittest/__init__.py +0 -31
- rqalpha-5.6.5/tests/unittest/test_data/__init__.py +0 -7
- rqalpha-5.6.5/tests/unittest/test_data/test_auto_update_bundle/__init__.py +0 -7
- rqalpha-5.6.5/tests/unittest/test_mod/__init__.py +0 -21
- rqalpha-5.6.5/tests/unittest/test_mod/test_sys_simulation/__init__.py +0 -21
- rqalpha-5.6.5/tests/utils.py +0 -34
- rqalpha-5.6.5/versioneer.py +0 -2284
- {rqalpha-5.6.5 → rqalpha-6.1.1}/LICENSE +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/MANIFEST.in +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/__main__.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/api.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/apis/names.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/cmds/__init__.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/cmds/bundle.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/cmds/entry.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/cmds/misc.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/cmds/mod.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/cmds/run.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/config.yml +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/core/__init__.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/core/events.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/core/execution_context.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/core/executor.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/core/global_var.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/core/strategy.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/core/strategy_loader.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/core/strategy_universe.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/data/__init__.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/data/base_data_source/adjust.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/examples/IF1706_20161108.csv +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/examples/IF_macd.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/examples/buy_and_hold.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/examples/data_source/get_csv_module.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/examples/data_source/import_get_csv_module.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/examples/data_source/read_csv_as_df.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/examples/extend_api/rqalpha_mod_extend_api_demo.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/examples/extend_api/test_extend_api.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/examples/golden_cross.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/examples/macd.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/examples/pair_trading.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/examples/rsi.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/examples/run_code_demo.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/examples/run_file_demo.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/examples/run_func_demo.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/examples/subscribe_event.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/examples/test_pt.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/examples/turtle.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_accounts/api/__init__.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_accounts/component_validator.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_accounts/position_validator.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_accounts/validator.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_analyser/plot/__init__.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_analyser/plot/plot.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_analyser/plot/utils.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_analyser/plot_store.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_analyser/report/__init__.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_analyser/report/excel_template.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_analyser/report/templates/summary.xlsx +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_progress/__init__.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_progress/mod.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_risk/__init__.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_risk/mod.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_risk/validators/__init__.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_risk/validators/price_validator.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_risk/validators/self_trade_validator.py +0 -0
- /rqalpha-5.6.5/tests/api_tests/mod/sys_scheduler/__init__.py → /rqalpha-6.1.1/rqalpha/mod/rqalpha_mod_sys_scheduler/README.rst +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_scheduler/__init__.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_scheduler/mod.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_scheduler/scheduler.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_simulation/__init__.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_simulation/mod.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_simulation/simulation_broker.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_simulation/simulation_event_source.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_simulation/slippage.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_simulation/testing.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/rqalpha_mod_sys_simulation/validator.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod/utils.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/mod_config.yml +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/model/bar.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/model/tick.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/resource/ricequant-logo.png +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/user_module.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/utils/click_helper.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/utils/concurrent.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/utils/config.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/utils/dict_func.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/utils/i18n.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/utils/log_capture.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/utils/logger.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/utils/package_helper.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/utils/persisit_helper.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/utils/risk_free_helper.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/utils/rq_json.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/utils/strategy_loader_help.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/utils/testing/mocking.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/utils/translations/__init__.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/utils/translations/zh_Hans_CN/LC_MESSAGES/__init__.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/utils/translations/zh_Hans_CN/__init__.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha/utils/typing.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha.egg-info/dependency_links.txt +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha.egg-info/entry_points.txt +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/rqalpha.egg-info/not-zip-safe +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/tests/unittest/test_data/test_instrument_mixin.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/tests/unittest/test_data/test_trading_dates_mixin.py +0 -0
- {rqalpha-5.6.5 → rqalpha-6.1.1}/tests/unittest/test_mod/test_sys_simulation/test_simulation_event_source.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
rqalpha/_version.py export-subst
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug 反馈
|
|
3
|
+
about: 有一个bug需要解决
|
|
4
|
+
title: 发现一枚bug
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: Cuizi7
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# 提 ISSUE 须知
|
|
11
|
+
|
|
12
|
+
请先阅读文档 [rqalpha文档](http://rqalpha.readthedocs.io/)
|
|
13
|
+
|
|
14
|
+
如果仍有问题的话请在 [issue列表](https://github.com/ricequant/rqalpha/issues) 中寻找是否有相关问题的解决方案
|
|
15
|
+
|
|
16
|
+
如果没有的话 麻烦开一个issue 描述以下问题:
|
|
17
|
+
|
|
18
|
+
## 1. RQAlpha的版本
|
|
19
|
+
|
|
20
|
+
## 2. Python的版本
|
|
21
|
+
|
|
22
|
+
## 3. 是Windows/Linux/MacOS or others?
|
|
23
|
+
|
|
24
|
+
## 4. 您出现问题对应的源码/或者能复现问题的简易代码 以及对应的配置
|
|
25
|
+
|
|
26
|
+
## 5. 您出现的错误堆栈日志信息
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types:
|
|
6
|
+
- published # upload build tar when publish
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build-n-publish:
|
|
10
|
+
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@master
|
|
14
|
+
- name: Set up Python 3.14
|
|
15
|
+
uses: actions/setup-python@v1
|
|
16
|
+
with:
|
|
17
|
+
python-version: 3.14
|
|
18
|
+
- name: Install pypa/build
|
|
19
|
+
run: >-
|
|
20
|
+
python -m
|
|
21
|
+
pip install
|
|
22
|
+
build
|
|
23
|
+
--user
|
|
24
|
+
- name: Build a source tarball
|
|
25
|
+
run: >-
|
|
26
|
+
python -m
|
|
27
|
+
build
|
|
28
|
+
--sdist
|
|
29
|
+
--outdir dist/
|
|
30
|
+
- name: Publish distribution 📦 to PyPI
|
|
31
|
+
if: startsWith(github.ref, 'refs/tags/release/')
|
|
32
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
33
|
+
with:
|
|
34
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
on: [push, pull_request]
|
|
3
|
+
|
|
4
|
+
jobs:
|
|
5
|
+
test:
|
|
6
|
+
runs-on: ubuntu-22.04
|
|
7
|
+
strategy:
|
|
8
|
+
matrix:
|
|
9
|
+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
10
|
+
steps:
|
|
11
|
+
# Checks out a copy of your repository on the ubuntu-latest machine
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
with:
|
|
14
|
+
fetch-depth: 0 # 获取完整的 git 历史,而不是 shallow clone
|
|
15
|
+
- name: Set up Python
|
|
16
|
+
uses: actions/setup-python@v5
|
|
17
|
+
with:
|
|
18
|
+
python-version: ${{ matrix.python-version }}
|
|
19
|
+
- name: Cache dependencies
|
|
20
|
+
# cache will change when runner.os or requirements.txt changed
|
|
21
|
+
uses: actions/cache@v4
|
|
22
|
+
id: cache
|
|
23
|
+
with:
|
|
24
|
+
path: |
|
|
25
|
+
~/.cache/pip
|
|
26
|
+
~/.local
|
|
27
|
+
/usr/local/lib/ta-lib
|
|
28
|
+
key: ${{ runner.os }}-py-${{ matrix.python-version }}-deps-${{ hashFiles('**/requirements.txt') }}
|
|
29
|
+
- name: Install Python dependencies
|
|
30
|
+
run: |
|
|
31
|
+
# Install TA-Lib
|
|
32
|
+
# wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz
|
|
33
|
+
# tar -xzvf ta-lib-0.4.0-src.tar.gz
|
|
34
|
+
# cd ta-lib
|
|
35
|
+
# ./configure --prefix=/usr
|
|
36
|
+
# make
|
|
37
|
+
# sudo make install
|
|
38
|
+
# cd ..
|
|
39
|
+
# Install Test Deps
|
|
40
|
+
pip install -U pip
|
|
41
|
+
# Install numpy based on Python version
|
|
42
|
+
pip install build
|
|
43
|
+
if python -c "import sys; exit(0 if sys.version_info < (3, 12) else 1)"; then
|
|
44
|
+
pip install "numpy<2.0.0"
|
|
45
|
+
pip install TA-Lib==0.4.38 -i https://rquser:Ricequant8@pypi2.ricequant.com/simple/
|
|
46
|
+
else
|
|
47
|
+
pip install "numpy>=2.0.0"
|
|
48
|
+
pip install "TA-Lib>=0.6.5" -i https://rquser:Ricequant8@pypi2.ricequant.com/simple/
|
|
49
|
+
fi
|
|
50
|
+
pip install pytest
|
|
51
|
+
pip install pytest-cov
|
|
52
|
+
pip install coveralls
|
|
53
|
+
pip install -U setuptools
|
|
54
|
+
pip install ipython==5.3.0
|
|
55
|
+
pip install -e .
|
|
56
|
+
|
|
57
|
+
# download-bundle
|
|
58
|
+
rqalpha download-bundle
|
|
59
|
+
- name: run test
|
|
60
|
+
run: |
|
|
61
|
+
pytest --cov=rqalpha --cov-report=
|
|
62
|
+
ls -al $HOME/.rqalpha/
|
|
63
|
+
ls -al $HOME/.rqalpha/bundle/
|
|
64
|
+
- name: Upload coverage data to coveralls.io
|
|
65
|
+
# https://coveralls-python.readthedocs.io/en/latest/usage/configuration.html#configuration
|
|
66
|
+
# need COVERALLS_REPO_TOKEN
|
|
67
|
+
env:
|
|
68
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
69
|
+
COVERALLS_FLAG_NAME: ${{ matrix.python-version }}
|
|
70
|
+
COVERALLS_PARALLEL: true
|
|
71
|
+
run: |
|
|
72
|
+
python -m coveralls --service=github
|
|
73
|
+
|
|
74
|
+
coveralls:
|
|
75
|
+
name: Indicate completion to coveralls.io
|
|
76
|
+
# need secrets.GITHUB_TOKEN
|
|
77
|
+
needs: test
|
|
78
|
+
runs-on: ubuntu-latest
|
|
79
|
+
container: python:3-slim
|
|
80
|
+
steps:
|
|
81
|
+
- name: Finished
|
|
82
|
+
run: |
|
|
83
|
+
pip3 install --upgrade coveralls
|
|
84
|
+
python -m coveralls --finish
|
|
85
|
+
env:
|
|
86
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
rqalpha-6.1.1/.gitignore
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*.egg-info
|
|
2
|
+
.cache/
|
|
3
|
+
dist/
|
|
4
|
+
.idea
|
|
5
|
+
__pycache__
|
|
6
|
+
algoengine.iml
|
|
7
|
+
rqalpha.system.log
|
|
8
|
+
*.bcolz
|
|
9
|
+
*.pk
|
|
10
|
+
*.h5
|
|
11
|
+
.vscode
|
|
12
|
+
*.c
|
|
13
|
+
*.so
|
|
14
|
+
*.pyc
|
|
15
|
+
build/
|
|
16
|
+
bundle/
|
|
17
|
+
bundle
|
|
18
|
+
persist/
|
|
19
|
+
.coverage
|
|
20
|
+
.tox
|
|
21
|
+
rqalpha_test_coverage_report/
|
|
22
|
+
.tmp.pkl
|
|
23
|
+
.env
|
|
24
|
+
.DS_Store
|
|
25
|
+
rqalpha/_version.py
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# .readthedocs.yml
|
|
2
|
+
# Read the Docs configuration file
|
|
3
|
+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
|
4
|
+
|
|
5
|
+
# Required
|
|
6
|
+
version: 2
|
|
7
|
+
|
|
8
|
+
# Build documentation in the docs/ directory with Sphinx
|
|
9
|
+
sphinx:
|
|
10
|
+
configuration: docs/source/conf.py
|
|
11
|
+
|
|
12
|
+
# Optionally set the version of Python and requirements required to build your docs
|
|
13
|
+
python:
|
|
14
|
+
install:
|
|
15
|
+
- requirements: docs/requirements.txt
|
|
16
|
+
- method: pip
|
|
17
|
+
path: .
|
|
18
|
+
|
|
19
|
+
build:
|
|
20
|
+
os: ubuntu-22.04
|
|
21
|
+
tools:
|
|
22
|
+
python: "3.11"
|
|
23
|
+
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
language: python
|
|
2
|
+
dist: trusty
|
|
3
|
+
sudo: required
|
|
4
|
+
branches:
|
|
5
|
+
only:
|
|
6
|
+
- develop
|
|
7
|
+
- master
|
|
8
|
+
matrix:
|
|
9
|
+
include:
|
|
10
|
+
- python: 3.6
|
|
11
|
+
- python: 3.7
|
|
12
|
+
dist: xenial
|
|
13
|
+
sudo: true
|
|
14
|
+
- python: 3.8
|
|
15
|
+
dist: xenial
|
|
16
|
+
sudo: true
|
|
17
|
+
|
|
18
|
+
install:
|
|
19
|
+
# Install TA-Lib
|
|
20
|
+
- wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz
|
|
21
|
+
- tar -xzvf ta-lib-0.4.0-src.tar.gz
|
|
22
|
+
- cd ta-lib
|
|
23
|
+
- ./configure --prefix=/usr
|
|
24
|
+
- make
|
|
25
|
+
- sudo make install
|
|
26
|
+
- cd ..
|
|
27
|
+
|
|
28
|
+
# Install Test Deps
|
|
29
|
+
- pip install -U pip
|
|
30
|
+
- pip install "numpy<2.0.0"
|
|
31
|
+
- pip install "TA-Lib<=0.5.4"
|
|
32
|
+
- pip install coveralls
|
|
33
|
+
- pip install -U setuptools
|
|
34
|
+
- pip install ipython==5.3.0
|
|
35
|
+
- pip install --prefer-binary .
|
|
36
|
+
script:
|
|
37
|
+
- ls -al $HOME/.rqalpha/
|
|
38
|
+
- ls -al $HOME/.rqalpha/bundle/
|
|
39
|
+
- rqalpha download-bundle
|
|
40
|
+
- coverage run --source=rqalpha test.py
|
|
41
|
+
cache:
|
|
42
|
+
directories:
|
|
43
|
+
- $HOME/.cache/pip
|
|
44
|
+
- $HOME/.rqalpha/bundle
|
|
45
|
+
after_success:
|
|
46
|
+
coveralls
|
rqalpha-6.1.1/AGENTS.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# Repository Guidelines
|
|
2
|
+
|
|
3
|
+
## Project Structure and Module Organization
|
|
4
|
+
- `rqalpha/` is the main package; core engine code is under `rqalpha/core/`, and built-in mods under `rqalpha/mod/`.
|
|
5
|
+
- `rqalpha/examples/`, `strategy_test/`, and `test_strategy/` provide sample strategies/configs.
|
|
6
|
+
- `tests/` is split into `tests/unittest/` and `tests/integration_tests/`; docs live in `docs/`.
|
|
7
|
+
|
|
8
|
+
## Architecture Overview (for Agent Onboarding)
|
|
9
|
+
- The engine is event-driven: `rqalpha/core/executor.py` consumes events and publishes them through `rqalpha/core/events.py`.
|
|
10
|
+
- Strategy lifecycle hooks live in `rqalpha/core/strategy.py` (`init`, `before_trading`, `handle_bar`, `handle_tick`, `open_auction`, `after_trading`) with pre/post phases for mod hooks.
|
|
11
|
+
- `rqalpha/environment.py` is the runtime registry for core services (data proxy/source, broker, portfolio, mods).
|
|
12
|
+
- Extension contracts are defined in `rqalpha/interface.py`; new data/execution integrations should implement these.
|
|
13
|
+
|
|
14
|
+
## Build, Test, and Development Commands
|
|
15
|
+
- `pip install -e .` installs the package and `rqalpha` CLI.
|
|
16
|
+
- `rqalpha run -f path/to/strategy.py -s YYYY-MM-DD -e YYYY-MM-DD` runs a backtest.
|
|
17
|
+
- `make -C docs html` builds documentation locally.
|
|
18
|
+
|
|
19
|
+
## Coding Style and Naming Conventions
|
|
20
|
+
- Follow PEP 8: 4-space indentation, `snake_case` functions/variables, `CapWords` classes, `UPPER_SNAKE_CASE` constants.
|
|
21
|
+
- Keep APIs, errors, and type hints consistent with existing `rqalpha/` modules.
|
|
22
|
+
|
|
23
|
+
## Testing Guidelines
|
|
24
|
+
- Use `pytest`; run `pytest tests` for the full suite.
|
|
25
|
+
- Unit tests target individual modules under `tests/unittest/`.
|
|
26
|
+
- Integration tests under `tests/integration_tests/` run full backtests via `rqalpha.run_func`.
|
|
27
|
+
- Pattern to follow (see `tests/integration_tests/test_backtest_results/`): define strategy callbacks in-test, build a `config` dict, and use `run_and_assert_result` to compare outputs against `outs/*.txt`.
|
|
28
|
+
- If not explicitly told otherwise, prefer strategy-style integration tests that exercise the full framework with real data. Agents may read bundle data or call `rqdatac` to pick concrete instruments and dates.
|
|
29
|
+
|
|
30
|
+
## Commit and Pull Request Guidelines
|
|
31
|
+
- Recent commits use imperative, sentence-case summaries (e.g., "Refactor ...", "Fix ...", "Update ..."). Keep messages short and scoped.
|
|
32
|
+
- PRs should describe the change, link related issues if any, and include test results or rationale when tests are not run.
|
|
33
|
+
|
|
34
|
+
## Agent-Specific Pointers
|
|
35
|
+
- Entry points: `rqalpha/__main__.py`, `rqalpha/cmds/run.py`, and `rqalpha/main.py`.
|
|
36
|
+
- For strategy behavior: `rqalpha/core/strategy.py` and `rqalpha/core/events.py`.
|
|
37
|
+
- For data/instruments: `rqalpha/data/` and `rqalpha/interface.py`; for orders/portfolio: `rqalpha/portfolio/` and `rqalpha/mod/rqalpha_mod_sys_accounts/`.
|
|
38
|
+
|
|
39
|
+
## Documentation and Data Notes
|
|
40
|
+
- Update `docs/` when public behavior changes.
|
|
41
|
+
- Data access and strategy behavior are tightly coupled to RQAlpha/RQData; avoid changing data contracts without migration notes.
|
|
@@ -2,6 +2,140 @@
|
|
|
2
2
|
CHANGELOG
|
|
3
3
|
==================
|
|
4
4
|
|
|
5
|
+
6.1.0
|
|
6
|
+
==================
|
|
7
|
+
|
|
8
|
+
本次迭代包含重大的架构基本假设变更:
|
|
9
|
+
- 旧版本隐含假设了 每个 order_book_id 只对应唯一的 Instrument 对象,这与实际业务逻辑不符;
|
|
10
|
+
- 新版本假设 instrument 是时序的,同一个 order_book_id 在不同时间点可能对应不同的 Instrument 对象;
|
|
11
|
+
|
|
12
|
+
**[不兼容改动]**
|
|
13
|
+
|
|
14
|
+
- `order` 和 `order_to` 下单 API 的 order_book_id 参数名修改为 id_or_ins
|
|
15
|
+
- `get_position` 不能传入还未上市的 order_book_id,传入此类代码会抛出异常
|
|
16
|
+
- `Instrument.listing_at` 更名为 `active_at`,旧方法移除
|
|
17
|
+
|
|
18
|
+
**[新增功能]**
|
|
19
|
+
|
|
20
|
+
- 新增 `active_instrument` / `active_instruments` API,用于获取当前交易时点正在活跃(上市中、未退市)的合约对象
|
|
21
|
+
- 新增 `instrument_history`/ `instruments_history` API,用于获取合约历史记录列表(包含未上市或已退市合约)
|
|
22
|
+
|
|
23
|
+
**[重构和改善]**
|
|
24
|
+
|
|
25
|
+
- API 参数校验支持自动转换(Instrument/symbol -> order_book_id),统一下单与查询路径
|
|
26
|
+
- 风控、下单、分析等模块统一基于交易时点的合约对象进行判断
|
|
27
|
+
|
|
28
|
+
**[其他改进]**
|
|
29
|
+
|
|
30
|
+
- 依赖调整:`typing-extensions` 版本提升至 `>=4.5.0`
|
|
31
|
+
- 更新翻译文件
|
|
32
|
+
|
|
33
|
+
**[For Mod 开发者] 接口变更指引**
|
|
34
|
+
|
|
35
|
+
- `DataProxy` 增加合约历史/活跃合约相关接口(如 `get_active_instrument(s)`、`get_instrument_history`、`get_instruments_history` 等)
|
|
36
|
+
- `Environment.get_instrument` 及 `DataProxy` 旧合约相关接口(因不符合新假设)标记为废弃
|
|
37
|
+
- 参数校验体系调整
|
|
38
|
+
- 新增 `assure_that` 支持参数自动转换(如 Instrument / symbol -> order_book_id),若 API 内部需要参数格式转换,推荐直接使用该功能将检验和转换合并
|
|
39
|
+
- 移除部分依赖 “全局唯一 Instrument” 假设的校验规则,如 `is_valid_stock` / `is_valid_future` / `is_valid_instrument` 等
|
|
40
|
+
- 新增 `is_valid_order_book_id` 用于 order_book_id 的基础合法性检验/转换
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
6.0.0
|
|
44
|
+
==================
|
|
45
|
+
|
|
46
|
+
**[新增功能]**
|
|
47
|
+
|
|
48
|
+
- `mod_sys_accounts`新增 `dividend_tax_rate` 配置项,支持固定股息税率配置,默认为 0
|
|
49
|
+
- 新增 `order_target_portfolio_smart` API,相比 `order_target_portfolio` 更加智能和精确
|
|
50
|
+
|
|
51
|
+
**[问题修复]**
|
|
52
|
+
|
|
53
|
+
- 修复分红情况下 `position_pnl` 的计算
|
|
54
|
+
- 修复 `order_value` 及关联 API 在算法单撮合场景下对可买股数估计不准的问题
|
|
55
|
+
|
|
56
|
+
**[重构和改善]**
|
|
57
|
+
|
|
58
|
+
- 重构测试框架,从自定义框架迁移到 pytest,提升测试灵活性和功能性,更好地与 IDE 集成
|
|
59
|
+
- 重构 `BaseDataSource`,改善代码质量和性能;废弃 `InstrumentStore` 和 `AbstractInstrumentStore`
|
|
60
|
+
- 重构更新 bundle 的部分代码,提升扩展性
|
|
61
|
+
- 修改 `DataProxy` 的部分接口,改进代码质量和类型安全性
|
|
62
|
+
- 重构 `StockPosition` 类,增强分红拆分计算的鲁棒性
|
|
63
|
+
- 重构 `AnalyserMod`,增加对部分非 A 股交易日历的 benchmark 的支持
|
|
64
|
+
- 重构 `StockTransactionCostDecider` 和 `FutureTransactionCostDecider`,适配新的接口、简化代码
|
|
65
|
+
- 改善 `Instrument`、`Order` 和 `Trade` 类,简化使用、提升性能
|
|
66
|
+
- 改善 `Portfolio` 和 `Account` 类,提升针对不同合约及多市场场景下的扩展性
|
|
67
|
+
- 改善类型提示
|
|
68
|
+
- 大幅改善进程内多次运行回测会出现的内存泄漏问题
|
|
69
|
+
|
|
70
|
+
**[其他改进]**
|
|
71
|
+
|
|
72
|
+
- 策略抛出异常时,RQAlpha 主函数或进程最终也会抛出异常(而不是仅打印错误日志)
|
|
73
|
+
- 更新翻译文件
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
**[For Mod 开发者] 接口变更指引**
|
|
77
|
+
|
|
78
|
+
本版本对接口进行了重大重构,主要目的是简化代码、提升类型安全性及提升针对多市场交易的扩展性
|
|
79
|
+
|
|
80
|
+
**1. `interface.py` 变更**
|
|
81
|
+
|
|
82
|
+
- `AbstractTransactionCostDecider` 接口发生重大变更,多个方法合并为单一 `calc` 方法
|
|
83
|
+
- `DataSource` 新增 `get_exchange_rate` 方法,对于单一货币的场景,简单返回全 1 的汇率结构即可(参考 `BaseDataSource` 的实现)
|
|
84
|
+
|
|
85
|
+
**2. `BaseDataSource` 接口变更**
|
|
86
|
+
|
|
87
|
+
- `register_xxx_store` 增加 `market` 参数,`register_instrument_store` 替换为 `register_instruments`
|
|
88
|
+
- `InstrumentStore` 和 `AbstractInstrumentStore` 已标记为废弃
|
|
89
|
+
|
|
90
|
+
**3. `DataProxy` 接口变更**
|
|
91
|
+
|
|
92
|
+
- 删除 `get_dividend_by_book_date` 和 `get_split_by_ex_date` 方法
|
|
93
|
+
- `get_prev_close` 方法新增 `adjust_type` 参数
|
|
94
|
+
- 新增 `instrument_not_none` 和 `multi_instruments` 方法,提高类型安全性
|
|
95
|
+
- 新增 `get_exchange_rate` 方法,用于获取汇率数据
|
|
96
|
+
- 交易日历相关方法 `trading_calendar_type` 参数的默认值改为 `TRADING_CALENDAR_TYPE.CN_STOCK`
|
|
97
|
+
|
|
98
|
+
**4. `Environment` 接口变更**
|
|
99
|
+
|
|
100
|
+
- 简化税费计算相关接口,将功能重叠的多个接口合并精简为 `calc_transaction_cost`
|
|
101
|
+
- 变更多个组件属性的行为以提升类型安全,以下属性在未设置之前尝试访问会抛出 `AttributeError`(而不是返回 `None`):
|
|
102
|
+
- `data_proxy`
|
|
103
|
+
- `data_source`
|
|
104
|
+
- `price_board`
|
|
105
|
+
- `event_source`
|
|
106
|
+
- `broker`
|
|
107
|
+
- `strategy_loader`
|
|
108
|
+
- `portfolio`
|
|
109
|
+
- `mod_dict`
|
|
110
|
+
- `user_strategy`
|
|
111
|
+
|
|
112
|
+
**4. 各 model 和业务类**
|
|
113
|
+
|
|
114
|
+
- `Instrument`
|
|
115
|
+
- 构造函数新增 `market` 参数,非中国市场标的需要传入该参数
|
|
116
|
+
- 新增 `min_order_quantity` 和 `order_step_size` 属性,改善原 `round_lot` 含义模糊的问题
|
|
117
|
+
|
|
118
|
+
- `Order`
|
|
119
|
+
- 新增 `estimated_transaction_cost` 属性,用于估算订单交易成本
|
|
120
|
+
|
|
121
|
+
- `Trade`
|
|
122
|
+
- 构造后不再需要显式设置 `commission` 和 `tax`,这一过程已集成至 `__from_create__` 内部
|
|
123
|
+
|
|
124
|
+
- `Account`
|
|
125
|
+
- 增加 `available_cash_for` 方法,用于在多市场场景下获取指定标的的可用资金,风控场景应使用该方法而不是 `cash` 属性
|
|
126
|
+
|
|
127
|
+
**5. 枚举类型变化**
|
|
128
|
+
|
|
129
|
+
- `TRADING_CALENDAR_TYPE` 新增 `HK_STOCK` 和 `SOUTHBOUND` 类型,原 `EXCHANGE` 类型重命名为 `CN_STOCK`
|
|
130
|
+
- 新增 `MARKET` 枚举 (`MARKET.CN`, `MARKET.HK`) 用于多市场支持
|
|
131
|
+
|
|
132
|
+
**6. 重构测试框架**
|
|
133
|
+
|
|
134
|
+
- 新的回测结果断言工具
|
|
135
|
+
- `rqalpha.utils.testing` 下新增 `assert_result` 工具函数,用于断言回测结果与文件中持久化的结果相一致
|
|
136
|
+
- 增加了专门用来持久化回测结果的自定义文件格式,兼顾了可读性和序列化能力
|
|
137
|
+
|
|
138
|
+
|
|
5
139
|
5.3.3
|
|
6
140
|
==================
|
|
7
141
|
- 修复平今数量的计算异常
|
|
@@ -987,7 +1121,7 @@ RQAlpha 4.x 相对于 3.x 版本进行了部分重构,重构的核心目标是
|
|
|
987
1121
|
2.2.2
|
|
988
1122
|
==================
|
|
989
1123
|
|
|
990
|
-
- 增加 :code:`run_file` | :code:`run_code` | :code:`run_func` API, 详情请参见 `多种方式运行策略 <http://rqalpha.io/zh_CN/latest/intro/run_algorithm.html>`_
|
|
1124
|
+
- 增加 :code:`run_file` | :code:`run_code` | :code:`run_func` API, 详情请参见 `多种方式运行策略 <http://rqalpha.readthedocs.io/zh_CN/latest/intro/run_algorithm.html>`_
|
|
991
1125
|
- Breaking Change: 更改 :code:`AbstractStrategyLoader:load` 函数的传入参数,现在不需要 :code:`strategy` 了。
|
|
992
1126
|
- 增加 :code:`UserFuncStrategyLoader` 类
|
|
993
1127
|
- 根据 `Issue 116 <https://github.com/ricequant/rqalpha/issues/116>`_ 增加如下内容:
|