feat: add PDF report generation for backtest executions

- Implemented `generate_backtest_report` to create PDF reports for backtest results.
- Added `report_file` field to `StrategyExecution` for storing report paths.
- Introduced `/executions/<execution_id>/report/` endpoint for downloading reports.
- Enhanced backtesting flow to generate and save reports upon completion.
- Updated dependencies to include `matplotlib` for report generation.
This commit is contained in:
2026-02-08 14:39:23 +09:00
parent 0d7574e3c9
commit 940d9bfe6e
7 changed files with 222 additions and 6 deletions

View File

@@ -78,6 +78,8 @@ class StrategyExecution(models.Model):
callback_sent_at = models.DateTimeField(null=True, blank=True, help_text="콜백 전송 일시")
callback_response = models.JSONField(null=True, blank=True, help_text="콜백 응답 데이터")
report_file = models.CharField(max_length=500, blank=True, help_text="생성된 PDF 리포트 파일 경로")
def __str__(self):
return f"Execution of {self.strategy_version} - {self.status}"