lindfinancial tm api xml technology for electronic order entry and management ernesto l. aparcedo,...
TRANSCRIPT
LindFinancialTM API
XML Technology for
Electronic Order Entry and Management
Ernesto L. Aparcedo, Ph.D.Director Systems Development
Lind-Waldock Inc., a division of Refco LLC
Agenda
• Design Aspects of an XML API
• Implementing the LindFinancial API
• Developing Order Entry Solutions with the LindFinancial API
• Impact of the New API Architecture
• Trends and Future Directions
Why a new API Architecture?
• Provide a consistent and scalable Business-Centric API • Maintain High Performance for Interface Clients and
Server Applications• Minimize costs in software development maintenance
and upgrades:– Separate data presentation from business processing– Encoding and Decoding data via XML– Provide abstracted interface to Order Routing Engine
• Establish foundations for Order Routing growth• Preserve current Order Routing investment
API Technical Challenges
• Scalable and Extensible API• Multiple development platforms: client,
servers, desktop, web, wireless, tablet• Multiple Operating Systems: Microsoft
Windows, Linux, AIX, Solaris, etc.• Support for different transports• Data must be portable across different
computer architectures
Today’s Order Entry World
• Notable characteristics:– Fixed and variable length records. Flat Records.– Records are transmitted remotely through various communication
protocols– Various Message Queuing Systems are being used (MSMQ, MQ
Series)– Must implement a combination of technologies: Multithreading,
sockets, etc.
• Consequences:– Clients require substantial software development and maintenance
costs– Limited portability and scalability
Common API Design
Message Queuing
MultiThreading
TransportConnectivity
Flat RecordData Encoding
Application ProgrammingInterface
ClientSoftware
Flat RecordsOrder Routing
andProcessing
Flat Record Data Encoding
• FIX Record:
8=FIX.4.2^9=199^35=D^34=10^49=VENDOR^115=CUSTOMER^144=CHICAGO EQ^56=BROKER^57=DOT^143=NY^52=20000907-09:25:58^11=ORD_1^21=2^110=1000^55=KO^22=1^48=277461109^54=1^60=20000907-09:25:56^38=5000^40=2^44=62.5^15=USD^47=A^1010=165^
• CUSTOM Record:
ORDER FIRMXX2837485 683321 FIRMXX 6 200210291BUY 2 MAY03BO24 PUT 180 EW
Progressive API design
• Separate Interfacing, Data Encoding/Decoding and Transport
• XML for Data Portability and Distribution• Exposure of Transport payloads must be minimized• Abstract technology implementation by using the
Business-centric concepts in its interface functions• Symmetric construction of functions for clients and servers• Object Oriented design with portable language• Interactions driven by: API binaries and not by published
document schemas• Truly Portable: Must run everywhere!
LindFinancial API Design
MessageQueuing
TransportConnectivity
MultiThreading
ClientSoftware
XML RecordsOrder Routing
andProcessing
ApplicationProgramming
Interface
XMLData
Encoding
TransportProgramming
Interface
API Library Transport Library
<order>
<acct f="532" a="322480" />
<fid t="new" i="342380-N20916164" />
<leg s="BUY" qo="6">
<cc c="ES" m=“H" y="2003" />
<price p="1180" />
</leg>
<leg s="SELL" qo=“6">
<cc c="ES" m="Z" y="2003" />
</leg>
<msg t="clerk" m="Clerk message from EAPARCED" />
<msg t="order" m="Ticket message from EAPARCED" />
</order>
XML Data Encoding
LindFinancial API Technical Objectives
• Preserve Order Routing functionality• Provide a highly scalable and portable system
(Windows, Linux, AIX, Solaris)• Present a consistent API to both the Web,
Backend Server and Order Entry clients• Lay the foundations for an scalable, portable and
distributed Order Routing System• Maintain high performance processing while using
XML• Abstract Transport Layer from Client Experience
LindAccess Common Programmatic Interface (CPI)
Framework
• LindFinancial API LibraryGeneric Application Programming Interface (API)
• CasinoData Transport and Multitasking Classes
LindAccess CPI Architecture
OrdersOrderstoLindAccess
FillsFillsfromLindAccess
FillReceiver
OrderProvider
Send Order
OutgoingPersistance
IncomingPersistance
FillAcknowledge
ReceiveFill LindAccess
XML Server
CustomerDesktop
OES
INTERFACE and ONLINE CLIENTS LINDACCESS Protocol LINDACCESS XML SERVER & ORDER ROUTING
ORDER
FILL
Casino
Interface Driver
(Graphical | C
onsole)
TERMINAL CLIENT
Lind Classic
TradeOnline
Lind Connect
WirelesssHandheld
CustomerDesktop
OES
Interface Driver
(Graphical | C
onsole)
ORDER
FILL
.NETCompon
ents
COMCompon
ents
LindAccessXML ServerLind
FinancialAPI
Ernesto L. Aparcedo - Jan 2003
BackOffice
LindFinancial
API
LindFinancialAPI
Casino
Casino
.NETCompon
ents
COMCompon
ents
OrderAcknowledge
ORDER
ROUTING
AND
PROCESSING
LindFinancial APIBasic Characteristics
• Asynchronous Business-centric XML API for Order Entry Clients and backend processing Servers
• Full Abstraction of business functionality from technical implementation
• Extensive support for: – Orders, Fills, Status, Alerts, Quotes, Cancels, Cancel-Replace,
Positions, Requests, Funds, Checks and Heartbeats. – API functionality: Over 875 functions, methods, properties and
callbacks.
• All Data Encoding in XML• C++ API Object Oriented Library• Portable to multiple operating systems:
– Microsoft Windows (98, NT, 2000, XP, .NET, etc.)– Unix (AIX, Linux, Solaris, etc.),
LindFinancial APIAdvanced Features
• Provides a platform for distributed Order Entry System• Fully Extensible API library:
– Order management– Data communication and transports are abstracted
• Fully object oriented: its functionality can be inherited or overridden by other libraries
• Order Batching and Replay applications• Flexible XML design to support hot technologies like Web Services• Leverage XML design to support data transformations (XSLT),
storage and presentation. Ready for B2B use.• Readily integrates with software development technologies and
programmatic clients (COM, ATL, Microsoft .NET, dynamic linking)
LindFinancial API XML Features
• Automatic Encoding and Decoding (Parsing)
• Publishing of XML document structure (schema) is not required
• Flexibility in providing access to internal XML
To get the order/fill XMLOrder_XML = GetOrder();Fill_XML = GetFill();
• Transform XML as required (with XSLT):• LindFinancial XML to FIXML• XML to HTML for Web• XML to WML for wireless devices
• Can import XML into Databases
Transport ClassesCasino
• Data Communications and Transport C++ classes• Relevant Transport Protocols can be built as
needed:– LindAccess protocol
• Efficient Threading model for multitasking• Automatic and integrated Logging• Fast Message Queuing System: Orders and Fills are
saved to disk for order/fill recovery and post processing
• Fully Integrated with LindFinancial API and portable to other operating systems
LindFinancial APICurrent Applications
• Desktop Clients:
– C++ Windows– C++/MFC - COM Windows– Visual Basic - COM Windows - LindXpress– C++ Linux (Automated Trading System)
• Middleware Order Processing Server: – Web Site clients– Direct Access clients
• Order Routing Engine Order Processing– Order and Fills Routing
A LindFinancial API Client: LindXpress
A LindFinancial API Client: LindXpress
COM Interface
Order order;Leg leg;order.PutRecordType(order.RT_ORDER);order.PutFirm("532");order.PutAccount("L2248");leg.PutBuyOrSell(leg.TT_BUY);leg.PutQuantity(8);leg.PutMonth(leg.MT_MAR);leg.PutYear(3);leg.PutCommodityCode("ES");order.Send(order.GetOrder());
Transport Interface
API Interface
IOrder.recordType = RT_ORDERIOrder.firm = "532"IOrder.account = "L2248"ILeg.buyOrSell = TT_BUYILeg.quantity = 8ILeg.month = MT_MARILeg.year = "03"ILeg.commodityCode = "ES"IOrder.Send
<order> <acct f="532" a=“L2248" /> <fid t="new" i="371034258796296" e=“EAPARCED” /> <leg s="BUY" qo=“8">
<cc c="ES" m=“H" y="2003" /> <price p="108000“ /> </leg></order>
const char* LindBase::Send (const char* TransmitRecord) { if (latp->Write(GetRecordCategory(TransmitRecord), strlen(TransmitRecord), (char*) TransmitRecord) == -1) { return EMPTY; } return TransmitRecord;}
XML RecordsLindAccessXML Server
Visual BasicFront End
XML COM Component
LindFinancial API
Casino
Client Entry Point
DESKTOP
CLIENT
DESKTOP
CLIENT
LindFinancial APICOM Client
• Entering an order in a Visual Basic client (e.g. LindXpress):
Dim IOrder As LIND_ACCESS_COMPONENTLib.iOrderDim ILeg As LIND_ACCESS_COMPONENTLib.iLegIOrder.recordType = RT_ORDER
IOrder.firm = "532" IOrder.account = "L2248" IOrder.firmIdentifier = “371034258796296”
IOrder.enteredBy= “EAPARCED”IOrder.clerkMessage = "LindFinancial Futures - Clerk msg"
IOrder.orderMessage = "LindFinancial Futures - Order msg" IOrder.numberOfLegs = LEG_1 ILeg.buyOrSell = TT_BUY ILeg.quantity = 8 ILeg.month = MT_MAR ILeg.year = "03" ILeg.commodityCode = "ES" ILeg.orderType = OT_LIMIT ILeg.price = "118000"
IOrder.AddLeg LEG_1, ILeg.legIOrder.Send
LindFinancial APIDirect Order Entry
• Entering an Order (C++ direct access):Order order;Leg leg; order.PutOrder(BLANK);order.PutNumberOfLegs(order.LEG_1);order.PutRecordType(order.RT_ORDER);order.PutFirm("532");order.PutAccount("L2248");order.PutFirmIdentifier(“371034258796296”);order.PutEnteredBy("EAPARCED");order.PutClerkMessage("LindFinancial Futures - Clerk msg");order.PutOrderMessage("LindFinancial Futures - Order msg");
leg.PutLeg(BLANK);leg.PutBuyOrSell(leg.TT_BUY);leg.PutQuantity(8);leg.PutMonth(leg.MT_MAR);leg.PutYear(3);leg.PutCommodityCode("ES");leg.PutOrderType(leg.OT_LIMIT);leg.PutPrice(108000);order.AddLeg(order.LEG_1,leg.GetLeg());order.Send(order.GetOrder());
LindFinancial APIInternal XML Document
• Resultant Order XML:
<order>
<acct f="532" a=“L2248" />
<fid t="new" i="371034258796296" e=“EAPARCED” />
<leg s="BUY" qo=“8">
<cc c="ES" m=“H" y="2003" />
<price p="108000“ />
</leg>
<msg t="clerk" m="LindFinancial Futures - Clerk msg" />
<msg t="order" m="LindFinancial Futures - Order msg" />
</order>
Casino ClassesPayload Transport
• Pass Through Interface:
const char* LindBase::Send (const char* Transmit_XML_Record) {
if (latp->Write(GetRecordCategory(Transmit_XML_Record),
strlen(Transmit_XML_Record), (char*)Transmit_XML_Record) == -1){
return EMPTY;
}
return Transmit_XML_Record;
}
Future Enhancements
• Portable Order Routing Engine: – Able to install in multiple independent distributed
nodes• Develop a Web Service implementation
(SOAP+XML+HTTP)• Enhance LindFinancial API to support maintenance and
system management functions• Enhance API to support Plug-and-Play transports• Apply LindFinancial API to Web presentation experience• Develop a native XML database for seamless storage
Summary
• Design Overview of a Distributed XML API:
LindFinancial API
• Truly Scalable and Portable implementation for client and server solutions
• Demonstrated that XML technology can be readily adapted to Order Entry
• I propose consideration of:
• XML technology as a Standard for Order Entry