Skip to content

Quantopian Compatibility Mode

Compare
Choose a tag to compare
@ttt733 ttt733 released this 14 Jan 22:01
· 306 commits to master since this release

Starting with v0.0.21, Pylivetrader now runs by default in what will be referred to as Quantopian compatibility mode. Notable changes that were made in response to issue #72 :

  • Using the current() function to get 'price' data previously behaved the same way as using current() to get 'last_traded'. Rather than retrieving the last trade update, in Quantopian compatibility mode, using current() to get 'price' will instead return the 'close' value of the most recently finished bar. This is to reduce confusion for users bringing in scripts from Quantopian, where that is the expected behavior.

  • It is now much less likely that price data coming from the history() function will be NaN, even when selecting small bar sizes. If any true value is found, it will be forward and backward filled to cover NaN entries. However, if a small number of bars was requested, it was possible that all values seen would be NaN, and therefore there would be nothing to cover them with. In Quantopian compatibility mode, if all values seen are NaN, the query for data will now be repeated (up to three times,) looking farther back each time for non-NaN data.

Quantopian compatibility mode can be disabled to achieve the previous behavior if you specify -q 0 as an argument when running pylivetrader from the command line.