[R-SIG-Finance] demo("luxor.8.walk.forward") Error in if (!all(i <= 0)) stop("only zeros may be mixed with negative subscripts") : missing value where TRUE/FALSE needed

Joshua Ulrich josh.m.ulrich at gmail.com
Tue Jul 22 18:53:09 CEST 2014


Richard,

As the posting guide says, please don't send HTML.
http://www.r-project.org/mail.html#instructions

Your message is nearly unreadable.
https://stat.ethz.ch/pipermail/r-sig-finance/2014q3/012607.html

Best,
--
Joshua Ulrich  |  about.me/joshuaulrich
FOSS Trading  |  www.fosstrading.com


On Tue, Jul 22, 2014 at 11:44 AM, Richard Long <rlong011 at verizon.net> wrote:
> I've been trying to get  the Luxor demo to work.  I have 1 through 7 working
> and have modified to my needs and have working, but the walk.forward, which
> to me is key,
> fails running the demo as delivered in the latest release:
>
> demo("luxor.8.walk.forward")
> walk.forward> > r <- walk.forward(strategy.st, paramset.label='WFA',
> portfolio.st=portfolio.st, account.st=account.st, period='months',
>  k.training=3, k.testing=1, obj.func=my.obj.func,
> obj.args=list(x=quote(result$apply.paramset)), user.func=ess,
>  user.args=list('account.st'=account.st, 'portfolio.st'=portfolio.st),
> audit.prefix='wfa', anchored=FALSE, verbose=TRUE)
> Error in if (!all(i <= 0)) stop("only zeros may be mixed with negative
> subscripts") :   missing value where TRUE/FALSE needed
>
> I thought the error might be the results of the period being months and
> k.traing=3 and k.testing=1 and the data only having 10 days so
> I tried period= days.  It got in to the WFA and then failed.
>
> demo("luxor.8.walk.forward")
>> r <- walk.forward(strategy.st, paramset.label='WFA',
>> portfolio.st=portfolio.st, account.st=account.st, period='days',
>  k.training=3, k.testing=1, obj.func=my.obj.func,
> obj.args=list(x=quote(result$apply.paramset)), user.func=ess,
>  user.args=list('account.st'=account.st, 'portfolio.st'=portfolio.st),
> audit.prefix='wfa', anchored=FALSE, verbose=TRUE)
> [1] "=== training WFA on 2002-10-21 00:30:00/2002-10-23 23:30:00"Error in
> walk.forward(strategy.st, paramset.label = "WFA", portfolio.st =
> portfolio.st,  :
>   obj.func() returned empty resultIn addition: Warning message:In
> max(x$user.func$GBPUSD.DailyEndEq) :  no non-missing arguments to max;
> returning -Inf
>
> Using my own data with 6 months of data and period=months:
>
> GBPUSD <-
> to.daily(readRDS("/dataIII/RData/gbpusd_2014-01-06v.rds"),OHLC=FALSE)[,c(1,2,3,4,9)]GBPUSD
> = align.time(GBPUSD, 86400)GBPUSD<-GBPUSD["2014-01-02 00:00:00/2014-06-30
> 00:00:00"]head(GBPUSD)           Bid_Open Bid_High Bid_Low Bid_Close
> Vol2014-01-02  1.65501  1.65501 1.65501   1.65501  1.500002014-01-03
> 1.64427  1.64427 1.64426   1.64426  4.129992014-01-04  1.64269  1.64269
> 1.64269   1.64269  2.000002014-01-05  1.64171  1.64171 1.64171   1.64171
> 1.500002014-01-07  1.64129  1.64129 1.64124   1.64124 15.159992014-01-08
> 1.64234  1.64234 1.64232   1.64232  9.829982014-01-08  1.64234  1.64234
> 1.64232   1.64232  9.82998
>
> I get:
>
> ### walk.forward> > r <- walk.forward(strategy.st, paramset.label='WFA',
> portfolio.st=portfolio.st, account.st=account.st, period='months',
> k.training=3, k.testing=1, obj.func=my.obj.func,
> obj.args=list(x=quote(result$apply.paramset)), user.func=ess,
> user.args=list('account.st'=account.st, 'portfolio.st'=portfolio.st),
> audit.prefix='wfa', anchored=FALSE, verbose=TRUE)[1] "=== training WFA on
> 2014-01-02/2014-03-30"numValues: 15, numResults: 0, stopped: TRUEgot results
> for task 1numValues: 15, numResults: 1, stopped: TRUEreturning status
> FALSEgot results for task 2numValues: 15, numResults: 2, stopped:
> TRUEreturning status FALSEgot results for task 3numValues: 15, numResults:
> 3, stopped: TRUEreturning status FALSEgot results for task 4numValues: 15,
> numResults: 4, stopped: TRUEreturning status FALSEgot results for task
> 5numValues: 15, numResults: 5, stopped: TRUEreturning status FALSEgot
> results for task 6numValues: 15, numResults: 6, stopped: TRUEreturning
> status FALSEgot results for task 7numValues: 15, numResults: 7, stopped:
> TRUEreturning status FALSEgot results for task 8numValues: 15, numResults:
> 8, stopped: TRUEreturning status FALSEgot results for task 9numValues: 15,
> numResults: 9, stopped: TRUEreturning status FALSEgot results for task
> 10numValues: 15, numResults: 10, stopped: TRUEreturning status FALSEgot
> results for task 11numValues: 15, numResults: 11, stopped: TRUEreturning
> status FALSEgot results for task 12numValues: 15, numResults: 12, stopped:
> TRUEreturning status FALSEgot results for task 13numValues: 15, numResults:
> 13, stopped: TRUEreturning status FALSEgot results for task 14numValues: 15,
> numResults: 14, stopped: TRUEreturning status FALSEgot results for task
> 15numValues: 15, numResults: 15, stopped: TRUEfirst call to combine
> functionevaluating call object to combine results:  fun(result.1, result.2,
> result.3, result.4, result.5, result.6,     result.7, result.8, result.9,
> result.10, result.11, result.12,     result.13, result.14,
> result.15)returning status TRUE[1] "=== testing param.combo 5 on
> 2014-04-01/2014-04-30"  nFAST nSLOW5     9    42Error in runSum(x, n) :
> Invalid 'n'
>
> The 1st wfa appears to work but it fails in the testing phase and I don't
> know if the problem is
> in my data or my code.
>
> This the demo code alterations highlighted:
<snip>
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions
> should go.



More information about the R-SIG-Finance mailing list