[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: How do I initialise averagtruerange to be filled at barnumber 1?



PureBytes Links

Trading Reference Links

Solved it. It was not as hard as I thought, I was looking at the wrong
solution so I should never have bothered you.

What I am doing is backtesting over a long period of time. This causes more
and more problems and maybe I should give it up.

In this case, it was not the average true range that did not start in an
initialised way, it was the range that became zero since the differences in
high and low were lost when the metastock data was read by Tradestation,
where tradestation converts float date to integer values based on pointvalue
(0.001). Thus, there was no range in the beginning, since Tradestation
values did not differ in the start, only metastock values did.

In fact, this is a new version of the accuracy problem (or previously
debated, but I missed it). 0.001 loses some important data in the year of
1984 since values are so low when prices have been converted due to
emissions and splits. A tickvalue of 0.0001 would transfer more detail, but
then high priced stocks at reasent dates will get converted to very large
integers. 

Floats have a precision of a number of digits, independent of if prices are
below zero or above 1000, the tickvalue conversion to integers does not seem
a very clever way of handling this. Guess there are good reasons for it
though.

> -----Original Message-----
> From: Bengtsson, Mats [mailto:mats.bengtsson@xxxxxxxx] 
> Sent: den 8 juli 2001 18:19
> To: omega list
> Subject: How do I initialise averagtruerange to be filled at 
> barnumber 1?
> 
> 
> This must be an easy one, but I have tried a number of ways 
> without finding the fomrula. 
> 
> What I would really like is that the average of true range, 
> supplied in any way (preferably a variable of my own) 
> contains the average for true range already at bar number 1 
> (which occurs after 50 bars maxbarsback). This can be done 
> for so many other kinds of values, so there must be a way for 
> this as well.
> 
> Anyone that can give a helping hand here? Somebody must have 
> solved this before. Maybe the only solution is to write an 
> averagetruerange that does the desired lookback itself on bar 
> number one? Anybody already done that?
> 
> --- Mats ---
> 
> 
> This message contains information that may be privileged or 
> confidential and is the property of the Cap Gemini Ernst & 
> Young Group. It is intended only for the person to whom it is 
> addressed. If you are not the intended recipient, you are not 
> authorized to read, print, retain, copy, disseminate, 
> distribute, or use this message or any part thereof. If you 
> receive this message in error, please notify the sender 
> immediately and delete all copies of this message.
> 


This message contains information that may be privileged or confidential and is the property of the Cap Gemini Ernst & Young Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.