TPRAccess Doku

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
⬇ Download Example

TPRAccess Interface – Developer Documentation

Note

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:

Download TPRAccess.dll

Then extract the file TPRAccess.zip.

Integrating the DLL Interface

Open the Solution Explorer
β†’ Right-click on β€œReferences”
β†’ β€œAdd Reference…”
β†’ β€œBrowse…”
β†’ Select TPRAccess.dll
β†’ Click β€œAdd”
β†’ Ensure the checkbox is enabled
β†’ Click β€œOK”

Project Configuration (.NET Core)

Note: For .NET Core applications, code page 1252 must be added.

csproj file:

<ItemGroup>
Β Β Β Β <PackageReference Include="System.Text.Encoding.CodePages" Version="4.3.0" />
</ItemGroup>

Initialization in the source code:

Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

Usage

After successful integration, you can use the interface as follows:

using TPRAccess;
            

Connection & Login

TPRClientLanguages

German – German responses
English – English responses
connection.ClientLanguage = TPRClientLanguages.German;
The language should be set immediately after creating the connection, before making further API calls.

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.

var connection = new TPRServerConnection("DEVELOPER_ID");
connection.ClientLanguage = TPRClientLanguages.German;
TPRServerConnection(string developerId)
developerId – Developer ID required to activate the interface
Central connection object for login, search, feed, charts, watchlists, and additional API calls.
A productive connection cannot be established without a valid Developer ID.
Note:

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
customerId – customer identifier / login ID
password – user password
Return Value
true – login successful
false – login failed
Possible Error Causes
invalid login credentials
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.

var info = new TPRConnectionClientInfo();
connection.GetConnectionClientInfo(ref info);
string text = info.InfoText;
bool GetConnectionClientInfo(ref TPRConnectionClientInfo info)
Parameter
info – reference to an object
Return Value
true – data loaded successfully
false – failed to load data
Properties
InfoText – text information about the client or DLL version

User Data

GetUserInfo

var userInfo = connection.GetUserInfo();
Signature
TPRUserInfo GetUserInfo()
Return Value
TPRUserInfo – User data and master data lists of the logged-in user

TPRUserInfo

The TPRUserInfo object provides user-specific information, notification settings, and available collections such as watchlists, exchanges, and subscriptions.

Data
EMail – user's email address
Mobile – 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
Collections
WatchLists – existing watchlists
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 List();
        var folders = new Dictionary();
        var items = new Dictionary();
        
        connection.GetCatalogStructure(ref entries, ref folders, ref items);
        
GetCatalogStructure Signature
bool GetCatalogStructure(
            ref List entries,
            ref Dictionary folders,
            ref Dictionary items
        )
Parameters
entries – list of catalog entries in hierarchical structure form
folders – dictionary containing all folder objects, keyed by folder ID
items – dictionary containing all catalog objects, keyed by item ID
Return Value
true – catalog structure loaded successfully
false – loading failed

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

Default – standard search
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
searchType – search mode from TPRSearchTypes
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
Return Value
TPRSymbolList – result list containing TPRSymbol objects

TPRSecurityType

TPRSecurityType.All.Id

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.

Signature
TPRWatchList AddWatchList(string name)
Parameters
name – freely selectable name of the watchlist
Return Value
TPRWatchList – newly created watchlist
Example
var watchlist = userInfo.WatchLists.AddWatchList(string "My Watchlist");

Add (Single Instrument)

Adds a single instrument to the watchlist.

Example
watchlist.Add(169286);
Signature
void Add(int symbolNo)
Parameters
symbolNo – internal symbol number of the instrument

Add (Multiple Instruments)

Adds multiple instruments to the watchlist at the same time.

Example
watchlist.Add(new List<int> {169286, 79514});
Signature
void Add(List<int> symbolNumbers)
Parameters
symbolNumbers – list of internal symbol numbers

Add (From Search Result)

Adds all instruments from a search result list to the watchlist.

Example
watchlist.Add(result);
Signature
void Add(TPRSymbolList symbols)
Parameters
symbols – result list whose contained instruments are added to the watchlist

GetWatchListContent

Loads the contents of a watchlist.

Example
var entries = connection.GetWatchListContent(watchlist.Id);
Signature
TPRSymbolList GetWatchListContent(int watchListId)
Parameters
watchListId – ID of the watchlist
Return Value
TPRSymbolList – contents of the watchlist

DeleteWatchList

Deletes an existing watchlist.

Example
userInfo.WatchLists.DeleteWatchList(watchlist.Id);
Signature
bool DeleteWatchList(int watchListId)
Parameters
watchListId – ID of the watchlist to delete
Return Value
true – watchlist deleted
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 Example
TPRPushFeedMessage 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.

Signature
TPRPushFeed GetPushFeed()
Return Value
TPRPushFeed – feed object for realtime messages
Initialization
var feed = connection.GetPushFeed();
        feed.ConnectFeed();

SubscribeSymbol

Subscribes realtime data for a single instrument.

Example
feed.SubscribeSymbol(169286);
Signature
bool SubscribeSymbol(int symbolNo)
Parameters
symbolNo – internal symbol number of the instrument to subscribe
Return Value
true – subscription successful
false – subscription failed

SubscribeSymbol (Multiple Instruments)

Subscribes realtime data for multiple instruments simultaneously.

Example
feed.SubscribeSymbol(new List<int> {169286, 79514});
Signature
bool SubscribeSymbol(List<int> symbolNumbers)
Parameters
symbolNumbers – list of internal symbol numbers
Return Value
true – subscriptions successful
false – at least one subscription failed or the call was unsuccessful

UnsubscribeSymbol

Removes an existing realtime subscription.

Example
feed.UnsubscribeSymbol(169286);
Signature
bool UnsubscribeSymbol(int symbolNo)
Parameters
symbolNo – internal symbol number of the instrument to unsubscribe
Return Value
true – subscription removed
false – removal failed

GetNextPushFeedMessage

Reads the next available feed message.

Example
var msg = feed.GetNextPushFeedMessage();
Signature
TPRPushFeedMessage GetNextPushFeedMessage()
Return Value
next available feed message
TPRQuoteTypes (Quote Types)
TPRQuoteTypes.OFF_MARKET – pre-market and after-hours quotes (outside regular trading hours)

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

Quote – New quote data
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
Disconnect
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 Overloads
TPRCandleList GetCandleChart(int symbolNo, DateTime from)
        TPRCandleList GetCandleChart(int symbolNo, int compression, int count)
        TPRCandleList GetCandleChart(int symbolNo, int compression, DateTime from)
        
Parameters
symbolNo – internal symbol number of the instrument
compression – candle compression interval, e.g. minute interval
count – number of candles to retrieve
from – start date from which candles should be loaded
Return Value
TPRCandleList – list containing candle data
Daily Data
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 Overloads
TPRQuoteTickList 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
symbolNo – internal symbol number of the instrument
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 (Quote Types)
TPRQuoteTypes.OFF_MARKET – pre-market and after-hours quotes (outside regular trading hours)

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
Return Value
depending on the overload: TPRQuoteTickList or bool
for bool: true = data loaded successfully, false = loading failed
Simple
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
symbolNo – internal symbol number of the instrument
Return Value
TPRMarketDepth – market depth including ask and bid sides as well as quote information
Ask
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
symbolNo – internal symbol number of the underlying instrument
Return Value
TPROptionsMatrix – structured options matrix for the underlying instrument

Objects

TPRSymbol

SymbolNo – Internal unique symbol number
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

Open – Opening price
High – Highest price
Low – Lowest price
Close – Closing price
Time – Timestamp of the candle
Volume – Volume of the candle

TPRQuoteTick

Quote – Tick price
Time – Timestamp
Volume – Tick volume

Notes

A successful login must be completed before all API calls
Do not process PushFeed in the UI thread
SymbolNo is the central reference for almost all methods
ExchangeId = 0 means no restriction
Risk warning: Futures, shares and foreign exchange trading involve considerable risk and are not suitable for every investor. An investor could lose all or more than the capital invested. Risk capital is money that can be lost without jeopardizing financial security or lifestyle. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily an indicator of future results.