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