question

Upvotes
Accepted
0 0 0 0

How to use api get OpenInterest of history bar data

How to get openInterest of history daily bar data?

eikoneikon-com-api
test1.png (42.7 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

1 Answer

Upvotes
Accepted
39.2k 75 11 27

Use WithView("OPINT_1") method of ITimeSeriesDataRequestSetup interface when setting up the request. See "Views and intervals" section in Timeseries tutorial for more details.

You will also need to modify the callback for OnDataReceived event, as the timeseries for open interest cannot be converted to bar records, since only the close open interest is available. Instead of processing bar records in OnDataReceived event callback you can use something like

foreach (IData record in chunk.Records)
{
      foreach (string key in record.AllFields.Keys)
      {
          Console.WriteLine(key + " : " + record.AllFields[key]);
      }
}
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea