Skip to content

Commit

Permalink
Fix typo in walk.forward, update WFA test assertion
Browse files Browse the repository at this point in the history
See #125
  • Loading branch information
jaymon0703 committed Aug 25, 2020
1 parent d6b1680 commit 08f225f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions R/walk.forward.R
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ walk.forward <- function( strategy.st
results[[time.range]][['testing.timespan']] <- result$testing.timespan
results[[time.range]][['training.timespan']] <- result$training.timespan
results[[time.range]]$tradeStats <- result$apply.paramsets$tradeStats
results[[time.range]]$dailyStats <- result$apply.paramsets$dailyStats
if(saveenv){
results[[time.range]]$audit <- .audit
}
Expand Down Expand Up @@ -409,6 +410,7 @@ walk.forward <- function( strategy.st
updatePortf(test.portfolio.st, Dates=total.timespan, sep='')

results$tradeStats <- tradeStats(test.portfolio.st)
results$dailyStats <- dailyStats(test.portfolio.st)
#results$portfolio <- portfolio

iso.format <- "%Y%m%dT%H%M%S"
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test_demo_macdParameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ context("deom/macdParameters.R")

source(paste0(path.package("quantstrat"),"/demo/macdParameters.R"))

test_that("results environment has 33 objects", {
expect_equal(length(results), 33)
test_that("results environment has 34 objects", {
expect_equal(length(results), 34)
})

# Cannot test End.Equity since we use a random sample of all possible parameter combinations,
Expand Down

0 comments on commit 08f225f

Please sign in to comment.