예제 #1
0
        public void GetMarketData(MarketData marketData)
        {
            Console.WriteLine("Got new MarketData. Publishing OptionData");
            var options = publisher.GetAllOptions();
            var result  = new Result();

            result.Delta = 0.3;
            result.Value = 500;
            x           += 100;

            var optionResults = new OptionResult[options.Length];

            for (var i = 0; i < options.Length; i++)
            {
                var oResult = new OptionResult()
                {
                    Contract   = options[i],
                    BaseResult = result
                };
                optionResults[i] = oResult;
            }

            OptionData newOptionData = new OptionData()
            {
                MarketData    = marketData,
                OptionResults = optionResults
            };


            publisher.PublishUIData(newOptionData);
        }
        //Information source clients call this service operation to report a price change.
        //A price change event is raised. The price change event handlers for each subscriber will execute.

        public void PublishUIData(OptionData optionData)
        {
            if (PricerDataChangeEvent != null)
            {
                PricerDataChangeEvent(this, optionData);
            }
        }
        //This event handler runs when a PriceChange event is raised.
        //The client's PriceChange service operation is invoked to provide notification about the price change.

        public void PricerChangeHandler(object sender, OptionData optionData)
        {
            callback.GetPricerData(optionData);
        }
예제 #4
0
 public void GetPricerData(OptionData optionData)
 {
 }