public ProcessNewQuoteCommand(InstrumentFeedState state, Quote quote, Action<Quote> onValidQuoteAction, Action<Quote> onInValidQuoteAction)
     : base(state)
 {
     _quote = quote;
     _onValidQuoteAction = onValidQuoteAction;
     _onInValidQuoteAction = onInValidQuoteAction;
 }
 private bool IsValid(Quote quote)
 {
     return 0.00001 < quote.Bid && quote.Bid < quote.Offer && quote.Offer < 100000000;
 }
Пример #3
0
        private void OnValidQuote(Quote quote)
        {
            QuotesCache[quote.Instrument] = quote;

            //TODO: can be throttled to publish bulks of quotes - currently let ZMQ do the job
            _publisher.Publish(Constants.QuotesTopicName, BinarySerializer<Quote>.SerializeToByteArray(quote));
        }
Пример #4
0
 private void LogInvalidQuote(Quote quote)
 {
     //TODO: Use Serilog
     Debug.WriteLine("Invalid Quote. Instrument={0}", quote.Instrument);
 }
Пример #5
0
 private void OnInvalidQuote(Quote quote)
 {
     LogInvalidQuote(quote);
 }