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.
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.
Rename
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.
That said, something's still "off" because there are clearly at least 2 values lower than -19.32 showing in that chart.
Blue indicator is monthly, red is weekly?
Yes, that's right., in this case.
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) .
"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.
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?
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).
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).
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.
same problem...black line is "not long" enough...lookback till end of 2022 instead of aprox. 2013
and a backtest works till 4300 bars (aprox.)
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)
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.
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.
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.
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.
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.
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: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.
TimeSeries sharpeRatioRunning = SMA.Series(ROC.Series(bars.Close,1),15) / StdDev.Series(ROC.Series(bars.Close,1),15);
Your Response
Post
Edit Post
Login is required