powermob 19 posts msg #38173 - Ignore powermob |
9/23/2005 11:37:06 PM
If I'm not mistaken, ATR is Average True Range and should represent the highest between todays high and yesterday's close, and the lowest between today's low and yesterday's low. Therefore, the following two statements should yield the same results:
set{calcrange,atr(1)}
set{localc, min(low, close 1 day ago)}
set{hicalc, max(high, close 1 day ago)}
set{calcrange, hicalc - localc}
I tested this and the results vary. Am I off?
|
jaketheguy 52 posts msg #38174 - Ignore jaketheguy |
9/24/2005 12:52:58 AM
I think the problem could be your definition of ATR is wrong. Did you do a search on Average True Range?
|
powermob 19 posts msg #38181 - Ignore powermob |
9/24/2005 6:24:10 PM
Jaketheguy...the definition of True Range is the greater of:
High for the period less the Low for the period.
High for the period less the Close for the previous period.
Close for the previous period and the Low for the current period.
Basically, the Close for the previous period is substituted for the current Low, if lower, or for the current High, if higher.
The Average True Range would be just the average of this. Where am I of on the definition?
|
jaketheguy 52 posts msg #38183 - Ignore jaketheguy |
9/24/2005 9:31:55 PM
powermob,
You are correct. Based on a closer inspection of stockfetcher's results, Stockfetcher evidently defines ATR(1) as the day's high-close, which we agree is inaccurate.
We both agree that ATR(1) should be the highest of either:
high - low
abs(high - prev_close)
abs(low - prev_close)
(e.g., see http://trader.snowseed.com/atr.htm)
Will you report this to StockFetcher?
|
powermob 19 posts msg #38191 - Ignore powermob |
9/24/2005 11:41:57 PM
JakeTheGuy- Yeah, if you see the same problem, I'll go ahead and submit it through the bugs section. Also, although I don't think it matters, the last line should be:
ABS(prev_close - close}
(http://www.linnsoft.com/tour/techind/trueRange.htm)
because, in that instance we are looking at the previous close being above the high for the current day. I'm assuming that prev_close is acceptable, I have not used that syntax before.
Thanks for your response, jtg.
|
jaketheguy 52 posts msg #38194 - Ignore jaketheguy |
9/25/2005 12:20:28 AM
powermob,
I had the correct line based on your reference too, which uses the close of the current day, rather than the low:
ABS(CL.1 - LO)
|
jaketheguy 52 posts msg #38195 - Ignore jaketheguy |
9/25/2005 12:22:03 AM
Whoops. Sorry, I meant "which uses the low of the current day, rather than the close". (Too bad we can't edit posts.)
|