rl_generate_policy_mt: Function performs RL and generates model policy for each...

Description Usage Arguments Details Value Examples

View source: R/rl_generate_policy_mt.R

Description

This function will perform Reinforcement Learning using Trading Data. It will suggest whether or not it is better to keep using trading systems or not. Function is just using results of the past performance to generate the recommendation (not a holy grail).

[Stable]

Usage

1
rl_generate_policy_mt(x, states, actions, control)

Arguments

x
  • Dataframe containing trading data

states
  • Character vector, Selected states of the System

actions
  • Character vector, Selected actions executed under environment

control
  • List, control parameters as defined in the Reinforcement Learning Package

Details

Initial policy is generated using a dummy zero values. This way function starts working directly from the first observation. However policy 'ON' value will only be generated once the Q value is greater than zero

Value

Function returns data frame with reinforcement learning model policy

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(dplyr)
library(magrittr)
library(ReinforcementLearning)
library(lazytrade)
data(trading_systemDF)
states <- c("BUN", "BUV", "BEN", "BEV", "RAN", "RAV")
actions <- c("ON", "OFF")
control <- list(alpha = 0.7, gamma = 0.3, epsilon = 0.1)
rl_generate_policy_mt(x = trading_systemDF,
                      states = states,
                      actions = actions,
                      control = control)

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