StockFetcher Forums · General Discussion · How about a max drawdown function?<< 1 2 >>Post Follow-up
Kevin_in_GA
4,599 posts
msg #116809
Ignore Kevin_in_GA
11/16/2013 6:42:25 PM

SF:

I would love to see a function that tells you a specific stock's maximum drawdown over a user-specified period - something like
MaxDD(25) which would return the max drawdown over the last 25 days. Right now you really can't code for this using high 25 day high and low 25 day low since many stocks will have their high today and thus there might be no draw down at all.

Any thoughts on how to code this?

Thanks,

Kevin



dashover
224 posts
msg #116821
Ignore dashover
11/17/2013 4:23:19 PM

optionable

price > $1

set{low25, low 25 day low}
add column low25

set{high25, high 25 day high}
add column high25

set{biggestranger, high25-low25}
add column biggestranger


Would "low25" be drawdown over last 25 days?? Would that work?

Kevin_in_GA
4,599 posts
msg #116822
Ignore Kevin_in_GA
modified
11/17/2013 4:52:04 PM

Not really. Assume that 25 days ago the price of ABC was 10 and it has risen every day since then - there has been no drawdown.

Or 100 days ago the price was 10. It rose each day until it reached 20, then dropped to 12 before rising every day since to today's close of 30. The MaxDD(100) would be 40% (the percentage drop from 20 to 12). The low 100 day low would be 10, and the high 100 day high would be 30, neither of which were associated with the actual drawdown period.

This morning I asked the support staff at Stratasearch the same basic question - within an hour they had the following custom formula (which works):


days = parameter("days");

BigDrawD = 0;
HighVal = 0;

x = -days;
while(x <= 0) {
HighVal = higher(HighVal, ref(close, x));
BigDrawD = higher((HighVal-ref(close, x))/HighVal*100, BigDrawD);
x+=1;
};

SF support - here is the code. Are you going to be outdone by the Stratasearch team?

stockfetcher
979 posts
msg #116823
11/17/2013 5:23:09 PM

Hi Kevin -

Thanks for the suggestion. We're looking into the function that you requested. If we have any questions or updates, we'll be sure to let you know.

StockFetcher Support



alf44
2,025 posts
msg #116824
Ignore alf44
modified
11/17/2013 6:33:18 PM

.

"SF support - here is the code. Are you going to be outdone by the Stratasearch team?"

-----

Kevin, perhaps a "smiley :) face" at the end of that "snipe" ... would've been apropos !

Possibly even an "LOL" !

-----

That way you don't come across as being quite so insolent ! LOL

:)

See how that works ?

.

Kevin_in_GA
4,599 posts
msg #116825
Ignore Kevin_in_GA
modified
11/17/2013 7:05:23 PM

The tone of my requests is not relevant to whether or not SF does anything. I've grown tired of hoping that they do anything with the actual code - they choose to spend their time updating how things look rather than how well they work.

Read the above response - translation is "don't keep asking for any updates or action on our part. If we choose to do this we'll let you know."

Honestly - I gave them the friggin' code. How hard can it be?

alf44
2,025 posts
msg #116826
Ignore alf44
modified
11/17/2013 7:21:03 PM

.

... ya see ... a "friggin' smiley :) face" was blatantly omitted from your last post !!!

You ... REALLY .... need to work on your "posting etiquette" !!!

----------

Oh ...

LOL !!!

.

jimmyjazz
102 posts
msg #116835
Ignore jimmyjazz
11/18/2013 7:37:15 AM

Kevin's posts have more value than 99% of the other posts around here. He can tell me to take a long walk off a short pier as long as he keeps coming up with innovative ways to look at trading that are based in sound logic and statistics.

alf44
2,025 posts
msg #116837
Ignore alf44
modified
11/18/2013 9:49:38 AM

... It was all in good fun. :)

Now go take a long walk off a short pier ! LOL

.

stockfetcher
979 posts
msg #116893
11/20/2013 1:49:19 PM

We have a first-pass at a Max Drawdown function. The basic usage is:

Max Drawdown(period)
MaxDD(period)

This measure will compute the largest drawdown (in percent) over the period specified and draw a line from the high to low close.



Basic example
show stocks where close is above 10
and Max Drawdown(20) is above 15
and add column Max Drawdown(20)


Additionally, using the record high/low function on StockFetcher, you can find out what the largest n-day drawdown was over a specified period.

For example, the example below will display the current maximum drawdown for the last 20 days, as well as the max 20 day max drawdown over the last year (that was a mouthful!)

show stocks where close is above 10
and add column Max Drawdown(20)
and add column Max Drawdown(20) 1 year high


As with all new features, please let us know if you don't feel this value is computed correctly or have any questions on the data.

Thank you,

StockFetcher Support


StockFetcher Forums · General Discussion · How about a max drawdown function?<< 1 2 >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.