quantopian/zipline — pull request #351 by humdings (2014-06-17 17:31:01+00:00)
Title: ENH: Time in force models for orders DISCUSSION ONLY

This is a first run through on supporting time in force models for orders. It changes a lot of behavior, for instance, orders are cancelled at EOD by default. The plan is to support more order types, while making backtest behavior more closely model live trading.

The time in force models added are a few of the ones supported by IB. They should extend easily to other brokers because they essentially just define 'good after' and 'good till' dates for orders.

I modeled this after the ExecutionStyles because it seemed like a simple way to go about it. However, there are probably a lot of ways to get this done so I wanted open up the implementation to discussion before going further.

This won't pass nosetests as is (FAILED (errors=16, failures=3)), but it looks like it's the tests that are broken, and not the trading simulation.

TWS reference: https://www.interactivebrokers.com/en/software/tws/twsguide_Left.htm#CSHID=usersguidebook%2Fordertypes%2Ftime_in_force_for_orders.htm|StartTopic=usersguidebook%2Fordertypes%2Ftime_in_force_for_orders.htm|SkinName=ibskin