openfund-maker 1.3.13__py3-none-any.whl → 1.3.14__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 +18 -14
- {openfund_maker-1.3.13.dist-info → openfund_maker-1.3.14.dist-info}/METADATA +1 -1
- {openfund_maker-1.3.13.dist-info → openfund_maker-1.3.14.dist-info}/RECORD +5 -5
- {openfund_maker-1.3.13.dist-info → openfund_maker-1.3.14.dist-info}/WHEEL +0 -0
- {openfund_maker-1.3.13.dist-info → openfund_maker-1.3.14.dist-info}/entry_points.txt +0 -0
maker/MACDStrategyMaker.py
CHANGED
@@ -153,24 +153,28 @@ class MACDStrategyMaker(ThreeLineStrategyMaker):
|
|
153
153
|
|
154
154
|
order_side = 'none'
|
155
155
|
try:
|
156
|
+
# 20250312 增加validate_mode, 0: 严格模式,用MACD形态校验 1: 宽松模式,只看K线金叉死叉
|
157
|
+
validate_mode = int(strategy.get('validate_mode', 0))
|
156
158
|
htf = str(strategy.get('HTF', '1h'))
|
157
159
|
htf_kLines = self.get_historical_klines(symbol=symbol, bar=htf)
|
158
160
|
|
159
|
-
#
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
#
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
161
|
+
if validate_mode == 0 : # 0: 严格模式,用MACD形态校验
|
162
|
+
# 20250312 修改为MACD形态校验,而不只是金死叉
|
163
|
+
order_side = self.judge_order_side(symbol, kLines=htf_kLines)
|
164
|
+
self.logger.debug(f"{symbol} : HTF={htf} , {order_side}。")
|
165
|
+
else: # 1: 宽松模式,只看K线金叉死叉
|
166
|
+
crosses = self.get_macd_cross_direction(symbol, htf_kLines, strategy)
|
167
|
+
all_cross = crosses.get('all_cross',[])
|
168
|
+
if len(all_cross) > 1:
|
169
|
+
if all_cross[0][0] == 'golden':
|
170
|
+
order_side = 'buy'
|
171
|
+
else:
|
172
|
+
order_side = 'sell'
|
173
|
+
|
174
|
+
self.logger.debug(f"{symbol} : HTF={htf} , {order_side}。")
|
171
175
|
|
172
|
-
|
173
|
-
|
176
|
+
else:
|
177
|
+
self.logger.debug(f"{symbol} : HTF={htf} ,没有满足条件的交叉点。")
|
174
178
|
|
175
179
|
except Exception as e:
|
176
180
|
error_message = f"程序异常退出: {str(e)}"
|
@@ -1,4 +1,4 @@
|
|
1
|
-
maker/MACDStrategyMaker.py,sha256=
|
1
|
+
maker/MACDStrategyMaker.py,sha256=1HLx6Mvnqhm6hi8Vrfs8oDdyCnEVLM3Fix35JwpcAmY,12627
|
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.14.dist-info/METADATA,sha256=Dq_vAvuWG4kvPl3O8ewXkBV8FX_2mfK6GCDwDNJb0PY,1954
|
12
|
+
openfund_maker-1.3.14.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
|
13
|
+
openfund_maker-1.3.14.dist-info/entry_points.txt,sha256=gKMytICEKcMRFQDFkHZLnIpID7UQFoTIM_xcpiiV6Ns,50
|
14
|
+
openfund_maker-1.3.14.dist-info/RECORD,,
|
File without changes
|
File without changes
|