{ "cells": [ { "cell_type": "markdown", "id": "a2468e6e-b872-4c22-9d7c-bbd9e63b3960", "metadata": {}, "source": [ "# Symbologies" ] }, { "cell_type": "markdown", "id": "26263b8e-6573-4c93-82e4-bb1db1297aa8", "metadata": {}, "source": [ "
\n", "This is part of the OQD offering. Available in OneTick Cloud. Can be configured on prem.\n", "
" ] }, { "cell_type": "markdown", "id": "63dbbd13-4431-4e9f-afaf-a5f0f491cfab", "metadata": {}, "source": [ "We can query data using different symbologies." ] }, { "cell_type": "code", "execution_count": null, "id": "6eed0384-49d5-42f3-b00d-defb751c051c", "metadata": {}, "outputs": [], "source": [ "import onetick.py as otp\n", "\n", "trd = otp.DataSource('NYSE_TAQ', tick_type='TRD')\n", "trd = trd[['PRICE', 'SIZE', 'EXCHANGE', 'COND']]\n", "trd = trd.first(1)\n", "merged = otp.merge([trd], symbols=['BTKR::::AAPL US', 'FGV::::btkr000BPH459'], identify_input_ts=True)\n", "otp.run(merged, start=otp.dt(2022, 3, 1, 10), end=otp.dt(2022, 3, 1, 10, 15), symbol_date=otp.dt(2022, 10, 1))" ] }, { "cell_type": "markdown", "id": "2b8306e5-bc9c-41ac-824a-ef6da2f6f6a2", "metadata": {}, "source": [ "We can create a mapping between symbologies." ] }, { "cell_type": "code", "execution_count": 45, "id": "bd8a4dc1-0a5b-4fd9-b21c-6c62346e82d5", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
TimeSYMBOL_NAMEORIGINAL_SYMBOL_NAME
02022-12-01BBG000C2V3D6NYSE_TAQ::A
12022-12-01BBG00B3T3HD3NYSE_TAQ::AA
22022-12-01BBG01B0JRCS6NYSE_TAQ::AAA
32022-12-01BBG00LPXX872NYSE_TAQ::AAAU
42022-12-01BBG00YZC2Z91NYSE_TAQ::AAC
............
110072022-12-01BBG00YZ7S2J6NYSE_TAQ::ZWRKW
110082022-12-01BBG000H8R0N8NYSE_TAQ::ZWS
110092022-12-01BBG019XSYC89NYSE_TAQ::ZYME
110102022-12-01BBG007BBS8B7NYSE_TAQ::ZYNE
110112022-12-01BBG000BJBXZ2NYSE_TAQ::ZYXI
\n", "

11012 rows × 3 columns

\n", "
" ], "text/plain": [ " Time SYMBOL_NAME ORIGINAL_SYMBOL_NAME\n", "0 2022-12-01 BBG000C2V3D6 NYSE_TAQ::A\n", "1 2022-12-01 BBG00B3T3HD3 NYSE_TAQ::AA\n", "2 2022-12-01 BBG01B0JRCS6 NYSE_TAQ::AAA\n", "3 2022-12-01 BBG00LPXX872 NYSE_TAQ::AAAU\n", "4 2022-12-01 BBG00YZC2Z91 NYSE_TAQ::AAC\n", "... ... ... ...\n", "11007 2022-12-01 BBG00YZ7S2J6 NYSE_TAQ::ZWRKW\n", "11008 2022-12-01 BBG000H8R0N8 NYSE_TAQ::ZWS\n", "11009 2022-12-01 BBG019XSYC89 NYSE_TAQ::ZYME\n", "11010 2022-12-01 BBG007BBS8B7 NYSE_TAQ::ZYNE\n", "11011 2022-12-01 BBG000BJBXZ2 NYSE_TAQ::ZYXI\n", "\n", "[11012 rows x 3 columns]" ] }, "execution_count": 45, "metadata": {}, "output_type": "execute_result" } ], "source": [ "figi = otp.Symbols('NYSE_TAQ', symbology='FGV', show_original_symbols=True, for_tick_type='TRD')\n", "figi, _ = figi[figi['SYMBOL_NAME'] != '']\n", "otp.run(figi, start=otp.dt(2022, 12, 1), end=otp.dt(2022, 12, 2))" ] }, { "cell_type": "code", "execution_count": 46, "id": "d9510ca4-9f14-4ddf-907d-0e74ec45ee70", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
TimeSYMBOL_NAMEORIGINAL_SYMBOL_NAME
02022-12-01A USNYSE_TAQ::A
12022-12-01AA USNYSE_TAQ::AA
22022-12-01AAA USNYSE_TAQ::AAA
32022-12-01AAAU USNYSE_TAQ::AAAU
42022-12-01AAC USNYSE_TAQ::AAC
............
109262022-12-01ZWRKW USNYSE_TAQ::ZWRKW
109272022-12-01ZWS USNYSE_TAQ::ZWS
109282022-12-01ZYME USNYSE_TAQ::ZYME
109292022-12-01ZYNE USNYSE_TAQ::ZYNE
109302022-12-01ZYXI USNYSE_TAQ::ZYXI
\n", "

10931 rows × 3 columns

\n", "
" ], "text/plain": [ " Time SYMBOL_NAME ORIGINAL_SYMBOL_NAME\n", "0 2022-12-01 A US NYSE_TAQ::A\n", "1 2022-12-01 AA US NYSE_TAQ::AA\n", "2 2022-12-01 AAA US NYSE_TAQ::AAA\n", "3 2022-12-01 AAAU US NYSE_TAQ::AAAU\n", "4 2022-12-01 AAC US NYSE_TAQ::AAC\n", "... ... ... ...\n", "10926 2022-12-01 ZWRKW US NYSE_TAQ::ZWRKW\n", "10927 2022-12-01 ZWS US NYSE_TAQ::ZWS\n", "10928 2022-12-01 ZYME US NYSE_TAQ::ZYME\n", "10929 2022-12-01 ZYNE US NYSE_TAQ::ZYNE\n", "10930 2022-12-01 ZYXI US NYSE_TAQ::ZYXI\n", "\n", "[10931 rows x 3 columns]" ] }, "execution_count": 46, "metadata": {}, "output_type": "execute_result" } ], "source": [ "btkr = otp.Symbols('NYSE_TAQ', symbology='BTKR', show_original_symbols=True, for_tick_type='TRD')\n", "btkr, _ = btkr[btkr['SYMBOL_NAME'] != '']\n", "otp.run(btkr, start=otp.dt(2022, 12, 1), end=otp.dt(2022, 12, 2))" ] }, { "cell_type": "code", "execution_count": 51, "id": "58c2d540-438e-4086-87fc-043c443cc1ec", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
TimeFIGIBTKRDB_SYMBOL
02022-12-01BBG000C2V3D6A USNYSE_TAQ::A
12022-12-01BBG00B3T3HD3AA USNYSE_TAQ::AA
22022-12-01BBG01B0JRCS6AAA USNYSE_TAQ::AAA
32022-12-01BBG00LPXX872AAAU USNYSE_TAQ::AAAU
42022-12-01BBG00YZC2Z91AAC USNYSE_TAQ::AAC
...............
110052022-12-01BBG00YZ7S2J6ZWRKW USNYSE_TAQ::ZWRKW
110062022-12-01BBG000H8R0N8ZWS USNYSE_TAQ::ZWS
110072022-12-01BBG019XSYC89ZYME USNYSE_TAQ::ZYME
110082022-12-01BBG007BBS8B7ZYNE USNYSE_TAQ::ZYNE
110092022-12-01BBG000BJBXZ2ZYXI USNYSE_TAQ::ZYXI
\n", "

11010 rows × 4 columns

\n", "
" ], "text/plain": [ " Time FIGI BTKR DB_SYMBOL\n", "0 2022-12-01 BBG000C2V3D6 A US NYSE_TAQ::A\n", "1 2022-12-01 BBG00B3T3HD3 AA US NYSE_TAQ::AA\n", "2 2022-12-01 BBG01B0JRCS6 AAA US NYSE_TAQ::AAA\n", "3 2022-12-01 BBG00LPXX872 AAAU US NYSE_TAQ::AAAU\n", "4 2022-12-01 BBG00YZC2Z91 AAC US NYSE_TAQ::AAC\n", "... ... ... ... ...\n", "11005 2022-12-01 BBG00YZ7S2J6 ZWRKW US NYSE_TAQ::ZWRKW\n", "11006 2022-12-01 BBG000H8R0N8 ZWS US NYSE_TAQ::ZWS\n", "11007 2022-12-01 BBG019XSYC89 ZYME US NYSE_TAQ::ZYME\n", "11008 2022-12-01 BBG007BBS8B7 ZYNE US NYSE_TAQ::ZYNE\n", "11009 2022-12-01 BBG000BJBXZ2 ZYXI US NYSE_TAQ::ZYXI\n", "\n", "[11010 rows x 4 columns]" ] }, "execution_count": 51, "metadata": {}, "output_type": "execute_result" } ], "source": [ "figi = otp.Symbols('NYSE_TAQ', symbology='FGV', show_original_symbols=True, for_tick_type='TRD')\n", "btkr = otp.Symbols('NYSE_TAQ', symbology='BTKR', show_original_symbols=True, for_tick_type='TRD')\n", "btkr, _ = btkr[btkr['SYMBOL_NAME'] != '']\n", "figi, _ = figi[figi['SYMBOL_NAME'] != '']\n", "\n", "mapping = otp.functions.join(figi, btkr, on=btkr['ORIGINAL_SYMBOL_NAME']==figi['ORIGINAL_SYMBOL_NAME'], how=\"inner\")\n", "\n", "mapping = mapping.rename({'RIGHT_SYMBOL_NAME' : 'BTKR',\n", " 'SYMBOL_NAME' : 'FIGI',\n", " 'ORIGINAL_SYMBOL_NAME': 'DB_SYMBOL'})\n", "\n", "mapping = mapping[['FIGI', 'BTKR', 'DB_SYMBOL']]\n", "\n", "otp.run(mapping, start=otp.dt(2022, 12, 1), end=otp.dt(2022, 12, 2))" ] }, { "cell_type": "markdown", "id": "61ae358f-6d6b-4054-a2c2-b743c97be56d", "metadata": {}, "source": [ "And here is an example for a non-US market" ] }, { "cell_type": "code", "execution_count": 52, "id": "e58c23de-05b3-47eb-8a86-469ef1b88c26", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
TimeTICKERFIGIDB_SYMBOL
02022-12-01020YBBG007XBDG85LSE::020Y
12022-12-010A05BBG00SYG7Q00LSE::0A05
22022-12-010A07BBG00NWMW214LSE::0A07
32022-12-010A08BBG00NWMVL13LSE::0A08
42022-12-010A0BBBG00NWMW143LSE::0A0B
...............
53322022-12-01ZNWDBBG00JG082G0LSE::ZNWD
53332022-12-01ZOOBBG000DBR279LSE::ZOO
53342022-12-01ZPHRBBG000DB8YK5LSE::ZPHR
53352022-12-01ZTFBBG000BGXLF2LSE::ZTF
53362022-12-01ZYTBBG000BZPV76LSE::ZYT
\n", "

5337 rows × 4 columns

\n", "
" ], "text/plain": [ " Time TICKER FIGI DB_SYMBOL\n", "0 2022-12-01 020Y BBG007XBDG85 LSE::020Y\n", "1 2022-12-01 0A05 BBG00SYG7Q00 LSE::0A05\n", "2 2022-12-01 0A07 BBG00NWMW214 LSE::0A07\n", "3 2022-12-01 0A08 BBG00NWMVL13 LSE::0A08\n", "4 2022-12-01 0A0B BBG00NWMW143 LSE::0A0B\n", "... ... ... ... ...\n", "5332 2022-12-01 ZNWD BBG00JG082G0 LSE::ZNWD\n", "5333 2022-12-01 ZOO BBG000DBR279 LSE::ZOO\n", "5334 2022-12-01 ZPHR BBG000DB8YK5 LSE::ZPHR\n", "5335 2022-12-01 ZTF BBG000BGXLF2 LSE::ZTF\n", "5336 2022-12-01 ZYT BBG000BZPV76 LSE::ZYT\n", "\n", "[5337 rows x 4 columns]" ] }, "execution_count": 52, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# 'FGV' is venue FIGI\n", "# 'FGC' is composite FIGI\n", "fgv = otp.Symbols('LSE', symbology='FGV', show_original_symbols=True, for_tick_type='TRD')\n", "tkr = otp.Symbols('LSE', symbology='TKR', show_original_symbols=True, for_tick_type='TRD')\n", "\n", "mapping = otp.functions.join(fgv, tkr, on=fgv['ORIGINAL_SYMBOL_NAME']==tkr['ORIGINAL_SYMBOL_NAME'], how=\"inner\")\n", "\n", "mapping, _ = mapping[mapping['SYMBOL_NAME'] != '']\n", "mapping = mapping.rename({'RIGHT_SYMBOL_NAME' : 'TICKER',\n", " 'SYMBOL_NAME' : 'FIGI',\n", " 'ORIGINAL_SYMBOL_NAME': 'DB_SYMBOL'})\n", "\n", "mapping = mapping[['TICKER', 'FIGI', 'DB_SYMBOL']]\n", "start = otp.dt(2022, 5, 20)\n", "end = otp.dt(2022, 5, 25)\n", "\n", "otp.run(mapping, start=otp.dt(2022, 12, 1), end=otp.dt(2022, 12, 2))" ] }, { "cell_type": "markdown", "id": "4a5f2236-e7a9-4b20-859b-2fa3e3e0d7da", "metadata": {}, "source": [ "# Symbol name changes\n", "Symbol name changes are easy to handle with the `symbol_date` parameter of `otp.run()` which provides the \"as of\" date for the symbols. For example, we can pass `META` while setting `symbol_date` to any date after 2022-06-09 or `FB` and `symbol_date` before 2022-06-09." ] }, { "cell_type": "code", "execution_count": 53, "id": "5dd68a3d-4f69-47d4-ba08-ccd3a3f33377", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
TimeEXCHANGECONDSTOP_STOCKSOURCETRFTTETICKERPRICEDELETED_TIMETICK_STATUSSIZECORRSEQ_NUMTRADE_IDPARTICIPANT_TIMETRF_TIMEOMDSEQ
02023-02-02 00:00:00.100474511Q@ TIN0META183.131970-01-01010072861171609782023-02-02 00:00:00.1004583311970-01-01 00:00:00.0000000000
12023-02-02 00:00:00.825173183Q@FTN1META183.131970-01-010100072861181609792023-02-02 00:00:00.8251570121970-01-01 00:00:00.0000000000
22023-02-02 00:00:00.835111354K@ TIN1META183.181970-01-010207286119541292023-02-02 00:00:00.8348650001970-01-01 00:00:00.0000000000
32023-02-02 00:00:00.837461982Q@ TIN0META183.181970-01-0105072861231609802023-02-02 00:00:00.8374464381970-01-01 00:00:00.0000000000
42023-02-02 00:00:00.877120054D@ TINQ0META183.131970-01-01013072861241178542023-02-02 00:00:00.8750000002023-02-02 00:00:00.8770938810
\n", "
" ], "text/plain": [ " Time EXCHANGE COND STOP_STOCK SOURCE TRF TTE TICKER PRICE DELETED_TIME TICK_STATUS SIZE CORR SEQ_NUM TRADE_ID PARTICIPANT_TIME TRF_TIME OMDSEQ\n", "0 2023-02-02 00:00:00.100474511 Q @ TI N 0 META 183.13 1970-01-01 0 10 0 7286117 160978 2023-02-02 00:00:00.100458331 1970-01-01 00:00:00.000000000 0\n", "1 2023-02-02 00:00:00.825173183 Q @FT N 1 META 183.13 1970-01-01 0 100 0 7286118 160979 2023-02-02 00:00:00.825157012 1970-01-01 00:00:00.000000000 0\n", "2 2023-02-02 00:00:00.835111354 K @ TI N 1 META 183.18 1970-01-01 0 2 0 7286119 54129 2023-02-02 00:00:00.834865000 1970-01-01 00:00:00.000000000 0\n", "3 2023-02-02 00:00:00.837461982 Q @ TI N 0 META 183.18 1970-01-01 0 5 0 7286123 160980 2023-02-02 00:00:00.837446438 1970-01-01 00:00:00.000000000 0\n", "4 2023-02-02 00:00:00.877120054 D @ TI N Q 0 META 183.13 1970-01-01 0 13 0 7286124 117854 2023-02-02 00:00:00.875000000 2023-02-02 00:00:00.877093881 0" ] }, "execution_count": 53, "metadata": {}, "output_type": "execute_result" } ], "source": [ "trd = otp.DataSource('NYSE_TAQ', tick_type='TRD')\n", "trd = trd.first(5)\n", "otp.run(trd, start=otp.dt(2023, 2, 2), end=otp.dt(2023, 2, 3), symbols='META', symbol_date=otp.dt(2023, 2, 2))" ] }, { "cell_type": "code", "execution_count": 54, "id": "4ca8dd4e-9212-4d8c-b063-3de40286e034", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
TimeEXCHANGECONDSTOP_STOCKSOURCETRFTTETICKERPRICEDELETED_TIMETICK_STATUSSIZECORRSEQ_NUMTRADE_IDPARTICIPANT_TIMETRF_TIMEOMDSEQ
02023-02-02 00:00:00.100474511Q@ TIN0META183.131970-01-01010072861171609782023-02-02 00:00:00.1004583311970-01-01 00:00:00.0000000000
12023-02-02 00:00:00.825173183Q@FTN1META183.131970-01-010100072861181609792023-02-02 00:00:00.8251570121970-01-01 00:00:00.0000000000
22023-02-02 00:00:00.835111354K@ TIN1META183.181970-01-010207286119541292023-02-02 00:00:00.8348650001970-01-01 00:00:00.0000000000
32023-02-02 00:00:00.837461982Q@ TIN0META183.181970-01-0105072861231609802023-02-02 00:00:00.8374464381970-01-01 00:00:00.0000000000
42023-02-02 00:00:00.877120054D@ TINQ0META183.131970-01-01013072861241178542023-02-02 00:00:00.8750000002023-02-02 00:00:00.8770938810
\n", "
" ], "text/plain": [ " Time EXCHANGE COND STOP_STOCK SOURCE TRF TTE TICKER PRICE DELETED_TIME TICK_STATUS SIZE CORR SEQ_NUM TRADE_ID PARTICIPANT_TIME TRF_TIME OMDSEQ\n", "0 2023-02-02 00:00:00.100474511 Q @ TI N 0 META 183.13 1970-01-01 0 10 0 7286117 160978 2023-02-02 00:00:00.100458331 1970-01-01 00:00:00.000000000 0\n", "1 2023-02-02 00:00:00.825173183 Q @FT N 1 META 183.13 1970-01-01 0 100 0 7286118 160979 2023-02-02 00:00:00.825157012 1970-01-01 00:00:00.000000000 0\n", "2 2023-02-02 00:00:00.835111354 K @ TI N 1 META 183.18 1970-01-01 0 2 0 7286119 54129 2023-02-02 00:00:00.834865000 1970-01-01 00:00:00.000000000 0\n", "3 2023-02-02 00:00:00.837461982 Q @ TI N 0 META 183.18 1970-01-01 0 5 0 7286123 160980 2023-02-02 00:00:00.837446438 1970-01-01 00:00:00.000000000 0\n", "4 2023-02-02 00:00:00.877120054 D @ TI N Q 0 META 183.13 1970-01-01 0 13 0 7286124 117854 2023-02-02 00:00:00.875000000 2023-02-02 00:00:00.877093881 0" ] }, "execution_count": 54, "metadata": {}, "output_type": "execute_result" } ], "source": [ "trd = otp.DataSource('NYSE_TAQ', tick_type='TRD')\n", "trd = trd.first(5)\n", "otp.run(trd, start=otp.dt(2023, 2, 2), end=otp.dt(2023, 2, 3), symbols='FB', symbol_date=otp.dt(2021, 2, 2))" ] }, { "cell_type": "code", "execution_count": null, "id": "05e3ce48-53bc-40ef-a260-ff948622c2c6", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "276a6e9d-3831-469c-aaec-f923bb0b600d", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "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.9.8" } }, "nbformat": 4, "nbformat_minor": 5 }