On Wed, Aug 31, 2011 at 5:11 AM, G See <gsee000@gmail.com> wrote:

> mayouf.k,
>
> You have not provided us a complete example.  Your "IEF" has not been
> defined as an instrument (presumably a stock), and you have not provided us
> with initDate and endDate.
>
> Please have a look at the rsi.R demo that is included with quantstrat. Pay
> particular attention to which arguments end in an "s"
>
> e.g. initPortf has an argument named "symbols" not "symbol".  sigThreshold
> has an argument named "columns" not "column"
>
> Sorry, for sigThreshold the correct argument name is 'column' without the
's'


> Also, in your call to initPortf, you should have something like
> currency='EUR' or currency=currency("EUR") if you haven't yet defined the
> currency yet (unlikely here).
>
> If the stock and portfolio are denominated in different currencies, you
> will need to have exchange rate data available.
>
> Finally, do you really want the relationship to be 'lt' for both your
> "entre" and "sortie" signals?
>
> Let us know if you still have problems, after making these changes.
>
> HTH,
> Garrett
>
> On Wed, Aug 31, 2011 at 4:17 AM, mayouf.k <mayouf.k@gmail.com> wrote:
>
>> hi everyone,
>>
>> I want to backtest a simple strategy with RSI, im using "sigThreshold".
>>
>> i took example from the http://blog.fosstrading.com/ site to understand
>> how
>> quanstrat works.
>>
>> but now, i have a problem with my code that i really don't understand, R
>> says me:
>>
>> Error in match.names(column, colnames(data)) :
>>  argument "column" is missing, with no default
>>
>> please can someone tell me what is wrong with code:
>>
>> require(quantstrat)
>> require(blotter)
>> require(PerformanceAnalytics)
>>
>> # test de backtest quantstrat sur la strategie de daniel
>>
>>         symbols <- "IEF"
>>         getSymbols(symbols, from=initDate, to=endDate,
>> index.class=c("POSIXt","POSIXct"))
>>
>>
>>
>>
>>          # Delete portfolio, account, and order book if they already exist
>>
>> suppressWarnings(rm("account.daniel","portfolio.daniel",pos=.blotter))
>>          suppressWarnings(rm("order_book.daniel",pos=.strategy))
>>
>>                    # initialise du portefeuille
>>
>>
>> initPortf("daniel",symbol="IEF",initDate=periodicity(IEF)$start,currency('EUR'))
>>
>>                    # initialise le compte
>>          initAcct("daniel",
>> portfolios="daniel",initDate=periodicity(IEF)$start)
>>
>>                    # on initialise les ordres
>>          initOrders(portfolio="daniel",initDate=periodicity(IEF)$start)
>>
>>                    # on construit un objet de type strategy
>>          s=strategy("intraday")
>>
>>                   # on initialise un indicateur technique, (les arguments
>> sont en format list)
>>          s=
>>
>> add.indicator(strategy=s,name="RSI",arguments=list(price=quote(Cl(IEF)),n=21),label="RSI21")
>>
>>                  # on defini les 2 signals,,
>>          s=add.signal(s,name="sigThreshold" ,arguments=list(data=IEF ,
>> columns="RSI21",threshold=70,relationship="lt",cross=TRUE ),label="entre")
>>          s=add.signal(s,name="sigThreshold" ,arguments=list(data=IEF ,
>> columns="RSI21",threshold=40,relationship="lt",cross=TRUE ),label="sortie"
>> )
>>
>>
>>                 # on deifinit les regles
>>          s=add.rule(s,name="ruleSignal",arguments=list(sigcol="entre"
>> ,sigval=TRUE, orderqty=10    , ordertype="market" ,
>> orderside=NULL),type="enter")
>>          s=add.rule(s,name="ruleSignal",arguments=list(sigcol="sortie"
>> ,sigval=TRUE, orderqty="all" , ordertype="market" ,
>> orderside=NULL),type="exit" )
>>
>>          out <- try(applyStrategy(strategy=s, portfolios="daniel"))
>>
>>
>> thanks in advance
>>
>> --
>> View this message in context:
>> http://r.789695.n4.nabble.com/quantstrat-PROBLEM-WITH-APPLYSIGNAL-Error-in-match-names-column-colnames-data-argument-column-is-mist-tp3780562p3780562.html
>> Sent from the Rmetrics mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> R-SIG-Finance@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.
>>
>
>
-Garrett

	[[alternative HTML version deleted]]

