Activating our system with two simple functions
After you have loaded some data into the system, you will be able to execute the update-markets.R
and update-assets.R
files, whose contents are shown below. The first one loads the required definitions, as we did previously when creating the user data, and provides the update_markets_loop()
function, which receives a parameter that specifies the number of minutes between each time the live market data is retrieved. Every 60 minutes is a good option, and it's what we use below. The function simply creates a Storage
instance using the SETTINGS
specification shown before, gets the existing exchanges (which is only CoinMarketCap
at this point), and calls the public update_markets()
method on each of them, with the corresponding parameters:
library(R6) library(methods) source("../storage/storage.R", chdir = TRUE) source("../utilities/time-stamp.R") source("../settings.R") update_markets_loop <- function(minutes_interval) { storage = Storage...