Add forcebuy and forcesell

This commit is contained in:
Matthias
2019-04-26 12:50:13 +02:00
parent bc4342b2d0
commit 6e4b159611
2 changed files with 44 additions and 2 deletions

View File

@@ -167,6 +167,27 @@ class FtRestClient():
else:
return self._post("blacklist", data={"blacklist": args})
def forcebuy(self, pair, price=None):
"""
Buy an asset
:param pair: Pair to buy (ETH/BTC)
:param price: Optional - price to buy
:returns: json object of the trade
"""
data = {"pair": pair,
"price": price
}
return self._post("forcebuy", data=data)
def forcesell(self, tradeid):
"""
Force-sell a trade
:param tradeid: Id of the trade (can be received via status command)
:returns: json object
"""
return self._post("forcesell", data={"tradeid": tradeid})
def add_arguments():
parser = argparse.ArgumentParser()