Skip to content
Prev 6297 / 15274 Next

!SPAM: Re: quantstrat: order sizing question

On 06/28/2010 08:03 PM, km wrote:
You didn't tell us what warnings you received...

osNoOp (the default) has only the arguments in your example.  You may want to 
look at osMaxPos for a more involved example function.

Currently, 'ruleSignal' (which you could also replace if you wanted to ...) 
uses 'match.fun' to match your oder sizing function into 'osFUN', and then passes:

osFUN(strategy=strategy, mktdata=mktdata, timestamp=timestamp, 
orderqty=orderqty, ordertype=ordertype, orderside=orderside, 
portfolio=portfolio, symbol=symbol)

note these are all named arguments.

We should probably update that to also pass dots, but that's all the variables 
that ruleSignal knows about *for sure* at that point in time, and I suspect it 
should be sufficient for most order sizing functions without adding dots.  I'll 
add dots to SVN now.

Notice also that orderqty, per the docs, is "numeric quantity of the desired 
order, or 'all'" and ruleSignal has a number of different numeric comparisons 
for trade direction.  I suspect that may be the source of (some of) your warnings.

So, I hope this helps point you in the right direction, but you may also need 
to give us an actually reproducible example, and tell us exactly the error or 
warning messages you're seeing.

Regards,

    - Brian