rqalpha 5.4.1__tar.gz → 5.4.2__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.
Files changed (206) hide show
  1. {rqalpha-5.4.1/rqalpha.egg-info → rqalpha-5.4.2}/PKG-INFO +1 -1
  2. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/_version.py +3 -3
  3. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/cmds/bundle.py +4 -1
  4. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/data/bundle.py +54 -26
  5. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/environment.py +6 -0
  6. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/interface.py +10 -7
  7. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_accounts/api/api_stock.py +39 -14
  8. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_simulation/matcher.py +2 -2
  9. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_transaction_cost/deciders.py +8 -0
  10. {rqalpha-5.4.1 → rqalpha-5.4.2/rqalpha.egg-info}/PKG-INFO +1 -1
  11. {rqalpha-5.4.1 → rqalpha-5.4.2}/setup.cfg +1 -1
  12. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/api_tests/test_api_stock.py +4 -3
  13. {rqalpha-5.4.1 → rqalpha-5.4.2}/CHANGELOG.rst +0 -0
  14. {rqalpha-5.4.1 → rqalpha-5.4.2}/LICENSE +0 -0
  15. {rqalpha-5.4.1 → rqalpha-5.4.2}/MANIFEST.in +0 -0
  16. {rqalpha-5.4.1 → rqalpha-5.4.2}/README.rst +0 -0
  17. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/__init__.py +0 -0
  18. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/__main__.py +0 -0
  19. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/api.py +0 -0
  20. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/apis/__init__.py +0 -0
  21. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/apis/api_abstract.py +0 -0
  22. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/apis/api_base.py +0 -0
  23. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/apis/api_rqdatac.py +0 -0
  24. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/apis/names.py +0 -0
  25. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/cmds/__init__.py +0 -0
  26. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/cmds/entry.py +0 -0
  27. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/cmds/misc.py +0 -0
  28. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/cmds/mod.py +0 -0
  29. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/cmds/run.py +0 -0
  30. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/config.yml +0 -0
  31. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/const.py +0 -0
  32. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/core/__init__.py +0 -0
  33. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/core/events.py +0 -0
  34. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/core/execution_context.py +0 -0
  35. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/core/executor.py +0 -0
  36. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/core/global_var.py +0 -0
  37. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/core/strategy.py +0 -0
  38. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/core/strategy_context.py +0 -0
  39. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/core/strategy_loader.py +0 -0
  40. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/core/strategy_universe.py +0 -0
  41. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/data/__init__.py +0 -0
  42. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/data/bar_dict_price_board.py +0 -0
  43. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/data/base_data_source/__init__.py +0 -0
  44. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/data/base_data_source/adjust.py +0 -0
  45. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/data/base_data_source/data_source.py +0 -0
  46. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/data/base_data_source/storage_interface.py +0 -0
  47. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/data/base_data_source/storages.py +0 -0
  48. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/data/data_proxy.py +0 -0
  49. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/data/trading_dates_mixin.py +0 -0
  50. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/examples/IF1706_20161108.csv +0 -0
  51. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/examples/IF_macd.py +0 -0
  52. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/examples/buy_and_hold.py +0 -0
  53. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/examples/data_source/get_csv_module.py +0 -0
  54. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/examples/data_source/import_get_csv_module.py +0 -0
  55. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/examples/data_source/read_csv_as_df.py +0 -0
  56. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/examples/extend_api/rqalpha_mod_extend_api_demo.py +0 -0
  57. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/examples/extend_api/test_extend_api.py +0 -0
  58. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/examples/golden_cross.py +0 -0
  59. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/examples/macd.py +0 -0
  60. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/examples/pair_trading.py +0 -0
  61. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/examples/rsi.py +0 -0
  62. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/examples/run_code_demo.py +0 -0
  63. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/examples/run_file_demo.py +0 -0
  64. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/examples/run_func_demo.py +0 -0
  65. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/examples/subscribe_event.py +0 -0
  66. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/examples/test_pt.py +0 -0
  67. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/examples/turtle.py +0 -0
  68. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/main.py +0 -0
  69. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/__init__.py +0 -0
  70. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_accounts/__init__.py +0 -0
  71. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_accounts/api/__init__.py +0 -0
  72. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_accounts/api/api_future.py +0 -0
  73. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_accounts/component_validator.py +0 -0
  74. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_accounts/mod.py +0 -0
  75. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_accounts/position_model.py +0 -0
  76. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_accounts/position_validator.py +0 -0
  77. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_accounts/validator.py +0 -0
  78. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_analyser/__init__.py +0 -0
  79. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_analyser/mod.py +0 -0
  80. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_analyser/plot/__init__.py +0 -0
  81. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_analyser/plot/consts.py +0 -0
  82. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_analyser/plot/plot.py +0 -0
  83. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_analyser/plot/utils.py +0 -0
  84. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_analyser/plot_store.py +0 -0
  85. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_analyser/report/__init__.py +0 -0
  86. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_analyser/report/excel_template.py +0 -0
  87. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_analyser/report/report.py +0 -0
  88. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_analyser/report/templates/summary.xlsx +0 -0
  89. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_progress/__init__.py +0 -0
  90. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_progress/mod.py +0 -0
  91. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_risk/__init__.py +0 -0
  92. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_risk/mod.py +0 -0
  93. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_risk/validators/__init__.py +0 -0
  94. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_risk/validators/cash_validator.py +0 -0
  95. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_risk/validators/is_trading_validator.py +0 -0
  96. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_risk/validators/price_validator.py +0 -0
  97. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_risk/validators/self_trade_validator.py +0 -0
  98. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_scheduler/__init__.py +0 -0
  99. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_scheduler/mod.py +0 -0
  100. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_scheduler/scheduler.py +0 -0
  101. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_simulation/__init__.py +0 -0
  102. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_simulation/mod.py +0 -0
  103. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_simulation/signal_broker.py +0 -0
  104. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_simulation/simulation_broker.py +0 -0
  105. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_simulation/simulation_event_source.py +0 -0
  106. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_simulation/slippage.py +0 -0
  107. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_simulation/testing.py +0 -0
  108. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_simulation/validator.py +0 -0
  109. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_transaction_cost/__init__.py +0 -0
  110. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/rqalpha_mod_sys_transaction_cost/mod.py +0 -0
  111. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod/utils.py +0 -0
  112. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/mod_config.yml +0 -0
  113. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/model/__init__.py +0 -0
  114. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/model/bar.py +0 -0
  115. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/model/instrument.py +0 -0
  116. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/model/order.py +0 -0
  117. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/model/tick.py +0 -0
  118. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/model/trade.py +0 -0
  119. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/portfolio/__init__.py +0 -0
  120. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/portfolio/account.py +0 -0
  121. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/portfolio/position.py +0 -0
  122. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/resource/ricequant-logo.png +0 -0
  123. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/user_module.py +0 -0
  124. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/__init__.py +0 -0
  125. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/arg_checker.py +0 -0
  126. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/class_helper.py +0 -0
  127. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/click_helper.py +0 -0
  128. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/concurrent.py +0 -0
  129. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/config.py +0 -0
  130. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/datetime_func.py +0 -0
  131. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/dict_func.py +0 -0
  132. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/exception.py +0 -0
  133. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/functools.py +0 -0
  134. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/i18n.py +0 -0
  135. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/log_capture.py +0 -0
  136. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/logger.py +0 -0
  137. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/package_helper.py +0 -0
  138. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/persisit_helper.py +0 -0
  139. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/repr.py +0 -0
  140. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/risk_free_helper.py +0 -0
  141. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/rq_json.py +0 -0
  142. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/strategy_loader_help.py +0 -0
  143. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/testing/__init__.py +0 -0
  144. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/testing/fixtures.py +0 -0
  145. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/testing/mocking.py +0 -0
  146. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/translations/__init__.py +0 -0
  147. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/translations/zh_Hans_CN/LC_MESSAGES/__init__.py +0 -0
  148. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/translations/zh_Hans_CN/LC_MESSAGES/messages.mo +0 -0
  149. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/translations/zh_Hans_CN/LC_MESSAGES/messages.po +0 -0
  150. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/translations/zh_Hans_CN/__init__.py +0 -0
  151. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha/utils/typing.py +0 -0
  152. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha.egg-info/SOURCES.txt +0 -0
  153. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha.egg-info/dependency_links.txt +0 -0
  154. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha.egg-info/entry_points.txt +0 -0
  155. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha.egg-info/not-zip-safe +0 -0
  156. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha.egg-info/requires.txt +0 -0
  157. {rqalpha-5.4.1 → rqalpha-5.4.2}/rqalpha.egg-info/top_level.txt +0 -0
  158. {rqalpha-5.4.1 → rqalpha-5.4.2}/setup.py +0 -0
  159. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/__init__.py +0 -0
  160. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/api_tests/__init__.py +0 -0
  161. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/api_tests/mod/__init__.py +0 -0
  162. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/api_tests/mod/sys_accounts/__init__.py +0 -0
  163. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/api_tests/mod/sys_accounts/test_account_model.py +0 -0
  164. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/api_tests/mod/sys_accounts/test_futures_settlement_price_type.py +0 -0
  165. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/api_tests/mod/sys_accounts/test_margin_stocks.py +0 -0
  166. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/api_tests/mod/sys_accounts/test_position_models.py +0 -0
  167. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/api_tests/mod/sys_scheduler/__init__.py +0 -0
  168. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/api_tests/mod/sys_scheduler/test_physical_time.py +0 -0
  169. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/api_tests/mod/sys_scheduler/test_scheduler.py +0 -0
  170. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/api_tests/mod/sys_simulation/__init__.py +0 -0
  171. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/api_tests/mod/sys_simulation/test_management_fee.py +0 -0
  172. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/api_tests/mod/sys_simulation/test_match.py +0 -0
  173. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/api_tests/mod/sys_simulation/test_signal_broker.py +0 -0
  174. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/api_tests/mod/sys_simulation/test_simulation_broker.py +0 -0
  175. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/api_tests/mod/sys_simulation/test_simulation_event_source.py +0 -0
  176. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/api_tests/mod/sys_transaction_cost/__init__.py +0 -0
  177. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/api_tests/mod/sys_transaction_cost/test_commission_multiplier.py +0 -0
  178. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/api_tests/test_api_base.py +0 -0
  179. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/api_tests/test_api_future.py +0 -0
  180. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/api_tests/test_config.py +0 -0
  181. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/api_tests/utils.py +0 -0
  182. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/test_f_buy_and_hold.py +0 -0
  183. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/test_f_delivery.py +0 -0
  184. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/test_f_macd.py +0 -0
  185. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/test_f_macd_signal.py +0 -0
  186. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/test_f_mean_reverting.py +0 -0
  187. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/test_f_tick_size.py +0 -0
  188. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/test_s_buy_and_hold.py +0 -0
  189. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/test_s_dual_thrust.py +0 -0
  190. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/test_s_pit_tax.py +0 -0
  191. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/test_s_scheduler.py +0 -0
  192. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/test_s_tick_size.py +0 -0
  193. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/test_s_turtle.py +0 -0
  194. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/test_s_turtle_signal.py +0 -0
  195. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/test_sf_buy_and_hold.py +0 -0
  196. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/unittest/__init__.py +0 -0
  197. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/unittest/test_data/__init__.py +0 -0
  198. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/unittest/test_data/test_auto_update_bundle/__init__.py +0 -0
  199. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/unittest/test_data/test_auto_update_bundle/test_auto_update_bundle_mixin.py +0 -0
  200. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/unittest/test_data/test_instrument_mixin.py +0 -0
  201. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/unittest/test_data/test_trading_dates_mixin.py +0 -0
  202. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/unittest/test_mod/__init__.py +0 -0
  203. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/unittest/test_mod/test_sys_simulation/__init__.py +0 -0
  204. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/unittest/test_mod/test_sys_simulation/test_simulation_event_source.py +0 -0
  205. {rqalpha-5.4.1 → rqalpha-5.4.2}/tests/utils.py +0 -0
  206. {rqalpha-5.4.1 → rqalpha-5.4.2}/versioneer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rqalpha
3
- Version: 5.4.1
3
+ Version: 5.4.2
4
4
  Summary: Ricequant Algorithm Trading System
5
5
  Home-page: https://github.com/ricequant/rqalpha
6
6
  Author: ricequant
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2024-06-26T17:06:06+0800",
11
+ "date": "2024-09-12T15:00:52+0800",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "d703cffe64dc12db8b2b53399d04f8baee36b304",
15
- "version": "5.4.1"
14
+ "full-revisionid": "e608e57d423434d4654ff88a6ffefc72f6feb7bb",
15
+ "version": "5.4.2"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -19,6 +19,7 @@ import tempfile
19
19
  import time
20
20
  import datetime
21
21
  import dateutil
22
+ import sys
22
23
 
23
24
  import click
24
25
  import requests
@@ -89,7 +90,9 @@ def update_bundle(data_bundle_path, rqdatac_uri, compression, concurrency):
89
90
  return 1
90
91
 
91
92
  from rqalpha.data.bundle import update_bundle as update_bundle_
92
- update_bundle_(os.path.join(data_bundle_path, 'bundle'), False, compression, concurrency)
93
+ succeed = update_bundle_(os.path.join(data_bundle_path, 'bundle'), False, compression, concurrency)
94
+ if not succeed:
95
+ sys.exit(1)
93
96
 
94
97
 
95
98
  @cli.command(help=_("Download bundle (monthly updated)"))
@@ -20,6 +20,9 @@ import re
20
20
  from itertools import chain
21
21
  from typing import Callable, Optional, Union, List
22
22
  from filelock import FileLock, Timeout
23
+ import multiprocessing
24
+ from multiprocessing.sharedctypes import Synchronized
25
+ from ctypes import c_bool
23
26
 
24
27
  import h5py
25
28
  import numpy as np
@@ -28,9 +31,11 @@ from rqalpha.utils.concurrent import ProgressedProcessPoolExecutor, ProgressedTa
28
31
  from rqalpha.utils.datetime_func import convert_date_to_date_int, convert_date_to_int
29
32
  from rqalpha.utils.i18n import gettext as _
30
33
  from rqalpha.utils.functools import lru_cache
34
+ from rqalpha.utils.logger import init_logger, system_log
31
35
  from rqalpha.environment import Environment
32
36
  from rqalpha.model.instrument import Instrument
33
37
 
38
+
34
39
  START_DATE = 20050104
35
40
  END_DATE = 29991231
36
41
 
@@ -310,24 +315,32 @@ class DayBarTask(ProgressedTask):
310
315
 
311
316
  class GenerateDayBarTask(DayBarTask):
312
317
  def __call__(self, path, fields, **kwargs):
313
- with h5py.File(path, 'w') as h5:
314
- i, step = 0, 300
315
- while True:
316
- order_book_ids = self._order_book_ids[i:i + step]
317
- df = rqdatac.get_price(order_book_ids, START_DATE, datetime.date.today(), '1d',
318
- adjust_type='none', fields=fields, expect_df=True)
319
- if not (df is None or df.empty):
320
- df.reset_index(inplace=True)
321
- df['datetime'] = [convert_date_to_int(d) for d in df['date']]
322
- del df['date']
323
- df.set_index(['order_book_id', 'datetime'], inplace=True)
324
- df.sort_index(inplace=True)
325
- for order_book_id in df.index.levels[0]:
326
- h5.create_dataset(order_book_id, data=df.loc[order_book_id].to_records(), **kwargs)
327
- i += step
328
- yield len(order_book_ids)
329
- if i >= len(self._order_book_ids):
330
- break
318
+ try:
319
+ h5 = h5py.File(path, "w")
320
+ except OSError:
321
+ system_log.error("File {} update failed, if it is using, please update later, "
322
+ "or you can delete then update again".format(path))
323
+ sval.value = False
324
+ yield 1
325
+ else:
326
+ with h5:
327
+ i, step = 0, 300
328
+ while True:
329
+ order_book_ids = self._order_book_ids[i:i + step]
330
+ df = rqdatac.get_price(order_book_ids, START_DATE, datetime.date.today(), '1d',
331
+ adjust_type='none', fields=fields, expect_df=True)
332
+ if not (df is None or df.empty):
333
+ df.reset_index(inplace=True)
334
+ df['datetime'] = [convert_date_to_int(d) for d in df['date']]
335
+ del df['date']
336
+ df.set_index(['order_book_id', 'datetime'], inplace=True)
337
+ df.sort_index(inplace=True)
338
+ for order_book_id in df.index.levels[0]:
339
+ h5.create_dataset(order_book_id, data=df.loc[order_book_id].to_records(), **kwargs)
340
+ i += step
341
+ yield len(order_book_ids)
342
+ if i >= len(self._order_book_ids):
343
+ break
331
344
 
332
345
 
333
346
  class UpdateDayBarTask(DayBarTask):
@@ -353,12 +366,15 @@ class UpdateDayBarTask(DayBarTask):
353
366
  if need_recreate_h5:
354
367
  yield from GenerateDayBarTask(self._order_book_ids)(path, fields, **kwargs)
355
368
  else:
369
+ h5 = None
356
370
  try:
357
371
  h5 = h5py.File(path, 'a')
358
372
  except OSError:
359
- raise OSError("File {} update failed, if it is using, please update later, "
360
- "or you can delete then update again".format(path))
361
- try:
373
+ system_log.error("File {} update failed, if it is using, please update later, "
374
+ "or you can delete then update again".format(path))
375
+ sval.value = False
376
+ yield 1
377
+ else:
362
378
  is_futures = "futures" == os.path.basename(path).split(".")[0]
363
379
  for order_book_id in self._order_book_ids:
364
380
  # 特殊处理前复权合约,需要全量更新
@@ -367,8 +383,11 @@ class UpdateDayBarTask(DayBarTask):
367
383
  try:
368
384
  last_date = int(h5[order_book_id]['datetime'][-1] // 1000000)
369
385
  except OSError:
370
- raise OSError("File {} update failed, if it is using, please update later, "
371
- "or you can delete then update again".format(path))
386
+ system_log.error("File {} update failed, if it is using, please update later, "
387
+ "or you can delete then update again".format(path))
388
+ sval.value = False
389
+ yield 1
390
+ break
372
391
  except ValueError:
373
392
  h5.pop(order_book_id)
374
393
  start_date = START_DATE
@@ -396,14 +415,20 @@ class UpdateDayBarTask(DayBarTask):
396
415
  h5.create_dataset(order_book_id, data=df.to_records(), **kwargs)
397
416
  yield 1
398
417
  finally:
399
- h5.close()
418
+ if h5:
419
+ h5.close()
400
420
 
401
421
 
402
- def init_rqdatac_with_warnings_catch():
422
+ def process_init(args: Optional[Synchronized] = None):
403
423
  import warnings
404
424
  with warnings.catch_warnings(record=True):
405
425
  # catch warning: rqdatac is already inited. Settings will be changed
406
426
  rqdatac.init()
427
+ init_logger()
428
+ # Initialize process shared variables
429
+ if args:
430
+ global sval
431
+ sval = args
407
432
 
408
433
 
409
434
  def update_bundle(path, create, enable_compression=False, concurrency=1):
@@ -412,6 +437,7 @@ def update_bundle(path, create, enable_compression=False, concurrency=1):
412
437
  else:
413
438
  _DayBarTask = UpdateDayBarTask
414
439
 
440
+ init_logger()
415
441
  kwargs = {}
416
442
  if enable_compression:
417
443
  kwargs['compression'] = 9
@@ -430,14 +456,16 @@ def update_bundle(path, create, enable_compression=False, concurrency=1):
430
456
  gen_suspended_days, gen_yield_curve, gen_share_transformation, gen_future_info
431
457
  )
432
458
 
459
+ succeed = multiprocessing.Value(c_bool, True)
433
460
  with ProgressedProcessPoolExecutor(
434
- max_workers=concurrency, initializer=init_rqdatac_with_warnings_catch
461
+ max_workers=concurrency, initializer=process_init, initargs=(succeed, )
435
462
  ) as executor:
436
463
  # windows上子进程需要执行rqdatac.init, 其他os则需要执行rqdatac.reset; rqdatac.init包含了rqdatac.reset的功能
437
464
  for func in gen_file_funcs:
438
465
  executor.submit(GenerateFileTask(func), path)
439
466
  for file, order_book_id, field in day_bar_args:
440
467
  executor.submit(_DayBarTask(order_book_id), os.path.join(path, file), field, **kwargs)
468
+ return succeed.value
441
469
 
442
470
 
443
471
  class AutomaticUpdateBundle(object):
@@ -26,8 +26,10 @@ from rqalpha.const import INSTRUMENT_TYPE
26
26
  from rqalpha.utils.logger import system_log, user_log, user_system_log
27
27
  from rqalpha.core.global_var import GlobalVars
28
28
  from rqalpha.utils.i18n import gettext as _
29
+ from rqalpha.const import SIDE
29
30
  if TYPE_CHECKING:
30
31
  from rqalpha.model.order import Order
32
+
31
33
 
32
34
 
33
35
  class Environment(object):
@@ -183,6 +185,10 @@ class Environment(object):
183
185
 
184
186
  def get_trade_tax(self, trade):
185
187
  return self._get_transaction_cost_decider(trade.order_book_id).get_trade_tax(trade)
188
+
189
+ def get_transaction_cost_with_value(self, value: float) -> float:
190
+ side = SIDE.BUY if value >= 0 else SIDE.SELL
191
+ return self._transaction_cost_decider_dict[INSTRUMENT_TYPE.CS].get_transaction_cost_with_value(abs(value), side)
186
192
 
187
193
  def get_trade_commission(self, trade):
188
194
  return self._get_transaction_cost_decider(trade.order_book_id).get_trade_commission(trade)
@@ -30,7 +30,7 @@ from rqalpha.model.tick import TickObject
30
30
  from rqalpha.model.order import Order
31
31
  from rqalpha.model.trade import Trade
32
32
  from rqalpha.model.instrument import Instrument
33
- from rqalpha.const import POSITION_DIRECTION, TRADING_CALENDAR_TYPE, INSTRUMENT_TYPE
33
+ from rqalpha.const import POSITION_DIRECTION, TRADING_CALENDAR_TYPE, INSTRUMENT_TYPE, SIDE
34
34
 
35
35
 
36
36
  class AbstractPosition(with_metaclass(abc.ABCMeta)):
@@ -675,25 +675,28 @@ class AbstractTransactionCostDecider((with_metaclass(abc.ABCMeta))):
675
675
  订单税费计算接口,通过实现次接口可以定义不同市场、不同合约的个性化税费计算逻辑。
676
676
  """
677
677
  @abc.abstractmethod
678
- def get_trade_tax(self, trade):
679
- # type: (Trade) -> float
678
+ def get_trade_tax(self, trade: Trade) -> float:
680
679
  """
681
680
  计算指定交易应付的印花税
682
681
  """
683
682
  raise NotImplementedError
684
683
 
685
684
  @abc.abstractmethod
686
- def get_trade_commission(self, trade):
687
- # type: (Trade) -> float
685
+ def get_trade_commission(self, trade: Trade) -> float:
688
686
  """
689
687
  计算指定交易应付的佣金
690
688
  """
691
689
  raise NotImplementedError
692
690
 
693
691
  @abc.abstractmethod
694
- def get_order_transaction_cost(self, order):
695
- # type: (Order) -> float
692
+ def get_order_transaction_cost(self, order: Order) -> float:
696
693
  """
697
694
  计算指定订单应付的交易成本(税 + 费)
698
695
  """
699
696
  raise NotImplementedError
697
+
698
+ def get_transaction_cost_with_value(self, value: float, side: SIDE) -> float:
699
+ """
700
+ 计算指定价格交易应付的交易成本(税 + 费)
701
+ """
702
+ raise NotImplementedError
@@ -18,7 +18,9 @@
18
18
  import datetime
19
19
  from decimal import Decimal, getcontext
20
20
  from itertools import chain
21
- from typing import Dict, List, Optional, Union, Tuple
21
+ from typing import Dict, List, Optional, Union, Tuple, Callable
22
+ import math
23
+ from collections import defaultdict
22
24
 
23
25
  import numpy as np
24
26
  import pandas as pd
@@ -70,14 +72,14 @@ def _get_account_position_ins(id_or_ins):
70
72
  return account, position, ins
71
73
 
72
74
 
73
- def _round_order_quantity(ins, quantity) -> int:
75
+ def _round_order_quantity(ins, quantity, method: Callable = int) -> int:
74
76
  if ins.type == "CS" and ins.board_type == "KSH":
75
77
  # KSH can buy(sell) 201, 202 shares
76
78
  return 0 if abs(quantity) < KSH_MIN_AMOUNT else int(quantity)
77
79
  else:
78
80
  round_lot = ins.round_lot
79
81
  try:
80
- return int(Decimal(quantity) / Decimal(round_lot)) * round_lot
82
+ return method(Decimal(quantity) / Decimal(round_lot)) * round_lot
81
83
  except ValueError:
82
84
  raise
83
85
 
@@ -372,8 +374,18 @@ def order_target_portfolio(
372
374
  order_book_id, quantity, SIDE.SELL, MarketOrder(), POSITION_EFFECT.CLOSE
373
375
  ))
374
376
 
375
- account_value = account.total_value
377
+ account_value = account.total_value
378
+ if total_percent == 1:
379
+ # 在此处形成的订单不包含交易费用,需要预留一点余额以供交易费用使用
380
+ estimate_transaction_cost = 0
381
+ for order_book_id, (target_percent, open_style, close_style, last_price) in target.items():
382
+ current_value = current_quantities.get(order_book_id, 0) * last_price
383
+ change_value = target_percent * account_value - current_value
384
+ estimate_transaction_cost += env.get_transaction_cost_with_value(change_value)
385
+ account_value = account_value - estimate_transaction_cost
386
+
376
387
  close_orders, open_orders = [], []
388
+ waiting_to_buy = defaultdict()
377
389
  for order_book_id, (target_percent, open_style, close_style, last_price) in target.items():
378
390
  open_price = _get_order_style_price(order_book_id, open_style)
379
391
  close_price = _get_order_style_price(order_book_id, close_style)
@@ -383,23 +395,36 @@ def order_target_portfolio(
383
395
  )
384
396
  env.order_creation_failed(order_book_id=order_book_id, reason=reason)
385
397
  continue
386
-
387
398
  delta_quantity = (account_value * target_percent / close_price) - current_quantities.get(order_book_id, 0)
388
- delta_quantity = _round_order_quantity(env.data_proxy.instrument(order_book_id), delta_quantity)
399
+ delta_quantity = _round_order_quantity(env.data_proxy.instrument(order_book_id), delta_quantity, method=round)
400
+
401
+ # 优先生成卖单,以便计算出剩余现金,进行买单数量的计算
389
402
  if delta_quantity == 0:
390
403
  continue
391
404
  elif delta_quantity > 0:
392
- quantity, side, position_effect = delta_quantity, SIDE.BUY, POSITION_EFFECT.OPEN
393
- order_list = open_orders
394
- target_style = open_style
405
+ waiting_to_buy[order_book_id] = (delta_quantity, POSITION_EFFECT.OPEN, open_style, last_price)
406
+ continue
395
407
  else:
396
408
  quantity, side, position_effect = abs(delta_quantity), SIDE.SELL, POSITION_EFFECT.CLOSE
397
- order_list = close_orders
398
- target_style = close_style
399
- order = Order.__from_create__(order_book_id, quantity, side, target_style, position_effect)
400
- if isinstance(target_style, MarketOrder):
409
+ order = Order.__from_create__(order_book_id, quantity, side, close_style, position_effect)
410
+ if isinstance(close_style, MarketOrder):
411
+ order.set_frozen_price(last_price)
412
+ close_orders.append(order)
413
+
414
+ estimate_cash = account.cash + sum([o.quantity * o.frozen_price - env.get_order_transaction_cost(o) for o in close_orders])
415
+ for order_book_id, (delta_quantity, position_effect, open_style, last_price) in waiting_to_buy.items():
416
+ cost = delta_quantity * last_price + env.get_transaction_cost_with_value(delta_quantity * last_price)
417
+ if cost > estimate_cash:
418
+ delta_quantity = estimate_cash / last_price
419
+ delta_quantity = _round_order_quantity(env.data_proxy.instrument(order_book_id), delta_quantity)
420
+ if delta_quantity == 0:
421
+ continue
422
+ cost = delta_quantity * last_price + env.get_transaction_cost_with_value(delta_quantity * last_price)
423
+ order = Order.__from_create__(order_book_id, delta_quantity, SIDE.BUY, open_style, position_effect)
424
+ if isinstance(open_style, MarketOrder):
401
425
  order.set_frozen_price(last_price)
402
- order_list.append(order)
426
+ open_orders.append(order)
427
+ estimate_cash -= cost
403
428
 
404
429
  return list(env.submit_order(o) for o in chain(close_orders, open_orders))
405
430
 
@@ -210,7 +210,7 @@ class DefaultBarMatcher(AbstractMatcher):
210
210
  trade._commission = self._env.get_trade_commission(trade)
211
211
  trade._tax = self._env.get_trade_tax(trade)
212
212
 
213
- if order.side == SIDE.BUY and self._slippage_decider.decider.rate != 0:
213
+ if order.position_effect == POSITION_EFFECT.OPEN and self._slippage_decider.decider.rate != 0:
214
214
  # 标的价格经过滑点处理后,账户资金可能不够买入,需要进行验证
215
215
  cost_money = instrument.calc_cash_occupation(price, order.quantity, order.position_direction, order.trading_datetime.date())
216
216
  cost_money += trade.transaction_cost
@@ -467,7 +467,7 @@ class DefaultTickMatcher(AbstractMatcher):
467
467
  trade._commission = self._env.get_trade_commission(trade)
468
468
  trade._tax = self._env.get_trade_tax(trade)
469
469
 
470
- if order.side == SIDE.BUY and self._slippage_decider.decider.rate != 0:
470
+ if order.position_effect == POSITION_EFFECT.OPEN and self._slippage_decider.decider.rate != 0:
471
471
  cost_money = instrument.calc_cash_occupation(price, order.quantity, order.position_direction, order.trading_datetime.date())
472
472
  cost_money += trade.transaction_cost
473
473
  if cost_money > account.cash + order.init_frozen_cash:
@@ -77,6 +77,9 @@ class StockTransactionCostDecider(AbstractTransactionCostDecider):
77
77
  commission = self._get_order_commission(order.order_book_id, order.side, order.frozen_price, order.quantity)
78
78
  tax = self._get_tax(order.order_book_id, order.side, order.frozen_price * order.quantity)
79
79
  return tax + commission
80
+
81
+ def get_transaction_cost_with_value(self, value: float, side: SIDE) -> float:
82
+ raise NotImplementedError
80
83
 
81
84
 
82
85
  class CNStockTransactionCostDecider(StockTransactionCostDecider):
@@ -99,6 +102,11 @@ class CNStockTransactionCostDecider(StockTransactionCostDecider):
99
102
  else:
100
103
  self.tax_rate = 0.0005
101
104
 
105
+ def get_transaction_cost_with_value(self, value: float, side: SIDE) -> float:
106
+ tax = value * self.tax_rate * self.tax_multiplier if side == SIDE.SELL else 0
107
+ commission = max(value * self.commission_rate * self.commission_multiplier, self.min_commission)
108
+ return tax + commission
109
+
102
110
 
103
111
  class CNFutureTransactionCostDecider(AbstractTransactionCostDecider):
104
112
  def __init__(self, commission_multiplier):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: rqalpha
3
- Version: 5.4.1
3
+ Version: 5.4.2
4
4
  Summary: Ricequant Algorithm Trading System
5
5
  Home-page: https://github.com/ricequant/rqalpha
6
6
  Author: ricequant
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = rqalpha
3
- version = 5.4.1
3
+ version = 5.4.2
4
4
 
5
5
  [versioneer]
6
6
  VCS = git
@@ -162,8 +162,9 @@ def test_order_target_portfolio():
162
162
  "000001.XSHE": 0.1,
163
163
  "000004.XSHE": 0.2,
164
164
  })
165
- assert get_position("000001.XSHE").quantity == 6900 # (1000000 * 0.1) / 14.37 = 6958.94
166
- assert get_position("000004.XSHE").quantity == 10500 # (1000000 * 0.2) / 18.92 = 10570.82
165
+ # 开仓仓位在 rqalpha == 5.4.2 之后修改为四舍五入
166
+ assert get_position("000001.XSHE").quantity == 7000 # (1000000 * 0.1) / 14.37 = 6958.94
167
+ assert get_position("000004.XSHE").quantity == 10600 # (1000000 * 0.2) / 18.92 = 10570.82
167
168
  elif context.counter == 2:
168
169
  order_target_portfolio({
169
170
  "000004.XSHE": 0.1,
@@ -175,7 +176,7 @@ def test_order_target_portfolio():
175
176
  "600519.XSHG": (970, 980),
176
177
  })
177
178
  assert get_position("000001.XSHE").quantity == 0 # 清仓
178
- assert get_position("000004.XSHE").quantity == 5600 # (993695.7496 * 0.1) / 18 = 5520.53
179
+ assert get_position("000004.XSHE").quantity == 5500 # (993695.7496 * 0.1) / 18 = 5520.53
179
180
  assert get_position("000005.XSHE").quantity == 68000 # (993695.7496 * 0.2) / 2.92 = 68061.35
180
181
  assert get_position("600519.XSHG").quantity == 0 # 970 低于 收盘价 无法买进
181
182
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes