ActiveTick Feed C++ API SDK  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ActiveTickServerAPI.h File Reference
Include dependency graph for ActiveTickServerAPI.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DEFAULT_REQUEST_TIMEOUT   30000
 

Typedefs

typedef void(* ATBarHistoryResponseCallback )(uint64_t origRequest, ATBarHistoryResponseType responseType, LPATBARHISTORY_RESPONSE pResponse)
 
typedef void(* ATLoginResponseCallback )(uint64_t session, uint64_t request, LPATLOGIN_RESPONSE pResponse)
 
typedef void(* ATMarketMoversDbResponseCallback )(uint64_t origRequest, ATMarketMoversDbResponseType responseType, LPATMARKET_MOVERSDB_RESPONSE pResponse)
 
typedef void(* ATQuoteDbResponseCallback )(uint64_t origRequest, ATQuoteDbResponseType responseType, LPATQUOTEDB_RESPONSE pResponse, uint32_t responseCount)
 
typedef void(* ATQuoteStreamResponseCallback )(uint64_t origRequest, ATStreamResponseType responseType, LPATQUOTESTREAM_RESPONSE pResponse, uint32_t responseCount)
 
typedef void(* ATMarketMoversStreamResponseCallback )(uint64_t origRequest, ATStreamResponseType responseType, LPATMARKET_MOVERS_STREAM_RESPONSE pResponse)
 
typedef void(* ATStreamUpdateCallback )(LPATSTREAM_UPDATE pUpdate)
 
typedef void(* ATServerTimeUpdateCallback )(LPATTIME pServerTime)
 
typedef void(* ATRequestTimeoutCallback )(uint64_t origRequest)
 
typedef void(* ATSessionStatusChangeCallback )(uint64_t session, ATSessionStatusType statusType)
 
typedef void(* ATTickHistoryResponseCallback )(uint64_t origRequest, ATTickHistoryResponseType responseType, LPATTICKHISTORY_RESPONSE pResponse)
 
typedef void(* ATMarketHolidaysResponseCallback )(uint64_t origRequest, LPATMARKET_HOLIDAYSLIST_ITEM pItems, uint32_t itemsCount)
 
typedef void(* ATSectorListResponseCallback )(uint64_t origRequest, LPATSECTORLIST_RECORD pRecords, uint32_t recordsCount)
 
typedef void(* ATConstituentListResponseCallback )(uint64_t origRequest, LPATSYMBOL pSymbols, uint32_t symbolsCount)
 

Functions

ACTIVETICKSERVERAPI_API bool ATInitAPI ()
 
ACTIVETICKSERVERAPI_API bool ATShutdownAPI ()
 
ACTIVETICKSERVERAPI_API uint32_t ATGetAPIVersion ()
 
ACTIVETICKSERVERAPI_API uint32_t ATGetSessionQueuedStreamUpdates (uint64_t session)
 
ACTIVETICKSERVERAPI_API uint64_t ATGetSessionTotalRecvedByteCount (uint64_t session)
 
ACTIVETICKSERVERAPI_API uint64_t ATGetSessionTotalRecvedMsgCount (uint64_t session, ATSessionTotalRecvedMsgType type)
 
ACTIVETICKSERVERAPI_API uint64_t ATCreateSession ()
 
ACTIVETICKSERVERAPI_API void ATDestroySession (uint64_t session)
 
ACTIVETICKSERVERAPI_API bool ATSetAPIUserId (uint64_t session, LPATGUID pAPIUserId)
 
ACTIVETICKSERVERAPI_API bool ATSetServerTimeUpdateCallback (uint64_t session, ATServerTimeUpdateCallback pCallback)
 
ACTIVETICKSERVERAPI_API bool ATSetStreamUpdateCallback (uint64_t session, ATStreamUpdateCallback pCallback)
 
ACTIVETICKSERVERAPI_API bool ATInitSession (uint64_t session, const char *primaryServerHostname, const char *backupServerHostname, uint32_t serverPort, ATSessionStatusChangeCallback pCallback, bool isUsingInternalQueue=false)
 
ACTIVETICKSERVERAPI_API void ATShutdownSession (uint64_t session)
 
ACTIVETICKSERVERAPI_API void ATRedirectPumpMessage (uint64_t session, uint64_t wParam, uint64_t lParam)
 
ACTIVETICKSERVERAPI_API uint64_t ATCreateBarHistoryDbRequest (uint64_t session, const ATSYMBOL &symbol, ATBarHistoryType barHistoryType, uint8_t intradayMinuteCompression, const ATTIME &beginDateTime, const ATTIME &endDateTime, ATBarHistoryResponseCallback pCallback)
 
ACTIVETICKSERVERAPI_API uint64_t ATCreateBarHistoryDbRequest (uint64_t session, const ATSYMBOL &symbol, ATBarHistoryType barHistoryType, uint8_t intradayMinuteCompression, const ATTIME &beginDateTime, uint32_t recordsWanted, ATCursorType cursorType, ATBarHistoryResponseCallback pCallback)
 
ACTIVETICKSERVERAPI_API uint64_t ATCreateBarHistoryDbRequest (uint64_t session, const ATSYMBOL &symbol, ATBarHistoryType barHistoryType, uint8_t intradayMinuteCompression, uint32_t recordsWanted, ATBarHistoryResponseCallback pCallback)
 
ACTIVETICKSERVERAPI_API uint64_t ATCreateLoginRequest (uint64_t session, const wchar16_t *userid, const wchar16_t *password, ATLoginResponseCallback pCallback)
 
ACTIVETICKSERVERAPI_API uint64_t ATCreateTickHistoryDbRequest (uint64_t session, const ATSYMBOL &symbol, bool selectTrades, bool selectQuotes, const ATTIME &beginDateTime, const ATTIME &endDateTime, ATTickHistoryResponseCallback pCallback)
 
ACTIVETICKSERVERAPI_API uint64_t ATCreateTickHistoryDbRequest (uint64_t session, const ATSYMBOL &symbol, bool selectTrades, bool selectQuotes, const ATTIME &beginDateTime, uint32_t recordsWanted, ATCursorType cursorType, ATTickHistoryResponseCallback pCallback)
 
ACTIVETICKSERVERAPI_API uint64_t ATCreateTickHistoryDbRequest (uint64_t session, const ATSYMBOL &symbol, bool selectTrades, bool selectQuotes, uint32_t recordsWanted, ATTickHistoryResponseCallback pCallback)
 
ACTIVETICKSERVERAPI_API uint64_t ATCreateTickHistoryDbRequest (uint64_t session, const ATSYMBOL &symbol, bool selectTrades, bool selectQuotes, uint32_t pagesWanted, uint64_t offset, const ATTIME &dbdate, ATTickHistoryResponseCallback pCallback)
 
ACTIVETICKSERVERAPI_API uint64_t ATCreateMarketHolidaysRequest (uint64_t session, uint8_t yearsGoingBack, uint8_t yearsGoingForward, ATExchangeType exchangeType, ATCountryType countryType, ATMarketHolidaysResponseCallback pCallback)
 
ACTIVETICKSERVERAPI_API uint64_t ATCreateMarketMoversDbRequest (uint64_t session, const LPATSYMBOL symbols, uint16_t symbolCount, ATMarketMoversDbResponseCallback pCallback)
 
ACTIVETICKSERVERAPI_API uint64_t ATCreateMarketMoversStreamRequest (uint64_t session, const ATSYMBOL &symbol, ATStreamRequestType requestType, ATMarketMoversStreamResponseCallback pCallback)
 
ACTIVETICKSERVERAPI_API uint64_t ATCreateQuoteDbRequest (uint64_t session, const LPATSYMBOL symbols, uint16_t symbolCount, const ATQuoteFieldType *fields, uint16_t fieldCount, ATQuoteDbResponseCallback pCallback)
 
ACTIVETICKSERVERAPI_API uint64_t ATCreateQuoteStreamRequest (uint64_t session, const LPATSYMBOL symbols, uint16_t symbolCount, ATStreamRequestType requestType, ATQuoteStreamResponseCallback pCallback)
 
ACTIVETICKSERVERAPI_API uint64_t ATCreateSectorListRequest (uint64_t session, ATSectorListResponseCallback pCallback)
 
ACTIVETICKSERVERAPI_API uint64_t ATCreateConstituentListRequest (uint64_t session, ATConstituentListType constituentListType, const wchar16_t *key, ATConstituentListResponseCallback pCallback)
 
ACTIVETICKSERVERAPI_API bool ATCloseRequest (uint64_t session, uint64_t request)
 
ACTIVETICKSERVERAPI_API bool ATSendRequest (uint64_t session, uint64_t request, uint32_t timeout, ATRequestTimeoutCallback pCallback)
 

Macro Definition Documentation

#define DEFAULT_REQUEST_TIMEOUT   30000

Default timeout value for ATSendRequest function

See Also
ATSendRequest()

Typedef Documentation

typedef void(* ATBarHistoryResponseCallback)(uint64_t origRequest, ATBarHistoryResponseType responseType, LPATBARHISTORY_RESPONSE pResponse)

Callback for all Bar history responses. This function is called asynchronously by ActiveTick API's internal thread in response to ATCreateBarHistoryDbRequest/ATSendRequest call sequence.

Parameters
origRequestOriginal request generated by one of the ATCreateBarHistoryDbRequest functions. Use ATCloseRequest function to close the request handle inside your callback handler.
responseTypeOne of the ATBarHistoryResponseType response type values.
pResponsePointer to ATBARHISTORY_RESPONSE structure containing the response payload.
See Also
ATBarHistoryResponseType
LPATBARHISTORY_RESPONSE
ATCreateBarHistoryDbRequest
ATSendRequest
ATCloseRequest
typedef void(* ATConstituentListResponseCallback)(uint64_t origRequest, LPATSYMBOL pSymbols, uint32_t symbolsCount)

Callback for Constituent list response. This function is called asynchronously by the ActiveTick API's internal thread in response to ATCreateConstituentListRequest/ATSendRequest call sequence.

Parameters
origRequestOriginal request handle returned by ATCreateConstituentListRequest call.
pRecordsPointer to LPATSYMBOL containing array of symbols.
symbolsCountContains number of record structures.
See Also
ATSYMBOL
ATCreateConstituentListRequest
ATSendRequest
typedef void(* ATLoginResponseCallback)(uint64_t session, uint64_t request, LPATLOGIN_RESPONSE pResponse)

Callback for login response. This function is called asynchronously by the ActiveTick API's internal thread in response to ATCreateLoginRequest/ATSendRequest call sequence.

Parameters
sessionSession handle for which the response is intended.
requestOriginal request generated by ATCreateLoginRequest function. Use ATCloseRequest function to close the request handle inside your callback handler.
pResponsePointer to ATLOGIN_RESPONSE structure containing the login response payload.
See Also
LPATBARHISTORY_RESPONSE
ATCreateLoginRequest
ATSendRequest
ATCloseRequest
typedef void(* ATMarketHolidaysResponseCallback)(uint64_t origRequest, LPATMARKET_HOLIDAYSLIST_ITEM pItems, uint32_t itemsCount)

Callback for market holidays response. This function is called asynchronously by the ActiveTick API's internal thread in response to ATCreateMarketHolidaysRequest/ATSendRequest call sequence.

Parameters
origRequestOriginal request handle returned by ATCreateMarketHolidaysRequest call.
pItemsPointer to ATMARKET_HOLIDAYSLIST_ITEM containing first holiday.
itemsCountContains number of ATMARKET_HOLIDAYSLIST_ITEM structures inside pItems pointer.
See Also
ATMARKET_HOLIDAYSLIST_ITEM
ATCreateMarketHolidaysRequest
ATSendRequest
typedef void(* ATMarketMoversDbResponseCallback)(uint64_t origRequest, ATMarketMoversDbResponseType responseType, LPATMARKET_MOVERSDB_RESPONSE pResponse)

Callback for market movers database snapshot response. This function is called asynchronously by the ActiveTick API's internal thread in response to ATCreateMarketMoversDbRequest/ATSendRequest call sequence.

Parameters
origRequestOriginal request generated by ATCreateMarketMoversDbRequest function. Use ATCloseRequest function to close the request handle inside your callback handler.
responseTypeOne of the ATMarketMoversDbResponseType enum items.
pResponsePointer to ATMARKET_MOVERSDB_RESPONSE structure containing the market movers database snapshot response payload.
See Also
ATMarketMoversDbResponseType
LPATLOGIN_RESPONSE
ATCreateMarketMoversDbRequest
ATSendRequest
ATCloseRequest
typedef void(* ATMarketMoversStreamResponseCallback)(uint64_t origRequest, ATStreamResponseType responseType, LPATMARKET_MOVERS_STREAM_RESPONSE pResponse)

Callback for market movers stream response. This function is called asynchronously by the ActiveTick API's internal thread in response to ATCreateMarketMoversStreamRequest/ATSendRequest call sequence.

Parameters
origRequestOriginal request generated by ATCreateMarketMoversStreamRequest function. Use ATCloseRequest function to close the request handle inside your callback handler.
responseTypeOne of the ATStreamResponseType enum items.
pResponsePointer to ATMARKET_MOVERS_STREAM_RESPONSE structure containing the market movers stream response payload.
See Also
ATStreamResponseType
LPATQUOTESTREAM_RESPONSE
ATCreateMarketMoversStreamRequest
ATSendRequest
ATCloseRequest
typedef void(* ATQuoteDbResponseCallback)(uint64_t origRequest, ATQuoteDbResponseType responseType, LPATQUOTEDB_RESPONSE pResponse, uint32_t responseCount)

Callback for quote database snapshot response. This function is called asynchronously by the ActiveTick API's internal thread in response to ATCreateQuoteDbRequest/ATSendRequest call sequence.

Parameters
hOrigRequestOriginal request generated by ATCreateQuoteDbRequest function. Use ATCloseRequest function to close the request handle inside your callback handler.
responseTypeOne of the ATQuoteDbResponseType enum items.
pResponsePointer to ATQUOTEDB_RESPONSE structure containing the quote database snapshot response payload. The pointer points to the first location of quote database response. Use responseCount to determine how many structures are present.
responseCountCount of how many ATQUOTEDB_RESPONSE structures are present in current response.
See Also
ATQuoteDbResponseType
LPATMARKET_MOVERSDB_RESPONSE
ATCreateQuoteDbRequest
ATSendRequest
ATCloseRequest
typedef void(* ATQuoteStreamResponseCallback)(uint64_t origRequest, ATStreamResponseType responseType, LPATQUOTESTREAM_RESPONSE pResponse, uint32_t responseCount)

Callback for quote stream response. This function is called asynchronously by the ActiveTick API's internal thread in response to ATCreateQuoteStreamRequest/ATSendRequest call sequence.

Parameters
origRequestOriginal request generated by ATCreateQuoteStreamRequest function. Use ATCloseRequest function to close the request handle inside your callback handler.
responseTypeOne of the ATStreamResponseType enum items.
pResponsePointer to ATQUOTESTREAM_RESPONSE structure containing the quote stream response payload. The pointer points to the first location of quote stream response. Use responseCount to determine how many structures are present.
responseCountCount of how many ATQUOTESTREAM_RESPONSE structures are present in current response.
See Also
ATQuoteStreamResponseType
LPATQUOTEDB_RESPONSE
ATCreateQuoteStreamRequest
ATSendRequest
ATCloseRequest
typedef void(* ATRequestTimeoutCallback)(uint64_t origRequest)

Callback for any time out. This function is called asynchronously by the ActiveTick API's internal thread when a time out occurs for any request initiated via ATSendRequest function.

Parameters
origRequestOriginal request generated by one of the ATCreate* functions. ActiveTick API guarantees either a valid response callback or timeout callback for any request sent using ATSEndRequest function.
Note
The handle needs to be closed during processing of the callback by using ATCloseRequest function.
See Also
ATSendRequest
ATCloseRequest
typedef void(* ATSectorListResponseCallback)(uint64_t origRequest, LPATSECTORLIST_RECORD pRecords, uint32_t recordsCount)

Callback for Sector list response. This function is called asynchronously by the ActiveTick API's internal thread in response to ATCreateSectorListRequest/ATSendRequest call sequence.

Parameters
origRequestOriginal request handle returned by ATCreateSectorListRequest call.
pRecordsPointer to LPATSECTORLIST_RECORD containing array of sectors, comprised of sector/industry pairs.
recordsCountContains number of record structures.
See Also
ATSECTORLIST_RECORD
ATCreateSectorListRequest
ATSendRequest
typedef void(* ATServerTimeUpdateCallback)(LPATTIME pServerTime)

Callback for server time update. This function is called asynchronously by the ActiveTick API's internal thread.

Parameters
pServerTimePeriod timestamp sent from the ActiveTick server. Time is in Eastern Standard time zone.
See Also
LPSTREAM_UPDATE
typedef void(* ATSessionStatusChangeCallback)(uint64_t session, ATSessionStatusType statusType)

Callback for session status change. This function is called asynchronously by the ActiveTick API's internal thread when there is a change in the session, such as Connect or Disconnect event.

Parameters
sessionSession handle which caused the callback notification.
statusTypeOne of the ATSessionStatusType enum status types.
See Also
ATSessionStatusType
typedef void(* ATStreamUpdateCallback)(LPATSTREAM_UPDATE pUpdate)

Callback for all streaming updates. This function is called asynchronously by the ActiveTick API's internal thread.

Parameters
pUdpatePointer to ATSTREAM_UDPATE structure containing information about current stream update.
Note
Use this callback to process all streaming updates from ActiveTick data feed.
See Also
LPATSTREAM_UPDATE
typedef void(* ATTickHistoryResponseCallback)(uint64_t origRequest, ATTickHistoryResponseType responseType, LPATTICKHISTORY_RESPONSE pResponse)

Callback for all Tick history responses. This function is called asynchronously by ActiveTick API's internal thread in response to ATCreateTickHistoryDbRequest/ATSendRequest call sequence.

Parameters
origRequestOriginal request generated by one of the ATCreateTickHistoryDbRequest functions. Use ATCloseRequest function to close the request handle inside your callback handler.
responseTypeOne of the ATTickHistoryResponseType enum response type values.
pResponsePointer to ATTICKHISTORY_RESPONSE structure containing the response payload.
See Also
ATTickHistoryResponseType
LPATTICKHISTORY_RESPONSE
ATCreateTickHistoryDbRequest
ATSendRequest
ATCloseRequest

Function Documentation

ACTIVETICKSERVERAPI_API bool ATCloseRequest ( uint64_t  session,
uint64_t  request 
)

Close request handle generated by one of the ATCreate* request functions.

Parameters
sessionSession handle which initiated original request.
requestRequest handle to close.
Returns
true if successful or false otherwise.
ACTIVETICKSERVERAPI_API uint64_t ATCreateBarHistoryDbRequest ( uint64_t  session,
const ATSYMBOL symbol,
ATBarHistoryType  barHistoryType,
uint8_t  intradayMinuteCompression,
const ATTIME beginDateTime,
const ATTIME endDateTime,
ATBarHistoryResponseCallback  pCallback 
)

Create request for history bars. This function selects bars between two specific times.

Parameters
sessionSession handle created with prior call to ATCreateSession().
symbolATSYMBOL for which to create the request.
barHistoryTypeOne of ATBarHistoryType enum types.
intradayMinuteCompressionIf barHistoryType is BarHistoryIntraday, then this parameter specifies a range of 1-60 minutes bar compression, otherwise it should be 0.
beginDateTimeBeginning of the date+time range.
endDateTimeEnding of the date+time range.
pCallbackPointer to ATBarHistoryResponseCallback callback notification function. This function will be called upon successful receipt of bar history data.
Returns
uint64_t Returns a handle to the request. This handle must be used with ATSendRequest function.
Note
Once request handle is created, use SendRequest to send the request to the server. ActiveTick's API guarantees either a notification through ATBarHistoryResponseCallback upon successful data receipt from the server, or a time out notification through ATRequestTimeoutCallback.
See Also
ATSYMBOL
ATBarHistoryType
ATBarHistoryResponseCallback
ATCreateSession
ATSendRequest
ACTIVETICKSERVERAPI_API uint64_t ATCreateBarHistoryDbRequest ( uint64_t  session,
const ATSYMBOL symbol,
ATBarHistoryType  barHistoryType,
uint8_t  intradayMinuteCompression,
const ATTIME beginDateTime,
uint32_t  recordsWanted,
ATCursorType  cursorType,
ATBarHistoryResponseCallback  pCallback 
)

Create request for history bars. This function selects bars from a given time point, and using the back or forward cursor, retrieves specified count of bars.

Parameters
sessionSession handle created with prior call to ATCreateSession().
symbolATSYMBOL for which to create the request.
barHistoryTypeOne of ATBarHistoryType enum types.
intradayMinuteCompressionIf barHistoryType is BarHistoryIntraday, then this parameter specifies a range of 1-60 minutes bar compression, otherwise it should be 0.
beginDateTimeBeginning of the date+time range.
recordsWantedBars to retrieve.
cursorTypeOne of the ATCursorType enum types, specifying which direction to move to.
pCallbackPointer to ATBarHistoryResponseCallback callback notification function. This function will be called upon successful receipt of bar history data.
Returns
uint64_t Returns a handle to the request. This handle must be used with ATSendRequest function.
Note
Once request handle is created, use SendRequest to send the request to the server. ActiveTick's API guarantees either a notification through ATBarHistoryResponseCallback upon successful data receipt from the server, or a time out notification through ATRequestTimeoutCallback.
See Also
ATSYMBOL
ATBarHistoryType
ATBarHistoryResponseCallback
ATCreateSession
ATSendRequest
ACTIVETICKSERVERAPI_API uint64_t ATCreateBarHistoryDbRequest ( uint64_t  session,
const ATSYMBOL symbol,
ATBarHistoryType  barHistoryType,
uint8_t  intradayMinuteCompression,
uint32_t  recordsWanted,
ATBarHistoryResponseCallback  pCallback 
)

Create request for history bars. This function selects latest bars from present time, going back to specified count of bars.

Parameters
sessionSession handle created with prior call to ATCreateSession().
symbolATSYMBOL for which to create the request.
barHistoryTypeOne of ATBarHistoryType enum types.
intradayMinuteCompressionIf barHistoryType is BarHistoryIntraday, then this parameter specifies a range of 1-60 minutes bar compression, otherwise it should be 0.
recordsWantedBars to retrieve.
pCallbackPointer to ATBarHistoryResponseCallback callback notification function. This function will be called upon successful receipt of bar history data.
Returns
uint64_t Returns a handle to the request. This handle must be used with ATSendRequest function.
Note
Once request handle is created, use SendRequest to send the request to the server. ActiveTick's API guarantees either a notification through ATBarHistoryResponseCallback upon successful data receipt from the server, or a time out notification through ATRequestTimeoutCallback.
See Also
ATSYMBOL
ATBarHistoryType
ATBarHistoryResponseCallback
ATCreateSession
ATSendRequest
ACTIVETICKSERVERAPI_API uint64_t ATCreateConstituentListRequest ( uint64_t  session,
ATConstituentListType  constituentListType,
const wchar16_t key,
ATConstituentListResponseCallback  pCallback 
)

Create Constituents list request. This function is used to retrieve a list for a given constituent type.

Parameters
sessionSession handle created with prior call to ATCreateSession().
pCallbackPointer to ATConstituentListResponseCallback callback function. This function will be called when API receives a response from the server.
constituentListTypeOne of ATConstituentListType types, Sector, Index, or OptionChain
keySpecifies the key.
Returns
uint64_t Returns a handle to the request. This handle must be used with ATSendRequest function.
Note
If constituent type is Sector, the key should be formatted as follows: sectorname/nindustryname.
If constituent type is Index, the key should containt the full index symbol.
If constituent type is OptionChain, the key should containt the underlying symbol, such as "AAPL.
Once request handle is created, use SendRequest to send the request to the server. ActiveTick's API guarantees either a notification through ATSectorListResponseCallback upon successful response from the server, or a time out notification through ATRequestTimeoutCallback.
See Also
ATSYMBOL
ATSectorListResponseCallback
ATInitSession
ACTIVETICKSERVERAPI_API uint64_t ATCreateLoginRequest ( uint64_t  session,
const wchar16_t userid,
const wchar16_t password,
ATLoginResponseCallback  pCallback 
)

Create ActiveTick user login request.

Parameters
sessionSession handle created with prior call to ATCreateSession().
useridActiveTick user id.
passwordActiveTick user password.
pCallbackPointer to ATLoginResponseCallback callback function. This function will be called when API receives a login response from the server.
Returns
uint64_t Returns a handle to the request. This handle must be used with ATSendRequest function.
Note
Once request handle is created, use SendRequest to send the request to the server. ActiveTick's API guarantees either a notification through ATLoginResponseCallback upon successful response from the server, or a time out notification through ATRequestTimeoutCallback.
See Also
ATLoginResponseCallback
ATInitSession
ACTIVETICKSERVERAPI_API uint64_t ATCreateMarketHolidaysRequest ( uint64_t  session,
uint8_t  yearsGoingBack,
uint8_t  yearsGoingForward,
ATExchangeType  exchangeType,
ATCountryType  countryType,
ATMarketHolidaysResponseCallback  pCallback 
)

Create market holidays list request. This function returns all market holidays for a given year range.

Parameters
sessionSession handle created with prior call to ATCreateSession().
yearsGoingBackYears to go back from current year.
yearsGoingForwardYears to go forward from current year.
exchangeTypeExchange-specific holidays
countryTypeCountry-specific holidays
pCallbackPointer to ATMarketHolidaysResponseCallback callback function. This function will be called when API receives a response from the server.
Returns
uint64_t Returns a handle to the request. This handle must be used with ATSendRequest function.
Note
Once request handle is created, use SendRequest to send the request to the server. ActiveTick's API guarantees either a notification through ATMarketHolidaysResponseCallback upon successful response from the server, or a time out notification through ATRequestTimeoutCallback.
See Also
ATMarketHolidaysResponseCallback
ATInitSession
ACTIVETICKSERVERAPI_API uint64_t ATCreateMarketMoversDbRequest ( uint64_t  session,
const LPATSYMBOL  symbols,
uint16_t  symbolCount,
ATMarketMoversDbResponseCallback  pCallback 
)

Create market movers real-time snapshot database request.

Parameters
sessionSession handle created with prior call to ATCreateSession().
symbolsPointer to an array of symbols for which to retrieve market movers records.
symbolCountCount of symbols inside the symbols array.
pCallbackPointer to ATMarketMoversDbResponseCallback callback function. This function will be called when API receives a response from the server.
Returns
uint64_t Returns a handle to the request. This handle must be used with ATSendRequest function.
Note
The following is an accepted list of symbols:
  • "VL" Top Volume
  • "NG" Net Gainers
  • "NL" Net Losers
  • "PG" Percent Gainers
  • "PL" Percent Losers
Desired exchange is specified in ATSYMBOL::exchangeType field. ATSYMBOL::symbolType must be set to ATSymbolType::SymbolTopMarketMovers and ATSYMBOL::countryType must be set to ATCountryType::CountryUnitedStates.
Once request handle is created, use SendRequest to send the request to the server. ActiveTick's API guarantees either a notification through ATMarketMoversDbResponseCallback upon successful response from the server, or a time out notification through ATRequestTimeoutCallback.
See Also
ATSYMBOL
ATMarketMoversDbResponseCallback
ATInitSession
ACTIVETICKSERVERAPI_API uint64_t ATCreateMarketMoversStreamRequest ( uint64_t  session,
const ATSYMBOL symbol,
ATStreamRequestType  requestType,
ATMarketMoversStreamResponseCallback  pCallback 
)

Create market movers real-time stream request.

Parameters
sessionSession handle created with prior call to ATCreateSession().
symbolSymbol for which to create the stream request.
requestTypeOne of the ATStreamRequestType enum types specifying which type of stream operation to perform.
pCallbackPointer to ATMarketMoversStreamResponseCallback callback function. This function will be called when API receives a response from the server.
Returns
uint64_t Returns a handle to the request. This handle must be used with ATSendRequest function.
Note
The following is an accepted list of symbols:
  • "VL" Top Volume
  • "NG" Net Gainers
  • "NL" Net Losers
  • "PG" Percent Gainers
  • "PL" Percent Losers
Desired exchange is specified in ATSYMBOL::exchangeType field. ATSYMBOL::symbolType must be set to ATSymbolType::SymbolTopMarketMovers and ATSYMBOL::countryType must be set to ATCountryType::CountryUnitedStates.
Once request handle is created, use SendRequest to send the request to the server. ActiveTick's API guarantees either a notification through ATMarketMoversStreamResponseCallback upon successful response from the server, or a time out notification through ATRequestTimeoutCallback.
See Also
ATSYMBOL
ATMarketMoversStreamResponseCallback
ATInitSession
ACTIVETICKSERVERAPI_API uint64_t ATCreateQuoteDbRequest ( uint64_t  session,
const LPATSYMBOL  symbols,
uint16_t  symbolCount,
const ATQuoteFieldType fields,
uint16_t  fieldCount,
ATQuoteDbResponseCallback  pCallback 
)

Create real-time quote snapshot database request.

Parameters
sessionSession handle created with prior call to ATCreateSession().
symbolsPointer to an array of symbols for which to retrieve quote records.
symbolCountCount of symbols inside the symbols array.
fieldsPointer to an array of ATQuoteFieldTypes for which to retrieve the values.
fieldCountCount of fields inside the fields array.
pCallbackPointer to ATQuoteDbResponseCallback callback function. This function will be called when API receives a response from the server.
Returns
uint64_t Returns a handle to the request. This handle must be used with ATSendRequest function.
Note
Once request handle is created, use SendRequest to send the request to the server. ActiveTick's API guarantees either a notification through ATQuoteDbResponseCallback upon successful response from the server, or a time out notification through ATRequestTimeoutCallback.
See Also
ATSYMBOL
ATQuoteDbResponseCallback
ATInitSession
ACTIVETICKSERVERAPI_API uint64_t ATCreateQuoteStreamRequest ( uint64_t  session,
const LPATSYMBOL  symbols,
uint16_t  symbolCount,
ATStreamRequestType  requestType,
ATQuoteStreamResponseCallback  pCallback 
)

Create real-time quote stream request.

Parameters
sessionSession handle created with prior call to ATCreateSession().
symbolsPointer to an array of symbols for which to perform the stream request.
symbolCountCount of symbols inside the symbols array.
requestTypeOne of the ATStreamRequestType specifying the type of stream operation.
pCallbackPointer to ATQuoteStreamResponseCallback callback function. This function will be called when API receives a response from the server.
Returns
uint64_t Returns a handle to the request. This handle must be used with ATSendRequest function.
Note
Once request handle is created, use SendRequest to send the request to the server. ActiveTick's API guarantees either a notification through ATQuoteStreamResponseCallback upon successful response from the server, or a time out notification through ATRequestTimeoutCallback.
See Also
ATSYMBOL
ATQuoteStreamResponseCallback
ATInitSession
ACTIVETICKSERVERAPI_API uint64_t ATCreateSectorListRequest ( uint64_t  session,
ATSectorListResponseCallback  pCallback 
)

Create Sector list request. The list comes back as string pairs of sector/industry.

Parameters
sessionSession handle created with prior call to ATCreateSession().
pCallbackPointer to ATSectorListResponseCallback callback function. This function will be called when API receives a response from the server.
Returns
uint64_t Returns a handle to the request. This handle must be used with ATSendRequest function.
Note
Once request handle is created, use SendRequest to send the request to the server. ActiveTick's API guarantees either a notification through ATSectorListResponseCallback upon successful response from the server, or a time out notification through ATRequestTimeoutCallback.
See Also
ATSYMBOL
ATSectorListResponseCallback
ATInitSession
ACTIVETICKSERVERAPI_API uint64_t ATCreateSession ( )

Create ActiveTick session. Each session is represented by a single connection to ActiveTick's servers.

Note
ATInitAPI must be called prior to session creation.
Use ATDestroySession function to close session and release all resources associated with the session.
Returns
HANDLE Session handle.
See Also
ATDestroySession
ATInitAPI
ACTIVETICKSERVERAPI_API uint64_t ATCreateTickHistoryDbRequest ( uint64_t  session,
const ATSYMBOL symbol,
bool  selectTrades,
bool  selectQuotes,
const ATTIME beginDateTime,
const ATTIME endDateTime,
ATTickHistoryResponseCallback  pCallback 
)

Create request for tick data. This function selects tick data between two specific times.

Parameters
sessionSession handle created with prior call to ATCreateSession().
symbolATSYMBOL for which to create the request.
selectTradesIf set to true, the server will return TRADE records.
selectQuotesIf set to true, the server will return QUOTE records.
beginDateTimeBeginning of the date+time range.
endDateTimeEnding of the date+time range.
pCallbackPointer to ATTickHistoryResponseCallback callback notification function. This function will be called upon successful receipt of tick history data.
Returns
uint64_t Returns a handle to the request. This handle must be used with ATSendRequest function.
Note
Once request handle is created, use SendRequest to send the request to the server. ActiveTick's API guarantees either a notification through ATTickHistoryResponseCallback upon successful data receipt from the server, or a time out notification through ATRequestTimeoutCallback.
See Also
ATSYMBOL
ATTickHistoryResponseCallback
ATCreateSession
ATSendRequest
ACTIVETICKSERVERAPI_API uint64_t ATCreateTickHistoryDbRequest ( uint64_t  session,
const ATSYMBOL symbol,
bool  selectTrades,
bool  selectQuotes,
const ATTIME beginDateTime,
uint32_t  recordsWanted,
ATCursorType  cursorType,
ATTickHistoryResponseCallback  pCallback 
)

Create request for tick data. This function selects tick data from a given time point, and using the back or forward cursor, retrieves specified count of records.

Parameters
sessionSession handle created with prior call to ATCreateSession().
symbolATSYMBOL for which to create the request.
selectTradesIf set to true, the server will return TRADE records.
selectQuotesIf set to true, the server will return QUOTE records.
beginDateTimeBeginning of the date+time range.
recordsWantedRecords to retrieve.
cursorTypeOne of the ATCursorType enum types, specifying which direction to move to.
pCallbackPointer to ATTickHistoryResponseCallback callback notification function. This function will be called upon successful receipt of tick history data.
Returns
uint64_t Returns a handle to the request. This handle must be used with ATSendRequest function.
Note
Once request handle is created, use SendRequest to send the request to the server. ActiveTick's API guarantees either a notification through ATTickHistoryResponseCallback upon successful data receipt from the server, or a time out notification through ATRequestTimeoutCallback.
See Also
ATSYMBOL
ATTickHistoryResponseCallback
ATCreateSession
ATSendRequest
ACTIVETICKSERVERAPI_API uint64_t ATCreateTickHistoryDbRequest ( uint64_t  session,
const ATSYMBOL symbol,
bool  selectTrades,
bool  selectQuotes,
uint32_t  recordsWanted,
ATTickHistoryResponseCallback  pCallback 
)

Create request for tick data. This function selects latest tick data from present time, going back to specified count of records.

Parameters
sessionSession handle created with prior call to ATCreateSession().
symbolATSYMBOL for which to create the request.
selectTradesIf set to true, the server will return TRADE records.
selectQuotesIf set to true, the server will return QUOTE records.
recordsWantedRecords to retrieve.
pCallbackPointer to ATTickHistoryResponseCallback callback notification function. This function will be called upon successful receipt of tick history data.
Returns
uint64_t Returns a handle to the request. This handle must be used with ATSendRequest function.
Note
Once request handle is created, use SendRequest to send the request to the server. ActiveTick's API guarantees either a notification through ATTickHistoryResponseCallback upon successful data receipt from the server, or a time out notification through ATRequestTimeoutCallback.
See Also
ATSYMBOL
ATTickHistoryResponseCallback
ATCreateSession
ATSendRequest
ACTIVETICKSERVERAPI_API uint64_t ATCreateTickHistoryDbRequest ( uint64_t  session,
const ATSYMBOL symbol,
bool  selectTrades,
bool  selectQuotes,
uint32_t  pagesWanted,
uint64_t  offset,
const ATTIME dbdate,
ATTickHistoryResponseCallback  pCallback 
)

Create request for tick data. This function uses direct database offset value to retrieve data from data pages.

Parameters
sessionSession handle created with prior call to ATCreateSession().
symbolATSYMBOL for which to create the request.
selectTradesIf set to true, the server will return TRADE records.
selectQuotesIf set to true, the server will return QUOTE records.
pagesWantedPages to retrieve. Each page contains variable number of records.
offsetOffset value to use to look up records. The value must be a valid offset returned from previous calls, or set to -1 to retrieve last record inside the database.
dbdateDate of the datatabase. ActiveTick ticker plant stores tick records inside daily files, and dbdate param identifies the date of which database to retrieve the records from.
pCallbackPointer to ATTickHistoryResponseCallback callback notification function. This function will be called upon successful receipt of tick history data.
Returns
uint64_t Returns a handle to the request. This handle must be used with ATSendRequest function.
Note
This function uses offset as an index to look up records for given symbol. Once the callback is called, the callback will be passed an offset for the next lookup, if one is available. If there are no more pages available for the database identified in dbdate, the offset will return with 0xffffffffffffffff value.
Once request handle is created, use SendRequest to send the request to the server. ActiveTick's API guarantees either a notification through ATTickHistoryResponseCallback upon successful data receipt from the server, or a time out notification through ATRequestTimeoutCallback.
See Also
ATSYMBOL
ATTickHistoryResponseCallback
ATCreateSession
ATSendRequest
ACTIVETICKSERVERAPI_API void ATDestroySession ( uint64_t  session)

Destroy ActiveTick session by closing underlying server connection, and cleaning up any resources allocated for current session.

Parameters
sessionSession handle
Note
ATCreateSession must be called prior to session destruction.
See Also
ATCreateSession
ACTIVETICKSERVERAPI_API uint32_t ATGetAPIVersion ( )

Return current API version.

Returns
API version.
ACTIVETICKSERVERAPI_API uint32_t ATGetSessionQueuedStreamUpdates ( uint64_t  session)

Return queued streaming updates.

Parameters
sessionSession handle for which to retrieve the count.
Returns
uint32_t Number of queued streaming updates.
Note
This function returns valid data only if isUsingStreamQueue flag is set to true during the call to ATInitSession
See Also
ATInitSession
ACTIVETICKSERVERAPI_API uint64_t ATGetSessionTotalRecvedByteCount ( uint64_t  session)

Return total amount of bytes received for given session.

Parameters
sessionSession handle for which to retrieve the received bytes count.
Returns
uint64_t Number of bytes received since last session initialization.
ACTIVETICKSERVERAPI_API uint64_t ATGetSessionTotalRecvedMsgCount ( uint64_t  session,
ATSessionTotalRecvedMsgType  type 
)

Return total amount of bytes received for given session.

Parameters
sessionSession handle for which to retrieve the received bytes count.
Returns
uint64_t Number of msgs received since last session initialization.
ACTIVETICKSERVERAPI_API bool ATInitAPI ( )

Initialize ActiveTick's API. This function must be called before any other can be function called.

Note
Use ATShutdownAPI function to uninitialize.
Returns
BOOL Returns true if successful, false otherwise.
See Also
ATShutdownAPI
ACTIVETICKSERVERAPI_API bool ATInitSession ( uint64_t  session,
const char *  primaryServerHostname,
const char *  backupServerHostname,
uint32_t  serverPort,
ATSessionStatusChangeCallback  pCallback,
bool  isUsingInternalQueue = false 
)

Initialize session handle. This function is responsible for spawning a server connection thread, and initialization of various internal data structures.

Parameters
sessionSession handle created by ATCreateSession() prior to calling this function.
primaryServerHostnameHostname of the primary ActiveTick server.
backupServerHostnameHostname of the backup ActiveTick server.
serverPortActiveTick Server's port. This value is typically port 443.
pCallbackCallback function which will be used during various changes to sessions such as connects and disconnects.
isUsingInternalQueueFlag used to indicate whether the API should use internal queue for calling stream callbacks. Default is false.
Note
Use ATShutdownSession to close server connection and clean up internal data structures.
ATCreateSession must be called prior to calling this function.
For primary and backup server host names, the following host name should be used: activetick1.activetick.com, and activetick2.activetick.com.
All stream handling should be completed quickly to prevent buffering of too much data at the server level. If isUsingInternalQueue flag is set to true, the API will buffer all incoming streaming data into internal queue, and will have an internal thread call into ATStreamUpdateCallback, rather than having internal communication thread call the callback.
Returns
true if successful or false otherwise.
See Also
ATCreateSession
ATShutdownSession
ATSessionStatusChangeCallback
ACTIVETICKSERVERAPI_API void ATRedirectPumpMessage ( uint64_t  session,
uint64_t  wParam,
uint64_t  lParam 
)

Redirect window message from application using ActiveTick's API. ActiveTick's internal thread calls specified HWND with specified message id, and application should use this method to reflect all messages back to ActiveTick's API.

Parameters
sessionSession handle for which to redirect the message.
wParamWPARAM value from WindowProc.
lParamLPARAM value from WindowProc.
Note
This function should only be used if given session was initialized with using message pumps to synchronize notifications to a given HWND thread context.
See Also
ATInitSession
ACTIVETICKSERVERAPI_API bool ATSendRequest ( uint64_t  session,
uint64_t  request,
uint32_t  timeout,
ATRequestTimeoutCallback  pCallback 
)

Send request to the server.

Parameters
sessionSession handle which initiated original request.
requestRequest handle generated by one of the request functions.
timeoutTime out in milliseconds to wait before ATRequestTimeoutCallback callback is called. To use default time out, specify DEFAULT_REQUEST_TIMEOUT constant.
pCallbackPointer to ATRequestTimeoutCallback callback function. This function will be called if time out is reached.
Returns
true if successful or false otherwise.
ACTIVETICKSERVERAPI_API bool ATSetAPIUserId ( uint64_t  session,
LPATGUID  pAPIUserId 
)

Set user id for ActiveTick API identification and usage. This function is typically used by third party developers to validate their credentials with ActiveTick servers.

Parameters
sessionSession handle for which to set the user id.
pAPIUserIdPointer to a ATGUID assigned by ActiveTick support (suppo.nosp@m.rt@a.nosp@m.ctive.nosp@m.tick.nosp@m..com).
Note
This function is used strictly for identifying API users, and is different from ActiveTick Platform's user id.
Call this function after session has been created, but prior to initialization of current session.
Returns
true if successful or false otherwise.
See Also
ATCreateSession
ATInitSession
ACTIVETICKSERVERAPI_API bool ATSetServerTimeUpdateCallback ( uint64_t  session,
ATServerTimeUpdateCallback  pCallback 
)

Set the callback for server time updates. This callback will be called every time when ActiveTick's API receives a time synchronization message from the server.

Parameters
sessionSession handle for which to set the callback.
pCallbackPointer to ATServerTimeUpdateCallback function.
Returns
true if successful or false otherwise.
See Also
ATServerTimeUpdateCallback
ACTIVETICKSERVERAPI_API bool ATSetStreamUpdateCallback ( uint64_t  session,
ATStreamUpdateCallback  pCallback 
)

Set the callback all stream updates. This callback will be called every time when ActiveTick's API receives a stream update.

Parameters
sessionSession handle for which to set the callback.
pCallbackPointer to ATStreamUpdateCallback function.
Returns
true if successful or false otherwise.
See Also
ATStreamUpdateCallback
ACTIVETICKSERVERAPI_API bool ATShutdownAPI ( )

Shut down ActiveTick's API and releases all resources.

Returns
true if successful or false otherwise.
See Also
ATInitAPI
ACTIVETICKSERVERAPI_API void ATShutdownSession ( uint64_t  session)

Close server connection.

Parameters
sessionSession handle.
Note
ATInitSession must be called prior to session shutdown.
See Also
ATInitSession