Skip to content

Commit

Permalink
default leverage is loaded from config
Browse files Browse the repository at this point in the history
  • Loading branch information
enarjord committed May 4, 2024
1 parent 9e62372 commit 97eb4b4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions passivbot_multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ def set_live_configs(self):
logging.error(f"failed to apply universal_live_config {e}")
raise Exception(f"no usable live config found for {symbol}")
for symbol in self.live_configs:
if symbol not in self.flags or self.flags[symbol].leverage is None:
self.live_configs[symbol]["leverage"] = 10.0
else:
if symbol in self.flags and self.flags[symbol].leverage is not None:
self.live_configs[symbol]["leverage"] = max(1.0, float(self.flags[symbol].leverage))
else:
self.live_configs[symbol]["leverage"] = max(1.0, float(self.config["leverage"]))

for pside in ["long", "short"]:
# disable timed AU and set backwards TP
Expand Down Expand Up @@ -417,8 +417,8 @@ async def init_flags(self):
def is_old_enough(self, symbol):
if self.forager_mode and self.config["minimum_market_age_days"] > 0:
if symbol in self.first_timestamps:
#res = utc_ms() - self.first_timestamps[symbol] > self.config["minimum_market_age_millis"]
#logging.info(f"{symbol} {res}")
# res = utc_ms() - self.first_timestamps[symbol] > self.config["minimum_market_age_millis"]
# logging.info(f"{symbol} {res}")
return (
utc_ms() - self.first_timestamps[symbol]
> self.config["minimum_market_age_millis"]
Expand Down

0 comments on commit 97eb4b4

Please sign in to comment.