To receive quotes custom component shall implement IQuoteReceiverComponent and IQuoteListener interfaces and use SubscribeEventHandler events.
public delegate void SubscribeEventHandler(string instrumentName, int type); /// <summary> /// If the designed component needs to receive quotes on the selected instument, /// it shall implement this interface /// </summary> public interface IQuoteReceiverComponent : IExternalComponent, IQuoteListener { /// <summary> /// Call when your component wants to receive quotes on the selected instument /// Method newQuote will be called when new quotes are processed in system /// </summary> event SubscribeEventHandler Subscribe; /// <summary> /// Call when your component want to stop receiving quotes after subscribing /// </summary> event SubscribeEventHandler UnSubscribe; }
instrumentName – is Instrument name (not ticker) as you see it in ProTrader:
GOOG, IBM, EUR/USD, AUD/CAD (Fx instrumants are used with slash).
Type – quote type. Allowed values are –
public const int QUOTE_LEVEL1 = 1; - Level I – best quote public const int QUOTE_LEVEL2 = 2; - Level II – Market Depth public const int QUOTE_TRADES = 4; - Trades public const int QUOTE_OPTIONS = 8; - Options
You can subscribe to several types at one Instrument.
This interface is child of
/// <summary> /// Interface of quotes receiver /// </summary> public interface IQuoteListener { void newQuote(QuoteMessage message); }
This method called at each new quote, and quote is stored in general
QuoteMessage type.