tests/testthat/test-rankscore.R

#
# test-rankscore.R
# ----------------
#
#
library(ResilientPortfolio)
library(testthat)

context("Testing rankscore")

#test_that("Testing wfo_equitycurve function", {


library(ResilientPortfolio)
library(testthat)

########  For code testing  #############
library(ResilientPortfolio)
prices = xts_data["2007-05-01/2007-10-01", ]
rets  = ROC(prices, type = "discrete")
portassets = colnames(rets)[1]
port_size = length(portassets)

rho     = 0.1
abscor  = FALSE
sigma   = 0.1
epsilon = 0
eta     = 2
maxwtsvec = c(0.2, 0.3, 0.4, 0.35, 0.5, 0.6, 0.25, 0.1)
momvec   = NA

################################

x <- rankscore(rets, portassets = portassets, maxwtsvec = maxwtsvec,
               momvec = momvec, rho = rho, abscor = abscor, sigma = sigma,
               epsilon = epsilon, eta = eta, port_size = port_size)

xtsplot(prices)

print(x)




#})
jeanmarcgp/ResilientPortfolio documentation built on April 8, 2018, 5:43 p.m.