Commit Graph

11 Commits

Author SHA1 Message Date
AlexCatarino 11742406b7 Adds "sort=True" argument to pandas.concat call in PandasConverter
From [pandas-docs](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.concat.html):
> The current default of sorting is deprecated and will change to not-sorting in a future version of pandas.
>
> Explicitly pass sort=True to silence the warning and sort. > Explicitly pass sort=False to silence the warning and not sort.
2019-02-07 12:59:37 +00:00
AlexCatarino 7707c166dd Refactors PandasConverter and PandasData
Since Lean/QuantConnect data from a symbol can be found in Slice.Ticks, Slice.Bars and Slice.QuoteBars, information for all of this members must be used in order present all information in the pandas.DataFrame.
2018-03-17 19:03:52 +00:00
AlexCatarino 812906b0c3 Refactors PandasConverter
- Moves PandasData class to its own file
- Refactors PandasData class to deal with list of tick
- Other minor changes requested by peer-review
- Adds unit test for PandasConverter's tick handling
2017-11-17 16:09:44 +00:00
AlexCatarino 9023892838 Implements Tick data support in PandasConverter 2017-11-17 16:09:44 +00:00
AlexCatarino 209922e147 Minor fixes and improvements 2017-10-31 00:16:15 +00:00
AlexCatarino de19c98827 Improves PandasConverter
In the previous implementation, each one of bars.Select statement causes an extra enumeration of the bars enumerable. To make matters worse, this is all invoked 4*N times, where N is the number of data points.

Another bottleneck was related to the way we concatenate pandas.DataFrames: we would add a new data frame to an existing data frame individually. Now, we collect all data frames and concatenate them in one operation.

With this new implementation, we have accomplshed a reduction of 90% of memory usage in a history request of 1000 symbols.
2017-10-27 23:49:01 +01:00
AlexCatarino 9bbf52b4b8 Adds check for null Bid/Ask in QuoteBar for pandas.DataFrame 2017-09-13 23:09:10 +01:00
AlexCatarino 2d377b6f09 Adds QuoteBar handling to pandas.DataFrame creation 2017-08-21 13:41:00 +01:00
AlexCatarino b5dd2c403d Implements Indicator History in Jupyter project
With simple commands, we can use Lean indicators in QuantBook. It fetchs the historical data from the symbol, calculates the indicator and saves the output in a pandas.DataFrame.
2017-08-18 18:36:42 +01:00
AlexCatarino ccce9a0087 Lower-cases pandas.Dataframe columns names
Also changes BasicQuantBookTemplate to reflect the changes
2017-08-18 18:24:25 +01:00
AlexCatarino b322dec666 Modifies the pandas dataframe created from a history request
History requests should not return a dictionary with a dataframe, but a multi-index dataframe.
It is more common to work with multi-index dataframes rather than multi-column.
2017-08-18 18:23:11 +01:00