{"metadata":{"kernelspec":{"name":"ir","display_name":"R","language":"R"},"language_info":{"name":"R","codemirror_mode":"r","pygments_lexer":"r","mimetype":"text/x-r-source","file_extension":".r","version":"4.0.5"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"code","source":"library(tidyverse) # metapackage of all tidyverse packages\nlibrary(lubridate)\nlibrary(fpp2)\nlibrary(astsa)\nlibrary(plotly)\nlibrary(htmlwidgets)\nlibrary(IRdisplay)","metadata":{"_uuid":"051d70d956493feee0c6d64651c6a088724dca2a","_execution_state":"idle","execution":{"iopub.status.busy":"2021-11-05T14:41:54.184Z","iopub.execute_input":"2021-11-05T14:41:54.185806Z","iopub.status.idle":"2021-11-05T14:41:54.239325Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train=read.csv(\"../input/g-research-crypto-forecasting/supplemental_train.csv\")","metadata":{"execution":{"iopub.status.busy":"2021-11-05T14:29:28.563884Z","iopub.execute_input":"2021-11-05T14:29:28.60378Z","iopub.status.idle":"2021-11-05T14:30:25.848573Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"bit_df=train %>% filter(Asset_ID==1)\nhead(bit_df)","metadata":{"execution":{"iopub.status.busy":"2021-11-05T14:32:17.655033Z","iopub.execute_input":"2021-11-05T14:32:17.657003Z","iopub.status.idle":"2021-11-05T14:32:20.520363Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"Date <- as.Date(as.POSIXct(bit_df$timestamp, origin=\"1970-01-01 00:00:00.000\"))\nbit_df<- data.frame(Date, bit_df)\nhead(bit_df)","metadata":{"execution":{"iopub.status.busy":"2021-11-05T14:33:46.916252Z","iopub.execute_input":"2021-11-05T14:33:46.919652Z","iopub.status.idle":"2021-11-05T14:33:46.968168Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"dir.create(file.path(\"plots/\"), showWarnings = FALSE)\n","metadata":{"execution":{"iopub.status.busy":"2021-11-05T14:40:47.182622Z","iopub.execute_input":"2021-11-05T14:40:47.184601Z","iopub.status.idle":"2021-11-05T14:40:47.201007Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig <- bit_df %>% plot_ly(x = ~Date, type=\"candlestick\",\n          open = ~bit_df$Open, close = ~bit_df$Close,\n          high = ~bit_df$High, low = ~bit_df$Low) \nfig <- fig %>% layout(title = \"Basic Candlestick Chart\")\nf <-\"plots/plot1.html\"\nsaveWidget(fig, file.path(normalizePath(dirname(f)),basename(f)))\ndisplay_html('<iframe src=\"plots/plot1.html\" align=\"center\" width=\"100%\" height=\"500\" frameBorder=\"0\"></iframe>')","metadata":{"execution":{"iopub.status.busy":"2021-11-05T14:43:26.961778Z","iopub.execute_input":"2021-11-05T14:43:26.963607Z","iopub.status.idle":"2021-11-05T14:43:57.554154Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"eth_df=train %>% filter(Asset_ID==6)\nDate <- as.Date(as.POSIXct(eth_df$timestamp, origin=\"1970-01-01 00:00:00.000\"))\neth_df<- data.frame(Date, eth_df)\nhead(eth_df)\n","metadata":{"execution":{"iopub.status.busy":"2021-11-05T14:57:51.505341Z","iopub.execute_input":"2021-11-05T14:57:51.507025Z","iopub.status.idle":"2021-11-05T14:57:51.646256Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"fig <- eth_df %>% plot_ly(x = ~Date, type=\"candlestick\",\n          open = ~eth_df$Open, close = ~eth_df$Close,\n          high = ~eth_df$High, low = ~eth_df$Low) \nfig <- fig %>% layout(title = \"Basic Candlestick Chart\")\nf <-\"plots/plot2.html\"\nsaveWidget(fig, file.path(normalizePath(dirname(f)),basename(f)))\ndisplay_html('<iframe src=\"plots/plot2.html\" align=\"center\" width=\"100%\" height=\"500\" frameBorder=\"0\"></iframe>')","metadata":{"execution":{"iopub.status.busy":"2021-11-05T15:05:16.33763Z","iopub.execute_input":"2021-11-05T15:05:16.33972Z","iopub.status.idle":"2021-11-05T15:05:46.272934Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]}]}