Dot API Reference Manual
Version 1.0.0.0
|
uTrade Dot Net API 1.0.0.0 provides infrastructure to interact with algo and retail trading backend server using easy and to use and efficient api method calls based out of Microsoft .Net technologies.
It allows user to create their own latency sensitive strategies and single order placement method calls in uTrade's infrastructure in exchange co-location or non co-location environment.
New custom frontend and strategies can be integrated and run in the platform on the fly with no effect on the already running strategies.
Risk Management features is also available, same as the trading platform.
Custom strategy can be run with snapshot feed for now. Latest data (order book) is provided to the strategy on request and subscription basis.
Multiple threads will be active after user will be connected to market as it will help system to perform efficiently. All requests including order and market data will be placed in main thread. Response for orders and other requests
will be received in seperate thread. So, user need to take care of resources accordingly. For market data dispatch, there will be seperate thread.
There are 2 threads through which client application will receive updates :-
T1 : it will provide online snapshot data.
T2 : it will provide responses for different client application requests.
Request is accepted by the dll in the thread created by the user application.
Note : Response will be given seperately, the function only returns whether request accepted successfully or not.
Response for requests such as GetOpenOrders, and notification for order updates such as Order Partially filled (onOrderUpdate, fillReport) will be provided in seperate threads, so client application need to handle the responses and notifications such that synchronization and locking is there for updating resources if any.
Order updates :
E.g.
Assuming O1, O2 and O3 as orders request by the client.
Then at t1 + 0.5s, client application will receive the snapshot containing
Through onOrderUpdate callbacks, so here 3 callbacks will be received in thread T1.
Order updates will contain Order Price, Order Qty, Total Filled qty etc.
Trade Reports :
In the above example
Through fillReport callbacks, so here 2 callbacks will be received in thread T1.
Note : All fills will be received seperately, but all transactions may not be received, like in the above example, only 1 O1 update received, but both trades are received.
Order update will contain - Fully Filled, New Reject, Canceled, RMS Reject and will contain one Order Update for life cycle completion.
Order update and fill report both will contain entry for Partial Fill.
Note : If there is a trade then two callbacks will be generated FillReport and OrderUpdate for e.g.
Then Client C1 will received an OrderUpdate(PARTIAL-FILL) with (20 filled, 80 pending) qty and FillReport with 20 qty filled.
Where Client C2 will received an OrderUpdate(FILLED) with (20 filled, 00 pending) qty and FillReport with 20 qty filled.
To get all the states of an order override OrderUpdate and for trade orderride FillReport (Can override both methods at once)
E.g. for the working thread T2
Note : When user login to HFT then it will bring offline confirmations from DMS and these offline confirmations will not get any callback
these offline confirmations can access through GetOpenOrders() and GetTradeHistory() methods, after completing offline confirmations it will request to begin online data.
Every request or method call will return an integer value which will be 0 or 1. 0 - Failure, 1 - Success. In case of failure, user can call getLastErrorCode or getLastErrorStr for exact error code. Refer error codes for more detail.
Exchange Symbology : NSECM, NSEFO, NSECDS, NSEIFSC, NSECOM, BSECM, BSEFO, BSECDS, BSEINX, BSECOM, MCX, MSE, DGCX etc
Cash segment : <SOURCE> <EXCHANGE> <SYMBOL>-<GROUP>
Example : DEFAULT NSECM ABB-EQ
Future segment : <SOURCE> <EXCHANGE> <SYMBOL> <EXPIRY> <FUT>
Example : DEFAULT NSEFO ZEEL29NOVFUT
Options segment : <SOURCE> <EXCHANGE> <SYMBOL> <EXPIRY> <STK price>=""> <PUT or="" call>="">
Example : DEFAULT NSEFO BANKNIFTY29NOV28700PE
User need not to send source name or full key while placing an order.
e.g. PlaceOrder("NSEFO", "TESTACC", "DAY", "C", "NULL", "L", "BANKNIFTY29NOVFUT", "S", 40, 26873.50, .......)