From b879667779a564e46fc6884acf756f499612f5bc Mon Sep 17 00:00:00 2001 From: Jasen Mackie Date: Fri, 29 Mar 2019 19:46:38 +0000 Subject: [PATCH] Fix training.end.v vector so it does not overlap testing.start.v Could resolve #90 but needs to be tested --- R/walk.forward.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/walk.forward.R b/R/walk.forward.R index 4255470..f315d7b 100644 --- a/R/walk.forward.R +++ b/R/walk.forward.R @@ -124,7 +124,7 @@ walk.forward <- function( strategy.st total.timespan <- paste(index(symbol.data[total.start]), '', sep='/', index(last(symbol.data))) # construct the subsets to use for training/testing - training.end.v <- ep[c(k.training+1,(k.training+1)+cumsum(rep(k.testing,as.integer((length(ep)-k.training)/k.testing))))] + training.end.v <- ep[c(k.training+1,(k.training)+cumsum(rep(k.testing,as.integer((length(ep)-k.training)/k.testing))))] if( is.na(last(training.end.v)) ) { training.end.v <- training.end.v[-length(training.end.v)]