This commit is contained in:
Nicolás Sánchez 2026-06-03 19:45:16 -03:00
parent 130b1232c6
commit a43884f472
1 changed files with 7 additions and 6 deletions

View File

@ -95,7 +95,7 @@ class Broker:
return 0
def get_symbol(self,pair):
def get_symbol(self,pair: str):
if "/" in pair:
return pair
for item in self.markets:
@ -118,7 +118,7 @@ class Broker:
return {}
def validate_market(self,symbol):
def validate_market(self,symbol:str):
'''
Checks that the market for the symbol exists, that it's a spot market and that it's active.
Returns True if the market is valid, False otherwise.
@ -144,7 +144,7 @@ class Broker:
return 1
def get_trades_timestamps(self,pair,timespan,no_retries=False):
def get_trades_timestamps(self,pair:str ,timespan:int,no_retries=False):
'''
Returns the timestamps of the last trades from the database for the boosting algorithm
'''
@ -314,8 +314,9 @@ class Broker:
def remove_pair_from_config(self, pair: str):
try:
if pair in self.broker_config["pairs"]:
self.broker_config["pairs"].remove(pair.replace("/",""))
symbol = pair.replace("/","")
if symbol in self.broker_config["pairs"]:
self.broker_config["pairs"].remove(symbol)
return 0
self.logger.log_this("Pair does not exist - Can't remove from read_config",1,pair)
return 2
@ -359,7 +360,7 @@ class Broker:
return 1
def get_order_book(self,symbol,no_retries=False):
def get_order_book(self,symbol: str,no_retries=False):
'''
Returns the complete orderbook
'''