[R-SIG-Finance] Donchian Channel in TTR
Andreas Voellenklee
wotuzu17 at gmail.com
Thu Apr 5 15:11:48 CEST 2012
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
More information about the R-SIG-Finance
mailing list