quantstrat and add.rule: the inner working of the orderqty argument

19 Views Asked by At

Digging into quantstrat and have it working. If it set trade = 1000 at the start of a simulation and then run it, I get different results when an exit rule using add.rule has the argument orderqty = trade*-1 to when it has orderqty = "all".

Essentially, why can orderqty = trade*-1 on an exit order trigger a short buy? Now that I have asked the question, perhaps my question is really about the role of type = in add.rule.

Thanks

I have read all documentation and cannot find an answer (that I can understand). The documentation clearly states that 'type = 'exit'' is to exit a position.

0

There are 0 best solutions below