Help Center Thousands of today's Charts Free trial FT4Web installed on your computer Contact us: phone, address, e-mail Of Interest to Individual Investors Of interest to Money Managers Already have FT4Web Installed? Lots of well known FastTrackers  Mutual Fund Charts

Search by clicking , Search page, or the Home page

FastTrack API

The FastTrack API represents the interface to the FastTrack database and FNU files.

Introduction

The FastTrack DLL, FastTrack.dll, provides a Windows 32-bit API to the FastTrack database and FNU files. It is available to anyone and there are no royalties for redistribution. However, you must sign our license agreement. The DLL has been tested under C, C++ and Visual Basic, and uses standard Windows API-type calls, so any language that can handle those should have no problem with the DLL. It is not an ActiveX DLL.

Why use FastTrack.dll?

If you use FastTrack.dll in your programming instead of using the defined data structures we offered in FTLAYOUT.BAS for the DOS version of FastTrack, then your program can automatically take advantage of all FastTrack databases, stocks, mutual funds, indices, and future offerings. Also, you will not have to change your programs to use any new data structures that we introduce. When we change the structure, we will also download a new DLL . . . and you can count on this because FastTrack itself uses the same DLL you'll be using for its access to the FastTrack database and FNU files . . . if we send a bad DLL we're all in trouble.

Of course, we may enhance the features of the DLL and the databases from time to time. To use any such new features, you would, of course, have to revise your programs . . . BUT THE GOAL is to maintain a standard set of features forever so that your programs will always work with new symbols and databases in a totally transparent manner.

Standard Disclaimer:

There are no guarantees that you will not have problems. We will support you as best we can and fix any errors in the DLL as quickly as we are able to do so. By using the DLL you agree to hold us harmless and indemnify us with respect to any actions brought by your users.

Requirements

Any 32-bit Windows PC that can actively update the FT databases using our FTComm to get daily downloads. Users/developers with expired FastTrack subscription agreements will not be able to use the dll. 

Function Listing

There is a sample Visual Basic project in the vb directory. For C and C++ programmers, header and library files are supplied (ftapi.h and FastTrack.lib, respectively) in the c directory. For Delphi programmers, the delphi directory includes FastTrack.pas , which gives the Delphi interface to the FastTrack API, as well as two helper functions. FastTrack.pas was provided by Richard Kellogg, a Delphi developer who is using the FastTrack API. For programmers in other languages, this document and the C/C++ header should give you the information to use the FastTrack API.

In addition, there are two convenience function calls for C and C++ users, FTjulian2time_t and FTjulian2tm , that convert the Visual Basic version of a julian date into something C and C++ can understand.

Format

The functions in the API are documented in the following format:

Function Name

  • VB Declaration:
    This is the Visual Basic declaration of the function
  • Parameters:
    The function parameters go here. The format is:
    name - direction - description
    where direction is in, out, or in/out, depending on whether the parameter is passed to the function (in), is returned from the function (out), or both (in/out).

    Note on strings:
    When a string is to be returned from a function, it must be big enough to hold the returned value. In Visual Basic, this can be done either by dimensioning it large enough, or by filling it with enough characters.
    Examples:
    • Dim sym As String * 5
    • Dim namesize As Long
      Dim name As String
      namesize = FTgetNameSize
      name = String$ (namesize, " ")
    We recommend that the latter method be used, because then the string sizes can be dynamically sized (using functions such as FTgetNameSize)

    Some notes on arrays:
    • When a array is to be passed to or from a function, it must be dimensioned so that the specified lower and upper bounds are valid. For example, the prices array is specified to be dimensioned from 0 to maxnumdays; therefore, the lower bound must be at most 0, and the upper bound must be at least maxnumdays.
    • Also, when an array is passed to or from a function, pass the first element. For example, to pass the prices array prices, use prices (0) for the parameter.
    Example:
    maxnumdays& = FTgetMaxNumDays ()
    sym = "FMAGX" ' sym is defined above
    Dim prices (maxnumdays&) as Single
    If FTgetIssue (sym, prices (0)) <> 0 Then
        ' some kind of error has occurred
        ' see
    standard error codes to see what went wrong
        End If
  • Return value:
    Only functions have this section. Generally, functions return a standard return value. Most of the "get" functions, however, return a positive integer on success, representing the value requested, or a standard error code on failure. And some functions merely return boolean values.
  • Purpose:
    The purpose of the function goes here.
  • Notes:
    Some functions may have a notes section. Things that do not fit in any of the other sections go here.

Initialization and Cleanup Functions

FTopen

FTclose

  • VB Declaration:
    Declare Sub FTclose Lib "FastTrack" ()
  • Parameters:
    None
  • Purpose:
    Unload the DLL
  • Notes: The FastTrack DLL automatically unloads itself. FTclose can be used if it doesn't unload quickly enough. Note that if you decide to use this function to force unloading, every FTopen must be followed by an FTclose.

FTrebuildSymbols

  • VB Declaration:
    Declare Function FTrebuildSymbols Lib "FastTrack" () As Long
  • Parameters:
    None
  • Return value:
    standard return value
  • Purpose:
    Rebuild the symbols file, and then reset the DLL.
  • Notes: Calling this many times may cause a memory leak.

Issue Access Functions

These functions return a prices array.

FTgetIssue

Auxiliary Functions

These functions return information for a particular issue.

FTisFTIssue

FTgetIssueName

FTgetName

FTgetNumDays

FTgetMaxDaysBySym

FTgetStartDateBySym

Utility Functions

These functions return information about the FastTrack environment itself.

FTgetFTDir

FTgetJulian

FTgetMaxDays

FTgetMaxNumDays

FTgetMarketDay

FTgetNumSyms

FTgetSymSize

FTgetNameSize

FTgetPathSize

FTgetDLLVersion

Symbol Iterator Functions

These functions can be used to iterate through every symbol recognized by the DLL.

Basically, use these functions like this (Visual Basic code):
Dim iter As Long
Dim sym as String * 5
iter = FTgetIssueIter
While (FTissueNext (iter, sym))
     ' use sym here
     Wend
FTcloseIssueIter (iter)

Note that you can have more than one iterator open at a time.

FTgetIssueIter

FTissueNext

FTcloseIssueIter

Convenience Functions (For C and C++ users)

For this section, since it is intended for C and C++ users only, there are C and C++ declarations instead of VB ones.

FTjulian2time_t

FTjulian2tm

Terms and Definitions

iterator handle
A long integer value representing a issue iterator, which can be used to iterate through the issue in the FastTrack database files and FNUs.
julian date
A long integer value representing a date. This format is readily understood in Visual Basic. (For other languages, it is the number of days since December 30, 1899.)
julian date array
An array -- from 0 to maxnumdays -- of julian dates, one for each day there is data for in the database files plus 1 (every market day has one, and only one entry. Zero is not used.) FTgetJulian indexes into this array, and FTgetMarketDay does the reverse -- it returns the index corresponding to the market day passed to it (if the market was not open on that day, it returns an appropriate substitute).
market day
A long integer value representing the index (of a prices array) to the corresponding julian date in the database files and FNUs -- if a corresponding date does not exist, it is the index of the next smallest date. Note that the market day is between 1 and maxnumdays. (See also julian date array.)
maxdays
A long integer value representing the maximum number of days of a particular issue.
maxnumdays
A long integer value representing the the market day of the last day of data of the most current database.
prices array
An array of single-precision values, from 0 to maxnumdays, representing the dividend-adjusted prices of a issue. Note that even though the array has a lower bound of 0, there are valid prices only from 1 up. FTgetJulian can be used to convert the index of the prices array into its corresponding julian date.
symbol
The (up to) 5 character string uniquely representing an issue, usually a ticker symbol.
standard return value
Either 0 for success, or a standard error code for failure.

Standard Error Codes

All standard error codes are negative.

FT_BADDBPATH -1 unable to open database file
FT_DBCORRUPT -2 database file corrupt
FT_BADINI -3 bad INI file
FT_BADSYMBOLS -4 bad symbols file
FT_BADISSUE -5 no such issue
FT_ISSUECORRUPT -6 issue corrupt
FT_SYMDBMISMATCH -7 symbols file-database files mismatch
FT_BADINDEX -8 index out of bounds
FT_TIMESTAMP -9 timestamp
FT_GENERALERROR -99 general failure
FT_SYSTEMERROR -999 general system failure