I am currently using =TR("0#JGBc1","","CH=Fd RH=IN",A2) to retrieve the current contract name ("DJGB

I am currently using =TR("0#JGBc1","","CH=Fd RH=IN",A2) to retrieve the current contract name ("DJGBH8") for JGBc1. How can I perform the same operation in .NET SDK?

Best Answer

  • Jirapongse
    Jirapongse admin
    Answer ✓

    You can retrieve the same information from Real-time data.

    0#JGBc1 is a chain RIC so you can use IRealtimeService::GetChain to get the constituents of a Realtime chain.

    IRealtimeService realtime;

    ...
    realtime.GetChain("0#JGBc1", data=>{
    foreach (var ric in data)
    {
    Console.WriteLine(ric);
    }
    }, error=>{
    ...
    });

    After running, it will print the following.

    JGBH8
    DJGBH8

    For more information regarding chains, please refer to Tutorial Real-time data in Chains section.

Answers

  • Thank you very much, that works well, but leads me to my next question: is there a way of forcing a sequential retrieval of information, instead of asynchronous? In this case, I need to pick out the current label in the chain as a RIC for a subsequent query. I would also like to know if possible in general.

  • Instead of using 0#JGBc1 chain you can get DJGBH8 from JGBc1, FID 6376 MBP_RIC:

    IRealtimeService realtime;
    ...
    realtime.Request("JGBc1", "MBP_RIC", mbpRic => {
    Console.WriteLine(mbpRic.ToString());
    });

    But either way data retrieval is asynchronous. This API does not provide synchronous data retrieval.

  • Understood thanks.