Skip to content

Commit

Permalink
Fix Sim Sell messages and additional Market checks
Browse files Browse the repository at this point in the history
Sim Sell messages were showing 0 and modified one more section for checking valid market to allow new base symbols.
  • Loading branch information
chriskoepf committed Dec 7, 2021
1 parent f9588ba commit 95ac705
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions models/TradingAccount.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ def _checkMarketSyntax(self, market):
market to check
"""
if self.app.getExchange() == Exchange.COINBASEPRO and market != "":
p = re.compile(r"^[1-9A-Z]{2,5}\-[1-9A-Z]{2,5}$")
p = re.compile(r"^[0-9A-Z]{1,10}\-[1-9A-Z]{2,5}$")
if not p.match(market):
raise TypeError("Coinbase Pro market is invalid.")
elif self.app.getExchange() == Exchange.BINANCE:
p = re.compile(r"^[1-9A-Z]{5,12}$")
p = re.compile(r"^[0-9A-Z]{4,17}$")
if not p.match(market):
raise TypeError("Binance market is invalid.")
elif self.app.getExchange() == Exchange.KUCOIN:
p = re.compile(r"^[1-9A-Z]{2,5}\-[1-9A-Z]{2,5}$")
p = re.compile(r"^[0-9A-Z]{1,10}\-[1-9A-Z]{2,5}$")
if not p.match(market):
raise TypeError("Kucoin market is invalid.")

Expand Down
4 changes: 2 additions & 2 deletions pycryptobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ def executeJob(

if (
_app.getExchange() == Exchange.COINBASEPRO
or _app.getExchange() == Exchange.COINBASEPRO
or _app.getExchange() == Exchange.KUCOIN
):
if _state.last_buy_fee != exchange_last_buy["fee"]:
_state.last_buy_fee = exchange_last_buy["fee"]
Expand Down Expand Up @@ -1425,7 +1425,7 @@ def executeJob(
+ ") "
+ str(current_sim_date)
+ "\n - TEST SELL at "
+ str(_truncate(price_text, 4))
+ str(price_text)
+ " (margin: "
+ margin_text
+ ", delta: "
Expand Down

0 comments on commit 95ac705

Please sign in to comment.