openfund-taker 1.3.2__py3-none-any.whl → 1.3.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: openfund-taker
3
- Version: 1.3.2
3
+ Version: 1.3.4
4
4
  Summary: Openfund-taker
5
5
  Requires-Python: >=3.9,<4.0
6
6
  Classifier: Programming Language :: Python :: 3
@@ -1,7 +1,7 @@
1
1
  taker/MultiAssetOldTradingBot.py,sha256=uBh_BxglvcbaHIsWHM7GI9Qa_QjzsxXaXJAAWEOMO5c,15315
2
- taker/ThreeLineTradingBot.py,sha256=oXIoQ8z9AzKzk0z13d0ufj2KGBOk5iHJTJNZQRDKA5U,20625
3
- taker/TrailingSLAndTPTaker.py,sha256=gikp-Yahn4nWYk6PmUB02t8Sun--Fo4I7vDEU4U2uso,1263
4
- taker/TrailingSLTaker.py,sha256=LL6BxJQo6yhkruXRDA0jQMt9K-GxhMZiTmKrWwIuZzo,42277
2
+ taker/ThreeLineTradingTaker.py,sha256=ElD9pKDO4nxw5VKNRrvXqyiU0gkV_1Mg_zk-hftfaPs,20553
3
+ taker/TrailingSLAndTPTaker.py,sha256=rx3tw9TwFCpqnz3e0WlTtFVcn8mBbPHtp62n3RF86Kg,1144
4
+ taker/TrailingSLTaker.py,sha256=og_H02pTmUJISPAsHlLIBmNyTD3DLXuTnOTE-XnkkOY,42598
5
5
  taker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  taker/chua_bitget.py,sha256=YY6XK5Bd-wlArsN5BnAfiqE0h1DPkti6i4TEB4F5zDA,12918
7
7
  taker/chua_bn.py,sha256=GnTePWlgDwdHgroBbEp1Ajcsf5_m_Vn_RV63SYzu2jI,10668
@@ -9,8 +9,8 @@ taker/chua_ok.py,sha256=5pPAoEYbFuKxfZwqNvOO890s-2cy6n69QiI0ZA0GTCQ,12474
9
9
  taker/chua_ok_all.py,sha256=2XnZM6QdB3juSE1pqQIJyh2x1XuhlTlnBKNA3owlJ9E,15267
10
10
  taker/chua_ok_bot.py,sha256=9SW0ujhi6PfN4yR1JZ9NaA37HtnXJ2QAWUfW52NG68w,13109
11
11
  taker/config.py,sha256=YPxghO5i0vgRg9Cja8kGj9O7pgSbbtzOgf3RexqXXwY,1188
12
- taker/main.py,sha256=CYibDo9PEOWbhpSXZ5JTmE-NGJXqDdgvhpadXJNRX60,2557
13
- openfund_taker-1.3.2.dist-info/METADATA,sha256=JG97fvJiR96kRpwabOg1MlIRSTNGoBOX9A2bsymTm94,7527
14
- openfund_taker-1.3.2.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
15
- openfund_taker-1.3.2.dist-info/entry_points.txt,sha256=a7mG8F7aOA5-Gk2vPWuAR4537faxaHUgM_jwIDBZoEc,50
16
- openfund_taker-1.3.2.dist-info/RECORD,,
12
+ taker/main.py,sha256=QCEjINu3IgwWEGcuquHzeYjKJYAQrPe8ctQhMoIb9SA,2561
13
+ openfund_taker-1.3.4.dist-info/METADATA,sha256=pumU5NKxk5BBlZrKwsY2OvWKi_gKSIZ_3yUHcneouz0,7527
14
+ openfund_taker-1.3.4.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
15
+ openfund_taker-1.3.4.dist-info/entry_points.txt,sha256=a7mG8F7aOA5-Gk2vPWuAR4537faxaHUgM_jwIDBZoEc,50
16
+ openfund_taker-1.3.4.dist-info/RECORD,,
@@ -1,14 +1,12 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  import ccxt
3
- from ccxt.base.exchange import Exchange
4
- from ccxt.base.types import Order
5
3
  import time
6
4
  import logging
7
5
  import requests
8
6
  from logging.handlers import TimedRotatingFileHandler
9
7
 
10
8
 
11
- class ThreeLineTradingBot:
9
+ class ThreeLineTradingTaker:
12
10
  def __init__(self, config, feishu_webhook=None, monitor_interval=60):
13
11
  self.stop_loss_pct = config["all_stop_loss_pct"] # 全局止损百分比
14
12
 
@@ -1,10 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- import ccxt
3
- import time
4
- import requests
5
- import traceback
6
- import pandas as pd
7
- import talib as ta
1
+
8
2
  from taker.TrailingSLTaker import TrailingSLTaker
9
3
  '''
10
4
  自动设置移动止损单
taker/TrailingSLTaker.py CHANGED
@@ -52,6 +52,9 @@ class TrailingSLTaker:
52
52
  })
53
53
  self.logger = logger
54
54
  self.position_mode = self.get_position_mode() # 获取持仓模式
55
+
56
+ def get_pair_config(self,symbol):
57
+ return self.trading_pairs_config.get(symbol,{})
55
58
  # 获取市场信息
56
59
  def getMarket(self,symbol):
57
60
  self.exchange.load_markets()
@@ -788,9 +791,9 @@ class TrailingSLTaker:
788
791
  self.check_reverse_position(symbol=symbol, position=position, pair_config=pair_config)
789
792
 
790
793
  # 检查止损是否触发止盈
791
- if self.check_stop_loss_trigger(symbol, position):
792
- self.close_all_positions(symbol=symbol, position=position)
793
- return
794
+ # if self.check_stop_loss_trigger(symbol, position):
795
+ # self.close_all_positions(symbol=symbol, position=position)
796
+ # return
794
797
 
795
798
 
796
799
  def check_total_profit(self, symbol, position):
@@ -832,17 +835,17 @@ class TrailingSLTaker:
832
835
 
833
836
  '''
834
837
  # 各档止盈逻辑
835
-
836
- # 根据不同档位设置止损价格和通知
838
+ pair_config = self.get_pair_config(symbol)
839
+ # 根据不同档位设置止损价格,没有单独为交易对设置,用全局参数代替
837
840
  tier_config = {
838
841
  "低档": {
839
- "stop_loss_pct": float(self.low_trail_stop_loss_pct)
842
+ "stop_loss_pct": float(pair_config.get('low_trail_stop_loss_pct',self.low_trail_stop_loss_pct))
840
843
  },
841
844
  "中档": {
842
- "stop_loss_pct": float(self.trail_stop_loss_pct)
845
+ "stop_loss_pct": float(pair_config.get('trail_stop_loss_pct',self.trail_stop_loss_pct))
843
846
  },
844
847
  "高档": {
845
- "stop_loss_pct": float(self.higher_trail_stop_loss_pct)
848
+ "stop_loss_pct": float(pair_config.get('higher_trail_stop_loss_pct',self.higher_trail_stop_loss_pct))
846
849
  }
847
850
  }
848
851
 
taker/main.py CHANGED
@@ -4,7 +4,7 @@ from logging.handlers import TimedRotatingFileHandler
4
4
 
5
5
  from taker.TrailingSLTaker import TrailingSLTaker
6
6
  from taker.TrailingSLAndTPTaker import TrailingSLAndTPTaker
7
- from taker.ThreeLineTradingBot import ThreeLineTradingBot
7
+ from taker.ThreeLineTradingTaker import ThreeLineTradingTaker
8
8
 
9
9
  def build_logger(log_config) -> logging.Logger:
10
10
  # 配置日志