Which API can be used to get stock list of HKSE

I Develop use EMA in c++;
Which API can be used to get the stock list of HKSE?
Which Example can i used for reference?

Best Answer

  • Hi @luxiangyuan,

    You can use the EMA C++ API to retrieve your market data. To understand the basics of requesting for data, I would suggest you walk through the QuickStart guide then follow up with the Tutorials to help you to understand the general approach to retrieving data.

    The API is data agnostic meaning your simply provide instrument codes referred to RICs (Reuters Instrument Code) as a request when using the API. Regarding the specifics of retrieve the stock list of HKSE, I would contact the Refinitiv Helpdesk by calling the Helpdesk number in your country.

    As an example of the top 300 Equities within HK, you can use the RIC "0#.CSIH11164" which provides a record that contains references to other RICs. This is known as a Chain. To better understand what a Chain is, I would highly recommend you review this article discussing the basics of chains and how to process.

Answers

  • thanks nick zincone:

    1 、I run your example

    "Cpp-C\Ema\Examples\Training\Consumer\100_Series\100__MarketPrice__Streaming"

    2、I modify the code as follows

    AppClient client;

    OmmConsumer consumer( OmmConsumerConfig().host( "140.143.1.214:14002" ).username( "user1" ) );

    consumer.registerClient( ReqMsg().serviceName( "ELEKTRON_DD" ).name( "0#/MBD.HK" ), client );

    sleep( 60000 ); // API calls onRefreshMsg(), onUpdateMsg(), or onStatusMsg()

    3、I get no more than 20 stock of HKSE;

    FieldEntry fid="1" name="PROD_PERM" dataType="UInt" value="4019" FieldEntry fid="2" name="RDNDISPLAY" dataType="UInt" value="244" FieldEntry fid="3" name="DSPLY_NAME" dataType="Rmtes" value="HKSE MAIN BOAR/d" FieldEntry fid="4" name="RDN_EXCHID" dataType="Enum" value="92" FieldEntry fid="131" name="PRC_QL2" dataType="Enum" value="164" FieldEntry fid="239" name="REF_COUNT" dataType="UInt" value="14" FieldEntry fid="259" name="RECORDTYPE" dataType="UInt" value="120" FieldEntry fid="800" name="LONGLINK1" dataType="Ascii" value="/0001.HK" FieldEntry fid="801" name="LONGLINK2" dataType="Ascii" value="/0002.HK" FieldEntry fid="802" name="LONGLINK3" dataType="Ascii" value="/0003.HK" FieldEntry fid="803" name="LONGLINK4" dataType="Ascii" value="/0004.HK" FieldEntry fid="804" name="LONGLINK5" dataType="Ascii" value="/0005.HK" FieldEntry fid="805" name="LONGLINK6" dataType="Ascii" value="/0006.HK" FieldEntry fid="806" name="LONGLINK7" dataType="Ascii" value="/0007.HK" FieldEntry fid="807" name="LONGLINK8" dataType="Ascii" value="/0008.HK" FieldEntry fid="808" name="LONGLINK9" dataType="Ascii" value="/0009.HK" FieldEntry fid="809" name="LONGLINK10" dataType="Ascii" value="/0010.HK" FieldEntry fid="810" name="LONGLINK11" dataType="Ascii" value="/0011.HK" FieldEntry fid="811" name="LONGLINK12" dataType="Ascii" value="/0012.HK" FieldEntry fid="812" name="LONGLINK13" dataType="Ascii" value="/0014.HK" FieldEntry fid="813" name="LONGLINK14" dataType="Ascii" value="/0015.HK" FieldEntry fid="814" name="LONGPREVLR" dataType="Ascii" value="(blank data)" FieldEntry fid="815" name="LONGNEXTLR" dataType="Ascii" value="1#/MBD.HK" FieldEntry fid="1080" name="PREF_DISP" dataType="UInt" value="0" FieldEntry fid="1081" name="PREF_LINK" dataType="Ascii" value="1#/MBD.HK" FieldEntry fid="1352" name="DSPLY_NMLL" dataType="Rmtes" value="主板/d" FieldEntry fid="3263" name="PREV_DISP" dataType="UInt" value="0" FieldEntry fid="6401" name="DDS_DSO_ID" dataType="UInt" value="4214" FieldEntry fid="6480" name="SPS_SP_RIC" dataType="Ascii" value=".[SPSCDSAS0202"

    4、I am a new developer in china ,and our development cycle is tight,

    So I wan to konow is there is a Example i can refer to in ""Cpp-C\Ema\Examples\Training\Consumer\" to get the stock list

  • thanks nick:

    I review the article in your answer, but in java;

    we develop in c++, I can not even found the "FlatChain".

    So, how can I get the stock list in EMA(C++)

  • Hi @luxiangyuan,

    To get any data in C++, simply follow the Tutorials I linked to. You then use a "stock list" code, or RIC to request for your data.

    The article explains the concepts of Chains and uses Java to demonstrate. Using the examples within Tutorials or the samples packaged within the EMA product, you can apply the logic of the details within the Chain article and code in C++.

  • Hi nick:

    thanks for your answer,

    I read the "Article", and found the source code of chain. FlatChain.......

    thanks again.

  • Hi nick:

    what is the maxNum of :"getNameGuessesCount"?
    I see it is 50 in the example,

  • Hi @luxiangyuan,

    For now I would leave it at 50. I will reach out to the author to comment on the maximum.