trading.analyzer.data.analyze_and_graph
trading.analyzer.data.analyze_and_graph
generate_report
generate_report(results: list[BacktestExperimentResult], output_dir: str, rank_metric: str = 'calmar_ratio', shortlist_size: int = 8, max_traces: int = 40) -> None
Runs the full analysis flow and writes one HTML file per chart into output_dir.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
results
|
list[BacktestExperimentResult]
|
The list of BacktestExperimentResult from ResearchRunner.run(config). |
required |
output_dir
|
str
|
Directory to write the HTML files into (created if missing). |
required |
rank_metric
|
str
|
Metric used to rank/shortlist experiments throughout (charts 1 color, 4/5 selection, 7 selection). Defaults to "calmar_ratio" since it's risk-adjusted. |
'calmar_ratio'
|
shortlist_size
|
int
|
Number of experiments to show in the equity curve overlay (chart 4) and underwater plot (chart 5). |
8
|
max_traces
|
int
|
Number of traces (maximum amount of graphs) for all sliders. |
40
|
Source code in src\contango\trading\analyzer\data\analyze_and_graph.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |