create_labelled_data: Create labelled data

Description Usage Arguments Details Value Examples

View source: R/create_labelled_data.R

Description

FUNCTION create_labelled_data. PURPOSE: function gets price data of every currency in each column. It is splitting this data by periods and transposes the data. Additionally function is capable to label the data based on the simple logic. Each row will be assigned into 2 categories based on the difference between beginning and end of the row elements Finally all data will be stacked on top and joined into the table

Learn by example how to manipulate data

[Superseded]

Usage

1
create_labelled_data(x, n = 50, type = "regression")

Arguments

x
  • data set containing a table where 1st column is a Time index and other columns containing financial asset price values

n
  • number of rows we intend to split and transpose the data to

type
  • type of the label required. Can be either "classification" or "regression". "classification" will return either "BU" or "BE", "regression" will return the difference between first value and the last value in each row (in pips)

Details

see more info in the udemy course self-learning-trading-robot

Value

function returns transposed data. One column called 'LABEL' indicate achieved value of the label. Transposed values from every column are stacked one to each other

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(dplyr)
library(magrittr)
library(readr)
library(lazytrade)

# usind a sample data
data(price_dataset)

# price change as a label
create_labelled_data(x = price_dataset, n = 75, type = "regression")

# factors 'BU'/'BE' as a label
create_labelled_data(x = price_dataset, n = 75, type = "classification")

lazytrade documentation built on June 21, 2021, 1:08 a.m.