openfund-maker 1.3.10__py3-none-any.whl → 1.3.11__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/MACDStrategyMaker.py +16 -14
- {openfund_maker-1.3.10.dist-info → openfund_maker-1.3.11.dist-info}/METADATA +1 -1
- {openfund_maker-1.3.10.dist-info → openfund_maker-1.3.11.dist-info}/RECORD +5 -5
- {openfund_maker-1.3.10.dist-info → openfund_maker-1.3.11.dist-info}/WHEEL +0 -0
- {openfund_maker-1.3.10.dist-info → openfund_maker-1.3.11.dist-info}/entry_points.txt +0 -0
maker/MACDStrategyMaker.py
CHANGED
@@ -90,7 +90,7 @@ class MACDStrategyMaker(ThreeLineStrategyMaker):
|
|
90
90
|
|
91
91
|
|
92
92
|
|
93
|
-
def judge_order_side(self, symbol, kLines, valid_klines=
|
93
|
+
def judge_order_side(self, symbol, kLines, valid_klines=241 ,strategy=None) -> str:
|
94
94
|
|
95
95
|
'''
|
96
96
|
零轴之上的macd与signal形成金叉
|
@@ -156,18 +156,21 @@ class MACDStrategyMaker(ThreeLineStrategyMaker):
|
|
156
156
|
htf = str(strategy.get('HTF', '1h'))
|
157
157
|
htf_kLines = self.get_historical_klines(symbol=symbol, bar=htf)
|
158
158
|
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
159
|
+
# 20250312 修改为MACD形态校验,而不只是金死叉
|
160
|
+
order_side = self.judge_order_side(symbol, kLines=htf_kLines)
|
161
|
+
self.logger.debug(f"{symbol} : HTF={htf} , {order_side}。")
|
162
|
+
# crosses = self.get_macd_cross_direction(symbol, htf_kLines, strategy)
|
163
|
+
# all_cross = crosses.get('all_cross',[])
|
164
|
+
# if len(all_cross) > 1:
|
165
|
+
# if all_cross[0][0] == 'golden':
|
166
|
+
# order_side = 'buy'
|
167
|
+
# else:
|
168
|
+
# order_side = 'sell'
|
166
169
|
|
167
|
-
|
170
|
+
# self.logger.debug(f"{symbol} : HTF={htf} , {order_side}。")
|
168
171
|
|
169
|
-
else:
|
170
|
-
|
172
|
+
# else:
|
173
|
+
# self.logger.debug(f"{symbol} : HTF={htf} ,没有满足条件的交叉点。")
|
171
174
|
|
172
175
|
except Exception as e:
|
173
176
|
error_message = f"程序异常退出: {str(e)}"
|
@@ -207,12 +210,11 @@ class MACDStrategyMaker(ThreeLineStrategyMaker):
|
|
207
210
|
side = self.judge_order_side(symbol, kLines,valid_klines, macd_strategy)
|
208
211
|
# 和HTF方向进行对比
|
209
212
|
htf_side = self.judge_HTF_side(symbol, macd_strategy)
|
210
|
-
if htf_side
|
213
|
+
if htf_side == 'none' or side == 'none' or side != htf_side:
|
211
214
|
self.logger.debug(f"{symbol} : 下单方向 {side} 与HTF方向 {htf_side} 不一致,不进行下单。")
|
212
215
|
return
|
213
216
|
|
214
|
-
|
215
|
-
|
217
|
+
|
216
218
|
long_amount_usdt = pair_config.get('long_amount_usdt', 5)
|
217
219
|
short_amount_usdt = pair_config.get('short_amount_usdt', 5)
|
218
220
|
order_amount_usdt = 5
|
@@ -1,4 +1,4 @@
|
|
1
|
-
maker/MACDStrategyMaker.py,sha256=
|
1
|
+
maker/MACDStrategyMaker.py,sha256=7qH295CZrnGgJr9THo_EYZ65R5mni6DlSaw_8tTWSWY,12252
|
2
2
|
maker/ThreeLineStrategyMaker.py,sha256=5uUTRMOCe0-0d2Ll7Bzhe-0WKpnfddhDEaj3XTGDgyA,30270
|
3
3
|
maker/WickReversalStrategyMaker.py,sha256=7DqPDVJot4EM0_lSAcFAHrR9rNvkIds9KLMoDOiAHEc,17486
|
4
4
|
maker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -8,7 +8,7 @@ maker/main_m.py,sha256=0PzDTnuBrxfpy5WDfsIHKAzZ_7pkuvuqqeWik0vpWio,15522
|
|
8
8
|
maker/okxapi.py,sha256=_9G0U_o0ZC8NxaT6PqpiLgxBm9gPobC9PsFHZE1c5w0,553
|
9
9
|
maker/zhen.py.bak,sha256=HNkrQbJts8G9umE9chEFsc0cLQApcM9KOVNMYPpkBXM,10918
|
10
10
|
maker/zhen_2.py,sha256=4IaHVtTCMSlrLGSTZrWpW2q-f7HZsUNRkW_-5QgWv24,10509
|
11
|
-
openfund_maker-1.3.
|
12
|
-
openfund_maker-1.3.
|
13
|
-
openfund_maker-1.3.
|
14
|
-
openfund_maker-1.3.
|
11
|
+
openfund_maker-1.3.11.dist-info/METADATA,sha256=pFB9ass2dhlkL4dABaB3KQlqsqvnvQagdJw0BeEF-6I,1954
|
12
|
+
openfund_maker-1.3.11.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
13
|
+
openfund_maker-1.3.11.dist-info/entry_points.txt,sha256=gKMytICEKcMRFQDFkHZLnIpID7UQFoTIM_xcpiiV6Ns,50
|
14
|
+
openfund_maker-1.3.11.dist-info/RECORD,,
|
File without changes
|
File without changes
|