mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-09-20 01:21:11 +00:00
Add locks_add to rest api client
This commit is contained in:
parent
f4074d2960
commit
ad06f93501
|
@ -166,6 +166,7 @@ freqtrade-client --config rest_config.json <command> [optional parameters]
|
||||||
| `mix_tags [pair]` | Shows profit statistics for each combinations of enter tag + exit reasons for given pair (or all pairs if pair isn't given). Pair is optional.
|
| `mix_tags [pair]` | Shows profit statistics for each combinations of enter tag + exit reasons for given pair (or all pairs if pair isn't given). Pair is optional.
|
||||||
| `locks` | Displays currently locked pairs.
|
| `locks` | Displays currently locked pairs.
|
||||||
| `delete_lock <lock_id>` | Deletes (disables) the lock by id.
|
| `delete_lock <lock_id>` | Deletes (disables) the lock by id.
|
||||||
|
| `locks add <pair>, <until>, [side], [reason]` | Locks a pair until "until". (Until will be rounded up to the nearest timeframe).
|
||||||
| `profit` | Display a summary of your profit/loss from close trades and some stats about your performance.
|
| `profit` | Display a summary of your profit/loss from close trades and some stats about your performance.
|
||||||
| `forceexit <trade_id>` | Instantly exits the given trade (Ignoring `minimum_roi`).
|
| `forceexit <trade_id>` | Instantly exits the given trade (Ignoring `minimum_roi`).
|
||||||
| `forceexit all` | Instantly exits all open trades (Ignoring `minimum_roi`).
|
| `forceexit all` | Instantly exits all open trades (Ignoring `minimum_roi`).
|
||||||
|
|
|
@ -148,6 +148,25 @@ class FtRestClient:
|
||||||
"""
|
"""
|
||||||
return self._delete(f"locks/{lock_id}")
|
return self._delete(f"locks/{lock_id}")
|
||||||
|
|
||||||
|
def lock_add(self, pair: str, until: str, side: str = '*', reason: str = ''):
|
||||||
|
"""Lock pair
|
||||||
|
|
||||||
|
:param pair: Pair to lock
|
||||||
|
:param until: Lock until this date (format "2024-03-30 16:00:00Z")
|
||||||
|
:param side: Side to lock (long, short, *)
|
||||||
|
:param reason: Reason for the lock
|
||||||
|
:return: json object
|
||||||
|
"""
|
||||||
|
data = [
|
||||||
|
{
|
||||||
|
"pair": pair,
|
||||||
|
"until": until,
|
||||||
|
"side": side,
|
||||||
|
"reason": reason
|
||||||
|
}
|
||||||
|
]
|
||||||
|
return self._post("locks", data=data)
|
||||||
|
|
||||||
def daily(self, days=None):
|
def daily(self, days=None):
|
||||||
"""Return the profits for each day, and amount of trades.
|
"""Return the profits for each day, and amount of trades.
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,7 @@ def test_FtRestClient_call_invalid(caplog):
|
||||||
('exits', []),
|
('exits', []),
|
||||||
('mix_tags', []),
|
('mix_tags', []),
|
||||||
('locks', []),
|
('locks', []),
|
||||||
|
('lock_add', ["XRP/USDT", '2024-01-01 20:00:00Z', '*', 'rand']),
|
||||||
('delete_lock', [2]),
|
('delete_lock', [2]),
|
||||||
('daily', []),
|
('daily', []),
|
||||||
('daily', [15]),
|
('daily', [15]),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user