aml_consolidate_results: Function to consolidate model test results

Description Usage Arguments Details Value Author(s) Examples

View source: R/aml_consolidate_results.R

Description

Function is designed to evaluate test results of multiple models. This is done to select only group of models with the best performance. In addition, function will provide facility to generate logs hence to allow tracking of long term model performance

[Experimental]

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
aml_consolidate_results(
  timeframe = 15,
  used_symbols,
  path_model,
  path_sbxm,
  path_sbxs,
  min_quality = 0.75,
  get_quantile = FALSE,
  log_results = FALSE,
  path_logs = NULL
)

Arguments

timeframe

Integer, Data timeframe interval in minutes e.g. 60 min

used_symbols

Vector, containing several financial instruments that were previously used to test the model

path_model

String, User path where the test results were stored

path_sbxm

String, User path to the sandbox where file with strategy test results should be written (master terminal)

path_sbxs

String, User path to the sandbox where file with strategy test results should be written (slave terminal)

min_quality

Double, value typically from 0.25 to 0.95 to select the min threshold value

get_quantile

Bool, whether or not function should return an overall value of model performances this will be used to conditionally update only less performant models

log_results

Bool, option to write logs with cumulative results obtained for all models

path_logs

String, User path to the folder where to log results

Details

Provide a modular facility to aggregate and update files, write performance logs.

Value

Function is writing files into Decision Support System folders

Author(s)

(C) 2021 Vladimir Zhbanko

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
library(dplyr)
library(magrittr)
library(readr)
library(lazytrade)
library(stats)

testpath <- normalizePath(tempdir(),winslash = "/")
path_model <- file.path(testpath, "_Model")
path_sbxm <- file.path(testpath, "_T1")
path_sbxs <- file.path(testpath, "_T3")
path_logs <- file.path(testpath, "_LOGS")
dir.create(path_model)
dir.create(path_sbxm)
dir.create(path_sbxs)
dir.create(path_logs)

file.copy(from = system.file("extdata", "StrTest-EURGBPM15.csv", package = "lazytrade"),
          to = file.path(path_model, "StrTest-EURGBPM15.csv"), overwrite = TRUE)

file.copy(from = system.file("extdata", "StrTest-EURJPYM15.csv", package = "lazytrade"),
          to = file.path(path_model, "StrTest-EURJPYM15.csv"), overwrite = TRUE)

file.copy(from = system.file("extdata", "StrTest-EURNZDM15.csv", package = "lazytrade"),
          to = file.path(path_model, "StrTest-EURNZDM15.csv"), overwrite = TRUE)

file.copy(from = system.file("extdata", "StrTest-EURUSDM15.csv", package = "lazytrade"),
          to = file.path(path_model, "StrTest-EURUSDM15.csv"), overwrite = TRUE)

Pairs <- c("EURGBP","EURJPY","EURNZD","EURUSD")

aml_consolidate_results(timeframe = 15,
                        used_symbols = Pairs,
                        path_model = path_model,
                        path_sbxm = path_sbxm,
                        path_sbxs = path_sbxs,
                        min_quality = 0.75,
                        get_quantile = FALSE)


aml_consolidate_results(timeframe = 15,
                        used_symbols = Pairs,
                        path_model = path_model,
                        path_sbxm = path_sbxm,
                        path_sbxs = path_sbxs,
                        min_quality = 0.75,
                        get_quantile = TRUE)


aml_consolidate_results(timeframe = 15,
                        used_symbols = Pairs,
                        path_model = path_model,
                        path_sbxm = path_sbxm,
                        path_sbxs = path_sbxs,
                        min_quality = 0.75,
                        get_quantile = FALSE,
                        log_results = TRUE,
                        path_logs = path_logs)

lazytrade documentation built on Dec. 16, 2021, 1:06 a.m.