How to get real time data for a few currencies with AdxRtList simultaneously?

Hello! I am writing application on C#. To get real time data for one currency I writing this:

AdxRtList.Source = "IDN";
AdxRtList.RegisterItems("GPB=", "BID");
AdxRtList.StartUpdates(RT_RunMode.RT_MODE_ONUPDATE);

and this

void adxRtList_OnUpdate(string a_itemName, object a_userTag, RT_ItemStatus a_itemStatus)
{
//use item name to get the data
object temp = AdxRtList.get_ListFields(a_itemName, RT_FieldRowView.RT_FRV_ALL, RT_FieldColumnView.RT_FCV_VALUE);
object[,] l_fields = (object[,])Convert.ChangeType(temp, typeof(object[,]));
label5.Text = a_itemName + ": " + l_fields[0, 1];


AdxRtList.StopUpdates();
}

But I need to get data for 30 currencies, how can I do it? I tried to write

AdxRtList.RegisterItems("GPB=, AUD=, RUB=", "BID");

but it doesn't work.

Best Answer

Answers

  • Hi @aidynchik_84, you are correct! We would support a variant or a param array both for the list of instruments or the list of fields.

  • Hi @zhenyakovalyov

    Tell me please when I can stop AdxRtList updates? I need to launch AdxRtList only once, and then I need to stop it. But I can't do that on adxRtList_OnUpdate, because I don't know how many currencies did I get

  • This will do:

    mRtList.StopUpdates

    You can also consider using rtList in the snapshot mode. When requesting the updates, select this:

    With mRtList
    .Source = "IDN"
    .RegisterItems instrumentList, fields
    .StartUpdates RT_MODE_IMAGE
    End With

    As a result, rt list will not subscribe to the updates but only get a snapshot of values. Make sure that you use an appropriate event handler for this:

    Private Sub mRtList_OnImage(ByVal a_dataStatus As AdfinXRtLib.RT_DataStatus)

    End Sub

  • I wrote as you said

    AdxRtList.StartUpdates(RT_RunMode.RT_MODE_IMAGE);
    ....
    void adxRtList_OnImage(RT_DataStatus a_itemStatus)
    {
    //use item name to get the data
    string a_itemName = "";
    object temp = AdxRtList.get_ListFields(a_itemName, RT_FieldRowView.RT_FRV_ALL, RT_FieldColumnView.RT_FCV_VALUE);

    now I'm getting an error {"ERROR #360f - AdxRtList : invalid item "} on

    object temp = AdxRtList.get_ListFields(a_itemName, RT_FieldRowView.RT_FRV_ALL, RT_FieldColumnView.RT_FCV_VALUE);
  • according to your code, a_itemName is an empty string, it should be a RIC, for instance:

    object temp = AdxRtList.get_ListFields("RUB=", RT_FieldRowView.RT_FRV_ALL, RT_FieldColumnView.RT_FCV_VALUE);
  • oh, thank you very much! It works!