openfund-maker 1.0.2__py3-none-any.whl → 1.0.4__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.
@@ -236,9 +236,7 @@ class ThreeLineOrdergBot:
236
236
 
237
237
 
238
238
  def place_order(self,symbol, price, amount_usdt, side):
239
- if self.check_position(symbol=symbol) :
240
- self.logger.info(f"{symbol} 有持仓合约,不进行下单。")
241
- return
239
+
242
240
 
243
241
  markets = self.exchange.load_markets()
244
242
  if symbol not in markets:
@@ -327,7 +325,7 @@ class ThreeLineOrdergBot:
327
325
  direction = 0
328
326
 
329
327
 
330
- self.logger.debug(f"{symbol}: 极差={latest_ema_range} 斜率={latest_ema_slope}, K线方向 {direction}")
328
+ self.logger.debug(f"{symbol}: 极差={latest_ema_range:.9f} 斜率={latest_ema_slope:.9f}, K线方向 {direction}")
331
329
 
332
330
  return direction
333
331
 
@@ -403,6 +401,12 @@ class ThreeLineOrdergBot:
403
401
  return float(self.round_price_to_tick(place_order_price,tick_size))
404
402
 
405
403
  def process_pair(self,symbol,pair_config):
404
+ # 检查是否有持仓,有持仓不进行下单
405
+ if self.check_position(symbol=symbol) :
406
+ self.logger.info(f"{symbol} 有持仓合约,不进行下单。")
407
+ return
408
+ # 取消之前的挂单
409
+ self.cancel_all_orders(symbol=symbol)
406
410
 
407
411
  try:
408
412
  klines = self.get_historical_klines(symbol=symbol)
@@ -482,7 +486,7 @@ class ThreeLineOrdergBot:
482
486
 
483
487
  self.logger.debug(f"{symbol} 当前K线的前三根K线 最高价: {max_high}, 最低价: {min_low}")
484
488
 
485
- self.cancel_all_orders(symbol=symbol)
489
+
486
490
 
487
491
  long_amount_usdt = pair_config.get('long_amount_usdt', 5)
488
492
  short_amount_usdt = pair_config.get('short_amount_usdt', 5)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: openfund-maker
3
- Version: 1.0.2
3
+ Version: 1.0.4
4
4
  Summary: Openfund-maker.
5
5
  Requires-Python: >=3.9,<4.0
6
6
  Classifier: Programming Language :: Python :: 3
@@ -1,4 +1,4 @@
1
- maker/ThreeLineOrderBot.py,sha256=Adk7MsJNakmf3ekE8esGSyE1VV3sBFG3rKZ8g90AIK0,23405
1
+ maker/ThreeLineOrderBot.py,sha256=AGPTm3hRho537aKKXhwIHbr4hVRlTVEh_axul0enMXg,23507
2
2
  maker/WickReversalOrderBot.py,sha256=Oc6wChdWu39lfWh3NRHM8BqvaRIYDNZiDR6PDnE9XUM,17374
3
3
  maker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  maker/config.py,sha256=YPxghO5i0vgRg9Cja8kGj9O7pgSbbtzOgf3RexqXXwY,1188
@@ -7,7 +7,7 @@ maker/main_m.py,sha256=0PzDTnuBrxfpy5WDfsIHKAzZ_7pkuvuqqeWik0vpWio,15522
7
7
  maker/okxapi.py,sha256=_9G0U_o0ZC8NxaT6PqpiLgxBm9gPobC9PsFHZE1c5w0,553
8
8
  maker/zhen.py.bak,sha256=HNkrQbJts8G9umE9chEFsc0cLQApcM9KOVNMYPpkBXM,10918
9
9
  maker/zhen_2.py,sha256=4IaHVtTCMSlrLGSTZrWpW2q-f7HZsUNRkW_-5QgWv24,10509
10
- openfund_maker-1.0.2.dist-info/METADATA,sha256=yNEOQah1lPBe5pysgsHfRFslnUMyuRqkgYHgqMSM6rw,1965
11
- openfund_maker-1.0.2.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
12
- openfund_maker-1.0.2.dist-info/entry_points.txt,sha256=gKMytICEKcMRFQDFkHZLnIpID7UQFoTIM_xcpiiV6Ns,50
13
- openfund_maker-1.0.2.dist-info/RECORD,,
10
+ openfund_maker-1.0.4.dist-info/METADATA,sha256=cDXItR0Mz41fZ_xoiMVIIMBNv7CXMC480IrujQ_kvBQ,1965
11
+ openfund_maker-1.0.4.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
12
+ openfund_maker-1.0.4.dist-info/entry_points.txt,sha256=gKMytICEKcMRFQDFkHZLnIpID7UQFoTIM_xcpiiV6Ns,50
13
+ openfund_maker-1.0.4.dist-info/RECORD,,