Section - 9 Considerations

9.1 Not a trading tutorial

In this document we aimed to predict the change in cryptocurrency prices, and it is very important to recognize that this is not the same as being able to successfully make money trading on the cryptocurrency markets.

This is a very important distinction for the following reasons (and many more we have not thought of):

  • We already covered some of the reasons for why there is a meaningful difference between predicting price movements for the cryptocurrency markets and actually performing effective trades in the data exploration section, but things are further complicated by the fact that trades can be posted as either a limit order or a market order. A limit order gets added to the order book after the trader specifies the price point and the quantity, while a market order initiates a trade with the most favorable price from the order book. This is why someone doing a limit order would be referred to as a market maker, while someone posting a market order would be consider to be a market taker; this indicates whether someone is creating new liquidity for the market, or are taking from the available liquidity, which has implications in terms of the fees that the exchange actually charges, because exchanges prefer encouring activity that results in more liquidity rather than less. See this link for the latest specific maker and taker fees based on trading volume and more details on their rationale (as was also explained here).

  • There are many cryptocurrencies that have really low levels of liquidity, which can severely affect the ability to purchase the cryptocurrency at the desired price point and at the desired time. Simply put, things can get extraordinarily complex.

  • When programmatically trading it is easy to make a single mistake that ends up being more costly than the potential upside of a successful trading system.

  • Even if these models were at all accurate in predicting price changes, that would not necessarily indicate that future performance would be any good. The data made available in this tutorial is very limited in scope and perspective, and has no way of understanding more complex dynamics like world events and news coverage, which could very well have an effect on the prices.

  • Finding an effective trading strategy is easier said than done. Even if we could be accurate in predicting these markets, there is no guarantee we would be able to translate those predictions into an effective trading strategy. There are many nuances (i.e. trading fees) to deal with and decisions to be made, coming up with a good trade execution plan that works consistently is not easy.

  • Another thing we did not consider in this tutorial is the distinction between the price at which we could buy the cryptocurrency (the “ask” price), and the price at which we could sell it (the “bid” price). In our example we predicted where the ask price was headed rather than considering a specific trading dynamic.

  • One additional consideration to make, is that a good trading strategy would not only consider the beginning and ending points, but would make small adjustments based on how things are going over time, and that is another consideration that is not relevant to the approach we took because we are predicting price changes between those two points rather than coming up with a good trading strategy.

Hopefully it is clear by now, but this tutorial is not meant to show anyone how to trade on the cryptocurrency markets, but rather encourage people to apply these tools to their own data problems, and that is the reason the tutorial stops here (also because we like not getting sued).

9.2 Session Information

Below is information relating to the specific R session that was run. If you are unable to reproduce these steps, you can find the correct version of the tools to install below. Otherwise follow the instructions to run the code in the cloud instead.

sessionInfo()
## R version 4.0.3 (2020-10-10)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows Server x64 (build 17763)
## 
## 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] stats4    grid      parallel  stats     graphics  grDevices utils    
##  [8] datasets  methods   base     
## 
## other attached packages:
##  [1] formattable_0.2.0.1 hydroGOF_0.4-0      pls_2.7-3          
##  [4] elasticnet_1.3      lars_1.2            deepnet_0.2        
##  [7] party_1.3-5         strucchange_1.5-2   sandwich_3.0-0     
## [10] zoo_1.8-8           modeltools_0.2-23   mvtnorm_1.1-1      
## [13] brnn_0.8            truncnorm_1.0-8     Formula_1.2-4      
## [16] xgboost_1.0.0.2     doParallel_1.0.15   iterators_1.0.12   
## [19] foreach_1.5.0       caret_6.0-86        lattice_0.20-38    
## [22] transformr_0.1.3    gganimate_1.0.5     ggforce_0.3.2      
## [25] ggpubr_0.4.0        plotly_4.9.2.1      ggthemes_4.2.0     
## [28] magick_2.5.0        av_0.5.1            gifski_0.8.6       
## [31] ggTimeSeries_1.0.1  anytime_0.3.7       tsibble_0.9.2      
## [34] forcats_0.5.0       stringr_1.4.0       dplyr_1.0.2        
## [37] purrr_0.3.4         readr_1.3.1         tidyr_1.1.1        
## [40] tibble_3.0.4        ggplot2_3.3.2       tidyverse_1.3.0    
## [43] jsonlite_1.7.1      httr_1.4.2          DT_0.15            
## [46] skimr_2.1           pins_0.4.0          pacman_0.5.1       
## [49] knitr_1.39          bookdown_0.34      
## 
## loaded via a namespace (and not attached):
##   [1] utf8_1.1.4           tidyselect_1.1.0     htmlwidgets_1.5.1   
##   [4] maptools_1.0-2       lpSolve_5.6.15       pROC_1.16.2         
##   [7] munsell_0.5.0        codetools_0.2-16     units_0.6-7         
##  [10] withr_2.5.0          colorspace_1.4-1     filelock_1.0.2      
##  [13] highr_0.8            rstudioapi_0.11      ggsignif_0.6.0      
##  [16] labeling_0.3         repr_1.1.0           polyclip_1.10-0     
##  [19] farver_2.0.3         vctrs_0.3.2          generics_0.0.2      
##  [22] TH.data_1.0-10       ipred_0.9-9          xfun_0.39           
##  [25] R6_2.4.1             reshape_0.8.8        assertthat_0.2.1    
##  [28] hydroTSM_0.6-0       scales_1.1.1         multcomp_1.4-15     
##  [31] nnet_7.3-12          gtable_0.3.0         timeDate_3043.102   
##  [34] rlang_1.0.2          splines_4.0.3        rstatix_0.6.0       
##  [37] lazyeval_0.2.2       ModelMetrics_1.2.2.2 broom_0.7.2         
##  [40] yaml_2.2.1           reshape2_1.4.3       abind_1.4-5         
##  [43] modelr_0.1.6         crosstalk_1.1.0.1    backports_1.1.6     
##  [46] tools_4.0.3          lava_1.6.7           gstat_2.0-6         
##  [49] ellipsis_0.3.1       jquerylib_0.1.4      Rcpp_1.0.8.3        
##  [52] plyr_1.8.6           base64enc_0.1-3      progress_1.2.2      
##  [55] classInt_0.4-3       prettyunits_1.1.1    rpart_4.1-15        
##  [58] haven_2.2.0          fs_1.4.1             magrittr_1.5        
##  [61] data.table_1.12.8    openxlsx_4.2.2       spacetime_1.2-3     
##  [64] reprex_0.3.0         matrixStats_0.57.0   hms_0.5.3           
##  [67] evaluate_0.15        rio_0.5.16           readxl_1.3.1        
##  [70] compiler_4.0.3       KernSmooth_2.23-16   crayon_1.3.4        
##  [73] htmltools_0.5.2      mgcv_1.8-31          libcoin_1.0-6       
##  [76] lubridate_1.7.8      DBI_1.1.0            tweenr_1.0.1        
##  [79] dbplyr_1.4.2         MASS_7.3-51.5        rappdirs_0.3.1      
##  [82] sf_0.9-6             Matrix_1.2-18        car_3.0-10          
##  [85] cli_3.3.0            gower_0.2.1          pkgconfig_2.0.3     
##  [88] coin_1.3-1           foreign_0.8-80       sp_1.4-1            
##  [91] recipes_0.1.14       xml2_1.3.1           bslib_0.3.1         
##  [94] prodlim_2019.11.13   rvest_0.3.5          digest_0.6.25       
##  [97] rmarkdown_2.14       cellranger_1.1.0     intervals_0.15.2    
## [100] curl_4.3             lifecycle_0.2.0      nlme_3.1-144        
## [103] carData_3.0-4        viridisLite_0.3.0    fansi_0.4.1         
## [106] pillar_1.4.4         fastmap_1.1.0        survival_3.1-8      
## [109] glue_1.6.2           xts_0.12.1           zip_2.0.4           
## [112] FNN_1.1.3            class_7.3-15         stringi_1.4.6       
## [115] sass_0.4.1           automap_1.0-14       e1071_1.7-4