[R-SIG-Finance] How to specify price column for add.rule?

Brian G. Peterson brian at braverock.com
Wed Dec 19 04:12:57 CET 2012


On 12/18/2012 08:39 PM, Robert A'gata wrote:
> I am wondering when I say pricemethod="market" in add.rule function which
> price column in mktdata is selected? I skimmed through the code. It seems
> that if mktdata is BBO, it will pick opposite side price. However, my
> mktdata contains only price, vwap, deviation. How do I tell add.rule to
> pick price as opposed to vwap? Thank you.

as is described in the documentation, quantstrat uses the quantmod 
function getPrice to 'guess' at a price column, or uses the prefer= 
argument to choose one.  if you don't have data identifiable as BBO or 
OHLC data by the is.BBO or is.OHLC methods, getPrice will try to get a 
rational price out of your data if you don't specify prefer.

Obviously, aggressive/passive have very little meaning if you're using a 
set of traded prices, and assume that you would have been able to get 
those prices, which seems a pretty shaky assumption.


-- 
Brian G. Peterson
http://braverock.com/brian/
Ph: 773-459-4973
IM: bgpbraverock



More information about the R-SIG-Finance mailing list