Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Absolute Value Maximum Drawdown #1154

Closed
Tupolev-Tu-22 opened this issue Jul 3, 2024 · 1 comment
Closed

Absolute Value Maximum Drawdown #1154

Tupolev-Tu-22 opened this issue Jul 3, 2024 · 1 comment

Comments

@Tupolev-Tu-22
Copy link

How can I get the absolute value of the Maximum Drawdown for my optimisation? I want to maximise the Reward to Risk Ratio (RRR) which is the Net Profit divided by the Maximum Drawdown.

@Tupolev-Tu-22
Copy link
Author

Nvm I calculated the MDD by using the _equity_curve output:

equity = series._equity_curve["Equity"]
max_peak = equity.iloc[0]
max_drawdown = 0

for value in equity:
      if value > max_peak:
          max_peak = value
      drawdown = max_peak - value
      if drawdown > max_drawdown:
          max_drawdown = drawdown

print(max_drawdown)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant