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 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
Accepted
39.4k 77 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 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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