Embedded Python Real-Time FrameWork : API  Build 20250616.1
 All Classes Namespaces Files Functions Variables Pages
Gatea Real-Time Reactor : Embedded Python Interpreter

Gatea sells platforms to capture, bridge, analyze and mine real-time data from: + Direct exchanges,

  • Major market data vendors, and
  • Widely-used trading platforms

Program the Real-Time Data Stream

Each component of the real-time platform has a fully integrated Python interpreter that appears as a Python Module in your Python application:

Gatea Component Python Module Name Function
dmaDataMiner DMA Real-Time Data Mining
gateaBridge warp Data Capture and Analysis
gateaReplay warp Data Capture and Analysis
omniBridge omniBridge Driver-based Bridge

Each Embedded Python Interpreter is a Reactor that drives real-time events into well-defined callback handlers in your Python application, such as:

Callback Component Event Frequency
OnEngineLoad All Engine Loaded Once per app
OnEngineUnload All Engine Unloaded Once per app
OnMessage omni Raw Real-Time Update Received from Driver Each Update
OnFieldList omni Parsed Real-Time Update Received from Driver Each Update
OnPubOpen omni Data Stream Opened from Bridge Once per publication stream
OnPubClose omni Data Stream Closed from Bridge Once per publication stream
OnInitialize warp A record was created from message off tape Once per record
OnCache warp Real-Time update from tape was cached Once per message
OnPubImage warp Real-Time Image was published Once per message
OnPubUpdate warp xxReal-Time Update was published Once per message

The events generated by the Reactor in the Embedded Python Interpreter allow you to analyze, mine, calculate, publish, and program the real-time data stream in your Python application. In short, the Gatea Embedded Python Real-Time Platform allows you to program the real-time data stream. The platform gives you the ability to add your business logic inline in the data stream.

The framework consists of:

Python Component Description
Native Modules Embedded Python Reactors, driving events and callbacks into your code
pyRT package Python class libraries to help you quickly build your apps

You build your application using any combination of the two:

pyRT-AppDev2.png

Embedded Python Interpreter : Native Modules

Each embedded Python interpreter appears as a native Python module from the Gatea software component in which it is embedded:

Gatea Component Function Native Python Module
dmaDataMiner Real-Time Data Mining DMA
gateaBridge Data Capture and Analysis warp
gateaReplay Data Capture and Analysis warp
omniBridge Driver-based Bridge omniBridge

These well documented native Python modules must be imported for your Python code to run:

1 import warp
2 
3 print warp.version()

Event-Driven Callbacks

A native Python module is a Reactor that drives well-defined events (callbacks) into your Python code that you operate on. Generally speaking, data from the Reactor that is driven from the native modules are either:

Data Complexity Data Type
Simple int, double string
Complex Python lists
1 import warp
2 
3 def OnEngineLoad( cxt ):
4  warp.registerTickers( cxt, [ 'AAPL', 'GOOG' ] )

pyRT Python Package

The pyRT Python package is a set of class libraries that sit atop the native Python modules to help you quickly build apps to work with the data stream.

pyRT.native Package

The pyRT.native package wraps the native modules in a helpful class called API:

1 import native.warpModule
2 
3 def OnEngineLoad( cxt ):
4  manager = native.warpModule.API( cxt )
5  manager.RegisterTickerList( [ 'AAPL', 'GOOG' ] )
6  print api.Version()

The package also provides helpful classes to crack the complex data driven into your app by the native modules, for example:

Module Class Description
DMA native.dmaModule.Book Live Order Book
warp native.warpModule.FieldList Market Data Field List

You have 2 options for accessing the module-specific API:

  • Call native module directly :
    1 warp.registerTickers( cxt, [ 'AAPL', 'GOOG' ] )
  • Call through pyRT.native:
    1 global manager
    2 
    3 manager = native.warpModule.API( cxt )
    4 manager.RegisterTickerList( [ 'AAPL', 'GOOG' ] )

pyRT.gatea Library

The pyRT.gatea library includes several modules to help your quickly build value added services that process, analyze and transform real-time data:

Module Description
gatea.admin XML Admin / Control Channel Stuff
gatea.feeds Market Data Exchange and Vendor Feeds
gatea.FIX FIX Protocol Message Cracking
gatea.MktData Basic Market Data Constructs : Data Dict, Chains, etc.
gatea.net Network-related : Sockets, Connections, Event Pumps, DataDog
gatea.OMS Order Book, Live Order d/b
gatea.quant Quant Stuff, mostly from Numerical Recipes in C:
gatea.stat Time-Series Stats : Correlations, StdDev, etc.
gatea.sys System-level stuff : ODBC, SMTP, Thread
gatea.xml XML parsing and building
gatea.web HTTP and WebSockets classes

Applications : Services and Examples

Many fully functional real-time services and examples are included in apps:

Module Service Description
apps.omniBridge.Bridge FIX-fed Top of Book and Depth of Book services
apps.warp.Algo Algo-based Alerts : Simple Moving Average Crossover
apps.warp.Filter Block Trade, Options Trade Feeds
apps.warp.Monitor Cross Market and Latency Monitors
apps.warp.Simple Quote Flipping; Quote Spreading; 'Hello World' examples
apps.warp.Stat Stock-Pair Correlation and sorting
apps.warp.ValueAdded New Calcs : Chains, Basket Calcs, Synthetic BBO, etc.
apps.warp.VendorCmp Vendor Comparision (NASDAQ Basic to NBBO)