Entwickler-Example
Developer Example & SDK
- π Real-time data integration for C# / .NET
- π Tick, intraday, and end-of-day data
- β‘ Push-based live data delivery
What is the TAI-PAN .NET Example?
This sample project shows how the TAI-PAN interface can be used in a .NET application.
It serves as a starting point for developers who want to integrate market data, real-time feeds, and historical data.
Included Features
- π Login via DevID & user credentials
- π Access to price data (tick / intraday / historical)
- β‘ PushFeed for live data
- π₯οΈ Windows Forms interface
- π§© Structured .NET API integration
- π Master data access
- π Search function
TPRAccess Interface β Developer Documentation
This interface can be used with various programming languages.
However, not all functions may be fully or identically available in every language.
Development and testing are primarily carried out in C#. All functions have been validated in this environment.
Therefore, support cannot be provided for implementations in other programming languages (e.g. Python).
Quick Start
Download
First, download the required DLL:
Then extract the file TPRAccess.zip.
Integrating the DLL Interface
Project Configuration (.NET Core)
Note: For .NET Core applications, code page 1252 must be added.
csproj file:
Β Β Β Β <PackageReference Include="System.Text.Encoding.CodePages" Version="4.3.0" />
</ItemGroup>
Initialization in the source code:
Usage
After successful integration, you can use the interface as follows:
using TPRAccess;
Connection & Login
TPRClientLanguages
English β English responses
connection.ClientLanguage = TPRClientLanguages.German;
TPRServerConnection
The TPRServerConnection object initializes the connection to the API and provides all core functions of the interface.
A connection cannot be established without a valid Developer ID.
connection.ClientLanguage = TPRClientLanguages.German;
A Developer ID is required to use the interface. This ID is provided by our sales department.
If you have any questions or are interested in activating the interface, please contact us via our contact page .
Login
The Login method logs the user into the Tai-Pan server and initializes the session for subsequent API calls.
bool ok = connection.Login(string "CustomerID", string "Password");
bool Login(string customerId, string password) Parameter
false β login failed
no connection to the server
invalid Developer ID
Client Information
GetConnectionClientInfo can be used to retrieve information about the client or DLL version currently in use.
connection.GetConnectionClientInfo(ref info);
string text = info.InfoText;
false β failed to load data
User Data
GetUserInfo
var userInfo = connection.GetUserInfo(); Signature TPRUserInfo GetUserInfo() Return Value
TPRUserInfo
The TPRUserInfo object provides user-specific information, notification settings, and available collections such as watchlists, exchanges, and subscriptions.
DataMobile β mobile phone number
Username β display name / username
UserId β internal user or customer ID
UseEMail β flag indicating whether email notifications are enabled
UseSMS β flag indicating whether SMS notifications are enabled
Exchanges β exchange directory
SecurityTypes β security types
Countries β countries
NewsSubscriptions β existing news subscriptions
Catalog Structure
GetCatalogStructure can be used to load the complete catalog structure including folders and entries. Catalogs represent a folder structure of securities grouped by exchanges, markets, or thematic categories. The method provides both the hierarchical structure and direct access to all contained folder and catalog objects.
var entries = new ListGetCatalogStructure Signature(); var folders = new Dictionary (); var items = new Dictionary (); connection.GetCatalogStructure(ref entries, ref folders, ref items);
bool GetCatalogStructure( ref ListParametersentries, ref Dictionary folders, ref Dictionary items )
folders β dictionary containing all folder objects, keyed by folder ID
items β dictionary containing all catalog objects, keyed by item ID
false β loading failed
Search
The Search function allows searching for securities using different search types such as symbol, ISIN, name, or internal identifiers. Additionally, the search can be restricted to specific security types and exchanges.
TPRSearchTypes
EDV β search by EDV identifier
ISIN β search by ISIN
LimitSymbolen β special search for limit symbols
MMQuoteId β search by MM quote ID
Name β search by name
QuickSuggestion β fast suggestion list for search fields
SucheSymbolKuerzel β search by symbol abbreviation
Symbol β search by symbol
SymbolNo β search by internal symbol number
Symbol_Equal β exact symbol search
Symbol_ISIN_Name β combined search by symbol, ISIN, or name
TaiPanEODDBID β search by internal EOD database ID
Search
var result = connection.Search( TPRSearchTypes.Name, string "Daimler", TPRSecurityType.All.Id, 0 );Signature
TPRSymbolList Search(
TPRSearchTypes searchType,
string searchText,
int securityTypeId,
int exchangeId
) Parameters
searchText β search term, e.g. name, ISIN, or symbol
securityTypeId β filter for a specific security type; TPRSecurityType.All.Id means no type restriction
exchangeId β filter for an exchange; 0 means no restriction
TPRSecurityType
All β all security types
The complete list of available security types is provided through userInfo.SecurityTypes. There you can access both the Id and the description.
Watchlists
The watchlist functions allow creating, managing, and loading personal watchlists. Securities can be added individually, in groups, or directly from search results.
AddWatchList
Creates a new watchlist.
SignatureTPRWatchList AddWatchList(string name) Parameters
var watchlist = userInfo.WatchLists.AddWatchList(string "My Watchlist");
Add (Single Instrument)
Adds a single instrument to the watchlist.
Examplewatchlist.Add(169286); Signature void Add(int symbolNo) Parameters
Add (Multiple Instruments)
Adds multiple instruments to the watchlist at the same time.
Examplewatchlist.Add(new List<int> {169286, 79514}); Signature void Add(List<int> symbolNumbers) Parameters
Add (From Search Result)
Adds all instruments from a search result list to the watchlist.
Examplewatchlist.Add(result); Signature void Add(TPRSymbolList symbols) Parameters
GetWatchListContent
Loads the contents of a watchlist.
Examplevar entries = connection.GetWatchListContent(watchlist.Id); Signature TPRSymbolList GetWatchListContent(int watchListId) Parameters
DeleteWatchList
Deletes an existing watchlist.
ExampleuserInfo.WatchLists.DeleteWatchList(watchlist.Id); Signature bool DeleteWatchList(int watchListId) Parameters
false β deletion failed
Realtime Push Feed
The Realtime Push Feed enables the reception of real-time data and push messages for subscribed securities. Instruments can be subscribed to or removed dynamically, while incoming feed messages can continuously be processed.
Processing Feed Messages β Code ExampleTPRPushFeedMessage pfm = m_PushFeed.GetNextPushFeedMessage();
if (pfm != null)
{
do
{
switch (pfm.MessageType)
{
case TPRPushFeedMessageTypes.Quote:
var TickMessage = pfm as TPRQuoteTickMessage;
switch (TickMessage.QuoteType)
{
case TPRQuoteTypes.Ask:
// TickMessage.QuoteTick.Quote
// TickMessage.QuoteTick.Volume
// TickMessage.QuoteTick.Time
break;
case TPRQuoteTypes.Last:
// TickMessage.QuoteTick.Quote
// TickMessage.QuoteTick.Volume
// TickMessage.QuoteTick.Time
break;
case TPRQuoteTypes.Bid:
// TickMessage.QuoteTick.Quote
// TickMessage.QuoteTick.Volume
// TickMessage.QuoteTick.Time
break;
case TPRQuoteTypes.OFF_MARKET:
// TickMessage.QuoteTick.Quote
// TickMessage.QuoteTick.Volume
// TickMessage.QuoteTick.Time
break;
case TPRQuoteTypes.Auction:
// TickMessage.QuoteTick.Quote
// TickMessage.QuoteTick.Volume
// TickMessage.QuoteTick.Time
break;
case TPRQuoteTypes.OpenInterest:
// TickMessage.QuoteTick.Quote
// TickMessage.QuoteTick.Volume
// TickMessage.QuoteTick.Time
break;
}
break;
case TPRPushFeedMessageTypes.MarketDepth:
var MarketDepthMessage = pfm as TPRMarketDepthMessage;
// MarketDepthMessage.QuoteTick.Quote
// MarketDepthMessage.QuoteTick.Time
// MarketDepthMessage.QuoteTick.Volume
// MarketDepthMessage.QuoteType
// MarketDepthMessage.Position
break;
}
m_PushFeed.ReturnFeedMessage(pfm); // Release memory
pfm = m_PushFeed.GetNextPushFeedMessage();
} while (pfm != null);
}
GetPushFeed
Creates a TPRPushFeed object for receiving realtime messages.
SignatureTPRPushFeed GetPushFeed() Return Value
var feed = connection.GetPushFeed();
feed.ConnectFeed();
SubscribeSymbol
Subscribes realtime data for a single instrument.
Examplefeed.SubscribeSymbol(169286); Signature bool SubscribeSymbol(int symbolNo) Parameters
false β subscription failed
SubscribeSymbol (Multiple Instruments)
Subscribes realtime data for multiple instruments simultaneously.
Examplefeed.SubscribeSymbol(new List<int> {169286, 79514}); Signature bool SubscribeSymbol(List<int> symbolNumbers) Parameters
false β at least one subscription failed or the call was unsuccessful
UnsubscribeSymbol
Removes an existing realtime subscription.
Examplefeed.UnsubscribeSymbol(169286); Signature bool UnsubscribeSymbol(int symbolNo) Parameters
false β removal failed
GetNextPushFeedMessage
Reads the next available feed message.
Examplevar msg = feed.GetNextPushFeedMessage(); Signature TPRPushFeedMessage GetNextPushFeedMessage() Return Value
TPRQuoteTypes.Last β executed trade prices (last completed trade / closing tick price)
TPRQuoteTypes.Bid β bid price: highest price a buyer is currently willing to pay
TPRQuoteTypes.Ask β ask price: lowest price a seller is currently willing to accept
TPRQuoteTypes.Auction β auction price from opening, closing, or intraday auctions
TPRQuoteTypes.OpenInterest β open interest / number of open contracts for derivatives and futures instruments
TPRPushFeedMessageTypes
MarketDepth β New market depth
News β New news message
SymbolUpdate β Update of symbol master data
LimitUpdate β Change to a limit / alert
LimitTrigger β Limit / alert triggered
Reconnect β Reconnect status
Korrection β Quote correction
Ping β Server heartbeat
Info β General information
ConnectionStatus β Connection status
feed.DisconnectFeed();
Candle Charts
GetCandleChart can be used to load historical candle or price data for a security. Both daily data and compressed intervals such as minute candles can be retrieved.
GetCandleChart
Available OverloadsTPRCandleList GetCandleChart(int symbolNo, DateTime from) TPRCandleList GetCandleChart(int symbolNo, int compression, int count) TPRCandleList GetCandleChart(int symbolNo, int compression, DateTime from)Parameters
compression β candle compression interval, e.g. minute interval
count β number of candles to retrieve
from β start date from which candles should be loaded
var candles = connection.GetCandleChart(169286, DateTime.Now.AddDays(-10)); Minute Data var candles = connection.GetCandleChart(169286, 15, DateTime.Now.AddDays(-10)); By Count var candles = connection.GetCandleChart(169286, 12, 42);
Intraday Charts
GetIntradayChart can be used to load intraday price data and tick data for securities. Different quote types such as last, bid, or ask prices as well as different time ranges and detail levels can be requested.
Important OverloadsTPRQuoteTickList GetIntradayChart(int symbolNo, DateTime from) TPRQuoteTickList GetIntradayChart(int symbolNo, DateTime from, int dayCount) bool GetIntradayChart(int symbolNo, DateTime from, out TPRQuoteTickList last, out TPRQuoteTickList ask, out TPRQuoteTickList bid, int dayCount) TPRQuoteTickList GetIntradayChart(SymbolNo startDate, DateTime endDateThisLoad, TPRQuoteTypes quoteType)Parameters
from β start date of the request
dayCount β number of days starting from from
startDate β start date of the request (for advanced overload)
endDateThisLoad β end date of the request
quoteType β type of quote data (see below)
last β output parameter for last ticks
ask β output parameter for ask ticks
bid β output parameter for bid ticks
TPRQuoteTypes.last β executed trade prices (last completed trade / closing tick price)
TPRQuoteTypes.bid β bid price: highest price a buyer is currently willing to pay
TPRQuoteTypes.ask β ask price: lowest price a seller is currently willing to accept
for bool: true = data loaded successfully, false = loading failed
var ticks = connection.GetIntradayChart(169286, DateTime.Now.AddDays(-1)); With Bid/Ask TPRQuoteTickList last, ask, bid;
connection.GetIntradayChart(169286, DateTime.Now.AddDays(-3), out last, out ask, out bid, 1); With QuoteType var ticks = connection.GetIntradayChart(169286, DateTime.Now.AddDays(-1), DateTime.Now, TPRQuoteTypes.last);
Market Depth
GetMarketDepth can be used to retrieve the current market depth (Level 2) of an instrument. Both the bid and ask sides of the order book including price and volume information are available.
var depth = connection.GetMarketDepth(169286); Signature TPRMarketDepth GetMarketDepth(int symbolNo) Parameters
foreach (var a in depth.Ask) { var price = a.Quote; }Bid
foreach (var b in depth.Bid) { var price = b.Quote; }
Options Matrix
GetOptionsMatrix can be used to load the structured options matrix of an underlying instrument. The matrix contains available options and warrants including expirations, strike prices, and additional market data.
var matrix = connection.GetOptionsMatrix(169286); Signature TPROptionsMatrix GetOptionsMatrix(int symbolNo) Parameters
Objects
TPRSymbol
ISIN β International Securities Identification Number
WKN β National security identifier
Name β Name of the instrument
SymbolString β Symbol / symbol display
LastBid β Last bid price
LastAsk β Last ask price
LastTrade β Last traded price
DayOpen β Opening price of the day
DayHigh β Day high
DayLow β Day low
DayVolume or Volume β Daily trading volume, if available
TPRCandle
High β Highest price
Low β Lowest price
Close β Closing price
Time β Timestamp of the candle
Volume β Volume of the candle
TPRQuoteTick
Time β Timestamp
Volume β Tick volume
Notes
Do not process PushFeed in the UI thread
SymbolNo is the central reference for almost all methods
ExchangeId = 0 means no restriction