Integrating Qcollector and Openquant

Discussion in 'Trading Software' started by Runningbear, Apr 14, 2008.

  1. I'd like to know what people think about the idea of developing a bridging application or bridging code that allows Openquant to pull historical time and sales data from Qcollector.

    I'm thinking this may be a better option than paying for the esignal retail API which is crap anyways and doesn't allow you to access more than 10 days time and sales.

    Qcollector uses Windows Global Atom Table to talk to other applications. Can any Openquant users /programers tell me if it would be difficult to integrate the two.

    How many coding hours are we talking about? If I go ahead i'll be paying a pro to develop the code.

    Thanks in advance,

  2. All you need to do is to access QCollector data and then write to OpenQuant local data base. I have no idea how hard is to get data from QCollector but writing data to OQ db is done with

    DataManager.Add(Instrument, Quote/Trade/Bar);

    call. You can probably do it right in OpenQuant script using .NET classes and methods to access data in QC. Do they have examples in .NET / C# ?

  3. Hi Anton, their website provides the following information. They have a visual basic example and a C++ example but no C# example:

    To work with the QCollector Data Interface messages you simply call the Windows RegisterWindowMessage function passing the text definition for the message you want to use and then store the returned value in a variable. This value now defines a Windows message which you can use in your program.

    wm_QCollectorClientDataRequest := RegisterWindowMessage('QCOLLECTOR_CLIENT_DATA_REQUEST');

    QCollector also registers these messages with Windows. (In this document the messages making up the QCollector Data Interface are referred to by the text that is used when the message is registered with Windows, as in QCOLLECTOR_CLIENT_DATA_REQUEST.)

    You only need to register the messages your program will actually be using.

    QCOLLECTOR_CLIENT_REALTIME_SYMBOL_LIST_REQUEST - Send this message to QCollector to retrieve a list of all items in the QCollector timed updates list (QCollector timed updates data files for symbols in on a timed interval.). When QCollector receives this message it will save the symbol, interval and title for each item to a file in the QCollector application data folder. LParam holds the HWnd where you want the real time symbol list request complete message sent. WParam is not used. Your application can read the information from this file when it receives the real-time symbol list request complete message below.

    QCOLLECTOR_REALTIME_SYMBOL_LIST_REQUEST_COMPLETE - QCollector sends this message to the HWnd that requested the list. LParam is an Atom holding one string value - the full path and file name for the list data file. QCollector deletes the Atom when SendMessage returns. On receipt of this message your application can read the list file to get information about all the items in the QCollector timed updates list.

    The data in the list file saved by QCollector is plain text with one line for each item formatted as follows:


    Each field value is separated with the vertical bar ("|") character. For example:

    ADBE|5|Adobe Systems Incorporated
    INTC|D|Intel Corporation

    Action Messages

    Action messages include client data request messages and messages to remove items from the timed udpates list.

    Client data request messages are sent from your application to QCollector to retrieve data for a symbol. Each data request must include a QCollector portfolio name or portfolio folder path, so you should request the portfolio list (see above) from QCollector at least once before sending a data request.

    When QCollector processes a client data request it will create a new item in the QCollector portfolio unless an item matching the symbol and interval (and in the case of Ascii data files, file name) is found to already exist in that portfolio. If a matching item is found in the target portfolio QCollector will simply bring the data file for the existing item up to date and then send the data request complete message.

    When adding a new item to a portfolio, QCollector looks for any saved default portfolio item properties, and if found, will use them to create a new item. If the user hasn't saved any default item properties the item will be added to a portfolio with the default portfolio properties. Saved default properties can include whether or not to store volume or open interest in the data file, start and end session times, etc. In most cases this will not change any essential formatting of the data in the data files.

    QCOLLECTOR_CLIENT_DATA_REQUEST - Send this message to QCollector to request data for a symbol. WParam must hold the Atom with the formatted data request string. Set LParam to the HWnd where you want the data request complete message to be sent.

    The data request string must be formatted as follows, but all on one line:

    {ID string}|{symbol}|{interval}|{days back}|
    {collect now (0,1)}|{add to timed updates (0,1)}|{spare(0)}|
    {portfolio name or portfolio folder path}

    ID string - user defined. This string will be returned with the data request complete message. Your application can use this string value to track multiple data requests if required. Set to '0' if not required.
    Symbol - submitted to the data feed servers.
    Interval - D, W, M, Y for Daily, Weekly, Monthly, and if applicable, Yearly, or a number for intraday minutes. Use '0' for time and sales data items (see note below).
    Days back - calendar days back to start data file. If zero, then start at beginning of current day.
    Collect now - 1 to collect data for the item immediately, else 0. If '0' then the item will be added to QCollector portfolio (if it doesn't already exist) without data being collected. Items may be added this way when offline.
    Timed updates - 1 to add symbol to timed updates list, else 0. When '1' the symbol will be added to the timed updates list. Timed updates can be running, paused, or stopped. If timed updates are running, the data file for this item will now be updated in real-time.
    Spare - (0) for future use.
    Portfolio name or portfolio folder path - a new item will added to the specified QCollector portfolio using the properties included in the data request.

    Each field value is separated with the vertical bar ("|") character.

    If the data request interval is '0' (zero), and the target portfolio is a time and sales data Ascii portfolio, QCollector will create a new item in the portofolio if no existing item matches the data request. If the user has saved default properties for time and sales data items they will be used when adding the new item to the portfolio. Otherwise, a new time and sales item for the symbol will be created that collects trade price and size only.

    If the data request uses a non-zero value for the interval, and the target portfolio is a time and sales portfolio, the data request will fail.

    When sending an Atom to QCollector always use SendMessage, never PostMessage. QCollector will read the Atom immediately and you should delete the Atom when SendMessage returns.

    Important: Do not delete the Windows Global Atom by calling GlobalDeleteAtom; QCollector will do that when the message handling function returns.

    You can have QCollector begin running timed updates when the program starts up by adding a switch to the command line in the Windows shortcut properties. See the QCollector Help topic "Command Line" for instructions.


  4. Anyone?