openfund-maker 2.0.7__tar.gz → 2.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: openfund-maker
3
- Version: 2.0.7
3
+ Version: 2.1.1
4
4
  Summary: Openfund-maker.
5
5
  Requires-Python: >=3.9,<4.0
6
6
  Classifier: Programming Language :: Python :: 3
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "openfund-maker"
3
- version = "2.0.7"
3
+ version = "2.1.1"
4
4
  description = "Openfund-maker."
5
5
  authors = []
6
6
  readme = "README.md"
@@ -68,6 +68,8 @@ class BestFVGStrategyMaker(SMCStrategyMaker):
68
68
  ltf = str(smc_strategy.get('LTF', '1m'))
69
69
  htf_prd = int(smc_strategy.get('HTF_swing_points_length',15))
70
70
  ltf_prd = int(smc_strategy.get('LTF_swing_points_length',3))
71
+ htf_entry_struct = str(smc_strategy.get('HTF_entry_struct','CHoCH'))
72
+ ltf_entry_struct = str(smc_strategy.get('LTF_entry_struct','CHoCH'))
71
73
  enable_FVG = bool(smc_strategy.get('enable_FVG',True)) # 是否启用FVG
72
74
  enable_OB = bool(smc_strategy.get('enable_OB',True))# 是否启用OB
73
75
  self.logger.info(f"{symbol} : BestFVGSMC策略 {ltf}|{htf} \nenable_FVG={enable_FVG} enable_OB={enable_OB} \nHTF_swing_points_length={htf_prd} LTF_swing_points_length={ltf_prd}")
@@ -81,7 +83,7 @@ class BestFVGStrategyMaker(SMCStrategyMaker):
81
83
  htf_struct = {"struct": "None"}
82
84
  # 检查是否有上一个CHoCH结构
83
85
  htf_last_CHoCH = self.htf_last_CHoCH.get(symbol,None)
84
- htf_struct = self.detect_struct(htf_df, prd=htf_prd, struct_key="CHoCH") # HTF结构要严谨,prd周期要长一些
86
+ htf_struct = self.detect_struct(htf_df, prd=htf_prd, struct_key=htf_entry_struct) # HTF结构要严谨,prd周期要长一些
85
87
 
86
88
  # 如果存在上一个CHoCH结构,更新趋势标签和方向
87
89
  if htf_last_CHoCH:
@@ -91,19 +93,19 @@ class BestFVGStrategyMaker(SMCStrategyMaker):
91
93
  # 优化: 只在没有新CHoCH结构时使用上一个结构
92
94
  if htf_struct["struct"] == "None":
93
95
  htf_struct = htf_last_CHoCH
94
- self.logger.debug(f"{symbol} : {htf} 使用之前 CHoCH struct。{htf_struct['struct']} prd={htf_prd}。")
96
+ self.logger.debug(f"{symbol} : {htf} 使用之前 {htf_entry_struct} struct。{htf_struct['struct']} prd={htf_prd}。")
95
97
  else:
96
- self.logger.debug(f"{symbol} : {htf} 形成新的 CHoCH struct。{htf_struct['struct']} prd={htf_prd}。")
98
+ self.logger.debug(f"{symbol} : {htf} 形成新的 {htf_entry_struct} struct。{htf_struct['struct']} prd={htf_prd}。")
97
99
 
98
100
  # 检查是否已形成有效的CHoCH结构
99
101
  htf_struct_label = htf_struct["struct"]
100
102
  htf_side = htf_struct["side"]
101
103
  if htf_struct_label == "None" and not htf_last_CHoCH:
102
- self.logger.debug(f"{symbol} : {htf} 未形成有效的 CHoCH struct,不下单。{htf_struct}。")
104
+ self.logger.debug(f"{symbol} : {htf} is {htf_struct}, 未形成有效的 {htf_entry_struct} struct,不下单。")
103
105
  return
104
106
 
105
- # 更新最新的CHoCH结构信息
106
- if 'CHoCH' in htf_struct_label and htf_struct_label != htf_last_CHoCH_label:
107
+ # 更新最新的结构信息
108
+ if ltf_entry_struct in htf_struct_label and htf_struct_label != htf_last_CHoCH_label:
107
109
  self.htf_last_CHoCH[symbol] = htf_struct
108
110
  htf_last_CHoCH = htf_struct
109
111
  htf_last_CHoCH_label = htf_struct_label
@@ -128,7 +130,7 @@ class BestFVGStrategyMaker(SMCStrategyMaker):
128
130
  }
129
131
 
130
132
  self.logger.info(f"{symbol} : {htf} 趋势={htf_last_CHoCH_label}")
131
- self.logger.debug(f"{symbol} : \npivot_high={htf_pivot_high} pivot_low={htf_pivot_low} mid_line={htf_mid_line}\n溢价区={premium_box}\n折价区={discount_box}")
133
+ self.logger.debug(f"{symbol} : {htf}\npivot_high={htf_pivot_high} pivot_low={htf_pivot_low} mid_line={htf_mid_line}\n溢价区={premium_box}\n折价区={discount_box}")
132
134
 
133
135
  # 3. find HTF FVG
134
136
  pivot_index = htf_struct["pivot_low_index"] if htf_side == "buy" else htf_struct["pivot_high_index"]
@@ -173,7 +175,7 @@ class BestFVGStrategyMaker(SMCStrategyMaker):
173
175
  }
174
176
 
175
177
  self.logger.info(f"{symbol} : {ltf} 趋势={ltf_struct_label} struct={ltf_struct}")
176
- self.logger.debug(f"{symbol} : \npivot_high={ltf_last_pivot_high} pivot_low={ltf_last_pivot_low} mid_line={ltf_last_mid_line}\n溢价区={ltf_premium_box}\n折价区={ltf_discount_box}")
178
+ self.logger.debug(f"{symbol} : {ltf} \npivot_high={ltf_last_pivot_high} pivot_low={ltf_last_pivot_low} mid_line={ltf_last_mid_line}\n溢价区={ltf_premium_box}\n折价区={ltf_discount_box}")
177
179
 
178
180
 
179
181
  # 5. LTF 寻找FVG,下单
File without changes