Add test and formatting to drawdown
This commit is contained in:
@@ -190,7 +190,7 @@ def create_cum_profit(df: pd.DataFrame, trades: pd.DataFrame, col_name: str,
|
||||
return df
|
||||
|
||||
|
||||
def calculate_max_drawdown(trades: pd.DataFrame, date_col: str = 'close_time',
|
||||
def calculate_max_drawdown(trades: pd.DataFrame, *, date_col: str = 'close_time',
|
||||
value_col: str = 'profitperc'
|
||||
) -> Tuple[float, pd.Timestamp, pd.Timestamp]:
|
||||
"""
|
||||
|
@@ -126,8 +126,8 @@ def add_max_drawdown(fig, row, trades: pd.DataFrame, df_comb: pd.DataFrame) -> m
|
||||
df_comb.loc[lowdate, 'cum_profit'],
|
||||
],
|
||||
mode='markers',
|
||||
name='Max Drawdown',
|
||||
text=f"Max drawdown {max_drawdown}",
|
||||
name=f"Max drawdown {max_drawdown:.2f}%",
|
||||
text=f"Max drawdown {max_drawdown:.2f}%",
|
||||
marker=dict(
|
||||
symbol='square-open',
|
||||
size=9,
|
||||
|
Reference in New Issue
Block a user