mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
add entries, exits, and mix_tags API endpoints
This commit is contained in:
parent
e728e3bc75
commit
da3c42bbbc
|
@ -141,6 +141,9 @@ python3 scripts/rest_client.py --config rest_config.json <command> [optional par
|
||||||
| `logs` | Shows last log messages.
|
| `logs` | Shows last log messages.
|
||||||
| `status` | Lists all open trades.
|
| `status` | Lists all open trades.
|
||||||
| `count` | Displays number of trades used and available.
|
| `count` | Displays number of trades used and available.
|
||||||
|
| `entries [pair]` | Shows profit statistics for each enter tags for given pair (or all pairs if pair isn't given). Pair is optional.
|
||||||
|
| `exits [pair]` | Shows profit statistics for each 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.
|
||||||
| `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.
|
||||||
|
|
|
@ -82,6 +82,17 @@ def balance(rpc: RPC = Depends(get_rpc), config=Depends(get_config)):
|
||||||
def count(rpc: RPC = Depends(get_rpc)):
|
def count(rpc: RPC = Depends(get_rpc)):
|
||||||
return rpc._rpc_count()
|
return rpc._rpc_count()
|
||||||
|
|
||||||
|
@router.get('/entries', tags=['info', 'trading'])
|
||||||
|
def entries(pair: Optional[str] = None, rpc: RPC = Depends(get_rpc)):
|
||||||
|
return rpc._rpc_enter_tag_performance(pair)
|
||||||
|
|
||||||
|
@router.get('/exits', tags=['info', 'trading'])
|
||||||
|
def exits(pair: Optional[str] = None, rpc: RPC = Depends(get_rpc)):
|
||||||
|
return rpc._rpc_exit_reason_performance(pair)
|
||||||
|
|
||||||
|
@router.get('/mix_tags', tags=['info', 'trading'])
|
||||||
|
def mix_tags(pair: Optional[str] = None, rpc: RPC = Depends(get_rpc)):
|
||||||
|
return rpc._rpc_mix_tag_performance(pair)
|
||||||
|
|
||||||
@router.get('/performance', response_model=List[PerformanceEntry], tags=['info'])
|
@router.get('/performance', response_model=List[PerformanceEntry], tags=['info'])
|
||||||
def performance(rpc: RPC = Depends(get_rpc)):
|
def performance(rpc: RPC = Depends(get_rpc)):
|
||||||
|
|
|
@ -112,6 +112,30 @@ class FtRestClient:
|
||||||
"""
|
"""
|
||||||
return self._get("count")
|
return self._get("count")
|
||||||
|
|
||||||
|
def entries(self, pair=None):
|
||||||
|
"""Returns List of dicts containing all Trades, based on buy tag performance
|
||||||
|
Can either be average for all pairs or a specific pair provided
|
||||||
|
|
||||||
|
:return: json object
|
||||||
|
"""
|
||||||
|
return self._get("entries", params={"pair": pair} if pair else None)
|
||||||
|
|
||||||
|
def exits(self, pair=None):
|
||||||
|
"""Returns List of dicts containing all Trades, based on exit reason performance
|
||||||
|
Can either be average for all pairs or a specific pair provided
|
||||||
|
|
||||||
|
:return: json object
|
||||||
|
"""
|
||||||
|
return self._get("exits", params={"pair": pair} if pair else None)
|
||||||
|
|
||||||
|
def mix_tags(self, pair=None):
|
||||||
|
"""Returns List of dicts containing all Trades, based on entry_tag + exit_reason performance
|
||||||
|
Can either be average for all pairs or a specific pair provided
|
||||||
|
|
||||||
|
:return: json object
|
||||||
|
"""
|
||||||
|
return self._get("mix_tags", params={"pair": pair} if pair else None)
|
||||||
|
|
||||||
def locks(self):
|
def locks(self):
|
||||||
"""Return current locks
|
"""Return current locks
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user