ASPEN_GetInstrumentInfo

 

Related Topics

 

 

Purpose

Get financial instrument information using a previously obtained handle.

 

 

Call Syntax

#include <aspen.h>

AspenRequest(GLOBAL_session, ASPEN_GetInstrumentInfo, &input, &output);

 

 

Parameters

Input

The input parameter for this service is a pointer to a ASPEN_GETINSTRUMENT_INPUT structure.

 

Output

The output parameter for this service is a pointer to a ASPEN_INSTRUMENT structure, which receives financial instrument information from the Aspen Server.

 

 

Structures

typedef struct

{

   ASPEN_INUM           inum;

   char                 symbol[ASPEN_SYMBOL_SIZE+1];

   char                 description[ASPEN_SYMDESC_SIZE+1];

   int                  type;

   ASPEN_ATTRIBUTES     attributes;

   int                  exchange;

   ASPEN_QUANTUM        quantum;

   ASPEN_QUANTUM        strike_quantum;

   ASPEN_PRICE          strike_price;

   unsigned int         expire;

   float                dollars;

   int                  tradingSessionCount;

   ASPEN_SESSION_TIME   tradingSession[ASPEN_MAX_TRADING_SESSIONS];

   ASPEN_TICK           last;

   ASPEN_PRICE          trade;

   ASPEN_VOLUME         trade_size;

   int                  trade_exchange;

   ASPEN_PRICE          bid;

   ASPEN_VOLUME         bid_size;

   int                  bid_exchange;

   ASPEN_PRICE          ask;

   ASPEN_VOLUME         ask_size;

   int                  ask_exchange;

   ASPEN_PRICE          high;

   ASPEN_PRICE          low;

   ASPEN_PRICE          previous;

   ASPEN_PRICE          net_change;

   ASPEN_VOLUME         open_interest;

   ASPEN_VOLUME         prev_futures_volume;

   ASPEN_PRICE          open;

   ASPEN_PRICE          open2;

   ASPEN_PRICE          close;

   ASPEN_PRICE          close2;

   ASPEN_VOLUME         dvolume;

   ASPEN_VOLUME         uvolume;

   ASPEN_VOLUME         tvolume;

}ASPEN_INSTRUMENT;

 

typedef struct

{

   int                  want_updates;

   ASPEN_INUM           inum;

}ASPEN_GETINSTRUMENT_INPUT;

 

 

Remarks

Obtain an instrument number (inum) for use in this service by calling AspenRequest() with the ASPEN_GetInstrumentNumber or ASPEN_GetInstrumentInfo services.

 

 

Return Value

ASPEN_OK

Instrument information returned successfully.

 

 

See Also

ASPEN_INSTRUMENT

ASPEN_GetInstrumentNumber

AspenRequest()

ASPEN_QUANTUM

ASPEN_INUM

ASPEN_PRICE

ASPEN_GETINSTRUMENT_INPUT

ASPEN_SESSION_TIME

 

 

Example

int CAspenRequestDlg::DoASPEN_GetInstrumentInfo()

{

   ASPEN_GETINSTRUMENT_INPUT  input;

   ASPEN_INSTRUMENT           contract;

   server_list                *slp = list;

   int                        retval;

   char                       symbol_xlat[256];

   char                       tradeStr[16];

   unsigned long              inum;

   Cstring                    strText;

 

   strcpy(symbol_xlat,strSymb);

   retval = AspenRequest(

            slp->server_session,

            ASPEN_GetInstrumentNumber,

            symbol_xlat,

            &inum);

   if (retval == ASPEN_OK)

   {        

      input.want_updates = ASPEN_NO;

      input.inum = inum;

      retval = AspenRequest(

            slp->server_session,

            ASPEN_GetInstrumentInfo,

            &input,

            &contract);

 

      AspenDecodePrice(

            contract.trade,

            contract.quantum,

            ASPEN_YES,

            tradeStr,

            NULL,

            NULL,

            NULL);

      strText.Format(

            "%s (%s): Last Trade = %s",

            contract.description,

            contract.symbol,

            tradeStr);

      m_HistoryEdit.AppendString(strText);

   }

   return retval;

}

 

©2006 Aspen Research Group, Ltd. All rights reserved. Terms of Use.