Notebook

get_pricing for specific minutes example

In [13]:
# run the get_pricing method to pull in actual data
# the result is a Pandas dataframe
prices = get_pricing('MTSL', 
                     start_date="2018-07-19", 
                     end_date="2018-07-19", 
                     fields=['close_price', 'price'], 
                     frequency='minute')
In [14]:
# display the resulting dataframe in the default Pandas format
# Notice that pandas only displays the first and last rows when the series or dataframe is very large
# The entire data exists in memory but it's just not displayed
prices
Out[14]:
close_price price
2018-07-19 13:31:00+00:00 2.959 2.959
2018-07-19 13:32:00+00:00 3.125 3.125
2018-07-19 13:33:00+00:00 3.353 3.353
2018-07-19 13:34:00+00:00 3.491 3.491
2018-07-19 13:35:00+00:00 3.370 3.370
2018-07-19 13:36:00+00:00 3.310 3.310
2018-07-19 13:37:00+00:00 3.430 3.430
2018-07-19 13:38:00+00:00 3.390 3.390
2018-07-19 13:39:00+00:00 3.350 3.350
2018-07-19 13:40:00+00:00 3.580 3.580
2018-07-19 13:41:00+00:00 3.669 3.669
2018-07-19 13:42:00+00:00 3.470 3.470
2018-07-19 13:43:00+00:00 3.600 3.600
2018-07-19 13:44:00+00:00 3.520 3.520
2018-07-19 13:45:00+00:00 3.520 3.520
2018-07-19 13:46:00+00:00 3.280 3.280
2018-07-19 13:47:00+00:00 3.200 3.200
2018-07-19 13:48:00+00:00 3.249 3.249
2018-07-19 13:49:00+00:00 3.289 3.289
2018-07-19 13:50:00+00:00 3.191 3.191
2018-07-19 13:51:00+00:00 3.110 3.110
2018-07-19 13:52:00+00:00 3.130 3.130
2018-07-19 13:53:00+00:00 3.040 3.040
2018-07-19 13:54:00+00:00 3.080 3.080
2018-07-19 13:55:00+00:00 3.070 3.070
2018-07-19 13:56:00+00:00 3.170 3.170
2018-07-19 13:57:00+00:00 3.180 3.180
2018-07-19 13:58:00+00:00 3.176 3.176
2018-07-19 13:59:00+00:00 3.150 3.150
2018-07-19 14:00:00+00:00 3.225 3.225
... ... ...
2018-07-19 19:31:00+00:00 2.774 2.774
2018-07-19 19:32:00+00:00 2.835 2.835
2018-07-19 19:33:00+00:00 2.830 2.830
2018-07-19 19:34:00+00:00 2.846 2.846
2018-07-19 19:35:00+00:00 2.860 2.860
2018-07-19 19:36:00+00:00 2.854 2.854
2018-07-19 19:37:00+00:00 2.860 2.860
2018-07-19 19:38:00+00:00 2.801 2.801
2018-07-19 19:39:00+00:00 2.818 2.818
2018-07-19 19:40:00+00:00 2.810 2.810
2018-07-19 19:41:00+00:00 2.800 2.800
2018-07-19 19:42:00+00:00 2.760 2.760
2018-07-19 19:43:00+00:00 2.832 2.832
2018-07-19 19:44:00+00:00 2.821 2.821
2018-07-19 19:45:00+00:00 2.810 2.810
2018-07-19 19:46:00+00:00 2.819 2.819
2018-07-19 19:47:00+00:00 NaN 2.819
2018-07-19 19:48:00+00:00 2.813 2.813
2018-07-19 19:49:00+00:00 2.816 2.816
2018-07-19 19:50:00+00:00 2.825 2.825
2018-07-19 19:51:00+00:00 2.822 2.822
2018-07-19 19:52:00+00:00 2.840 2.840
2018-07-19 19:53:00+00:00 2.851 2.851
2018-07-19 19:54:00+00:00 2.870 2.870
2018-07-19 19:55:00+00:00 2.920 2.920
2018-07-19 19:56:00+00:00 2.950 2.950
2018-07-19 19:57:00+00:00 2.860 2.860
2018-07-19 19:58:00+00:00 2.850 2.850
2018-07-19 19:59:00+00:00 2.920 2.920
2018-07-19 20:00:00+00:00 2.950 2.950

390 rows × 2 columns

In [15]:
# A convenient way to show the entire dataframe in an interactive scrollable format
# is to use qgrid. Something like this.
import qgrid  
qgrid.show_grid(prices, show_toolbar=True) 

Failed to display Jupyter Widget of type QgridWidget.

If you're reading this message in the Jupyter Notebook or JupyterLab Notebook, it may mean that the widgets JavaScript is still loading. If this message persists, it likely means that the widgets JavaScript library is either not installed or not enabled. See the Jupyter Widgets Documentation for setup instructions.

If you're reading this message in another frontend (for example, a static rendering on GitHub or NBViewer), it may mean that your frontend doesn't currently support widgets.