Skip to content
Prev 10218 / 15274 Next

quanstrat rule to exit same day close (using daily data)

Garrett,
On 15-05-12 19:02, Brian G. Peterson wrote:
Yep, patch committed now, rev 1025. There was a problem with the new 
orderset feature (committed a couple of weeks ago), causing the 
enter-orders to be canceled.

This leaves us with the following situation:

=> if you use a hard-coded order position for the exit-order (eg, -100) 
this will still be ruthlessly followed; the order size will not be 
adjusted to match the (max) current position. As a result, you will end 
up with a -100 position after the first exit order gets executed. 
However with your modification (lt changed to gte) the enter order will 
be executed at the same bar, leaving you with a 0-position again.
=> if you use the 'all'-argument for the exit-order, the first 
exit-order will be skipped due to the 0-position, but the first 
enter-order (on the same bar) will be executed. In this case you end up 
with a 100-position, which will be exited and immediately entered again 
at the next bar that has a signal.
Best regards,