{ "cells": [ { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": true }, "outputs": [], "source": [ "#Import the icepython library\n", "#Make sure to read our quick start guide! Additional support can be reached by contacting DesktopClientSupport@theice.com\n", "import icepython as ice" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(('', 'IM Sent Date Bid', 'IM Bid', 'IM Ask Sender Name', 'IM Sent Date Ask', 'IM Ask', 'IM Ask Sender Name'), ('BRN 21Z-ICE', '2021-06-25T09:15:04', 72.65, 'Andrew McSween', '2021-06-25T09:15:04', 72.67, 'Andrew McSween'))\n" ] } ], "source": [ "#ICE Chat Quotes\n", "import icepython as ice\n", "symbols = ('BRN 21Z-ICE')\n", "fields = ('IM Sent Date Bid','IM Bid','IM Ask Sender Name','IM Sent Date Ask','IM Ask','IM Ask Sender Name')\n", "data = ice.get_quotes(symbols,fields,True)\n", "print(data)" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " 1 2 \\\n", "0 \n", "Time BRN 21Z-ICE.LAST BRN 21Z-ICE.IM BID CLOSE \n", "2021-06-25 72.8 72.65 \n", "\n", " 3 \n", "0 \n", "Time BRN 21Z-ICE.IM ASK CLOSE \n", "2021-06-25 72.67 \n" ] } ], "source": [ "#ICE Chat Time Series - Daily\n", "import icepython as ice\n", "import pandas as pd\n", "symbols = ('BRN 21Z-ICE')\n", "fields = ('Last','IM Bid Close','IM Ask Close')\n", "data = ice.get_timeseries(symbols,\n", " fields,\n", " granularity = 'D',\n", " start_date='2021-06-25',\n", " end_date='2021-06-25',\n", " )\n", "df = pd.DataFrame(list(data))\n", "df = df.set_index(0)\n", "print(df)" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " 1 2 \\\n", "0 \n", "Time BRN 21Z-ICE.LAST BRN 21Z-ICE.IM BID CLOSE \n", "2021-06-25T00:00:00 72.89 None \n", "2021-06-25T01:00:00 72.67 None \n", "2021-06-25T02:00:00 72.9 None \n", "2021-06-25T03:00:00 72.65 None \n", "2021-06-25T04:00:00 72.47 None \n", "2021-06-25T05:00:00 72.54 None \n", "2021-06-25T06:00:00 72.59 None \n", "2021-06-25T07:00:00 72.78 None \n", "2021-06-25T08:00:00 72.76 None \n", "2021-06-25T09:00:00 72.74 72.65 \n", "2021-06-25T10:00:00 72.83 None \n", "\n", " 3 \n", "0 \n", "Time BRN 21Z-ICE.IM ASK CLOSE \n", "2021-06-25T00:00:00 None \n", "2021-06-25T01:00:00 None \n", "2021-06-25T02:00:00 None \n", "2021-06-25T03:00:00 None \n", "2021-06-25T04:00:00 None \n", "2021-06-25T05:00:00 None \n", "2021-06-25T06:00:00 None \n", "2021-06-25T07:00:00 None \n", "2021-06-25T08:00:00 None \n", "2021-06-25T09:00:00 72.67 \n", "2021-06-25T10:00:00 None \n" ] } ], "source": [ "#ICE Chat Time Series - Intraday\n", "import icepython as ice\n", "import pandas as pd\n", "symbols = ('BRN 21Z-ICE')\n", "fields = ('Last','IM Bid Close','IM Ask Close')\n", "data = ice.get_timeseries(symbols,\n", " fields,\n", " granularity = 'i60',\n", " start_date='2021-06-25',\n", " end_date='2021-06-26',\n", " )\n", "df = pd.DataFrame(list(data))\n", "df = df.set_index(0)\n", "print(df)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.1" } }, "nbformat": 4, "nbformat_minor": 2 }