Show Max DrawDawn in a given period

Hi,
In order to be able to calculate the Risk in our strategies is fundamental to know the Max. DrawDawn and QA gives us this value. However it would be very interesting to have Maximum Drawdawn in a given period. For instance; I want to know the Max. Drawdawn in a day, like this I know that the maximum historical loss in a day is a specific value and I can calculate my Money Management rules. That is; I'll decide how much I can risk per day. This period should be a parameter because I could need which is the Max. Drawdawn the strategy has in my backtest per day, or per week, or per month,...
Attachments
No attachments
  • Votes +1
  • Project QuantAnalyzer
  • Type Feature
  • Status Fixed
  • Priority Low

History

o
#1

Enric

12.02.2020 20:22

Task created

o
#2

Enric

12.02.2020 20:23
Voted for this task.
JK
#3

Insanity82007

14.02.2020 12:59

My food for thought on this one...


You can use the Stagnation or Stagnation % along with Ret /DD, Fitness and Stability filters to achieve this when building. 


There are also a number of things to consider with this from a risk perspective too as this approach seems geared more towards a single or isolated strategy. If you are too stringent with a setting like this, you could end up with over-fitting issues. For example, I generated a bucket of EURUSD H1 strategies with high Fitness and Stability (IS and OOS) filters that were >= 0.9 and while the equity curves looked amazing they ALL failed the MC tests and couldn't even make it to the WFM tests that followed because they were over optimised (curve fitted). 


You also have to consider how this will work when building a portfolio. If you've been through the Building Strategy Portfolio part of the Algo-Trading Course videos on Quastic, the teachers explain how to risk adjust each strategy within a portfolio based on the max drawdown for each strategy. For example, if a strategy has a $3,000 max drawdown for your chosen risk amount (fixed lot or fixed amount) versus another strategy that has a $1,000 drawdown, your THEORETICAL risk per trade ratio for the $1,000 drawdown strategy for risk will be 3x that of the strategy with the $3,000 drawdown e.g. $300 versus $100 risked per trade. 

Once you've worked out the relative risk for all strategies in a portfolio (as a theoretical amount) to balance each strategy to the same or similar drawdown $, the next practical step is to evaluate (most likely in an excel spreadsheet) all of the trades combined for the entire portfolio and risk reduce this accordingly.


This may sound vague at this point, but let's say for example you have 20 strategies in a portfolio and your average number of trades is ~3 per day (assuming all strats are on an H1 timeframe with an average of 40 trades per year for 240 trading days per year).

In this example, it would not be wise to assume your maximum risk is based on 3 trades per day, but rather to do a deep dive into the trade data itself to look for the MAXIMUM number of trades this combination of strategies produces on a the most active day in the historical trade data.


The average might be 3 trades per day from your 20 strategy portfolio, but there may (theoretically) be a day in the historical trade data where 20 trades were opened in a single day! This is the maximum risk / margin usage you should balance your portfolio on.

Let's say for example you want to risk 3% of your account per trade. On an "average" day you will risk 9% of your account (3 x 3%), but on your most active day with 20 newly opened trades you will risk 60% of your account (20 x 3%)! This will be ON TOP OF your existing margin usage for open positions! 


When doing this analysis, you will ultimately work out the true risk value you need to assign to each strategy in your portfolio. Let's say you have a $10,000 account and only want to risk a maximum of $1,000 (or 10%) on your busiest potential trading day with 20 new positions opened. Then let's say you balanced your theoretical fixed $ risk amount per trade to be between $50 per trade and $400 per trade (based on an initial $100 fixed amount per trade when building the strategies in SQX before re-balancing to get the same drawdown for each strategy) and this averages out at $200 per trade across all strategies in the 20 strategy portfolio, this will not work with your 20 strategies. It won't work because $200 x 20 = $4,000, so you need to modify the Fixed $ Risk Amount for each strategy to be 1/4 of the theoretical adjusted amount you had before e.g. $50 will become $12.50 and $400 will become $100 etc. to achieve your max risk of $1,000 on a potential future max day of 20 new positions.

o
#4

Enric

14.02.2020 18:13

Hi Insanity,

I think I see your point. Thanks for your comments.

Though I must say that my feature request is not about Building but about Risk Management. I need to know which is the Max. historical DD in a week to decide how much I invest in a EA's trade. Nowadays we have the Max. historical DD, but for me is not the same if this Max DD has been in 9 months or 9 days. Well, that's not a formula of mine but some of the Risk Management methods I've studied and I think it makes sense to me.

OF course later you have to tune the Risk Management regarding the portfolio. But the raw measurement is the Max. historical DD in a period; 1 day, 1 week, ...

JK
#5

Insanity82007

15.02.2020 00:20
Hi Enric,


If you look at a week in isolation to establish your risk, what happens if drawdown continues outside of this week?

o
#6

Enric

15.02.2020 10:45

Hi Insanity,

Easy! Each week you should readjust your lots accordingly to the balance, either up or down.

Imagine you have a scalping strategy. You would only want to know the Max DD in a day, not in the entire live of the strategy. That was an example. But regarding my method (not mine I took it from a book) it would be more accurate to know the Max DD on the periods you are reviewing your strat. The total Max DD would be useful if you were a swing trader and let it run for months

TT
#7

Tamas

01.06.2020 11:53

Status changed from New to Fixed

It can be done by creating a new databank column via QuantEditor.

How to do it read here https://strategyquant.com/doc/quantanalyzer/add-new-statistical-value/


Votes: +1

Drop files to upload

or

choose files

Max size: 5MB

Not allowed: exe, msi, application, reg, php, js, htaccess, htpasswd, gitignore

...
Wait please