|
|
|
|
Purpose |
Add a symbol to the Server's database. | ||||||||
|
|
| ||||||||
|
Call Syntax |
#include <aspen.h> … AspenRequest(GLOBAL_session, ASPEN_CreateInstrument, instrument, &this_inum); … | ||||||||
|
|
| ||||||||
|
Parameters |
Input A pointer to an ASPEN_CREATEINSTRUMENT_INPUT structure. This structure defines the new instrument in the Server database.
Output A pointer to an ASPEN_INUM used to reference the new instrument in the Server database. | ||||||||
|
|
| ||||||||
|
Structures |
typedef struct { char *symbol; char *description; ASPEN_QUANTUM quantum; int exchange; | ||||||||
|
|
| ||||||||
|
Remarks |
The ASPEN_CreateInstrument service requires:
The Aspen_CreateInstrument service returns an inum for the instrument created. Ticker symbols vary by instrument type. Please consult your data vendor's symbol guide for symbol conventions you should use.
An instrument description is typically a stock’s corporate name, like “International Business Machine” for the symbol IBM, or “Light Crude Oil Futures” for CLU1 (or CL01U on BridgeFeed). ASPEN_CreateInstrument obtains an inum for the instrument you are creating. You do not have to request an inum from the Server prior to using this service.
Instruments are created as type ASPEN_IT_UNKNOWN on a user defined exchange. The user-defined exchanges are currently defined as 0 and 250.
On some data feeds symbol names are case sensitive. Aspen Research Group, Ltd. recommends user defined instruments be created using ALL capital letters. Using mixed case symbol names on case insensitive feeds may result in a symbol that is inaccessible. | ||||||||
|
|
| ||||||||
|
Return Value |
| ||||||||
|
|
| ||||||||
|
See Also |
quantum | ||||||||
|
|
| ||||||||
|
Example |
int CAspenRequestDlg::DoASPEN_CreateInstrument() { ASPEN_CREATEINSTRUMENT_INPUT instrument; server_list *slp = list; char symb[ASPEN_SYMBOL_SIZE], desc[ASPEN_SYMDESC_SIZE]; int retval, xchg, base, exp; strcpy(symb,strSymb); strcpy(desc,strDesc); xchg = atoi(strXchg); base = atoi(strBase); exp = atoi(strExp); instrument.symbol= symb; instrument.description= desc; instrument.exchange = xchg; instrument.quantum.base = base; instrument.quantum.exponent = exp; retval = AspenRequest( slp->server_session, ASPEN_CreateInstrument, &instrument, &a_inum); return retval; } |
©2006 Aspen Research Group, Ltd. All rights reserved. Terms of Use.