openfund-maker 2.1.0__py3-none-any.whl → 2.1.1__py3-none-any.whl
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.
- maker/BestFVGStrategyMaker.py +10 -8
- {openfund_maker-2.1.0.dist-info → openfund_maker-2.1.1.dist-info}/METADATA +1 -1
- {openfund_maker-2.1.0.dist-info → openfund_maker-2.1.1.dist-info}/RECORD +5 -5
- {openfund_maker-2.1.0.dist-info → openfund_maker-2.1.1.dist-info}/WHEEL +0 -0
- {openfund_maker-2.1.0.dist-info → openfund_maker-2.1.1.dist-info}/entry_points.txt +0 -0
maker/BestFVGStrategyMaker.py
CHANGED
@@ -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=
|
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} 使用之前
|
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} 形成新的
|
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} 未形成有效的
|
104
|
+
self.logger.debug(f"{symbol} : {htf} is {htf_struct}, 未形成有效的 {htf_entry_struct} struct,不下单。")
|
103
105
|
return
|
104
106
|
|
105
|
-
#
|
106
|
-
if
|
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,下单
|
@@ -1,4 +1,4 @@
|
|
1
|
-
maker/BestFVGStrategyMaker.py,sha256=
|
1
|
+
maker/BestFVGStrategyMaker.py,sha256=IGCk6TUwaJMWOSjM4fJU5BQ7ckCfTZBOMoSlI9Cka8U,11391
|
2
2
|
maker/MACDStrategyMaker.py,sha256=iS5HO04piKHFJxUI2e5QmicxzGeK-V1aphJSr2n_4Ac,12651
|
3
3
|
maker/SMCStrategyMaker.py,sha256=gXhYs-QvKBZ-mdR4UN2EF7OwFGI5JyW2-0RJLXq7SSc,34695
|
4
4
|
maker/ThreeLineStrategyMaker.py,sha256=ArjnHlGECiD3cCFXxO0Ex5scR2agwoxZY-4mKukyKc4,30402
|
@@ -10,7 +10,7 @@ maker/main_m.py,sha256=0PzDTnuBrxfpy5WDfsIHKAzZ_7pkuvuqqeWik0vpWio,15522
|
|
10
10
|
maker/okxapi.py,sha256=_9G0U_o0ZC8NxaT6PqpiLgxBm9gPobC9PsFHZE1c5w0,553
|
11
11
|
maker/zhen.py.bak,sha256=HNkrQbJts8G9umE9chEFsc0cLQApcM9KOVNMYPpkBXM,10918
|
12
12
|
maker/zhen_2.py,sha256=4IaHVtTCMSlrLGSTZrWpW2q-f7HZsUNRkW_-5QgWv24,10509
|
13
|
-
openfund_maker-2.1.
|
14
|
-
openfund_maker-2.1.
|
15
|
-
openfund_maker-2.1.
|
16
|
-
openfund_maker-2.1.
|
13
|
+
openfund_maker-2.1.1.dist-info/METADATA,sha256=nvo_ZreiBz-kFuFxFphTfaKw6eEBXNa9RiOiLYgEahQ,1953
|
14
|
+
openfund_maker-2.1.1.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
15
|
+
openfund_maker-2.1.1.dist-info/entry_points.txt,sha256=gKMytICEKcMRFQDFkHZLnIpID7UQFoTIM_xcpiiV6Ns,50
|
16
|
+
openfund_maker-2.1.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|