mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Add trade count to progress
This commit is contained in:
parent
048008756f
commit
37b15e830a
|
@ -331,5 +331,6 @@ class BacktestResponse(BaseModel):
|
|||
status_msg: str
|
||||
step: str
|
||||
progress: float
|
||||
trade_count: Optional[float]
|
||||
# TODO: Properly type backtestresult...
|
||||
backtest_result: Optional[Dict[str, Any]]
|
||||
|
|
|
@ -339,12 +339,14 @@ def api_get_backtest():
|
|||
Get backtesting result.
|
||||
Returns Result after backtesting has been ran.
|
||||
"""
|
||||
from freqtrade.persistence import Trade
|
||||
if ApiServer._bgtask_running:
|
||||
return {
|
||||
"status": "running",
|
||||
"running": True,
|
||||
"step": ApiServer._bt.get_action() if ApiServer._bt else str(BacktestState.STARTUP),
|
||||
"progress": ApiServer._bt.get_progress() if ApiServer._bt else 0,
|
||||
"trade_count": Trade.get_trades_proxy(is_open=False),
|
||||
"status_msg": "Backtest running",
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user