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
load_asset_data(
path_terminal,
trade_log_file,
time_period = 1,
data_deepth = 50000
)
- path to the MT4 terminal, string
- csv file name where the data is stored, without ".csv"
- data periodicity in minutes, can be 1, 15, 60
- collected data deepth in rows. describe how many rows in original file to read
- dataframe with asset data in columns where X1 column is in a POSIXct format
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
# 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