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);
 }