openfund-maker 2.3.3__py3-none-any.whl → 2.3.5__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.
@@ -390,14 +390,14 @@ class BestTopDownStrategyMaker(StrategyMaker):
390
390
  self.logger.info(f"{symbol} : {step}. ETF {etf}, {etf_side} 价格={order_price:.{precision}}")
391
391
 
392
392
 
393
- except KeyboardInterrupt:
394
- self.logger.info("程序收到中断信号,开始退出...")
395
393
  except Exception as e:
396
394
  error_message = f"程序异常退出: {str(e)}"
397
395
  # 记录错误信息和堆栈跟踪
398
396
  self.logger.error(f"{error_message}\n{traceback.format_exc()}")
399
397
  traceback.print_exc()
400
398
  self.send_feishu_notification(symbol, error_message)
399
+ except KeyboardInterrupt:
400
+ self.logger.info("程序收到中断信号,开始退出...")
401
401
  finally:
402
402
  self.logger.info("=" * 60 + "\n")
403
403
 
maker/StrategyMaker.py CHANGED
@@ -206,7 +206,7 @@ class StrategyMaker():
206
206
  )
207
207
  except Exception as e:
208
208
  error_message = f"{symbol} 下单失败: {e}"
209
- self.logger.warning(error_message)
209
+ self.logger.error(error_message)
210
210
  self.send_feishu_notification(symbol, error_message)
211
211
 
212
212
  def cancel_all_orders(self, symbol):
@@ -219,7 +219,7 @@ class StrategyMaker():
219
219
  self.exchange.cancel_all_orders(symbol=symbol)
220
220
  except Exception as e:
221
221
  error_message = f"{symbol} 取消所有挂单失败: {e}"
222
- self.logger.warning(error_message)
222
+ self.logger.error(error_message)
223
223
  self.send_feishu_notification(symbol, error_message)
224
224
 
225
225
  def get_historical_klines(self, symbol, tf='15m'):
@@ -237,6 +237,7 @@ class StrategyMaker():
237
237
  def _get_cache_historical_klines_df(self, symbol, tf):
238
238
  """被缓存的获取K线数据的方法"""
239
239
  return self.get_historical_klines_df(symbol, tf)
240
+
240
241
  def clear_cache_historical_klines_df(self, symbol=None):
241
242
  """
242
243
  清除指定交易对和时间周期的缓存
@@ -258,8 +259,7 @@ class StrategyMaker():
258
259
  del self.cache_time[k]
259
260
  # 由于lru_cache无法单独清除特定键,这里只能清除所有缓存
260
261
  self._get_cache_historical_klines_df.cache_clear()
261
-
262
-
262
+
263
263
  def get_historical_klines_df_by_cache(self, symbol, tf='15m'):
264
264
  """_summary_
265
265
  获取历史K线数据
@@ -291,8 +291,7 @@ class StrategyMaker():
291
291
  self.logger.debug(f"{symbol} : 重新获取新数据: {symbol} {tf}")
292
292
  self.cache_time[cache_key] = current_time
293
293
  return self._get_cache_historical_klines_df(symbol, tf)
294
-
295
-
294
+
296
295
  def get_historical_klines_df(self, symbol, tf='15m'):
297
296
  """_summary_
298
297
  获取历史K线数据
@@ -303,6 +302,7 @@ class StrategyMaker():
303
302
  _type_: _description_
304
303
  """
305
304
  return self.exchange.get_historical_klines_df(symbol=symbol, bar=tf)
305
+
306
306
  def format_klines(self, klines) -> pd.DataFrame:
307
307
 
308
308
  """_summary_
@@ -360,8 +360,7 @@ class StrategyMaker():
360
360
  """
361
361
 
362
362
  return self.smcOB.get_latest_OB(data=data, trend=trend, start_index=start_index)
363
-
364
-
363
+
365
364
  def find_FVGs(self, symbol, data, side, check_balanced=True, start_index=-1, pair_config=None) -> pd.DataFrame:
366
365
  """_summary_
367
366
  寻找公允价值缺口
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: openfund-maker
3
- Version: 2.3.3
3
+ Version: 2.3.5
4
4
  Summary: Openfund-maker.
5
5
  Requires-Python: >=3.9,<4.0
6
6
  Classifier: Programming Language :: Python :: 3
@@ -1,8 +1,8 @@
1
1
  maker/BestFVGStrategyMaker.py,sha256=a9UfClrfzkgX6jXL2FODzANtawrmGeZ_PVeO1-tweDc,12532
2
- maker/BestTopDownStrategyMaker.py,sha256=HGG4883WTDBc3PPHNtWAAR4cjtg6r7a7QNv-JLBVOU0,23981
2
+ maker/BestTopDownStrategyMaker.py,sha256=KT7x29dbJh8Kbaj1l_cHJ_CpACmdEnafNuU9viiOcMk,23981
3
3
  maker/MACDStrategyMaker.py,sha256=WX8wqpF9h5W4WclN1NjZ_Bur7KFi_aMTvacfLyHzEcI,12681
4
4
  maker/SMCStrategyMaker.py,sha256=hkDqymWnuyYDo1gTYY_uyO4H4yOwCw8NBTM9RcfLRPc,28780
5
- maker/StrategyMaker.py,sha256=iJa-9MxuUwPDOZot2YJmT-sdYHnPZbgPsdCaKvw3Sis,18821
5
+ maker/StrategyMaker.py,sha256=aJ_uSoGC5enYMgmRbPOKEEICk7r7yUA4XLsd04hWNfI,18820
6
6
  maker/ThreeLineStrategyMaker.py,sha256=K4NZB1rH8IZMVrCFEnzwXctZQbyI9ZdyTMrYObpl-vM,32095
7
7
  maker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  maker/history_code/WickReversalStrategyMaker.py,sha256=7DqPDVJot4EM0_lSAcFAHrR9rNvkIds9KLMoDOiAHEc,17486
@@ -11,7 +11,7 @@ maker/history_code/okxapi.py,sha256=_9G0U_o0ZC8NxaT6PqpiLgxBm9gPobC9PsFHZE1c5w0,
11
11
  maker/history_code/zhen.py.bak,sha256=HNkrQbJts8G9umE9chEFsc0cLQApcM9KOVNMYPpkBXM,10918
12
12
  maker/history_code/zhen_2.py,sha256=4IaHVtTCMSlrLGSTZrWpW2q-f7HZsUNRkW_-5QgWv24,10509
13
13
  maker/main.py,sha256=PRCP2qCUiUFPQyi1YbvnmW9KqeCZcc0zGjy9OBvMWbM,3723
14
- openfund_maker-2.3.3.dist-info/METADATA,sha256=0ZvMTnyUA47auoEj2OmQ4gDGOWDk1PbQEQJ2Wp17XNs,2001
15
- openfund_maker-2.3.3.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
16
- openfund_maker-2.3.3.dist-info/entry_points.txt,sha256=gKMytICEKcMRFQDFkHZLnIpID7UQFoTIM_xcpiiV6Ns,50
17
- openfund_maker-2.3.3.dist-info/RECORD,,
14
+ openfund_maker-2.3.5.dist-info/METADATA,sha256=VbZXRzTRnPMr8I5XNfrhgT0Mz3kA1SKQh4BjkEp7EIg,2001
15
+ openfund_maker-2.3.5.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
16
+ openfund_maker-2.3.5.dist-info/entry_points.txt,sha256=gKMytICEKcMRFQDFkHZLnIpID7UQFoTIM_xcpiiV6Ns,50
17
+ openfund_maker-2.3.5.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.0.1
2
+ Generator: poetry-core 2.1.3
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any