Sample code for processing NxCore market data using Python.
- Python 3.7 or higher
- Supported OS and CPU architecture
- Windows (x86 only)
- Debian or CentOS based Linux (x86 or AArch64)
- macOS (Intel or Apple silicon)
-
Install the NxCore Python module
pip install NxCore
-
Change filepath string to the path of an nx2/nx3 tape file
filepath=""
-
Change String passed to LoadNxCore from "NxCoreAPI64.dll" to the path of the native library for your operating system
if NxCore.LoadNxCore("NxCoreAPI64.dll"):
- NxCoreAPI64.dll/NxCoreAPI.dll for Windows
- libnx.dylib for macOS
- libnx.so for Linux
- Starting NxCore ProcessTape.
- Defining/using NxCore Callback function.
- Handling the NxCore Status message.
- Handling NxCore Symbol Spin messages.
- Using NxOptionHdr.
- Constructing Option Symbols in OSI or old OPRA format.
- Handling NxCore Category messages.
- Handling NxCore Trade messages.
- Handling Exchange Quote messages.
- Handling Market Maker Quote messages.
- Processing a tape with multiple threads.
- Retrieving last Trade.
- Retrieving last Exchange Quote.
- Retrieving last Market Maker Quote.
- User defined symbol spin function.
- Available NxCore Data file listings.
- Available NxCore DLL file listings.
- Retrieving strings from NxCore Tables.
- Get Date from N days.
- Get N days from date.
- User defined symbol spin function.
- Setting UserData1 and UserData2 values.
- Retrieving UserData1 and UserData2 values.
- Determining if a tape is OSI from the tape version number.
- Constructing Option Symbols in OSI or old OPRA format.
- Sending User Defined Data through the ProcessTape function.
- Retrieving it in the NxCore Callback.
- Saving a State.
- Loading from a State.
- Handling Exteneded Trade Conditions.
- Handling Extended Timestamps.