fwquant 1.0.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.
Files changed (237) hide show
  1. fwquant-1.0.1/LICENSE +21 -0
  2. fwquant-1.0.1/PKG-INFO +44 -0
  3. fwquant-1.0.1/README.md +14 -0
  4. fwquant-1.0.1/config/__init__.py +0 -0
  5. fwquant-1.0.1/config//345/270/270/351/207/217.py +12 -0
  6. fwquant-1.0.1/fuwen_adaptor/__init__.py +24 -0
  7. fwquant-1.0.1/fuwen_adaptor/alpha/__init__.py +17 -0
  8. fwquant-1.0.1/fuwen_adaptor/alpha/dataset/__init__.py +21 -0
  9. fwquant-1.0.1/fuwen_adaptor/alpha/dataset/cs_function.py +64 -0
  10. fwquant-1.0.1/fuwen_adaptor/alpha/dataset/datasets/__init__.py +0 -0
  11. fwquant-1.0.1/fuwen_adaptor/alpha/dataset/datasets/alpha_101.py +330 -0
  12. fwquant-1.0.1/fuwen_adaptor/alpha/dataset/datasets/alpha_158.py +130 -0
  13. fwquant-1.0.1/fuwen_adaptor/alpha/dataset/math_function.py +167 -0
  14. fwquant-1.0.1/fuwen_adaptor/alpha/dataset/processor.py +125 -0
  15. fwquant-1.0.1/fuwen_adaptor/alpha/dataset/ta_function.py +42 -0
  16. fwquant-1.0.1/fuwen_adaptor/alpha/dataset/template.py +305 -0
  17. fwquant-1.0.1/fuwen_adaptor/alpha/dataset/ts_function.py +328 -0
  18. fwquant-1.0.1/fuwen_adaptor/alpha/dataset/utility.py +192 -0
  19. fwquant-1.0.1/fuwen_adaptor/alpha/lab.py +480 -0
  20. fwquant-1.0.1/fuwen_adaptor/alpha/logger.py +12 -0
  21. fwquant-1.0.1/fuwen_adaptor/alpha/model/__init__.py +6 -0
  22. fwquant-1.0.1/fuwen_adaptor/alpha/model/models/__init__.py +0 -0
  23. fwquant-1.0.1/fuwen_adaptor/alpha/model/models/lasso_model.py +139 -0
  24. fwquant-1.0.1/fuwen_adaptor/alpha/model/models/lgb_model.py +170 -0
  25. fwquant-1.0.1/fuwen_adaptor/alpha/model/models/mlp_model.py +683 -0
  26. fwquant-1.0.1/fuwen_adaptor/alpha/model/template.py +30 -0
  27. fwquant-1.0.1/fuwen_adaptor/alpha/strategy/__init__.py +8 -0
  28. fwquant-1.0.1/fuwen_adaptor/alpha/strategy/backtesting.py +944 -0
  29. fwquant-1.0.1/fuwen_adaptor/alpha/strategy/strategies/__init__.py +0 -0
  30. fwquant-1.0.1/fuwen_adaptor/alpha/strategy/strategies/equity_demo_strategy.py +101 -0
  31. fwquant-1.0.1/fuwen_adaptor/alpha/strategy/template.py +205 -0
  32. fwquant-1.0.1/fuwen_adaptor/chart/__init__.py +9 -0
  33. fwquant-1.0.1/fuwen_adaptor/chart/axis.py +44 -0
  34. fwquant-1.0.1/fuwen_adaptor/chart/base.py +21 -0
  35. fwquant-1.0.1/fuwen_adaptor/chart/item.py +333 -0
  36. fwquant-1.0.1/fuwen_adaptor/chart/manager.py +170 -0
  37. fwquant-1.0.1/fuwen_adaptor/chart/widget.py +556 -0
  38. fwquant-1.0.1/fuwen_adaptor/event/__init__.py +8 -0
  39. fwquant-1.0.1/fuwen_adaptor/event/engine.py +145 -0
  40. fwquant-1.0.1/fuwen_adaptor/py.typed +0 -0
  41. fwquant-1.0.1/fuwen_adaptor/rpc/__init__.py +8 -0
  42. fwquant-1.0.1/fuwen_adaptor/rpc/client.py +169 -0
  43. fwquant-1.0.1/fuwen_adaptor/rpc/common.py +10 -0
  44. fwquant-1.0.1/fuwen_adaptor/rpc/server.py +140 -0
  45. fwquant-1.0.1/fuwen_adaptor/trader/__init__.py +0 -0
  46. fwquant-1.0.1/fuwen_adaptor/trader/app.py +21 -0
  47. fwquant-1.0.1/fuwen_adaptor/trader/constant.py +160 -0
  48. fwquant-1.0.1/fuwen_adaptor/trader/converter.py +402 -0
  49. fwquant-1.0.1/fuwen_adaptor/trader/database.py +159 -0
  50. fwquant-1.0.1/fuwen_adaptor/trader/datafeed.py +68 -0
  51. fwquant-1.0.1/fuwen_adaptor/trader/engine.py +633 -0
  52. fwquant-1.0.1/fuwen_adaptor/trader/event.py +14 -0
  53. fwquant-1.0.1/fuwen_adaptor/trader/gateway.py +272 -0
  54. fwquant-1.0.1/fuwen_adaptor/trader/locale/__init__.py +9 -0
  55. fwquant-1.0.1/fuwen_adaptor/trader/locale/build_hook.py +23 -0
  56. fwquant-1.0.1/fuwen_adaptor/trader/logger.py +55 -0
  57. fwquant-1.0.1/fuwen_adaptor/trader/object.py +427 -0
  58. fwquant-1.0.1/fuwen_adaptor/trader/optimize.py +250 -0
  59. fwquant-1.0.1/fuwen_adaptor/trader/setting.py +43 -0
  60. fwquant-1.0.1/fuwen_adaptor/trader/ui/__init__.py +12 -0
  61. fwquant-1.0.1/fuwen_adaptor/trader/ui/ico/__init__.py +0 -0
  62. fwquant-1.0.1/fuwen_adaptor/trader/ui/mainwindow.py +333 -0
  63. fwquant-1.0.1/fuwen_adaptor/trader/ui/qt.py +125 -0
  64. fwquant-1.0.1/fuwen_adaptor/trader/ui/widget.py +1292 -0
  65. fwquant-1.0.1/fuwen_adaptor/trader/utility.py +1281 -0
  66. fwquant-1.0.1/fuwen_ctabacktester/__init__.py +49 -0
  67. fwquant-1.0.1/fuwen_ctabacktester/engine.py +499 -0
  68. fwquant-1.0.1/fuwen_ctabacktester/locale/__init__.py +7 -0
  69. fwquant-1.0.1/fuwen_ctabacktester/locale/build_hook.py +23 -0
  70. fwquant-1.0.1/fuwen_ctabacktester/ui/__init__.py +4 -0
  71. fwquant-1.0.1/fuwen_ctabacktester/ui/widget.py +1468 -0
  72. fwquant-1.0.1/fuwen_ctastrategy/__init__.py +67 -0
  73. fwquant-1.0.1/fuwen_ctastrategy/backtesting.py +1267 -0
  74. fwquant-1.0.1/fuwen_ctastrategy/base.py +58 -0
  75. fwquant-1.0.1/fuwen_ctastrategy/engine.py +970 -0
  76. fwquant-1.0.1/fuwen_ctastrategy/fw_strategies/__init__.py +0 -0
  77. fwquant-1.0.1/fuwen_ctastrategy/fw_strategies/atr_rsi_strategy.py +143 -0
  78. fwquant-1.0.1/fuwen_ctastrategy/fw_strategies/boll_channel_strategy.py +142 -0
  79. fwquant-1.0.1/fuwen_ctastrategy/fw_strategies/double_ma_strategy.py +117 -0
  80. fwquant-1.0.1/fuwen_ctastrategy/fw_strategies/dual_thrust_strategy.py +149 -0
  81. fwquant-1.0.1/fuwen_ctastrategy/fw_strategies/king_keltner_strategy.py +149 -0
  82. fwquant-1.0.1/fuwen_ctastrategy/fw_strategies/multi_signal_strategy.py +231 -0
  83. fwquant-1.0.1/fuwen_ctastrategy/fw_strategies/multi_timeframe_strategy.py +138 -0
  84. fwquant-1.0.1/fuwen_ctastrategy/fw_strategies/random_strategy.py +28 -0
  85. fwquant-1.0.1/fuwen_ctastrategy/fw_strategies/test_strategy.py +133 -0
  86. fwquant-1.0.1/fuwen_ctastrategy/fw_strategies/turtle_signal_strategy.py +160 -0
  87. fwquant-1.0.1/fuwen_ctastrategy/locale/__init__.py +9 -0
  88. fwquant-1.0.1/fuwen_ctastrategy/locale/build_hook.py +23 -0
  89. fwquant-1.0.1/fuwen_ctastrategy/template.py +496 -0
  90. fwquant-1.0.1/fuwen_ctastrategy/ui/__init__.py +4 -0
  91. fwquant-1.0.1/fuwen_ctastrategy/ui/rollover.py +270 -0
  92. fwquant-1.0.1/fuwen_ctastrategy/ui/widget.py +523 -0
  93. fwquant-1.0.1/fuwen_ctp/1.py +11 -0
  94. fwquant-1.0.1/fuwen_ctp/__init__.py +0 -0
  95. fwquant-1.0.1/fuwen_ctp/fw_ctp/__init__.py +35 -0
  96. fwquant-1.0.1/fuwen_ctp/fw_ctp/api/1.py +26 -0
  97. fwquant-1.0.1/fuwen_ctp/fw_ctp/api/__init__.py +3 -0
  98. fwquant-1.0.1/fuwen_ctp/fw_ctp/api/ctp_constant.py +1331 -0
  99. fwquant-1.0.1/fuwen_ctp/fw_ctp/gateway/__init__.py +4 -0
  100. fwquant-1.0.1/fuwen_ctp/fw_ctp/gateway/ctp_gateway.py +903 -0
  101. fwquant-1.0.1/fuwen_ctp/install.py +542 -0
  102. fwquant-1.0.1/fuwen_ctp/setup_config.py +132 -0
  103. fwquant-1.0.1/fuwen_datamanager/__init__.py +48 -0
  104. fwquant-1.0.1/fuwen_datamanager/engine.py +244 -0
  105. fwquant-1.0.1/fuwen_datamanager/ui/__init__.py +4 -0
  106. fwquant-1.0.1/fuwen_datamanager/ui/widget.py +617 -0
  107. fwquant-1.0.1/fuwen_frame/__init__.py +4 -0
  108. fwquant-1.0.1/fuwen_frame/gateway/__init__.py +0 -0
  109. fwquant-1.0.1/fuwen_frame/gateway/fuwen/__init__.py +1 -0
  110. fwquant-1.0.1/fuwen_frame/gateway/fuwen/trader/__init__.py +0 -0
  111. fwquant-1.0.1/fuwen_frame/gateway/fuwen/trader/engine.py +159 -0
  112. fwquant-1.0.1/fuwen_frame/gateway/fuwen/trader/ui/__init__.py +0 -0
  113. fwquant-1.0.1/fuwen_frame/gateway/fuwen/trader/ui/mainwindow.py +36 -0
  114. fwquant-1.0.1/fuwen_frame/gateway/fuwen/trader/ui/widget.py +88 -0
  115. fwquant-1.0.1/fuwen_frame/gateway/fw_ctp/__init__.py +0 -0
  116. fwquant-1.0.1/fuwen_frame/gateway/fw_ctp/ctp_gateway.py +40 -0
  117. fwquant-1.0.1/fuwen_frame/gateway/fw_okx/OKX/345/237/272/347/261/273/__init__.py +31 -0
  118. fwquant-1.0.1/fuwen_frame/gateway/fw_okx/OKX/345/237/272/347/261/273/okx_gateway.py +2295 -0
  119. fwquant-1.0.1/fuwen_frame/gateway/fw_okx/OkxGateway.py +230 -0
  120. fwquant-1.0.1/fuwen_frame/gateway/fw_okx/__init__.py +5 -0
  121. fwquant-1.0.1/fuwen_frame/gateway/fw_riskmanager/__init__.py +8 -0
  122. fwquant-1.0.1/fuwen_frame/gateway/fw_riskmanager/engine.py +34 -0
  123. fwquant-1.0.1/fuwen_frame/gateway/fw_riskmanager/ui/__init__.py +4 -0
  124. fwquant-1.0.1/fuwen_frame/gateway/fw_riskmanager/ui/widget.py +38 -0
  125. fwquant-1.0.1/fuwen_frame//345/205/254/345/205/261/345/272/223/__init__.py +0 -0
  126. fwquant-1.0.1/fuwen_frame//345/205/254/345/205/261/345/272/223//346/211/223/345/215/260/346/227/245/345/277/227_/347/246/217/347/272/271/346/241/206/346/236/266.py +218 -0
  127. fwquant-1.0.1/fuwen_frame//345/205/254/345/205/261/345/272/223//347/231/273/345/275/225/350/207/252/345/212/250/350/277/236/346/216/245.py +146 -0
  128. fwquant-1.0.1/fuwen_frame//345/205/254/345/205/261/345/272/223//350/257/255/350/250/200/__init__.py +1 -0
  129. fwquant-1.0.1/fuwen_frame//345/205/254/345/205/261/345/272/223//350/257/255/350/250/200/main.py +103 -0
  130. fwquant-1.0.1/fuwen_frame//345/205/254/345/205/261/345/272/223//351/205/215/347/275/256.py +8 -0
  131. fwquant-1.0.1/fuwen_frame//345/220/257/345/212/250/347/250/213/345/272/217/__init__.py +24 -0
  132. fwquant-1.0.1/fuwen_frame//345/220/257/345/212/250/347/250/213/345/272/217/run.py +93 -0
  133. fwquant-1.0.1/fuwen_frame//345/220/257/345/212/250/347/250/213/345/272/217//345/220/257/345/212/250_/347/246/217/347/272/271/347/263/273/347/273/237.py +96 -0
  134. fwquant-1.0.1/fuwen_frame//345/256/236/351/252/214/345/237/272/345/234/260/__init__.py +0 -0
  135. fwquant-1.0.1/fuwen_frame//345/256/236/351/252/214/345/237/272/345/234/260/other/__init__.py +0 -0
  136. fwquant-1.0.1/fuwen_frame//345/256/236/351/252/214/345/237/272/345/234/260/other//344/273/205/345/271/263/344/273/223.py +2136 -0
  137. fwquant-1.0.1/fuwen_frame//345/256/236/351/252/214/345/237/272/345/234/260//345/205/266/345/256/203/347/213/254/347/253/213/347/263/273/347/273/237/HSI2601_1.23.1#.py +2250 -0
  138. fwquant-1.0.1/fuwen_frame//345/256/236/351/252/214/345/237/272/345/234/260//345/205/266/345/256/203/347/213/254/347/253/213/347/263/273/347/273/237/__init__.py +0 -0
  139. fwquant-1.0.1/fuwen_frame//345/256/236/351/252/214/345/237/272/345/234/260//345/205/266/345/256/203/347/213/254/347/253/213/347/263/273/347/273/237//347/255/226/347/225/245/344/270/203/345/260/217/347/246/217/BS123A-bak.py +1233 -0
  140. fwquant-1.0.1/fuwen_frame//345/256/236/351/252/214/345/237/272/345/234/260//345/205/266/345/256/203/347/213/254/347/253/213/347/263/273/347/273/237//347/255/226/347/225/245/344/270/203/345/260/217/347/246/217/__init__.py +0 -0
  141. fwquant-1.0.1/fuwen_frame//345/256/236/351/252/214/345/237/272/345/234/260//345/205/266/345/256/203/347/213/254/347/253/213/347/263/273/347/273/237//347/255/226/347/225/245/344/270/203/345/260/217/347/246/217//345/215/225/344/270/200/346/226/207/344/273/266.py +1254 -0
  142. fwquant-1.0.1/fuwen_frame//345/267/245/345/205/267/__init__.py +0 -0
  143. fwquant-1.0.1/fuwen_frame//345/267/245/345/205/267//345/257/214/351/200/224/347/211/233/347/211/233/350/216/267/345/276/227k/347/272/277_futunn_/346/234/200/347/256/200.py +25 -0
  144. fwquant-1.0.1/fuwen_frame//345/267/245/345/205/267//345/267/262OK/346/255/243/344/275/277/347/224/250/344/270/255/347/232/204/347/211/210/346/234/254/__init__.py +0 -0
  145. fwquant-1.0.1/fuwen_frame//345/267/245/345/205/267//345/267/262OK/346/255/243/344/275/277/347/224/250/344/270/255/347/232/204/347/211/210/346/234/254//345/257/214/351/200/224/347/211/233/347/211/233/350/216/267/345/276/227k/347/272/277_futunn.py +334 -0
  146. fwquant-1.0.1/fuwen_frame//345/267/245/345/205/267//345/267/262OK/346/255/243/344/275/277/347/224/250/344/270/255/347/232/204/347/211/210/346/234/254//345/257/214/351/200/224/347/211/233/347/211/233/350/216/267/345/276/227k/347/272/277/345/210/260vnpy/344/270/255/345/216/273_futunn.py +528 -0
  147. fwquant-1.0.1/fuwen_frame//345/267/245/345/205/267//350/216/267/345/217/226k/347/272/277_tushare.py +288 -0
  148. fwquant-1.0.1/fuwen_frame//346/210/221/347/232/204/347/255/226/347/225/245/__init__.py +0 -0
  149. fwquant-1.0.1/fuwen_frame//346/210/221/347/232/204/347/255/226/347/225/245//344/277/241/345/217/267/346/235/245/346/272/220_/351/200/202/351/205/215/345/231/250/__init__.py +0 -0
  150. fwquant-1.0.1/fuwen_frame//346/210/221/347/232/204/347/255/226/347/225/245//344/277/241/345/217/267/346/235/245/346/272/220_/351/200/202/351/205/215/345/231/250/main.py +55 -0
  151. fwquant-1.0.1/fuwen_frame//346/210/221/347/232/204/347/255/226/347/225/245//345/205/254/345/205/261/345/207/275/346/225/260/__init__.py +0 -0
  152. fwquant-1.0.1/fuwen_frame//346/210/221/347/232/204/347/255/226/347/225/245//345/205/254/345/205/261/345/207/275/346/225/260//345/205/254/345/205/261/345/270/270/351/207/217.py +5 -0
  153. fwquant-1.0.1/fuwen_frame//346/210/221/347/232/204/347/255/226/347/225/245//345/205/254/345/205/261/345/207/275/346/225/260//345/233/236/346/265/213/344/272/244/346/230/223/350/256/260/345/275/225/345/231/250.py +784 -0
  154. fwquant-1.0.1/fuwen_frame//346/210/221/347/232/204/347/255/226/347/225/245//345/237/272/347/261/273/__init__.py +0 -0
  155. fwquant-1.0.1/fuwen_frame//346/210/221/347/232/204/347/255/226/347/225/245//345/237/272/347/261/273//347/255/226/347/225/245.py +333 -0
  156. fwquant-1.0.1/fuwen_frame//346/210/221/347/232/204/347/255/226/347/225/245//347/244/272/344/276/213_/344/270/203/347/246/217.py +817 -0
  157. fwquant-1.0.1/fuwen_frame//346/210/221/347/232/204/347/255/226/347/225/245//347/244/272/344/276/213_/344/270/203/347/246/217_20260407.py +430 -0
  158. fwquant-1.0.1/fuwen_frame//346/210/221/347/232/204/347/255/226/347/225/245//347/244/272/344/276/213_/344/270/203/347/246/217_/347/273/247/346/211/277/__init__.py +1 -0
  159. fwquant-1.0.1/fuwen_frame//346/210/221/347/232/204/347/255/226/347/225/245//347/244/272/344/276/213_/344/270/203/347/246/217_/347/273/247/346/211/277/main.py +194 -0
  160. fwquant-1.0.1/fuwen_frame//346/210/221/347/232/204/347/255/226/347/225/245//347/244/272/344/276/213_/344/270/203/347/246/217_/347/273/247/346/211/277//347/244/272/344/276/213_/344/270/203/347/246/217_/346/211/271/351/207/217/344/277/235/345/255/230.py +897 -0
  161. fwquant-1.0.1/fuwen_frame//346/210/221/347/232/204/347/255/226/347/225/245//347/244/272/344/276/213_/345/217/214/345/235/207/347/272/277.py +147 -0
  162. fwquant-1.0.1/fuwen_frame//346/210/221/347/232/204/347/255/226/347/225/245//347/244/272/344/276/213_/345/217/214/345/235/207/347/272/277_/346/226/260.py +102 -0
  163. fwquant-1.0.1/fuwen_frame//346/210/221/347/232/204/347/255/226/347/225/245//347/244/272/344/276/213_/345/217/214/345/235/207/347/272/277_/347/273/247/346/211/277/__init__.py +0 -0
  164. fwquant-1.0.1/fuwen_frame//346/210/221/347/232/204/347/255/226/347/225/245//347/244/272/344/276/213_/345/217/214/345/235/207/347/272/277_/347/273/247/346/211/277/main.py +41 -0
  165. fwquant-1.0.1/fuwen_frame//346/210/221/347/232/204/347/255/226/347/225/245//347/244/272/344/276/213_/345/270/270/347/224/250.py +217 -0
  166. fwquant-1.0.1/fuwen_frame//346/210/221/347/232/204/347/255/226/347/225/245//347/244/272/344/276/213_/346/214/207/345/256/232/346/227/266/351/227/264/344/272/244/346/230/223.py +351 -0
  167. fwquant-1.0.1/fuwen_frame//346/210/221/347/232/204/347/255/226/347/225/245//347/244/272/344/276/213_/346/214/207/345/256/232/346/227/266/351/227/264/344/272/244/346/230/223_bak.py +72 -0
  168. fwquant-1.0.1/fuwen_frame//346/210/221/347/232/204/347/255/226/347/225/245//347/244/272/344/276/213_/346/234/200/347/256/200.py +28 -0
  169. fwquant-1.0.1/fuwen_frame//346/210/221/347/232/204/347/255/226/347/225/245//347/244/272/344/276/213_/351/232/217/346/234/272.py +28 -0
  170. fwquant-1.0.1/fuwen_frame//346/210/221/347/232/204/347/255/226/347/225/245//347/244/272/344/276/213_/351/232/217/346/234/272_/347/273/247/346/211/277/__init__.py +0 -0
  171. fwquant-1.0.1/fuwen_frame//346/210/221/347/232/204/347/255/226/347/225/245//347/244/272/344/276/213_/351/232/217/346/234/272_/347/273/247/346/211/277/main.py +39 -0
  172. fwquant-1.0.1/fuwen_frame//346/210/221/347/232/204/347/255/226/347/225/245//347/273/274/345/220/210.py +35 -0
  173. fwquant-1.0.1/fuwen_okx/__init__.py +29 -0
  174. fwquant-1.0.1/fuwen_okx/okx_gateway.py +2292 -0
  175. fwquant-1.0.1/fuwen_okx/py.typed +0 -0
  176. fwquant-1.0.1/fuwen_rest/__init__.py +33 -0
  177. fwquant-1.0.1/fuwen_rest/rest_client.py +355 -0
  178. fwquant-1.0.1/fuwen_riskmanager/__init__.py +47 -0
  179. fwquant-1.0.1/fuwen_riskmanager/base.py +7 -0
  180. fwquant-1.0.1/fuwen_riskmanager/engine.py +252 -0
  181. fwquant-1.0.1/fuwen_riskmanager/rules/__init__.py +0 -0
  182. fwquant-1.0.1/fuwen_riskmanager/rules/active_order_rule.py +49 -0
  183. fwquant-1.0.1/fuwen_riskmanager/rules/daily_limit_rule.py +121 -0
  184. fwquant-1.0.1/fuwen_riskmanager/rules/duplicate_order_rule.py +46 -0
  185. fwquant-1.0.1/fuwen_riskmanager/rules/order_size_rule.py +35 -0
  186. fwquant-1.0.1/fuwen_riskmanager/rules/order_validity_rule.py +42 -0
  187. fwquant-1.0.1/fuwen_riskmanager/template.py +103 -0
  188. fwquant-1.0.1/fuwen_riskmanager/ui/__init__.py +4 -0
  189. fwquant-1.0.1/fuwen_riskmanager/ui/widget.py +287 -0
  190. fwquant-1.0.1/fuwen_signal/1.py +2 -0
  191. fwquant-1.0.1/fuwen_signal/__init__.py +1 -0
  192. fwquant-1.0.1/fuwen_signal/fw_signal/__init__.py +0 -0
  193. fwquant-1.0.1/fuwen_signal/fw_signal//344/277/241/345/217/267/345/267/245/345/216/202/__init__.py +0 -0
  194. fwquant-1.0.1/fuwen_signal/fw_signal//344/277/241/345/217/267/345/267/245/345/216/202//344/270/203/347/246/217/1.py +4 -0
  195. fwquant-1.0.1/fuwen_signal/fw_signal//344/277/241/345/217/267/345/267/245/345/216/202//344/270/203/347/246/217/__init__.py +1 -0
  196. fwquant-1.0.1/fuwen_signal/fw_signal//344/277/241/345/217/267/345/267/245/345/216/202//344/270/203/347/246/217//344/270/203/347/246/217/345/205/245/345/217/243.py +238 -0
  197. fwquant-1.0.1/fuwen_signal/fw_signal//344/277/241/345/217/267/345/267/245/345/216/202//344/270/203/347/246/217//345/205/254/345/205/261/__init__.py +0 -0
  198. fwquant-1.0.1/fuwen_signal/fw_signal//344/277/241/345/217/267/345/267/245/345/216/202//344/270/203/347/246/217//345/205/254/345/205/261//345/205/254/345/205/261/345/270/270/351/207/217.py +1 -0
  199. fwquant-1.0.1/fuwen_signal/fw_signal//344/277/241/345/217/267/345/267/245/345/216/202//344/270/203/347/246/217//345/205/254/345/205/261//345/205/254/347/224/250/345/207/275/346/225/260.py +276 -0
  200. fwquant-1.0.1/fuwen_signal/fw_signal//344/277/241/345/217/267/345/267/245/345/216/202//344/270/203/347/246/217//345/205/254/345/205/261//350/256/241/347/256/227/351/253/230/344/275/216/347/202/271.py +293 -0
  201. fwquant-1.0.1/fuwen_signal/fw_signal//344/277/241/345/217/267/345/267/245/345/216/202//344/270/203/347/246/217//345/271/263/344/273/223/350/247/204/345/210/231/__init__.py +0 -0
  202. fwquant-1.0.1/fuwen_signal/fw_signal//344/277/241/345/217/267/345/267/245/345/216/202//344/270/203/347/246/217//345/271/263/344/273/223/350/247/204/345/210/231//345/271/263/344/273/223/344/277/241/345/217/267/346/243/200/346/265/213.py +67 -0
  203. fwquant-1.0.1/fuwen_signal/fw_signal//344/277/241/345/217/267/345/267/245/345/216/202//344/270/203/347/246/217//345/271/263/344/273/223/350/247/204/345/210/231//345/271/263/344/273/223/350/247/204/345/210/2311.py +97 -0
  204. fwquant-1.0.1/fuwen_signal/fw_signal//344/277/241/345/217/267/345/267/245/345/216/202//344/270/203/347/246/217//345/271/263/344/273/223/350/247/204/345/210/231//345/271/263/344/273/223/350/247/204/345/210/2312.py +166 -0
  205. fwquant-1.0.1/fuwen_signal/fw_signal//344/277/241/345/217/267/345/267/245/345/216/202//344/270/203/347/246/217//345/271/263/344/273/223/350/247/204/345/210/231//345/271/263/344/273/223/350/247/204/345/210/2313.py +188 -0
  206. fwquant-1.0.1/fuwen_signal/fw_signal//344/277/241/345/217/267/345/267/245/345/216/202//344/270/203/347/246/217//345/271/263/344/273/223/350/247/204/345/210/231//345/271/263/344/273/223/350/247/204/345/210/2314.py +252 -0
  207. fwquant-1.0.1/fuwen_signal/fw_signal//344/277/241/345/217/267/345/267/245/345/216/202//344/270/203/347/246/217//345/271/263/344/273/223/350/247/204/345/210/231//345/271/263/344/273/223/350/247/204/345/210/2315.py +977 -0
  208. fwquant-1.0.1/fuwen_signal/fw_signal//344/277/241/345/217/267/345/267/245/345/216/202//344/270/203/347/246/217//345/274/200/344/273/223/350/247/204/345/210/231/__init__.py +6 -0
  209. fwquant-1.0.1/fuwen_signal/fw_signal//344/277/241/345/217/267/345/267/245/345/216/202//344/270/203/347/246/217//345/274/200/344/273/223/350/247/204/345/210/231//345/274/200/344/273/223/344/277/241/345/217/267/345/210/244/346/226/255.py +289 -0
  210. fwquant-1.0.1/fuwen_signal/fw_signal//344/277/241/345/217/267/345/267/245/345/216/202//344/270/203/347/246/217//351/205/215/347/275/256/__init__.py +0 -0
  211. fwquant-1.0.1/fuwen_signal/fw_signal//344/277/241/345/217/267/345/267/245/345/216/202//344/270/203/347/246/217//351/205/215/347/275/256//351/273/230/350/256/244.py +73 -0
  212. fwquant-1.0.1/fuwen_signal/fw_signal//344/277/241/345/217/267/345/267/245/345/216/202//345/217/214/345/235/207/347/272/277/__init__.py +0 -0
  213. fwquant-1.0.1/fuwen_signal/fw_signal//344/277/241/345/217/267/345/267/245/345/216/202//345/217/214/345/235/207/347/272/277/main.py +47 -0
  214. fwquant-1.0.1/fuwen_signal/fw_signal//344/277/241/345/217/267/345/267/245/345/216/202//345/217/214/345/235/207/347/272/277//345/217/214/345/235/207/347/272/277_/346/226/260.py +56 -0
  215. fwquant-1.0.1/fuwen_signal/fw_signal//344/277/241/345/217/267/345/267/245/345/216/202//346/250/241/346/235/277/__init__.py +0 -0
  216. fwquant-1.0.1/fuwen_signal/fw_signal//344/277/241/345/217/267/345/267/245/345/216/202//346/250/241/346/235/277/main.py +15 -0
  217. fwquant-1.0.1/fuwen_signal/fw_signal//344/277/241/345/217/267/345/267/245/345/216/202//351/232/217/346/234/272/1.py +56 -0
  218. fwquant-1.0.1/fuwen_signal/fw_signal//344/277/241/345/217/267/345/267/245/345/216/202//351/232/217/346/234/272/__init__.py +0 -0
  219. fwquant-1.0.1/fuwen_signal/fw_signal//344/277/241/345/217/267/345/267/245/345/216/202//351/232/217/346/234/272/main.py +21 -0
  220. fwquant-1.0.1/fuwen_signal/fw_signal//345/205/254/345/205/261/345/272/223/__init__.py +4 -0
  221. fwquant-1.0.1/fuwen_signal/fw_signal//345/205/254/345/205/261/345/272/223//346/211/223/345/215/260/346/227/245/345/277/227.py +73 -0
  222. fwquant-1.0.1/fuwen_signal/fw_signal//345/205/254/345/205/261/345/272/223//347/246/217/347/272/271/344/277/241/345/217/267/351/200/202/351/205/215/345/231/250.py +127 -0
  223. fwquant-1.0.1/fuwen_signal//347/244/272/344/276/213_/344/270/203/347/246/217.py +13 -0
  224. fwquant-1.0.1/fuwen_sqlite/__init__.py +30 -0
  225. fwquant-1.0.1/fuwen_sqlite/sqlite_database.py +484 -0
  226. fwquant-1.0.1/fuwen_websocket/__init__.py +29 -0
  227. fwquant-1.0.1/fuwen_websocket/websocket_client.py +188 -0
  228. fwquant-1.0.1/fw_strategies/__init__.py +0 -0
  229. fwquant-1.0.1/fw_strategies//345/257/274/345/205/245/347/255/226/347/225/245.py +10 -0
  230. fwquant-1.0.1/fwquant.egg-info/PKG-INFO +44 -0
  231. fwquant-1.0.1/fwquant.egg-info/SOURCES.txt +235 -0
  232. fwquant-1.0.1/fwquant.egg-info/dependency_links.txt +1 -0
  233. fwquant-1.0.1/fwquant.egg-info/not-zip-safe +1 -0
  234. fwquant-1.0.1/fwquant.egg-info/requires.txt +1 -0
  235. fwquant-1.0.1/fwquant.egg-info/top_level.txt +14 -0
  236. fwquant-1.0.1/setup.cfg +4 -0
  237. fwquant-1.0.1/setup.py +50 -0
fwquant-1.0.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 duduzixun
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
fwquant-1.0.1/PKG-INFO ADDED
@@ -0,0 +1,44 @@
1
+ Metadata-Version: 2.4
2
+ Name: fwquant
3
+ Version: 1.0.1
4
+ Summary: 一个功能完整的 福纹量化 交易系统 ,支持多交易所连接、策略回测与实盘交易,包含数据管理、风控和GUI界面
5
+ Home-page:
6
+ Author: fwquant
7
+ Author-email: fuwenquant@gmail.com
8
+ License: MIT
9
+ Keywords: bin,test,demo,add_one
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: OS Independent
18
+ Requires-Python: >=3.8
19
+ Description-Content-Type: text/markdown
20
+ License-File: LICENSE
21
+ Requires-Dist: six>=1.10.0
22
+ Dynamic: author
23
+ Dynamic: author-email
24
+ Dynamic: classifier
25
+ Dynamic: description
26
+ Dynamic: description-content-type
27
+ Dynamic: keywords
28
+ Dynamic: license
29
+ Dynamic: license-file
30
+ Dynamic: requires-dist
31
+ Dynamic: requires-python
32
+ Dynamic: summary
33
+
34
+ # FWQuant
35
+ 一个从0到1的完全自建的量化平台.
36
+ 主要技术 与工具:
37
+ fwquant: 量化平台的主框架,包含下面所 有技术 与工具
38
+ fwdata: 量化数据框架, 用于处理量化数据, 并提供数据接口.
39
+ fwweb: 量化Web框架, 用于提供量化平台的Web界面.
40
+ fwengine: 量化引擎, 负责执行量化策略.
41
+ vnpy: 量化交易框架, 用于连接交易接口, 处理交易数据, 并执行交易指令.
42
+
43
+
44
+ 特别感谢:VNPY 项目, 为我提供了量化交易框架, 帮助我们能快速搭建了量化平台.
@@ -0,0 +1,14 @@
1
+ # FWQuant
2
+ 一个从0到1的完全自建的量化平台.
3
+ 主要技术 与工具:
4
+ fwquant: 量化平台的主框架,包含下面所 有技术 与工具
5
+ fwdata: 量化数据框架, 用于处理量化数据, 并提供数据接口.
6
+ fwweb: 量化Web框架, 用于提供量化平台的Web界面.
7
+ fwengine: 量化引擎, 负责执行量化策略.
8
+ vnpy: 量化交易框架, 用于连接交易接口, 处理交易数据, 并执行交易指令.
9
+
10
+
11
+ 特别感谢:VNPY 项目, 为我提供了量化交易框架, 帮助我们能快速搭建了量化平台.
12
+
13
+
14
+
File without changes
@@ -0,0 +1,12 @@
1
+ # 项目根目录(跨平台兼容)
2
+ import os
3
+
4
+ 项目根目录 = os.path.abspath(os.path.join(os.path.dirname(__file__), '../'))
5
+
6
+ # 缓存目录路径
7
+ 缓存目录 = os.path.join(项目根目录, "缓存目录")
8
+ os.makedirs(缓存目录, exist_ok=True)
9
+
10
+ # 日志目录路径
11
+ 日志目录 = os.path.join(项目根目录, "日志目录")
12
+ os.makedirs(日志目录, exist_ok=True)
@@ -0,0 +1,24 @@
1
+ # The MIT License (MIT)
2
+
3
+ # Copyright (c) 2015-present, Xiaoyou Chen
4
+
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+
24
+ __version__ = "4.3.0"
@@ -0,0 +1,17 @@
1
+ from .logger import logger
2
+ from .dataset import AlphaDataset, Segment, to_datetime
3
+ from .model import AlphaModel
4
+ from .strategy import AlphaStrategy, BacktestingEngine
5
+ from .lab import AlphaLab
6
+
7
+
8
+ __all__ = [
9
+ "logger",
10
+ "AlphaDataset",
11
+ "Segment",
12
+ "to_datetime",
13
+ "AlphaModel",
14
+ "AlphaStrategy",
15
+ "BacktestingEngine",
16
+ "AlphaLab"
17
+ ]
@@ -0,0 +1,21 @@
1
+ from .template import AlphaDataset
2
+ from .utility import Segment, to_datetime
3
+ from .processor import (
4
+ process_drop_na,
5
+ process_fill_na,
6
+ process_cs_norm,
7
+ process_robust_zscore_norm,
8
+ process_cs_rank_norm
9
+ )
10
+
11
+
12
+ __all__ = [
13
+ "AlphaDataset",
14
+ "Segment",
15
+ "to_datetime",
16
+ "process_drop_na",
17
+ "process_fill_na",
18
+ "process_cs_norm",
19
+ "process_robust_zscore_norm",
20
+ "process_cs_rank_norm"
21
+ ]
@@ -0,0 +1,64 @@
1
+ """
2
+ Cross Section Operators
3
+ """
4
+
5
+ import polars as pl
6
+
7
+ from .utility import DataProxy
8
+
9
+
10
+ def cs_rank(feature: DataProxy) -> DataProxy:
11
+ """Perform cross-sectional ranking"""
12
+ df: pl.DataFrame = feature.df.select(
13
+ pl.col("datetime"),
14
+ pl.col("vt_symbol"),
15
+ pl.col("data").rank().over("datetime")
16
+ )
17
+ return DataProxy(df)
18
+
19
+
20
+ def cs_mean(feature: DataProxy) -> DataProxy:
21
+ """Calculate cross-sectional mean"""
22
+ df: pl.DataFrame = feature.df.select(
23
+ pl.col("datetime"),
24
+ pl.col("vt_symbol"),
25
+ pl.col("data").mean().over("datetime")
26
+ )
27
+ return DataProxy(df)
28
+
29
+
30
+ def cs_std(feature: DataProxy) -> DataProxy:
31
+ """Calculate cross-sectional standard deviation"""
32
+ df: pl.DataFrame = feature.df.select(
33
+ pl.col("datetime"),
34
+ pl.col("vt_symbol"),
35
+ pl.col("data").std().over("datetime")
36
+ )
37
+ return DataProxy(df)
38
+
39
+
40
+ def cs_sum(feature: DataProxy) -> DataProxy:
41
+ """Calculate cross-sectional sum"""
42
+ df: pl.DataFrame = feature.df.select(
43
+ pl.col("datetime"),
44
+ pl.col("vt_symbol"),
45
+ pl.col("data").sum().over("datetime")
46
+ )
47
+ return DataProxy(df)
48
+
49
+
50
+ def cs_scale(feature: DataProxy) -> DataProxy:
51
+ """Scale the feature by the sum of absolute values in the cross section"""
52
+ abs_feature = abs(feature)
53
+ sum_abs = cs_sum(abs_feature)
54
+
55
+ df_merged: pl.DataFrame = feature.df.join(sum_abs.df, on=["datetime", "vt_symbol"], suffix="_sum")
56
+
57
+ df: pl.DataFrame = df_merged.with_columns(
58
+ pl.when(pl.col("data_sum") != 0)
59
+ .then(pl.col("data") / pl.col("data_sum"))
60
+ .otherwise(0)
61
+ .alias("data")
62
+ ).select(["datetime", "vt_symbol", "data"])
63
+
64
+ return DataProxy(df)
@@ -0,0 +1,330 @@
1
+ import polars as pl
2
+
3
+ from fuwen_adaptor.alpha import AlphaDataset
4
+
5
+
6
+ class Alpha101(AlphaDataset):
7
+ """101 basic factors from WorldQuant"""
8
+
9
+ def __init__(
10
+ self,
11
+ df: pl.DataFrame,
12
+ train_period: tuple[str, str],
13
+ valid_period: tuple[str, str],
14
+ test_period: tuple[str, str]
15
+ ) -> None:
16
+ """Constructor"""
17
+ super().__init__(
18
+ df=df,
19
+ train_period=train_period,
20
+ valid_period=valid_period,
21
+ test_period=test_period,
22
+ )
23
+
24
+ returns_expr: str = "(close / ts_delay(close, 1) - 1)"
25
+
26
+ # Alpha1
27
+ self.add_feature("alpha1", f"(cs_rank(ts_argmax(pow1(quesval(0, {returns_expr}, close, ts_std({returns_expr}, 20)), 2.0), 5)) - 0.5)")
28
+
29
+ # Alpha2
30
+ self.add_feature("alpha2", "(-1) * ts_corr(cs_rank(ts_delta(log(volume), 2)), cs_rank((close - open) / open), 6)")
31
+
32
+ # Alpha3
33
+ self.add_feature("alpha3", "ts_corr(cs_rank(open), cs_rank(volume), 10) * -1")
34
+
35
+ # Alpha4
36
+ self.add_feature("alpha4", "-1 * ts_rank(cs_rank(low), 9)")
37
+
38
+ # Alpha5
39
+ self.add_feature("alpha5", "cs_rank((open - (ts_sum(vwap, 10) / 10))) * (-1 * abs(cs_rank((close - vwap))))")
40
+
41
+ # Alpha6
42
+ self.add_feature("alpha6", "(-1) * ts_corr(open, volume, 10)")
43
+
44
+ # Alpha7
45
+ self.add_feature("alpha7", "quesval2(ts_mean(volume, 20), volume, (-1 * ts_rank(abs(close - ts_delay(close, 7)), 60)) * sign(ts_delta(close, 7)), -1)")
46
+
47
+ # Alpha8
48
+ self.add_feature("alpha8", f"-1 * cs_rank(((ts_sum(open, 5) * ts_sum({returns_expr}, 5)) - ts_delay((ts_sum(open, 5) * ts_sum({returns_expr}, 5)), 10)))")
49
+
50
+ # Alpha9
51
+ self.add_feature("alpha9", "quesval(0, ts_min(ts_delta(close, 1), 5), ts_delta(close, 1), quesval(0, ts_max(ts_delta(close, 1), 5), (-1 * ts_delta(close, 1)), ts_delta(close, 1)))")
52
+
53
+ # Alpha10
54
+ self.add_feature("alpha10", "cs_rank(quesval(0, ts_min(ts_delta(close, 1), 4), ts_delta(close, 1), quesval(0, ts_max(ts_delta(close, 1), 4), (-1 * ts_delta(close, 1)), ts_delta(close, 1))))")
55
+
56
+ # Alpha11
57
+ self.add_feature("alpha11", "(cs_rank(ts_max(vwap - close, 3)) + cs_rank(ts_min(vwap - close, 3))) * cs_rank(ts_delta(volume, 3))")
58
+
59
+ # Alpha12
60
+ self.add_feature("alpha12", "sign(ts_delta(volume, 1)) * (-1 * ts_delta(close, 1))")
61
+
62
+ # Alpha13
63
+ self.add_feature("alpha13", "-1 * cs_rank(ts_cov(cs_rank(close), cs_rank(volume), 5))")
64
+
65
+ # Alpha14
66
+ self.add_feature("alpha14", f"(-1 * cs_rank(({returns_expr}) - ts_delay({returns_expr}, 3))) * ts_corr(open, volume, 10)")
67
+
68
+ # Alpha15
69
+ self.add_feature("alpha15", "-1 * ts_sum(cs_rank(ts_corr(cs_rank(high), cs_rank(volume), 3)), 3)")
70
+
71
+ # Alpha16
72
+ self.add_feature("alpha16", "-1 * cs_rank(ts_cov(cs_rank(high), cs_rank(volume), 5))")
73
+
74
+ # Alpha17
75
+ self.add_feature("alpha17", "(-1 * cs_rank(ts_rank(close, 10))) * cs_rank(close - 2 * ts_delay(close, 1) + ts_delay(close, 2)) * cs_rank(ts_rank(volume / ts_mean(volume, 20), 5))")
76
+
77
+ # Alpha18
78
+ self.add_feature("alpha18", "-1 * cs_rank((ts_std(abs(close - open), 5) + (close - open)) + ts_corr(close, open, 10))")
79
+
80
+ # Alpha19
81
+ self.add_feature("alpha19", f"(-1 * sign(ts_delta(close, 7) + (close - ts_delay(close, 7)))) * (cs_rank(ts_sum({returns_expr}, 250) + 1) + 1)")
82
+
83
+ # Alpha20
84
+ self.add_feature("alpha20", "(-1 * cs_rank(open - ts_delay(high, 1))) * cs_rank(open - ts_delay(close, 1)) * cs_rank(open - ts_delay(low, 1))")
85
+
86
+ # Alpha21 (the innermost original was >=1, implemented as >1)
87
+ self.add_feature("alpha21", "quesval2((ts_mean(close, 8) + ts_std(close, 8)), ts_mean(close, 2), -1, quesval2(ts_mean(close, 2), (ts_mean(close, 8) - ts_std(close, 8)), 1, quesval(1, (volume / ts_mean(volume, 20)), 1, -1)))")
88
+
89
+ # Alpha22
90
+ self.add_feature("alpha22", "-1 * ts_delta(ts_corr(high, volume, 5), 5) * cs_rank(ts_std(close, 20))")
91
+
92
+ # Alpha23
93
+ self.add_feature("alpha23", "quesval2(ts_mean(high, 20), high, -1 * ts_delta(high, 2), 0)")
94
+
95
+ # Alpha24 (the original condition was <=0.05, implemented as <0.05)
96
+ self.add_feature("alpha24", "quesval(0.05, ts_delta(ts_sum(close, 100) / 100, 100) / ts_delay(close, 100), (-1 * ts_delta(close, 3)), (-1 * (close - ts_min(close, 100))))")
97
+
98
+ # Alpha25
99
+ self.add_feature("alpha25", f"cs_rank( (-1 * {returns_expr}) * ts_mean(volume, 20) * vwap * (high - close) )")
100
+
101
+ # Alpha26
102
+ self.add_feature("alpha26", "-1 * ts_max(ts_corr(ts_rank(volume, 5), ts_rank(high, 5), 5), 3)")
103
+
104
+ # Alpha27
105
+ self.add_feature("alpha27", "quesval(0.5, cs_rank(ts_mean(ts_corr(cs_rank(volume), cs_rank(vwap), 6), 2)), -1, 1)")
106
+
107
+ # Alpha28
108
+ self.add_feature("alpha28", "cs_scale(ts_corr(ts_mean(volume, 20), low, 5) + (high + low) / 2 - close)")
109
+
110
+ # Alpha29
111
+ self.add_feature("alpha29", f"ts_min(ts_product(cs_rank(cs_rank(cs_scale(log(ts_sum(ts_min(cs_rank(cs_rank((-1 * cs_rank(ts_delta((close - 1), 5))))), 2), 1))))), 1), 5) + ts_rank(ts_delay((-1 * {returns_expr}), 6), 5)")
112
+
113
+ # Alpha30
114
+ self.add_feature("alpha30", "((cs_rank(sign(close - ts_delay(close, 1)) + sign(ts_delay(close, 1) - ts_delay(close, 2)) + sign(ts_delay(close, 2) - ts_delay(close, 3))) * -1 + 1) * ts_sum(volume, 5)) / ts_sum(volume, 20)")
115
+
116
+ # Alpha31
117
+ self.add_feature("alpha31", "(cs_rank(cs_rank(cs_rank(ts_decay_linear((-1) * cs_rank(cs_rank(ts_delta(close, 10))), 10)))) + cs_rank((-1) * ts_delta(close, 3))) + sign(cs_scale(ts_corr(ts_mean(volume, 20), low, 12)))")
118
+
119
+ # Alpha32
120
+ self.add_feature("alpha32", "cs_scale((ts_sum(close, 7) / 7 - close)) + (20 * cs_scale(ts_corr(vwap, ts_delay(close, 5), 230)))")
121
+
122
+ # Alpha33
123
+ self.add_feature("alpha33", "cs_rank((-1) * (open / close * -1 + 1))")
124
+
125
+ # Alpha34
126
+ self.add_feature("alpha34", f"cs_rank((cs_rank(ts_std({returns_expr}, 2) / ts_std({returns_expr}, 5)) * -1 + 1) + (cs_rank(ts_delta(close, 1)) * -1 + 1))")
127
+
128
+ # Alpha35
129
+ self.add_feature("alpha35", f"(ts_rank(volume, 32) * (ts_rank((close + high - low), 16) * -1 + 1)) * (ts_rank({returns_expr}, 32) * -1 + 1)")
130
+
131
+ # Alpha36
132
+ self.add_feature("alpha36", f"((((2.21 * cs_rank(ts_corr((close - open), ts_delay(volume, 1), 15))) + (0.7 * cs_rank((open - close)))) + (0.73 * cs_rank(ts_rank(ts_delay((-1) * {returns_expr}, 6), 5)))) + cs_rank(abs(ts_corr(vwap, ts_mean(volume, 20), 6)))) + (0.6 * cs_rank(((ts_sum(close, 200) / 200 - open) * (close - open))))")
133
+
134
+ # Alpha37
135
+ self.add_feature("alpha37", "cs_rank(ts_corr(ts_delay((open - close), 1), close, 200)) + cs_rank((open - close))")
136
+
137
+ # Alpha38
138
+ self.add_feature("alpha38", "((-1) * cs_rank(ts_rank(close, 10))) * cs_rank((close / open))")
139
+
140
+ # Alpha39
141
+ self.add_feature("alpha39", f"((-1) * cs_rank((ts_delta(close, 7) * (cs_rank(ts_decay_linear((volume / ts_mean(volume, 20)), 9)) * -1 + 1)))) * (cs_rank(ts_sum({returns_expr}, 250)) + 1)")
142
+
143
+ # Alpha40
144
+ self.add_feature("alpha40", "((-1) * cs_rank(ts_std(high, 10))) * ts_corr(high, volume, 10)")
145
+
146
+ # Alpha41
147
+ self.add_feature("alpha41", "pow1((high * low), 0.5) - vwap")
148
+
149
+ # Alpha42
150
+ self.add_feature("alpha42", "cs_rank((vwap - close)) / cs_rank((vwap + close))")
151
+
152
+ # Alpha43
153
+ self.add_feature("alpha43", "ts_rank((volume / ts_mean(volume, 20)), 20) * ts_rank((-1) * ts_delta(close, 7), 8)")
154
+
155
+ # Alpha44
156
+ self.add_feature("alpha44", "(-1) * ts_corr(high, cs_rank(volume), 5)")
157
+
158
+ # Alpha45
159
+ self.add_feature("alpha45", "(-1) * cs_rank(ts_sum(ts_delay(close, 5), 20) / 20) * ts_corr(close, volume, 2) * cs_rank(ts_corr(ts_sum(close, 5), ts_sum(close, 20), 2))")
160
+
161
+ # Alpha46
162
+ self.add_feature("alpha46", "quesval(0.25, ((ts_delay(close, 20) - ts_delay(close, 10)) / 10 - (ts_delay(close, 10) - close) / 10), -1, quesval(0, ((ts_delay(close, 20) - ts_delay(close, 10)) / 10 - (ts_delay(close, 10) - close) / 10), (-1) * (close - ts_delay(close, 1)), 1))")
163
+
164
+ # Alpha47
165
+ self.add_feature("alpha47", "((cs_rank(pow1(close, -1)) * volume / ts_mean(volume, 20)) * (high * cs_rank(high - close)) / (ts_sum(high, 5) / 5)) - cs_rank(vwap - ts_delay(vwap, 5))")
166
+
167
+ # Alpha48 (contains `IndNeutralize`, currently not implemented)
168
+ # self.add_feature("alpha48", "(ts_corr(ts_delta(close, 1), ts_delta(ts_delay(close, 1), 1), 250) * ts_delta(close, 1)) / close / ts_sum(pow1((ts_delta(close, 1) / ts_delay(close, 1)), 2), 250)")
169
+
170
+ # Alpha49
171
+ self.add_feature("alpha49", "quesval(-0.1, ((ts_delay(close, 20) - ts_delay(close, 10)) / 10 - (ts_delay(close, 10) - close) / 10), (-1) * (close - ts_delay(close, 1)), 1)")
172
+
173
+ # Alpha50
174
+ self.add_feature("alpha50", "(-1) * ts_max(cs_rank(ts_corr(cs_rank(volume), cs_rank(vwap), 5)), 5)")
175
+
176
+ # Alpha51
177
+ self.add_feature("alpha51", "quesval(-0.05, ((ts_delay(close, 20) - ts_delay(close, 10)) / 10 - (ts_delay(close, 10) - close) / 10), (-1) * (close - ts_delay(close, 1)), 1)")
178
+
179
+ # Alpha52
180
+ self.add_feature("alpha52", f"(((-1) * ts_min(low, 5)) + ts_delay(ts_min(low, 5), 5)) * cs_rank((ts_sum({returns_expr}, 240) - ts_sum({returns_expr}, 20)) / 220) * ts_rank(volume, 5)")
181
+
182
+ # Alpha53
183
+ self.add_feature("alpha53", "(-1) * ts_delta(((close - low) - (high - close)) / (close - low), 9)")
184
+
185
+ # Alpha54
186
+ self.add_feature("alpha54", "((-1) * ((low - close) * pow1(open, 5))) / ((low - high) * pow1(close, 5))")
187
+
188
+ # Alpha55
189
+ self.add_feature("alpha55", "(-1) * ts_corr(cs_rank((close - ts_min(low, 12)) / (ts_max(high, 12) - ts_min(low, 12))), cs_rank(volume), 6)")
190
+
191
+ # Alpha56 (missing `cap` field, cannot be implemented)
192
+ # original formula: (0 - (1 * (rank((sum(returns, 10) / sum(sum(returns, 2), 3))) * rank((returns * cap)))))
193
+
194
+ # Alpha57
195
+ self.add_feature("alpha57", "-1 * ((close - vwap) / ts_decay_linear(cs_rank(ts_argmax(close, 30)), 2))")
196
+
197
+ # Alpha58 (contains `IndNeutralize`, currently not implemented)
198
+ # self.add_feature("alpha58", "(-1) * ts_rank(ts_decay_linear(ts_corr(vwap, volume, 4), 8), 6)")
199
+
200
+ # Alpha59 (contains `IndNeutralize`, currently not implemented)
201
+ # self.add_feature("alpha59", "(-1) * ts_rank(ts_decay_linear(ts_corr(((vwap * 0.728317) + (vwap * (1 - 0.728317))), volume, 4), 16), 8)")
202
+
203
+ # Alpha60
204
+ self.add_feature("alpha60", "- 1 * ((2 * cs_scale(cs_rank((((close - low) - (high - close)) / (high - low)) * volume))) - cs_scale(cs_rank(ts_argmax(close, 10))))")
205
+
206
+ # Alpha61
207
+ self.add_feature("alpha61", "quesval2(cs_rank(vwap - ts_min(vwap, 16)), cs_rank(ts_corr(vwap, ts_mean(volume, 180), 18)), 1, 0)")
208
+
209
+ # Alpha62
210
+ self.add_feature("alpha62", "(cs_rank(ts_corr(vwap, ts_sum(ts_mean(volume, 20), 22), 10)) < cs_rank((cs_rank(open) + cs_rank(open)) < (cs_rank((high + low) / 2) + cs_rank(high)))) * -1")
211
+
212
+ # Alpha63 (contains `IndNeutralize`, currently not implemented)
213
+ # self.add_feature("alpha63", "(cs_rank(ts_decay_linear(ts_delta(close, 2), 8)) - cs_rank(ts_decay_linear(ts_corr(vwap * 0.318108 + open * 0.681892, ts_sum(ts_mean(volume, 180), 37), 14), 12))) * -1")
214
+
215
+ # Alpha64
216
+ self.add_feature("alpha64", "(cs_rank(ts_corr(ts_sum(((open * 0.178404) + (low * (1 - 0.178404))), 13), ts_sum(ts_mean(volume, 120), 13), 17)) < cs_rank(ts_delta((((high + low) / 2 * 0.178404) + (vwap * (1 - 0.178404))), 4))) * -1")
217
+
218
+ # Alpha65
219
+ self.add_feature("alpha65", "(cs_rank(ts_corr(((open * 0.00817205) + (vwap * (1 - 0.00817205))), ts_sum(ts_mean(volume, 60), 9), 6)) < cs_rank(open - ts_min(open, 14))) * -1")
220
+
221
+ # Alpha66
222
+ self.add_feature("alpha66", "(cs_rank(ts_decay_linear(ts_delta(vwap, 4), 7)) + ts_rank(ts_decay_linear((((low * 0.96633) + (low * (1 - 0.96633))) - vwap) / (open - ((high + low) / 2)), 11), 7)) * -1")
223
+
224
+ # Alpha67 (contains `IndNeutralize`, currently not implemented)
225
+ # self.add_feature("alpha67", "pow2(cs_rank(high - ts_min(high, 2)), cs_rank(ts_corr(vwap, ts_mean(volume, 20), 6))) * -1")
226
+
227
+ # Alpha68
228
+ self.add_feature("alpha68", "(ts_rank(ts_corr(cs_rank(high), cs_rank(ts_mean(volume, 15)), 9), 14) < cs_rank(ts_delta((close * 0.518371 + low * (1 - 0.518371)), 1))) * -1")
229
+
230
+ # Alpha69 (contains `IndNeutralize`, currently not implemented)
231
+ # self.add_feature("alpha69", "pow2(cs_rank(ts_max(ts_delta(vwap, 3), 5)), ts_rank(ts_corr(close * 0.490655 + vwap * 0.509345, ts_mean(volume, 20), 5), 9)) * -1")
232
+
233
+ # Alpha70 (contains `IndNeutralize`, currently not implemented)
234
+ # self.add_feature("alpha70", "pow2(cs_rank(ts_delta(vwap, 1)), ts_rank(ts_corr(close, ts_mean(volume, 50), 18), 18)) * -1")
235
+
236
+ # Alpha71
237
+ self.add_feature("alpha71", "ts_greater(ts_rank(ts_decay_linear(ts_corr(ts_rank(close, 3), ts_rank(ts_mean(volume, 180), 12), 18), 4), 16), ts_rank(ts_decay_linear(pow1(cs_rank((low + open) - (vwap + vwap)), 2), 16), 4))")
238
+
239
+ # Alpha72
240
+ self.add_feature("alpha72", "cs_rank(ts_decay_linear(ts_corr((high + low) / 2, ts_mean(volume, 40), 9), 10)) / cs_rank(ts_decay_linear(ts_corr(ts_rank(vwap, 4), ts_rank(volume, 19), 7), 3))")
241
+
242
+ # Alpha73
243
+ self.add_feature("alpha73", "ts_greater(cs_rank(ts_decay_linear(ts_delta(vwap, 5), 3)), ts_rank(ts_decay_linear((ts_delta(open * 0.147155 + low * 0.852845, 2) / (open * 0.147155 + low * 0.852845)) * -1, 3), 17)) * -1")
244
+
245
+ # Alpha74
246
+ self.add_feature("alpha74", "quesval2(cs_rank(ts_corr(close, ts_sum(ts_mean(volume, 30), 37), 15)), cs_rank(ts_corr(cs_rank(high * 0.0261661 + vwap * 0.9738339), cs_rank(volume), 11)), 1, 0) * -1")
247
+
248
+ # Alpha75
249
+ self.add_feature("alpha75", "quesval2(cs_rank(ts_corr(vwap, volume, 4)), cs_rank(ts_corr(cs_rank(low), cs_rank(ts_mean(volume, 50)), 12)), 1, 0)")
250
+
251
+ # Alpha76 (contains `IndNeutralize`, currently not implemented)
252
+ # self.add_feature("alpha76", "ts_greater(cs_rank(ts_decay_linear(ts_delta(vwap, 1), 12)), ts_rank(ts_decay_linear(ts_rank(ts_corr(low, ts_mean(volume, 81), 8), 20), 17), 19)) * -1")
253
+
254
+ # Alpha77
255
+ self.add_feature("alpha77", "ts_less(cs_rank(ts_decay_linear((((high + low) / 2 + high) - (vwap + high)), 20)), cs_rank(ts_decay_linear(ts_corr((high + low) / 2, ts_mean(volume, 40), 3), 6)))")
256
+
257
+ # Alpha78
258
+ self.add_feature("alpha78", "pow2(cs_rank(ts_corr(ts_sum((low * 0.352233) + (vwap * (1 - 0.352233)), 20), ts_sum(ts_mean(volume, 40), 20), 7)), cs_rank(ts_corr(cs_rank(vwap), cs_rank(volume), 6)))")
259
+
260
+ # Alpha79 (contains `IndNeutralize`, currently not implemented)
261
+ # self.add_feature("alpha79", "quesval2(cs_rank(ts_delta(close * 0.60733 + open * 0.39267, 1)), cs_rank(ts_corr(ts_rank(vwap, 4), ts_rank(ts_mean(volume, 150), 9), 15)), 1, 0)")
262
+
263
+ # Alpha80 (contains `IndNeutralize`, currently not implemented)
264
+ # self.add_feature("alpha80", "pow2(cs_rank(sign(ts_delta(open * 0.868128 + high * 0.131872, 4))), ts_rank(ts_corr(high, ts_mean(volume, 10), 5), 6)) * -1")
265
+
266
+ # Alpha81
267
+ self.add_feature("alpha81", "quesval2(cs_rank(log(ts_product(cs_rank(pow1(cs_rank(ts_corr(vwap, ts_sum(ts_mean(volume, 10), 50), 8)), 4)), 15))), cs_rank(ts_corr(cs_rank(vwap), cs_rank(volume), 5)), 1, 0) * -1")
268
+
269
+ # Alpha82 (contains `IndNeutralize`, currently not implemented)
270
+ # self.add_feature("alpha82", "ts_less(cs_rank(ts_decay_linear(ts_delta(open, 1), 15)), ts_rank(ts_decay_linear(ts_corr(volume, open, 17), 7), 13)) * -1")
271
+
272
+ # Alpha83
273
+ self.add_feature("alpha83", "(cs_rank(ts_delay((high - low) / (ts_sum(close, 5) / 5), 2)) * cs_rank(cs_rank(volume))) / (((high - low) / (ts_sum(close, 5) / 5)) / (vwap - close))")
274
+
275
+ # Alpha84
276
+ self.add_feature("alpha84", "pow2(ts_rank(vwap - ts_max(vwap, 15), 21), ts_delta(close, 5))")
277
+
278
+ # Alpha85
279
+ self.add_feature("alpha85", "pow2(cs_rank(ts_corr(high * 0.876703 + close * 0.123297, ts_mean(volume, 30), 10)), cs_rank(ts_corr(ts_rank((high + low) / 2, 4), ts_rank(volume, 10), 7)))")
280
+
281
+ # Alpha86
282
+ self.add_feature("alpha86", "quesval2(ts_rank(ts_corr(close, ts_sum(ts_mean(volume, 20), 15), 6), 20), cs_rank((open + close) - (vwap + open)), 1, 0) * -1")
283
+
284
+ # Alpha87 (contains `IndNeutralize`, currently not implemented)
285
+ # self.add_feature("alpha87", "ts_greater(cs_rank(ts_decay_linear(ts_delta(close * 0.369701 + vwap * 0.630299, 2), 3)), ts_rank(ts_decay_linear(abs(ts_corr(ts_mean(volume, 81), close, 13)), 5), 14)) * -1")
286
+
287
+ # Alpha88
288
+ self.add_feature("alpha88", "ts_less(cs_rank(ts_decay_linear((cs_rank(open) + cs_rank(low)) - (cs_rank(high) + cs_rank(close)), 8)), ts_rank(ts_decay_linear(ts_corr(ts_rank(close, 8), ts_rank(ts_mean(volume, 60), 21), 8), 7), 3))")
289
+
290
+ # Alpha89 (contains `IndNeutralize`, currently not implemented)
291
+ # self.add_feature("alpha89", "(ts_rank(ts_decay_linear(ts_corr(low, ts_mean(volume, 10), 7), 6), 4) - ts_rank(ts_decay_linear(ts_delta(vwap, 3), 10), 15))")
292
+
293
+ # Alpha90 (contains `IndNeutralize`, currently not implemented)
294
+ # self.add_feature("alpha90", "pow2(cs_rank(close - ts_max(close, 5)), ts_rank(ts_corr(ts_mean(volume, 40), low, 5), 3)) * -1")
295
+
296
+ # Alpha91 (contains `IndNeutralize`, currently not implemented)
297
+ # self.add_feature("alpha91", "(ts_rank(ts_decay_linear(ts_decay_linear(ts_corr(close, volume, 10), 16), 4), 5) - cs_rank(ts_decay_linear(ts_corr(vwap, ts_mean(volume, 30), 4), 3))) * -1")
298
+
299
+ # Alpha92
300
+ self.add_feature("alpha92", "ts_less(ts_rank(ts_decay_linear(quesval2(((high + low) / 2 + close), (low + open), 1, 0), 15), 19), ts_rank(ts_decay_linear(ts_corr(cs_rank(low), cs_rank(ts_mean(volume, 30)), 8), 7), 7))")
301
+
302
+ # Alpha93 (contains `IndNeutralize`, currently not implemented)
303
+ # self.add_feature("alpha93", "ts_rank(ts_decay_linear(ts_corr(vwap, ts_mean(volume, 81), 17), 20), 8) / cs_rank(ts_decay_linear(ts_delta(close * 0.524434 + vwap * 0.475566, 3), 16))")
304
+
305
+ # Alpha94
306
+ self.add_feature("alpha94", "pow2(cs_rank(vwap - ts_min(vwap, 12)), ts_rank(ts_corr(ts_rank(vwap, 20), ts_rank(ts_mean(volume, 60), 4), 18), 3)) * -1")
307
+
308
+ # Alpha95
309
+ self.add_feature("alpha95", "quesval2(cs_rank(open - ts_min(open, 12)), ts_rank(pow1(cs_rank(ts_corr(ts_sum((high + low) / 2, 19), ts_sum(ts_mean(volume, 40), 19), 13)), 5), 12), 1, 0)")
310
+
311
+ # Alpha96
312
+ self.add_feature("alpha96", "ts_greater(ts_rank(ts_decay_linear(ts_corr(cs_rank(vwap), cs_rank(volume), 4), 4), 8), ts_rank(ts_decay_linear(ts_argmax(ts_corr(ts_rank(close, 7), ts_rank(ts_mean(volume, 60), 4), 4), 13), 14), 13)) * -1")
313
+
314
+ # Alpha97 (contains `IndNeutralize`, currently not implemented)
315
+ # self.add_feature("alpha97", "(cs_rank(ts_decay_linear(ts_delta(low * 0.721001 + vwap * 0.278999, 3), 20)) - ts_rank(ts_decay_linear(ts_rank(ts_corr(ts_rank(low, 8), ts_rank(ts_mean(volume, 60), 17), 5), 19), 16), 7)) * -1")
316
+
317
+ # Alpha98
318
+ self.add_feature("alpha98", "cs_rank(ts_decay_linear(ts_corr(vwap, ts_sum(ts_mean(volume, 5), 26), 5), 7)) - cs_rank(ts_decay_linear(ts_rank(ts_argmin(ts_corr(cs_rank(open), cs_rank(ts_mean(volume, 15)), 21), 9), 7), 8))")
319
+
320
+ # Alpha99
321
+ self.add_feature("alpha99", "quesval2(cs_rank(ts_corr(ts_sum((high + low) / 2, 20), ts_sum(ts_mean(volume, 60), 20), 9)), cs_rank(ts_corr(low, volume, 6)), 1, 0) * -1")
322
+
323
+ # Alpha100 (contains `IndNeutralize`, currently not implemented)
324
+ # self.add_feature("alpha100", "-1 * ((1.5 * cs_scale(cs_rank(((close - low) - (high - close)) / (high - low) * volume))) - cs_scale(ts_corr(close, cs_rank(ts_mean(volume, 20)), 5) - cs_rank(ts_argmin(close, 30)))) * (volume / ts_mean(volume, 20))")
325
+
326
+ # Alpha101
327
+ self.add_feature("alpha101", "((close - open) / ((high - low) + 0.001))")
328
+
329
+ # Set label
330
+ self.set_label("ts_delay(close, -3) / ts_delay(close, -1) - 1")