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

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 ✭✭✭✭✭
    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