Skip to content

Commit

Permalink
Also copy leverage params during a bot update.
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberjunky committed Nov 26, 2021
1 parent bab6279 commit e55f304
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
17 changes: 12 additions & 5 deletions altrank.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,11 @@ def get_lunarcrush_data():
def load_tickerlist(exchange):
"""Return tickerlist for exchange."""

if "binance" in exchange.lower() or "paper account" in exchange.lower() or MODE == "paper":
if (
"binance" in exchange.lower()
or "paper account" in exchange.lower()
or MODE == "paper"
):
return get_threecommas_market("binance")

if "ftx" in exchange.lower():
Expand Down Expand Up @@ -481,8 +485,7 @@ def find_pairs(thebot):
logger.debug("These pairs are blacklisted and were skipped: %s" % blackpairs)

logger.debug(
"These pairs are invalid on '%s' and were skipped: %s"
% (exchange, badpairs)
"These pairs are invalid on '%s' and were skipped: %s" % (exchange, badpairs)
)

if not newpairs:
Expand Down Expand Up @@ -532,6 +535,8 @@ def update_bot(thebot, newpairs):
),
"take_profit_type": thebot["take_profit_type"],
"strategy_list": thebot["strategy_list"],
"leverage_type": thebot["leverage_type"],
"leverage_custom_value": thebot["leverage_custom_value"],
"bot_id": int(thebot["id"]),
},
)
Expand Down Expand Up @@ -587,8 +592,10 @@ def update_bot(thebot, newpairs):
sys.exit(0)
else:
# Handle timezone
if hasattr(time, 'tzset'):
os.environ["TZ"] = config.get("settings", "timezone", fallback="Europe/Amsterdam")
if hasattr(time, "tzset"):
os.environ["TZ"] = config.get(
"settings", "timezone", fallback="Europe/Amsterdam"
)
time.tzset()

# Init notification handler
Expand Down
17 changes: 12 additions & 5 deletions galaxyscore.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,11 @@ def get_lunarcrush_data():
def load_tickerlist(exchange):
"""Return tickerlist for exchange."""

if "binance" in exchange.lower() or "paper account" in exchange.lower() or MODE == "paper":
if (
"binance" in exchange.lower()
or "paper account" in exchange.lower()
or MODE == "paper"
):
return get_threecommas_market("binance")

if "ftx" in exchange.lower():
Expand Down Expand Up @@ -481,8 +485,7 @@ def find_pairs(thebot):
logger.debug("These pairs are blacklisted and were skipped: %s" % blackpairs)

logger.debug(
"These pairs are invalid on '%s' and were skipped: %s"
% (exchange, badpairs)
"These pairs are invalid on '%s' and were skipped: %s" % (exchange, badpairs)
)

if not newpairs:
Expand Down Expand Up @@ -532,6 +535,8 @@ def update_bot(thebot, newpairs):
),
"take_profit_type": thebot["take_profit_type"],
"strategy_list": thebot["strategy_list"],
"leverage_type": thebot["leverage_type"],
"leverage_custom_value": thebot["leverage_custom_value"],
"bot_id": int(thebot["id"]),
},
)
Expand Down Expand Up @@ -587,8 +592,10 @@ def update_bot(thebot, newpairs):
sys.exit(0)
else:
# Handle timezone
if hasattr(time, 'tzset'):
os.environ["TZ"] = config.get("settings", "timezone", fallback="Europe/Amsterdam")
if hasattr(time, "tzset"):
os.environ["TZ"] = config.get(
"settings", "timezone", fallback="Europe/Amsterdam"
)
time.tzset()

# Init notification handler
Expand Down

0 comments on commit e55f304

Please sign in to comment.