contango.trading.analysis.graphing.underwater_drawdown
contango.trading.analysis.graphing.underwater_drawdown
UnderwaterDrawdown
UnderwaterDrawdown(config: C)
Bases: GraphType[UnderwaterDrawdownConfig]
A graph type that shows drawdown-from-peak over time for a shortlist of experiments.
Source code in src\contango\trading\analysis\graph_type.py
26 27 28 29 30 31 32 33 | |
build
build(df: DataFrame) -> go.Figure
Builds an underwater plot (drawdown-from-peak over time) for a shortlist of experiments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
The experiment DataFrame. |
required |
Returns:
| Type | Description |
|---|---|
Figure
|
A plotly Figure. |
Source code in src\contango\trading\analysis\graphing\underwater_drawdown.py
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 | |
UnderwaterDrawdownConfig
dataclass
UnderwaterDrawdownConfig(experiment_ids: list[str] | None = None, top_n: int = 8, rank_by: str = 'calmar_ratio', max_points_per_curve: int = 1500)
Bases: GraphConfig
A graph configuration specific to the underwater drawdown graph.
Attributes:
| Name | Type | Description |
|---|---|---|
experiment_ids |
list[str] | None
|
The list of experiment_id values to plot. |
top_n |
int
|
The top amount of experiments to plot when auto-ranking. |
rank_by |
str
|
The name for the targeted metric to rank by when auto-selecting the shortlist. |
max_points_per_curve |
int
|
The maximum amount of points kept per curve after downsampling. |