Bläddra i källkod

去除私有ip检测,本地可调试。

skyfffire 2 år sedan
förälder
incheckning
45df714efc
4 ändrade filer med 17 tillägg och 15 borttagningar
  1. 2 1
      .gitignore
  2. 12 11
      config.toml
  3. 2 2
      quant.py
  4. 1 1
      utils.py

+ 2 - 1
.gitignore

@@ -1,2 +1,3 @@
 .idea
-/venv
+/venv
+*.log

+ 12 - 11
config.toml

@@ -1,20 +1,18 @@
-broker_id = ""
-account_name = "test_account_001"
-access_key = "B5261D7FB987478FA47E14F00C4A653B"
-secret_key = "CAF69F5A23DE0EA32B7B15777AF47609C61B1EB17E5AC203"
+broker_id = "gate"
+account_name = "gate_account"
+access_key = ""
+secret_key = ""
 pass_key = ""
-exchange = "coinex_usdt_swap"
-pair = "rose_usdt"
+exchange = "gate_usdt_swap"
+pair = "hifi_usdt"
 debug = "False"
 open = 0.001
 close = 0.0002
-server_port = 8003
-leverrate = "1.0"
+leverrate = 1.0
 interval = 0.1
 refexchange = "['binance_usdt_swap']"
-refpair = "['rose_usdt']"
-webhook = ""
-used_pct = "0.9"
+refpair = "['hifi_usdt']"
+used_pct = 0.9
 index = 0
 save = 0
 hold_coin = 0.0
@@ -22,5 +20,8 @@ log = 1
 stoploss = "0.02"
 gamma = 0.999
 grid = 1
+place_order_limit = 0
+colo = 0
+proxy = 'socks5://127.0.0.1:7890'
 ip = 0
 backtest = 0

+ 2 - 2
quant.py

@@ -152,8 +152,8 @@ class Quant:
         # 服务器私有ip地址检查
         ipList = utils.get_local_ip_list()
         ipListNum = len(ipList)
-        if int(self.params.ip) >= ipListNum:
-            raise Exception("指定私有ip地址序号不存在")
+        # if int(self.params.ip) >= ipListNum:
+        #     raise Exception("指定私有ip地址序号不存在")
         # 用于创建ws实例
         name = self.exchange+'@'+self.params.pair
         self.trade_name = name

+ 1 - 1
utils.py

@@ -475,7 +475,7 @@ def get_local_ip_list():
                 if ip not in ipList:
                     ipList.append(ip)
     print(f"当前服务器私有ip为{ipList}")
-    return ipList
+    return ['127.0.0.1']
     
 if __name__ == "__main__":