bitunix-automated-crypto-trading 3.3.7__py3-none-any.whl → 3.3.8__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.
@@ -399,7 +399,7 @@ class BitunixSignal:
399
399
  ###########################################################################################################
400
400
  async def checkTickerAndAutotradeStatus(self):
401
401
  while True:
402
- if self.lastAutoTradeTime + 300 < time.time() or self.lastTickerDataTime + 300 < time.time():
402
+ if self.lastAutoTradeTime + 300 < time.time(): # or self.lastTickerDataTime + 300 < time.time():
403
403
  self.notifications.add_notification("AutoTradeProcess or GetTickerData is not running")
404
404
  os._exit(1)
405
405
  break
@@ -901,12 +901,10 @@ class BitunixSignal:
901
901
  if self.settings.BOT_TRAIL_SL:
902
902
  if old_slPrice is not None:
903
903
  sl_midpoint = old_slPrice / (1 - self.settings.LOSS_PERCENTAGE/100/self.settings.LEVERAGE) if side == "BUY" else old_slPrice / (1 + self.settings.LOSS_PERCENTAGE/100/self.settings.LEVERAGE) if tpPrice is not None else None
904
- if roi > self.settings.PROFIT_PERCENTAGE:
905
- sl_midpoint = tp_midpoint
906
904
 
907
905
  if sl_midpoint is not None and (price > sl_midpoint and side == "BUY" or price < sl_midpoint and side == "SELL"):
908
- if roi > self.settings.PROFIT_PERCENTAGE and self.settings.PROFIT_PERCENTAGE < self.settings.LOSS_PERCENTAGE:
909
- slPrice = price * (1 - float(self.settings.PROFIT_PERCENTAGE) / 100 / self.settings.LEVERAGE) if side == "BUY" else price * (1 + float(self.settings.PROFIT_PERCENTAGE) / 100 / self.settings.LEVERAGE)
906
+ if roi > self.settings.PROFIT_PERCENTAGE * 0.75 and self.settings.PROFIT_PERCENTAGE < self.settings.LOSS_PERCENTAGE:
907
+ slPrice = price * (1 - float(self.settings.PROFIT_PERCENTAGE * 0.75) / 100 / self.settings.LEVERAGE) if side == "BUY" else avgOpenPrice * (1 + float(self.settings.PROFIT_PERCENTAGE) / 100 / self.settings.LEVERAGE)
910
908
  else:
911
909
  slPrice = price * (1 - float(self.settings.LOSS_PERCENTAGE) / 100 / self.settings.LEVERAGE) if side == "BUY" else price * (1 + float(self.settings.LOSS_PERCENTAGE) / 100 / self.settings.LEVERAGE)
912
910
  slPrice = Decimal(await self.str_precision(slPrice))
@@ -920,6 +918,7 @@ class BitunixSignal:
920
918
 
921
919
 
922
920
  if self.settings.BOT_TRAIL_TP and tpPrice is not None and tpOrderPrice is not None:
921
+ if old_tpPrice is None or tpPrice != old_tpPrice:
923
922
  datajs2 = await self.bitunixApi.ModifyTpSlOrder({'orderId':tporderId,'tpPrice':str(tpPrice), 'tpOrderPrice':str(tpOrderPrice), 'tpQty':str(qty),'tpStopType':tpStopType,'tpOrderType':tpOrderType})
924
923
  if datajs2 is not None:
925
924
  self.notifications.add_notification(
@@ -927,9 +926,10 @@ class BitunixSignal:
927
926
  )
928
927
 
929
928
  if self.settings.BOT_TRAIL_SL and slPrice is not None and slOrderPrice is not None:
929
+ if old_slPrice is None or slPrice != old_slPrice:
930
930
  datajs3 = await self.bitunixApi.ModifyTpSlOrder({'orderId':slorderId,'slPrice':str(slPrice),'slQty':str(qty),'slStopType':slStopType,'slOrderType':slOrderType})
931
931
  if datajs3 is not None:
932
- if roi > self.settings.PROFIT_PERCENTAGE and self.settings.PROFIT_PERCENTAGE < self.settings.LOSS_PERCENTAGE:
932
+ if roi > self.settings.PROFIT_PERCENTAGE * 0.75 and self.settings.PROFIT_PERCENTAGE < self.settings.LOSS_PERCENTAGE:
933
933
  self.notifications.add_notification(
934
934
  f'{colors.CYAN} Stop Loss order for {row.symbol} moved from {old_slPrice} to breakeven {slPrice}'
935
935
  )
@@ -1 +1 @@
1
- __version__ = "3.3.7"
1
+ __version__ = "3.3.8"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bitunix_automated_crypto_trading
3
- Version: 3.3.7
3
+ Version: 3.3.8
4
4
  Summary: Bitunix Futures Auto Trading Platform
5
5
  Home-page: https://github.com/tcj2001/bitunix-automated-crypto-trading
6
6
  Author: tcj2001
@@ -1,6 +1,6 @@
1
1
  bitunix_automated_crypto_trading/AsyncThreadRunner.py,sha256=bNIM_1xRYQOFEsIn74EX6qVpC59-GMhhr2CeiPr_GWg,3253
2
2
  bitunix_automated_crypto_trading/BitunixApi.py,sha256=5qg-K5IcsAbb6K1feP9zL7RzSz7JzdGAxoY8R_YWxWE,15666
3
- bitunix_automated_crypto_trading/BitunixSignal.py,sha256=jPxnlaKA7NJDl1az3m1bfNLpouUsMYa35CixwUCD25E,91091
3
+ bitunix_automated_crypto_trading/BitunixSignal.py,sha256=nMdHsWqtnrHcem_OlC4k8gbI2KDrJKuivzTG13g-udI,91104
4
4
  bitunix_automated_crypto_trading/BitunixWebSocket.py,sha256=uiqAcis3u-ct07tjaTiC87ujzvcAtVRZ31CMiTBDW_M,11309
5
5
  bitunix_automated_crypto_trading/DataFrameHtmlRenderer.py,sha256=Pqdzhh_nfIxFEZH9L_R5QXB8moDPbgeTGT_hmBkHWMg,2899
6
6
  bitunix_automated_crypto_trading/NotificationManager.py,sha256=exs6REABBA1omTeTGuUuECzxs5dGqdyL7oI8WyxS6Xc,798
@@ -11,9 +11,9 @@ bitunix_automated_crypto_trading/__init__.py,sha256=1hzk6nX8NnUCr1tsq8oFq1qGCNhN
11
11
  bitunix_automated_crypto_trading/bitunix.py,sha256=lxwnYARxldA2oU6GdjupilXIlnUh4RX8rQLCOn7x13I,27143
12
12
  bitunix_automated_crypto_trading/config.py,sha256=2K-5NzWoVUaU3O2tgi4qt-3dA_sCC6Nm3vFQBZrO5y8,5943
13
13
  bitunix_automated_crypto_trading/logger.py,sha256=NHnA5JZdUFkTAhB7i-1iCAwrdf1fxhDuRvJUkbKPi9Y,2923
14
- bitunix_automated_crypto_trading/version.py,sha256=Z9dy-a-QtSCS4duPQWpgA6G-wTeWi6aUt5Wi1lK_Ltg,21
15
- bitunix_automated_crypto_trading-3.3.7.dist-info/METADATA,sha256=pppKFPixMGagASNAjEA4nu5lY9wTbslP4__00JOmNIk,996
16
- bitunix_automated_crypto_trading-3.3.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
- bitunix_automated_crypto_trading-3.3.7.dist-info/entry_points.txt,sha256=UXREYHuSl2XYd_tOtLIq0zg3d1kX3lixX5SpN8yGBw4,82
18
- bitunix_automated_crypto_trading-3.3.7.dist-info/top_level.txt,sha256=uyFzHUCOsp8elnG2Ovor6xXcf7dxRxY-C-Txiwix64Q,33
19
- bitunix_automated_crypto_trading-3.3.7.dist-info/RECORD,,
14
+ bitunix_automated_crypto_trading/version.py,sha256=37tflRBXps5ly3x-d0V5MX2DfwsqrPwDzFH9EVchsG4,21
15
+ bitunix_automated_crypto_trading-3.3.8.dist-info/METADATA,sha256=HXT-qw3CG4V7GtZlr-vdv86LP6p_o-qxhamOgQH7354,996
16
+ bitunix_automated_crypto_trading-3.3.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
+ bitunix_automated_crypto_trading-3.3.8.dist-info/entry_points.txt,sha256=UXREYHuSl2XYd_tOtLIq0zg3d1kX3lixX5SpN8yGBw4,82
18
+ bitunix_automated_crypto_trading-3.3.8.dist-info/top_level.txt,sha256=uyFzHUCOsp8elnG2Ovor6xXcf7dxRxY-C-Txiwix64Q,33
19
+ bitunix_automated_crypto_trading-3.3.8.dist-info/RECORD,,