lazytrade (version 0.4.0)

load_asset_data: Load and Prepare Asset Data

Description

Function imports file with financial asset data. Each column represent one asset, rows represent observations. Values in specific columns will be normalized by dividing them by 100. This is specifically done for pairs with JPY. In addition, X1 column will be converted to the ymd_hms format

Usage

load_asset_data(
  path_terminal,
  trade_log_file,
  time_period = 1,
  data_deepth = 50000
)

Arguments

path_terminal

- path to the MT4 terminal, string

trade_log_file

- csv file name where the data is stored, without ".csv"

time_period

- data periodicity in minutes, can be 1, 15, 60

data_deepth

- collected data deepth in rows. describe how many rows in original file to read

Value

- dataframe with asset data in columns where X1 column is in a POSIXct format

Details

Works for both price and indicator values, function parameters allowing to import different files. File names are selected to account different time periodicity and amount of the data

Examples

Run this code
# NOT RUN {
library(readr)
library(dplyr)
library(lubridate)
library(magrittr)
path_terminal <- system.file("extdata", package = "lazytrade")

# load and prepare prices data
prices <- load_asset_data(path_terminal = path_terminal,
                          trade_log_file = "AI_CP",
                          time_period = 60,
                          data_deepth = "300")

# load and prepare indicator data
macd <- load_asset_data(path_terminal = path_terminal,
                        trade_log_file = "AI_Macd",
                        time_period = 60,
                        data_deepth = "300")


# }

Run the code above in your browser using DataLab