lazytrade (version 0.4.4)

test_model: Test model using independent price data.

Description

Goal of the function is to verify how good predicted results are.

Usage

test_model(test_dataset, predictor_dataset, test_type)

Arguments

test_dataset

- Dataset containing the column 'LABEL' which will correspond to the real outcome of Asset price change. This column will be used to verify the trading strategy

predictor_dataset

- Dataset containing the column 'predict'. This column is corresponding to the predicted outcome of Asset change. This column will be used to verify strategy outcomes

test_type

can be either "regression" or "classification" used to distinguish which type of model is being used

Value

Function will return a data frame with several quality score metrics for the best model. In case quality score is positive or more than 1 the model would likely be working good. In case the score will be negative then the model is not predicting good. Internal logic will test several predictor thresholds and will indicate the best one

Details

This function should work to backtest any possible dataset length. It could be that we will need to use it for testing 1 week or 1 month. It should also work for both Regression and Classification models. Note: strategy outcomes assumes trading on all 28 major forex pairs

Examples

Run this code
# NOT RUN {
library(dplyr)
data(result_prev)
data(test_data_pattern)

## evaluate hypothetical results of trading using the model
test_model(test_dataset = test_data_pattern,
           predictor_dataset = result_prev,
           test_type = "regression")



# }

Run the code above in your browser using DataLab