Skip to content

NanexLLC/sample-apps-python

Repository files navigation

NxCore Python Samples

Sample code for processing NxCore market data using Python.

Setup

Requirements

  • 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)

Downloads

Running

  • 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

Samples

Sample 1

  • Starting NxCore ProcessTape.
  • Defining/using NxCore Callback function.
  • Handling the NxCore Status message.

Sample 2

  • Handling NxCore Symbol Spin messages.
  • Using NxOptionHdr.
  • Constructing Option Symbols in OSI or old OPRA format.

Sample 3

  • Handling NxCore Category messages.

Sample 4

  • Handling NxCore Trade messages.
  • Handling Exchange Quote messages.
  • Handling Market Maker Quote messages.

Sample 5

  • Processing a tape with multiple threads.

Sample 6

  • Retrieving last Trade.
  • Retrieving last Exchange Quote.
  • Retrieving last Market Maker Quote.

Sample 7

  • 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.

Sample 8

  • 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.

Sample 9

  • Sending User Defined Data through the ProcessTape function.
  • Retrieving it in the NxCore Callback.

Sample 10

  • Saving a State.
  • Loading from a State.

Sample 11

  • Handling Exteneded Trade Conditions.
  • Handling Extended Timestamps.

About

Sample code demonstrating NxCore functionality using Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages