View source: R/rl_generate_policy.R
rl_generate_policy | R Documentation |
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).
rl_generate_policy(x, states, actions, control)
x |
|
states |
|
actions |
|
control |
|
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
Function returns data frame with reinforcement learning model policy
(C) 2019,2021 Vladimir Zhbanko
library(dplyr)
library(ReinforcementLearning)
library(magrittr)
library(lazytrade)
data(data_trades)
states <- c("tradewin", "tradeloss")
actions <- c("ON", "OFF")
control <- list(alpha = 0.7, gamma = 0.3, epsilon = 0.1)
rl_generate_policy(x = data_trades,
states, actions, control)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.