mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-13 03:33:55 +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
|
status_msg: str
|
||||||
step: str
|
step: str
|
||||||
progress: float
|
progress: float
|
||||||
|
trade_count: Optional[float]
|
||||||
# TODO: Properly type backtestresult...
|
# TODO: Properly type backtestresult...
|
||||||
backtest_result: Optional[Dict[str, Any]]
|
backtest_result: Optional[Dict[str, Any]]
|
||||||
|
|
|
@ -339,12 +339,14 @@ def api_get_backtest():
|
||||||
Get backtesting result.
|
Get backtesting result.
|
||||||
Returns Result after backtesting has been ran.
|
Returns Result after backtesting has been ran.
|
||||||
"""
|
"""
|
||||||
|
from freqtrade.persistence import Trade
|
||||||
if ApiServer._bgtask_running:
|
if ApiServer._bgtask_running:
|
||||||
return {
|
return {
|
||||||
"status": "running",
|
"status": "running",
|
||||||
"running": True,
|
"running": True,
|
||||||
"step": ApiServer._bt.get_action() if ApiServer._bt else str(BacktestState.STARTUP),
|
"step": ApiServer._bt.get_action() if ApiServer._bt else str(BacktestState.STARTUP),
|
||||||
"progress": ApiServer._bt.get_progress() if ApiServer._bt else 0,
|
"progress": ApiServer._bt.get_progress() if ApiServer._bt else 0,
|
||||||
|
"trade_count": Trade.get_trades_proxy(is_open=False),
|
||||||
"status_msg": "Backtest running",
|
"status_msg": "Backtest running",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user