Function to simulate multiple input structures
Function is designed to evaluate several different inputs.
aml_simulation( timeframe = 60, path_sim_input, path_sim_result, par_simulate1 = 10, par_simulate2 = 16, demo_mode = FALSE )
timeframe
: Integer, Data timeframe e.g. 60 min. This will be equal to 1 barpath_sim_input
: String, Path to the folder where csv files will be placed, typically AI_RSIADXAUDCAD60.csvpath_sim_result
: String, Path to the folder where all results from simulations shall be writtenpar_simulate1
: Integer, Parameter that can be used in simulationpar_simulate2
: Integer, Parameter that can be used in simulationdemo_mode
: Boolean, Simplify function test. When TRUE no simulation will be madeFunction is writing file into Decision Support System folders
Function is using several other functions to perform sets of operations designed to test several inputs. Designed to validate model settings.
Update: New function structure to allow quicker simulation of parameters to find best performing input
library(dplyr) library(magrittr) library(readr) library(h2o) library(lazytrade) library(lubridate) library(stats) path_input <- normalizePath(tempdir(),winslash = "/") path_sim_input <- file.path(path_input, "path_sim_input") dir.create(path_sim_input) path_sim_result <- file.path(path_input, "path_sim_result") dir.create(path_sim_result) file.copy(from = system.file("extdata", "AI_RSIADXCADCHF60.csv", package = "lazytrade"), to = file.path(path_sim_input, "AI_RSIADXCADCHF60.csv"), overwrite = TRUE) file.copy(from = system.file("extdata", "AI_RSIADXEURNZD60.csv", package = "lazytrade"), to = file.path(path_sim_input, "AI_RSIADXEURNZD60.csv"), overwrite = TRUE) # start h2o engine h2o.init(nthreads = 2) # simulation of different epoch values aml_simulation(timeframe = 60, path_sim_input = path_sim_input, path_sim_result = path_sim_result, par_simulate1 = 10, par_simulate2 = 10, demo_mode = FALSE) Sys.sleep(5) # stop h2o engine h2o.shutdown(prompt = FALSE) #set delay to insure h2o unit closes properly before the next test Sys.sleep(5)
(C) 2021 Vladimir Zhbanko
Useful links