- ago
Hello,
I would like to determine the largest drawdown within a long period (for example 10 years).
I implemented it with the following building block (see first picture). However, a period that is far too small is taken into account here (see second image). Red line is the lowest low of drawdown. But instead of 4000 bars (appr. 10 years) just 2 years.
Am I doing something wrong or is there a bug here? Or how can I implement this in the building blocks?
Thank you in advance for your help, Marko.

0
252
18 Replies

Reply

Bookmark

Sort
- ago
#1
0
Cone8
 ( 6.07% )
- ago
#2
If you use a period of 4000, then the Lowest indicator won't be valid until bar number 3999.

That said, something's still "off" because there are clearly at least 2 values lower than -19.32 showing in that chart.
0
Glitch8
 ( 11.64% )
- ago
#3
Blue indicator is monthly, red is weekly?
0
- ago
#4
Yes, that's right., in this case.
0
- ago
#5
But even if I only use the Lowest low of drawdown (see first image), the look-back period ends after 2 years, i.e. around 730 days, instead of 4000 days. (see second image) .

0
- ago
#6
0
Cone8
 ( 6.07% )
- ago
#7
"Weekly" is from where the Drawdown is measured - the indicator will give you the Daily Drawdown from the end of the last Weekly period. It doesn't make sense to calculate "Weekly" DD using Monthly bars. Select Drawdown("Monthly") if you're using Monthly bars.
0
- ago
#8
I like to use daily bars and some other indikactors. And I like to have the lowest drawdown while a specific lokkback period. and the lookback should be 4000 days, mean 4000 bars, correct? But I just see approximately 700 bars. The blue line is too short... thats what I mean. and in this case, stronger drawdowns before this are not recognized... but I like to know it... do you have a solution for my problem?
0
Cone8
 ( 6.07% )
- ago
#9
I can't duplicate your problem. What is the symbol and source of the data?

How many bars are loaded? (I suspect about 4700.)
If you want more "Lowest" data, then you'll need to use a smaller lookback - or build your own indicator that gives you the lowest from some arbitrary starting point (which would be bad idea for an indicator that you're using in a backtest).
0
- ago
#10
o.k. I can duplicate very easy. Made a very simple "strategie (makes no sence yet, just to show the problem). I send you the images for better understanding.
0
- ago
#11
0
- ago
#12
same problem...black line is "not long" enough...lookback till end of 2022 instead of aprox. 2013
0
- ago
#13
and a backtest works till 4300 bars (aprox.)
0
- ago
#14
and when I switch to weekly or monthly instead of daily bars in the setting of the in dicator "drawdown" the lookback is still shorter ... (see image)
0
Cone8
 ( 6.07% )
- ago
#15
I can't really say it another way. If you want a 4000 period lookback for an indicator, the first 4000 bars will be NaN - no result, no line.

You're looking to keep track of the lowest low from an arbitrary starting point. No standard indicator does that (and that's good).

You need a custom indicator, and like I said, it would be a bad one to use in a backtest because the result would change your strategy trades based on wherever the backtest started.

1
- ago
#16
Hi Cone,

ahhhh, now I understand like you mean it. So I have to choose a erlier data in strategy settings for example?!
Sorry... so many "beautiful misunderstandings" can arise when writing...

My actual goal is to use some kind of indicators to automatically find out which stocks have continuously risen by a certain minimum percentage over the last 10/15 years. And they should not have had any large or long downward phases. So quality stocks.

I you would have any other ideas, I am grateful for every tip. Thank you.
0
- ago
#17
QUOTE:
risen by a certain minimum percentage over the last 10/15 years

This is just the Rate of Change (ROC) indictor, of course.

QUOTE:
And they should not have had any large or long downward phases. So quality stocks.

There are many ways to "measure" the "quality" of a stock's time series and "drawdown" is among the worst, because it usually depends on a very low number of "unsual" days that are guaranteed to not repeat in the future.

There are much better measures:
* Standard deviation of returns: over longer periods of time this gives a very stable/robust measure of a stock's volatility (amount of inherent risk). This is the basic statistic which drives everything else:
* some linear regression of (log) prices: This is an "intuitive" way to judge "quality". We are all used to look at the price series. But again: if volatility is high, prices look bad. So it is much better to estimate volatility than playing around and trying to judge the "gestalt" of the price-series.

By the way: Taken together you want a high Rate of Change and low Volatility at the same time. This is exactly what the SharpeRatio does.

Summary: Just calculate the SharpeRatio of the price series. You can't do better.
0
- ago
#18
QUOTE:
Just calculate the SharpeRatio of the price series. You can't do better.

The equation below comes from PostNo.5 discussion at https://www.wealth-lab.com/Discussion/Weigh-by-Sharpe-Ratio-10554
CODE:
TimeSeries sharpeRatioRunning = SMA.Series(ROC.Series(bars.Close,1),15) / StdDev.Series(ROC.Series(bars.Close,1),15);
But understand the "real" Sharpe Ratio is looking at returns from trading and the above formula isn't doing that. So although the above formulation is useful, I wouldn't call it a Sharpe Ratio.
0

Reply

Bookmark

Sort