This commit is contained in:
parent
130b1232c6
commit
a43884f472
|
|
@ -95,7 +95,7 @@ class Broker:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
||||||
def get_symbol(self,pair):
|
def get_symbol(self,pair: str):
|
||||||
if "/" in pair:
|
if "/" in pair:
|
||||||
return pair
|
return pair
|
||||||
for item in self.markets:
|
for item in self.markets:
|
||||||
|
|
@ -118,7 +118,7 @@ class Broker:
|
||||||
return {}
|
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.
|
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.
|
Returns True if the market is valid, False otherwise.
|
||||||
|
|
@ -144,7 +144,7 @@ class Broker:
|
||||||
return 1
|
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
|
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):
|
def remove_pair_from_config(self, pair: str):
|
||||||
try:
|
try:
|
||||||
if pair in self.broker_config["pairs"]:
|
symbol = pair.replace("/","")
|
||||||
self.broker_config["pairs"].remove(pair.replace("/",""))
|
if symbol in self.broker_config["pairs"]:
|
||||||
|
self.broker_config["pairs"].remove(symbol)
|
||||||
return 0
|
return 0
|
||||||
self.logger.log_this("Pair does not exist - Can't remove from read_config",1,pair)
|
self.logger.log_this("Pair does not exist - Can't remove from read_config",1,pair)
|
||||||
return 2
|
return 2
|
||||||
|
|
@ -359,7 +360,7 @@ class Broker:
|
||||||
return 1
|
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
|
Returns the complete orderbook
|
||||||
'''
|
'''
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue