question

Upvotes
Accepted
9 1 3 5

REDIApi RediLib market data

I create an instance of CacheControl.

I believe saying something like CacheControl.Submit("L1", "True", errorMsg) begins listening.

To get a value for a symbol I do something like this: CacheControl.GetL1Value("SPY", "Bid", L1_BidPx)

That gets me a bid of SPY at the moment.

Is there an event which gets fired with a given field is updated? For instance Bid changed from 234.56 to 234.57

is there an example of it being used?

What is the use for CacheControl.CacheEvent? How is it used?

redi-api
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.

Hello @ichernyavskiy

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?

If so please can you click the 'Accept' text next to the appropriate reply. This will guide all community members who have a similar question.

Thanks,

AHS

Upvotes
Accepted
32.2k 40 11 20

Hello @ichernyavskiy,

Yes, one is able to either retrieve the data once, or to register a custom event handler to be called on the events.

The callback should fire, it should be getting the updates.

Please verify if the project includes the required references, to the latest REDI Addin and REDI tlb. If you are not 100% sure, would recommend following the quick tutorial Getting Started in C#.

If they are included, I would suggest learning about REDI Cache Control and events by following one of our tutorials, I would go with Monitor Orders In C#.

Alternatively, the REDI API Spec includes all the details as well. The tutorial, in general, is a quicker way to absorb the approach, and to get the L1 updates.

... note, REDIPlus should be running on the box and logged in, to be able to interact with the CacheControl. The logged in user should be permissioned for API access to L1 market data in order to access it via API.

Hope this helps?

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.

Upvotes
32.2k 40 11 20

Hello @ichernyavskiy,

Yes, you can use the CacheControl to subscribe to the updates via REDI C#, and to set an event handler to process them asynchronously.

Please look at the example REDIConsoleL1 on github.

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.

Hi zoya, please see my comment below.

Upvotes
9 1 3 5

Thank you, Zoya.

In your example, when I subscribe, I add an eventHandler. However, it doesn't fire when prices change. Also even if I don't addwatch or submit, I can still pull data using GetL1Value. What is the point for AddWatch and Submit? redilibsubscribe.png

How do I get the event to fire when prices change?


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.

Hello @ichernyavskiy,

This is a private comment, only visible to you and moderators.

Please reply with your REDI id via a private comment and we will try to verify you have L1 perms?

Zoya, is there an email address I can use to send you the ID? I don't know if this comment is visible or private

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.