Hi,

The DonchianChannel function in the package TTR calculates the highest
high and lowest low of the *current price* and the last (n-1) prices.
According to my sources, only the previous n prices should be
regarded, not the current price.

The following example shows that the current price is taken in the fifth line

getSymbols("YHOO", adjust=TRUE)
head(cbind((YHOO), DonchianChannel(cbind(Hi(YHOO),Lo(YHOO)),n=5)),n=10)

Possibly both methods are valid, but there should be a (optional)
parameter to the function so that users can choose whether they want
to include the current price or not. As in here:
http://www.linnsoft.com/tour/techind/donch.htm

Regards,
Andreas

_______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions should 
go.

Reply via email to