Exit String Using Lowest ATR since Entry

Questions directed to our Support Team. Responses can be expected within 24 hours.

Exit String Using Lowest ATR since Entry

Postby reeldeal » Wed Sep 03, 2014 4:03 pm

Hello. Sorry if this is posted somewhere, but I have searched every way I can think of and cannot find anything on it. I started by wanting to have a strategy exit where I exit if the close is less than the highest price since entry - 3 times the 14 day Average True Range (ATR). I got this working (or at least I think I did) using this string:

close <= ($highprice - 3*atr(14))

At least I think I did.

However, I realized today that is actually a little different what I was expecting. ATR is changing constantly, obviously, and as a price starts to turn against me, the ATR is most likely expanding, pushing my exit lower than I planned. What I really want is to exit when the close is <= 3 times the lowest 14 Day ATR that has occurred since entry. I cannot figure out how to write that, or if it is even possible (although I suspect it is).

Without making this too long, say ATR(14) on day of entry was 0.75 and over the course of the next month it bounced around but put in a low value of 0.5 on day 24. Then it started to creep back up for whatever reason. I want to keep that 0.5 value as the value I use in my exit string. Hope that makes sense and wondering if anyone knows an easy way to do it without writing a custom formula. Thanks!
Posts: 1
Joined: Wed Sep 03, 2014 11:42 am

Re: Exit String Using Lowest ATR since Entry

Postby Overload » Wed Sep 03, 2014 6:37 pm

Actually I don't think that can be done without a Custom Formula DLL.

The StrataSearch architecture is built primarily for speed, which allows it do the automated searches as fast as it does. But your request highlights one area that doesn't provide much flexibility. Basically what you're talking about is a variable number of days in the "low()" formula, which would let you do something like this:

close <= ($highprice - 3*low(atr(14), $daysheld))

But the above isn't allowed. Some thought has definitely been put into providing that, but it would take significant development time and it would most certainly slow down the processing. So, for now, I don't believe it can be done outside of a Custom Formula DLL.

Posts: 2248
Joined: Wed Nov 30, 2005 12:14 pm

Return to Technical Support