Skip to content

Commit

Permalink
Fix training.end.v vector so it does not overlap testing.start.v
Browse files Browse the repository at this point in the history
Could resolve #90 but needs to be tested
  • Loading branch information
jaymon0703 committed Mar 29, 2019
1 parent 4e91555 commit b879667
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/walk.forward.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit b879667

Please sign in to comment.