mt_stat_evaluate: Function to prepare and score data, finally predict current...

Description Usage Arguments Value Author(s) Examples

View source: R/mt_stat_evaluate.R

Description

PURPOSE: Function that uses Deep Learning model and Time Series Column of the dataframe to find out specific market type of the financial asset it will also discard bad result outputting -1 if it is the case

[Stable]

Usage

1
mt_stat_evaluate(x, path_model, num_bars, timeframe)

Arguments

x
  • dataframe with one column containing asset indicator in the time descending order, typically 64 or more values

path_model

String, path to the model

num_bars

Integer, Number of bars used to perform transformation

timeframe

Integer, timeframe in Minutes.

Value

dataframe with predicted value of the market type

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
library(h2o)
library(magrittr)
library(dplyr)
library(readr)
library(lazytrade)
library(stats)

path_model <- normalizePath(tempdir(),winslash = "/")
path_data <- normalizePath(tempdir(),winslash = "/")


# start h2o engine (using all CPU's by default)
h2o.init(nthreads = 2)

data(price_dataset_big)
data <- head(price_dataset_big, 500) #reduce computational time

ai_class <- mt_stat_transf(indicator_dataset = data,
                      num_bars = 64,
                      timeframe = 60,
                      path_data = path_data,
                      mt_classes = c('BUN', 'BEN', 'RAN'))

# performing Deep Learning Classification using the custom function auto clustered data
mt_make_model(indicator_dataset = ai_class,
              num_bars = 64,
              timeframe = 60,
              path_model = path_model,
              path_data = path_data,
              activate_balance = TRUE,
              num_nn_options = 3,
              num_epoch = 10,
              is_cluster = TRUE)


# Use sample data
data(price_dataset)

# use one column for testing
x <- price_dataset[ ,2]


mt_stat_evaluate(x = x,
                 path_model = path_model,
                 num_bars = 64,
                 timeframe = 60)

h2o.shutdown(prompt = FALSE)

#set delay to insure h2o unit closes properly before the next test
Sys.sleep(5)

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