Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
M1ch43lV committed Apr 15, 2022
2 parents 0b18535 + 7bfc04b commit deb3938
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 29 deletions.
18 changes: 6 additions & 12 deletions signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ def topcoin(self, pairs, rank, volume, exchange, trademarket):
):
self.logging.info(
str(pair)
+ " ranked "
+ " is ranked #"
+ str(symbol["market_cap_rank"])
+ " and passed marketcap filter of <= "
+ " and has passed marketcap filter minimum of #"
+ str(rank)
)
# Check if topcoin has enough volume
Expand All @@ -197,24 +197,18 @@ def topcoin(self, pairs, rank, volume, exchange, trademarket):
):
self.logging.info(
str(pairs)
+ " ranked "
+ " is ranked #"
+ str(symbol["market_cap_rank"])
+ " passed marketcap filter"
+ " and has passed marketcap filter minimum of #"
+ str(rank)
)
# Check if topcoin has enough volume
if self.topvolume(symbol["id"], volume, exchange, trademarket):
pairlist = pairs
break

if not pairlist:
self.logging.info(
str(pairs)
+ " ranked "
+ str(symbol["market_cap_rank"])
+ " in marketcap not under the top "
+ str(rank)
+ " coins"
)
self.logging.info(str(pairs) + " did not match the topcoin filter criteria")
else:
if isinstance(pairlist, str):
self.logging.info(str(pairlist) + " matching top coin filter criteria")
Expand Down
36 changes: 19 additions & 17 deletions singlebot.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ def __init__(self, tg_data, bot_data, account_data, attributes, p3cw, logging):
self.prefix = self.attributes.get("prefix")
self.subprefix = self.attributes.get("subprefix")
self.suffix = self.attributes.get("suffix")
self.bot_name = (
self.prefix
+ "_"
+ self.subprefix
+ "_"
+ self.attributes.get("market")
+ "(.*)"
+ "_"
+ self.suffix
)

def strategy(self):
if self.attributes.get("deal_mode", "signal") == "signal":
Expand All @@ -42,7 +52,7 @@ def deal_count(self):
action="",
action_id=account["id"],
additional_headers={"Forced-Mode": self.attributes.get("trade_mode")},
payload={"limit": 1000, "scope": "active"},
payload={"limit": 1000, "scope": "active", "account_id": account["id"]},
)

if error:
Expand All @@ -53,13 +63,7 @@ def deal_count(self):
return self.attributes.get("single_count")
else:
for deal in data:
if (
self.prefix
+ "_"
+ self.subprefix
+ "_"
+ self.attributes.get("market")
) in deal["bot_name"]:
if re.search(self.bot_name, deal["bot_name"]):
deals.append(deal["bot_name"])

self.logging.debug(str(deals))
Expand All @@ -72,9 +76,7 @@ def bot_count(self):
bots = []

for bot in self.bot_data:
if (
self.prefix + "_" + self.subprefix + "_" + self.attributes.get("market")
) in bot["name"] and bot["is_enabled"]:
if re.search(self.bot_name, bot["name"]) and bot["is_enabled"]:
bots.append(bot["name"])

self.logging.info("Enabled single bot count: " + str(len(bots)))
Expand Down Expand Up @@ -298,17 +300,17 @@ def trigger(self):
+ str(self.tg_data["pair"])
+ " is not in the top coin list - not added!"
)
else:
self.logging.info(
"Maximum bots/deals reached. Bot with pair: "
+ pair
+ " not added."
)

elif self.tg_data["action"] == "STOP":
self.logging.info(
"Stop command on a non-existing single bot with pair: " + pair
)
else:
self.logging.info(
"Maximum bots/deals reached. Bot with pair: "
+ pair
+ " not added."
)
else:
self.logging.debug("Pair: " + pair)
self.logging.debug("Bot-Name: " + bot["name"])
Expand Down

0 comments on commit deb3938

Please sign in to comment.