add /trade endpoint to rest_client script

This commit is contained in:
Matthias 2021-04-16 19:42:13 +02:00
parent aeb81f90ff
commit 5c579613e1
2 changed files with 18 additions and 6 deletions

View File

@ -235,6 +235,9 @@ pair_history
performance performance
Return the performance of the different coins. Return the performance of the different coins.
ping
simple ping
plot_config plot_config
Return plot configuration if the strategy defines one. Return plot configuration if the strategy defines one.
@ -271,15 +274,16 @@ strategy
:param strategy: Strategy class name :param strategy: Strategy class name
trade
Return specific trade
:param trade_id: Specify which trade to get.
trades trades
Return trades history. Return trades history.
:param limit: Limits trades to the X last trades. No limit to get all the trades. :param limit: Limits trades to the X last trades. No limit to get all the trades.
trade
Return specific trade.
:param tradeid: Specify which trade to get.
version version
Return the version of the bot. Return the version of the bot.

View File

@ -127,7 +127,7 @@ class FtRestClient():
return self._delete("locks/{}".format(lock_id)) return self._delete("locks/{}".format(lock_id))
def daily(self, days=None): def daily(self, days=None):
"""Return the amount of open trades. """Return the profits for each day, and amount of trades.
:return: json object :return: json object
""" """
@ -195,7 +195,7 @@ class FtRestClient():
def logs(self, limit=None): def logs(self, limit=None):
"""Show latest logs. """Show latest logs.
:param limit: Limits log messages to the last <limit> logs. No limit to get all the trades. :param limit: Limits log messages to the last <limit> logs. No limit to get the entire log.
:return: json object :return: json object
""" """
return self._get("logs", params={"limit": limit} if limit else 0) return self._get("logs", params={"limit": limit} if limit else 0)
@ -208,6 +208,14 @@ class FtRestClient():
""" """
return self._get("trades", params={"limit": limit} if limit else 0) return self._get("trades", params={"limit": limit} if limit else 0)
def trade(self, trade_id):
"""Return specific trade
:param trade_id: Specify which trade to get.
:return: json object
"""
return self._get("trade/{}".format(trade_id))
def delete_trade(self, trade_id): def delete_trade(self, trade_id):
"""Delete trade from the database. """Delete trade from the database.
Tries to close open orders. Requires manual handling of this asset on the exchange. Tries to close open orders. Requires manual handling of this asset on the exchange.