title: R - Quantstrat Issue with prefer and getPrice
body: <p>Currently working on a strategy in quantstrat using Quandl futures data. However, when I try to applyStrategy() after adding indicators, signals and order rules, I receive the following error message, <code>Error in getPrice(mktdata, prefer = prefer) : object 'prefer' not found</code>. <code>applyIndicators()</code> and <code>applySignals()</code> works well when debugging so the error is most likely in the processing of the rules. Below is the tail end of the mktdata variable that results after applying the signals in addition to the end part of the code.</p>
  
  <p>mktdata:</p>
  
  <p><img src="https://i.stack.imgur.com/8WSO9.jpg" alt="enter image description here"></p>
  
  <p>Code:</p>
  
  <pre><code>initPortf(portfolio.mom, symbols=allInstruments, initDate=initDate, currency='USD')
  initAcct(account.mom, portfolios=portfolio.mom, initDate=initDate, currency='USD')
  initOrders(portfolio.mom, initDate=initDate)
  strategy(strategy.mom, store=TRUE)
  
  #Indicators
  strategy.mom &lt;- add.indicator(strategy=strategy.mom, name="tsMOM", arguments=list(futDataRet = quote(Cl(mktdata)), momLookback=momLookback, tradingDays=tradingDays), label="tsMOM")
  strategy.mom &lt;- add.indicator(strategy=strategy.mom, name="retVol", arguments=list(futDataRet = quote(Cl(mktdata)), volLookback=volLookback, tradingDays=tradingDays), label="retVol")
  
  #Signals
  strategy.mom &lt;- add.signal(strategy.mom,name="sigThreshold",arguments=list(threshold=posTradeThresh, column="tsMOM", relationship="gt", cross=FALSE), label="LongCond")
  strategy.mom &lt;- add.signal(strategy.mom,name="sigThreshold",arguments=list(threshold=negTradeThresh, column="tsMOM", relationship="lt", cross=FALSE), label="ShortCond")
  
  strategy.mom &lt;- add.signal(strategy.mom, name="sigFormula",  arguments=list(columns=c("tsMOM","LongCond"), formula="((LongCond != 1) &amp; (tsMOM &gt;= 0))", cross=FALSE), label="NeutralPosCond")
  strategy.mom &lt;- add.signal(strategy.mom, name="sigFormula",  arguments=list(columns=c("tsMOM","ShortCond"), formula="((tsMOM &lt; 0) &amp; (ShortCond != 1))", cross=FALSE), label="NeutralNegCond")
  
  # Entry Rule
  strategy.mom &lt;- add.rule(strategy.mom, name="ruleSignal", arguments=list(sigcol="LongCond", sigval=TRUE, orderqty=1000, ordertype="market", orderside="long", prefer = "Close", TxnFees = -100), type="enter")
  strategy.mom &lt;- add.rule(strategy.mom, name="ruleSignal", arguments=list(sigcol="ShortCond", sigval=TRUE, orderqty=1000, ordertype="market", orderside="short", prefer = "Close", TxnFees = -100), type="enter")
  # Exit Rule
  strategy.mom &lt;- add.rule(strategy.mom, name="ruleSignal", arguments=list(sigcol="NeutralPosCond", sigval=TRUE, orderqty="all", ordertype="market", orderside="short", prefer = "Close", TxnFees = -100), type="exit")
  strategy.mom &lt;- add.rule(strategy.mom, name="ruleSignal", arguments=list(sigcol="NeutralNegCond", sigval=TRUE, orderqty="all", ordertype="market", orderside="long", prefer = "Close", TxnFees = -100), type="exit")
  
  applyStrategy(strategy=strategy.mom, portfolios=portfolio.mom, prefer="Close")
  updatePortf(portfolio.mom)
  updateAcct(account.mom)
  updateEndEq(account.mom)
  </code></pre>
  
  <p>Output of <code>sessionInfo()</code>:</p>
  
  <p><img src="https://i.stack.imgur.com/jgiLO.jpg" alt="enter image description here"></p>