I do not understand why I get the ATR and DonchianChannel columns twice, so that in the end the tibble has the column ATR and and ATR.1, also the column DonchianChannel and DonchianChannel.1. The values also differs to each other? Can someone maybe help? Thanks.
tq_get(c("DTE.DE", "SAP.DE"), get = "stock.prices", from = "2017-12-01") %>%
group_by(symbol) %>%
tq_mutate(select = c("high", "low", "close"), n=14, mutate_fun = ATR) %>%
tq_mutate(select = c("high", "low"), mutate_fun = DonchianChannel)
# A tibble: 38 x 15
# Groups: symbol [2]
symbol date open high low close volume adjusted tr atr ATR ATR.1 DonchianChannel mid DonchianChannel.1
<chr> <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
1 DTE.DE 2017-12-01 15.065 15.140 14.975 14.975 14796786 14.975 NA NA NA NA NA NA NA
2 DTE.DE 2017-12-04 15.140 15.345 15.050 15.245 13463710 15.245 0.370 NA 15.345 14.975 NA NA NA
3 DTE.DE 2017-12-05 15.335 15.425 15.265 15.275 9877870 15.275 0.180 NA 15.425 15.245 NA NA NA
4 DTE.DE 2017-12-06 15.200 15.425 15.175 15.360 8934058 15.360 0.250 NA 15.425 15.175 NA NA NA
5 DTE.DE 2017-12-07 15.405 15.690 15.370 15.620 13318348 15.620 0.330 NA 15.690 15.360 NA NA NA
6 DTE.DE 2017-12-08 15.710 15.730 15.520 15.520 13255747 15.520 0.210 NA 15.730 15.520 NA NA NA
7 DTE.DE 2017-12-11 15.505 15.505 15.255 15.330 11920247 15.330 0.265 NA 15.520 15.255 NA NA NA
8 DTE.DE 2017-12-12 15.360 15.370 15.160 15.280 10615751 15.280 0.210 NA 15.370 15.160 NA NA NA
9 DTE.DE 2017-12-13 15.270 15.325 15.165 15.200 8826821 15.200 0.160 NA 15.325 15.165 NA NA NA
10 DTE.DE 2017-12-14 15.260 15.270 15.025 15.175 12976932 15.175 0.245 NA 15.270 15.025 15.73 15.3525 14.975
# ... with 28 more rows