EMA Webinar Nov 2: How can we convert Enum data?

EMA Webinar Nov 2: How can we convert Enum data?

Best Answer

Answers

  • Hi there,

    One more thing. The word "enum" implies some type of uniqueness to most developers. This is a trap when talking about OMM Enums.

    Consider the following OMM Enum which is the one used by field RDN_EXCHID (Fid 4):

    ..   ...    ....
    4 "CIN" National Stock Exchange
    5 "PSE" NYSE Arca
    6 "XPH" NASDAQ OMX PSX when trading in SIAC
    7 "THM" NASDAQ InterMarket
    8 "MID" Chicago Stock Exchange
    9 "NYQ" Consolidated Issue, listed by NYSE
    10 "TOR" Toronto Stock Exchange
    11 "MON" Montreal Stock Exchange
    12 "TSX" TSX Venture Exchange
    13 "DEX" Direct Edge Holdings - EDGX (CTA)
    14 "AOE" American Options Exchange
    .. ... ....


    The first column, the integer value, is what travels the wire. The second column is the translation of the enum. It is what you would display to an end-user. The last column is a description. It typically cannot be retrieved from any of the TR APIs.

    Here's the trap: Do not assume that the second column is unique. It is not. The only thing which is unique is the integer value. In other words. If you want to display something which is truly unique to the end-user then you'll have no other option than to display to him the integer value (which will mean nothing to him) or (perhaps better) instead display some form of concatenation of the integer value plus the short name.