zipline-live / zipline

Zipline-Live, a Pythonic Algorithmic Trading Library
http://www.zipline-live.io/
Apache License 2.0
394 stars 65 forks source link

Forward fill first historical data's last field (#57) #59

Closed tibkiss closed 6 years ago

tibkiss commented 6 years ago

Up to now today's bar data was dropped from the dataframe returned by history(), as it was returned as np.nan.

With this PR whenever history() or current() called for a given asset the broker client will subscribe to its feed and wait for the first bar to arrive. This way the behavior will be the same as in Quantopian platform.

This PR also fixes a nasty bug introduced in #55: Asset with extended life-time was re-created using the asset's superclass (capital Asset). Now we're using the proper subclass.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.01%) to 86.088% when pulling 78b906ca08f669b11d659320b9004a762f74329d on tibkiss:fix/daily_data_history into 948beb769089141af848f51877b1610de9979278 on zipline-live:master.