joshuaulrich / TTR

Technical analysis and other functions to construct technical trading rules with R
GNU General Public License v2.0
326 stars 102 forks source link

Column name for CMO - unnamed #55

Closed amirmazmi closed 6 years ago

amirmazmi commented 6 years ago

Description

Column name for CMO is unnamed

Probably just after line 131, just needs to re-label

65   cmo <- 100 * (up-dn)/(up+dn)
66   colnames(cmo) <- "cmo"
67
68   reclass( cmo, x )

Expected behavior

Column is labelled "cmo"

Minimal, reproducible example

> tail( CMO( Cl( xtsclean[[1]]) ))
                [,1]
2017-10-11 -62.50000
2017-10-12 -64.00000
2017-10-16 -64.00000
2017-10-17 -73.07692
2017-10-19 -82.45614
2017-10-20 -83.60656

Session Info

R version 3.4.0 (2017-04-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252 
[2] LC_CTYPE=English_United States.1252   
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils    
[5] datasets  methods   base     

other attached packages:
 [1] quadprog_1.5-5  e1071_1.6-8     ranger_0.8.0   
 [4] caret_6.0-77    lattice_0.20-35 lubridate_1.6.0
 [7] plotly_4.7.1    scales_0.5.0    cowplot_0.8.0  
[10] gridExtra_2.3   RcppRoll_0.2.2  dplyr_0.7.4    
[13] ggplot2_2.2.1   quantmod_0.4-11 TTR_0.23-2     
[16] xts_0.10-0      zoo_1.8-0       pacman_0.4.6   

loaded via a namespace (and not attached):
 [1] httr_1.3.1          ddalpha_1.3.1      
 [3] tidyr_0.7.2         sfsmisc_1.1-1      
 [5] jsonlite_1.5        viridisLite_0.2.0  
 [7] splines_3.4.0       foreach_1.4.3      
 [9] prodlim_1.6.1       assertthat_0.2.0   
[11] stats4_3.4.0        DRR_0.0.2          
[13] yaml_2.1.14         robustbase_0.92-7  
[15] ipred_0.9-6         glue_1.1.1         
[17] digest_0.6.12       colorspace_1.3-2   
[19] recipes_0.1.0       htmltools_0.3.6    
[21] Matrix_1.2-11       plyr_1.8.4         
[23] timeDate_3012.100   pkgconfig_2.0.1    
[25] CVST_0.2-1          purrr_0.2.4        
[27] gower_0.1.2         lava_1.5.1         
[29] tibble_1.3.4        withr_2.0.0        
[31] nnet_7.3-12         lazyeval_0.2.0     
[33] survival_2.41-3     magrittr_1.5       
[35] nlme_3.1-131        MASS_7.3-47        
[37] dimRed_0.1.0        class_7.3-14       
[39] tools_3.4.0         data.table_1.10.4-2
[41] stringr_1.2.0       kernlab_0.9-25     
[43] munsell_0.4.3       bindrcpp_0.2       
[45] compiler_3.4.0      rlang_0.1.2        
[47] grid_3.4.0          iterators_1.0.8    
[49] htmlwidgets_0.9     gtable_0.2.0       
[51] ModelMetrics_1.1.0  codetools_0.2-15   
[53] curl_3.0            reshape2_1.4.2     
[55] R6_2.2.2            bindr_0.1          
[57] stringi_1.1.5       Rcpp_0.12.13       
[59] rpart_4.1-11        DEoptimR_1.0-8