Implement backtesting with fastapi

This commit is contained in:
Matthias
2021-01-02 15:13:32 +01:00
parent df55259737
commit 5c18c8726d
3 changed files with 113 additions and 9 deletions

View File

@@ -313,3 +313,19 @@ class PairHistory(BaseModel):
json_encoders = {
datetime: lambda v: v.strftime(DATETIME_PRINT_FORMAT),
}
class BacktestRequest(BaseModel):
strategy: str
timeframe: Optional[str]
timerange: Optional[str]
max_open_trades: Optional[int]
stake_amount: Optional[int]
class BacktestResponse(BaseModel):
status: str
running: bool
status_msg: str
# TODO: Properly type backtestresult...
backtest_result: Optional[Dict[str, Any]]